Changeset df8a13e in sasview for guiframe


Ignore:
Timestamp:
May 12, 2011 3:35:05 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
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:
b2448a5
Parents:
0685f45
Message:

assigned help file dir

Location:
guiframe
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • guiframe/local_perspectives/plotting/__init__.py

    r41d466f rdf8a13e  
    11PLUGIN_ID = "Plotting plug-in 1.0" 
    22from plotting import * 
     3 
     4import os 
     5from distutils.filelist import findall 
     6 
     7N_DIR = 12 
     8def get_data_path(media): 
     9    """ 
     10    """ 
     11    # Check for data path in the package 
     12    path = os.path.join(os.path.dirname(__file__), media) 
     13    if os.path.isdir(path): 
     14        return path 
     15    # Check for data path next to exe/zip file. 
     16    # If we are inside a py2exe zip file, we need to go up 
     17    # two levels to get to the directory containing the exe 
     18    # We will check if the exe and the xsf are in the same 
     19    # directory. 
     20    path = os.path.dirname(__file__) 
     21    #Look for maximum n_dir up of the current dir to find media 
     22    
     23    #for i in range(n_dir): 
     24    i = 0 
     25    while(i < N_DIR): 
     26        path, _ = os.path.split(path) 
     27        media_path = os.path.join(path, media) 
     28        if os.path.isdir(media_path): 
     29             module_media_path = os.path.join(media_path,'plotting_media') 
     30             if os.path.isdir(module_media_path): 
     31                 return module_media_path 
     32             return media_path 
     33        i += 1 
     34    
     35    raise RuntimeError('Could not find plotting media files') 
     36 
     37def data_files(): 
     38    """ 
     39    Return the data files associated with media plotting. 
     40     
     41    The format is a list of (directory, [files...]) pairs which can be 
     42    used directly in setup(...,data_files=...) for setup.py. 
     43 
     44    """ 
     45    data_files = [] 
     46    path = get_data_path(media="media") 
     47    for f in findall(path): 
     48        data_files.append(('media/plotting_media', [f])) 
     49    return data_files 
  • guiframe/local_perspectives/plotting/plotting.py

    rc91ef7e rdf8a13e  
    307307            self.menu.Check(event_id, False) 
    308308         
     309    def help(self, evt): 
     310        """ 
     311        Show a general help dialog.  
     312        """ 
     313        from help_panel import  HelpWindow 
     314        frame = HelpWindow(None, -1, 'HelpWindow')     
     315        frame.Show(True) 
     316               
    309317    def _on_close_panel(self, event): 
    310318        """ 
  • guiframe/setup.py

    r02775ab8 rdf8a13e  
    1414package_dir = { "sans.guiframe":".", 
    1515                "sans.guiframe.local_perspectives":"local_perspectives", 
    16                 "sans.guiframe.widgets":"widgets"} 
     16                "sans.guiframe.widgets":"widgets", 
     17                "sans.guiframe.media":"media"} 
     18package_data = {"sans.guiframe": ['images/*'], 
     19                "sans.guiframe.media": ['*']} 
    1720packages = ["sans.guiframe",  
    1821            "sans.guiframe.local_perspectives", 
    19             "sans.guiframe.widgets"] 
     22            "sans.guiframe.widgets", 
     23            "sans.guiframe.media"] 
    2024# build local plugin 
    2125for dir in os.listdir(path): 
     
    5256    packages = packages, 
    5357     
    54     package_data={"sans.guiframe": ['images/*']}, 
     58    package_data = package_data, 
    5559    ) 
    5660         
Note: See TracChangeset for help on using the changeset viewer.