- Timestamp:
- Sep 20, 2017 7:24:29 PM (7 years ago)
- 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 5a405bd
- Parents:
- 2ecb0a5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/CategoryInstaller.py
r914ba0a r6e50a8d 21 21 logger = logging.getLogger(__name__) 22 22 23 class CategoryInstaller :23 class CategoryInstaller(object): 24 24 """ 25 25 Class for making sure all category stuff is installed … … 27 27 Note - class is entirely static! 28 28 """ 29 30 def __init__(self):31 """ initialization """32 33 @staticmethod34 def _get_installed_model_dir():35 """36 returns the dir where installed_models.txt should be37 """38 import sas.sascalc.dataloader.readers39 return sas.sascalc.dataloader.readers.get_data_path()40 41 @staticmethod42 def _get_models_py_dir():43 """44 returns the dir where models.py should be45 """46 import sas.sasgui.perspectives.fitting.models47 return sas.sasgui.perspectives.fitting.models.get_model_python_path()48 49 @staticmethod50 def _get_default_cat_file_dir():51 """52 returns the dir where default_cat.j should be53 """54 # The default categories file is usually found with the code, except55 # when deploying using py2app (it will be in Contents/Resources), or56 # py2exe (it will be in the exec dir).57 import sas.sasview58 cat_file = "default_categories.json"59 60 possible_cat_file_paths = [61 os.path.join(os.path.split(sas.sasview.__file__)[0], cat_file), # Source62 os.path.join(os.path.dirname(sys.executable), '..', 'Resources', cat_file), # Mac63 os.path.join(os.path.dirname(sys.executable), cat_file) # Windows64 ]65 66 for path in possible_cat_file_paths:67 if os.path.isfile(path):68 return os.path.dirname(path)69 70 raise RuntimeError('CategoryInstaller: Could not find folder containing default categories')71 29 72 30 @staticmethod
Note: See TracChangeset
for help on using the changeset viewer.