Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Utilities/CategoryInstaller.py

    rc889a3e r75906a1  
    2626    def __init__(self): 
    2727        """ initialization """ 
    28  
    29     @staticmethod 
    30     def _get_installed_model_dir(): 
    31         """ 
    32         returns the dir where installed_models.txt should be 
    33         """ 
    34         import sas.sascalc.dataloader.readers 
    35         return sas.sascalc.dataloader.readers.get_data_path() 
    36  
    37     @staticmethod 
    38     def _get_models_py_dir(): 
    39         """ 
    40         returns the dir where models.py should be 
    41         """ 
    42         import sas.sasgui.perspectives.fitting.models 
    43         return sas.sasgui.perspectives.fitting.models.get_model_python_path() 
    44  
    45     @staticmethod 
    46     def _get_default_cat_file_dir(): 
    47         """ 
    48         returns the dir where default_cat.j should be 
    49         """ 
    50         # The default categories file is usually found with the code, except 
    51         # when deploying using py2app (it will be in Contents/Resources), or 
    52         # py2exe (it will be in the exec dir). 
    53         import sas.sasview 
    54         cat_file = "default_categories.json" 
    55  
    56         possible_cat_file_paths = [ 
    57             os.path.join(os.path.split(sas.sasview.__file__)[0], cat_file),           # Source 
    58             os.path.join(os.path.dirname(sys.executable), '..', 'Resources', cat_file), # Mac 
    59             os.path.join(os.path.dirname(sys.executable), cat_file)                     # Windows 
    60         ] 
    61  
    62         for path in possible_cat_file_paths: 
    63             if os.path.isfile(path): 
    64                 return os.path.dirname(path) 
    65  
    66         raise RuntimeError('CategoryInstaller: Could not find folder containing default categories') 
    6728 
    6829    @staticmethod 
Note: See TracChangeset for help on using the changeset viewer.