Changeset 65f3930 in sasview for src/sas/sasgui/guiframe
- Timestamp:
- Jun 26, 2017 4:22:56 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:
- 50fcb09
- Parents:
- 98e3f24
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/CategoryInstaller.py
r235f514 r65f3930 19 19 logger = logging.getLogger(__name__) 20 20 21 class CategoryInstaller :21 class CategoryInstaller(object): 22 22 """ 23 23 Class for making sure all category stuff is installed … … 34 34 returns the dir where installed_models.txt should be 35 35 """ 36 import sas.sascalc.dataloader.readers 37 return sas.sascalc.dataloader.readers.get_data_path() 38 39 @staticmethod 40 def _get_models_py_dir(): 41 """ 42 returns the dir where models.py should be 43 """ 44 import sas.sasgui.perspectives.fitting.models 45 return sas.sasgui.perspectives.fitting.models.get_model_python_path() 36 from sas.sascalc.dataloader.readers import get_data_path 37 return get_data_path() 46 38 47 39 @staticmethod … … 85 77 by_model_dict = defaultdict(list) 86 78 model_enabled_dict = defaultdict(bool) 87 79 88 80 for category in master_category_dict: 89 81 for (model, enabled) in master_category_dict[category]: … … 96 88 def _regenerate_master_dict(by_model_dict, model_enabled_dict): 97 89 """ 98 regenerates master_category_dict from by_model_dict 90 regenerates master_category_dict from by_model_dict 99 91 and model_enabled_dict 100 92 returns the master category dictionary … … 128 120 which are user supplied. 129 121 """ 130 _model_dict = { 122 _model_dict = {model.name: model for model in model_list} 131 123 _model_list = _model_dict.keys() 132 124 … … 150 142 model_name, enabled = master_category_dict[cat][ind] 151 143 if model_name not in _model_list: 152 del_name = True 144 del_name = True 153 145 try: 154 146 by_model_dict.pop(model_name) 155 147 model_enabled_dict.pop(model_name) 156 except :148 except Exception: 157 149 logger.error("CategoryInstaller: %s", sys.exc_value) 158 150 else: … … 160 152 if del_name or (len(add_list) > 0): 161 153 for model in add_list: 162 model_enabled_dict[model]= True 163 if _model_dict[model].category is None or len(str(_model_dict[model].category.capitalize())) == 0: 154 model_enabled_dict[model] = True 155 # TODO: should be: not _model_dict[model].category 156 if (_model_dict[model].category is None 157 or len(str(_model_dict[model].category.capitalize())) == 0): 164 158 by_model_dict[model].append('Uncategorized') 165 159 else:
Note: See TracChangeset
for help on using the changeset viewer.