Changeset 823859a in sasview


Ignore:
Timestamp:
May 20, 2011 3:10:54 PM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
12cd4ec
Parents:
5e4520c
Message:

edit help function

Location:
guiframe
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • guiframe/__init__.py

    rb2629b4 r823859a  
    3030    raise RuntimeError('Could not find guiframe images files') 
    3131 
     32def get_media_path(media): 
     33    """ 
     34    """ 
     35    # Check for data path in the package 
     36    path = os.path.join(os.path.dirname(__file__), media) 
     37    if os.path.isdir(path): 
     38        return path 
     39 
     40    # Check for data path next to exe/zip file. 
     41    # If we are inside a py2exe zip file, we need to go up 
     42    # to get to the directory containing  
     43    # the media for this module 
     44    path = os.path.dirname(__file__) 
     45    #Look for maximum n_dir up of the current dir to find media 
     46    n_dir = 12 
     47    for i in range(n_dir): 
     48        path, _ = os.path.split(path) 
     49        media_path = os.path.join(path, media) 
     50        if os.path.isdir(media_path): 
     51            module_media_path = os.path.join(media_path, 'guiframe_media') 
     52            if os.path.isdir(module_media_path): 
     53                return module_media_path 
     54            return media_path 
     55    raise RuntimeError('Could not find guiframe media files') 
     56 
    3257def data_files(): 
    3358    """ 
     
    4267    for f in findall(path): 
    4368        data_files.append(('images/icons', [f])) 
    44     path = get_data_path(media="media") 
     69    path = get_media_path(media="media") 
    4570    for f in findall(path): 
    46         data_files.append(('media', [f])) 
     71        data_files.append(('media/guiframe_media', [f])) 
    4772    return data_files 
  • guiframe/local_perspectives/data_loader/help_panel.py

    rb2629b4 r823859a  
    77import wx.html as html 
    88from wx.lib.splitter import MultiSplitterWindow 
    9 from sans.guiframe import get_data_path 
     9from sans.guiframe import get_media_path 
    1010 
    1111class HelpWindow(wx.Frame): 
     
    5151                                     size=(500,-1)) 
    5252         
    53         self.path = get_data_path(media='media') 
     53        self.path = get_media_path(media='media') 
    5454        page1 = """<html> 
    5555            <body> 
  • guiframe/local_perspectives/plotting/help_panel.py

    r5e4520c r823859a  
    77import wx.html as html 
    88from wx.lib.splitter import MultiSplitterWindow 
    9 from sans.guiframe import get_data_path 
     9from sans.guiframe import get_media_path 
    1010 
    1111 
     
    5252                                     size=(500,-1)) 
    5353         
    54         self.path = get_data_path(media='media') 
     54        self.path = get_media_path(media='media') 
    5555        
    5656        page1 = """<html> 
Note: See TracChangeset for help on using the changeset viewer.