Changes in src/sas/sasgui/perspectives/fitting/models.py [e92a352:05b8e01] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/models.py
re92a352 r05b8e01 18 18 from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 19 19 from sasmodels.sasview_model import load_custom_model, load_standard_models 20 from sas.sasgui.perspectives.fitting.fitpage import CUSTOM_MODEL 20 21 21 22 … … 23 24 PLUGIN_LOG = os.path.join(os.path.expanduser("~"), '.sasview', PLUGIN_DIR, 24 25 "plugins.log") 26 PLUGIN_NAME_BASE = '[plug-in] ' 25 27 26 28 def get_model_python_path(): … … 181 183 try: 182 184 model = load_custom_model(path) 183 model.name = "[plug-in] "+model.name185 model.name = PLUGIN_NAME_BASE + model.name 184 186 plugins[model.name] = model 185 187 except Exception: … … 259 261 temp = {} 260 262 if self.is_changed(): 261 return _findModels(dir) 263 temp = _findModels(dir) 264 self.last_time_dir_modified = time.time() 265 return temp 262 266 logging.info("plugin model : %s" % str(temp)) 263 267 return temp … … 306 310 if os.path.isdir(plugin_dir): 307 311 temp = os.path.getmtime(plugin_dir) 308 if self.last_time_dir_modified !=temp:312 if self.last_time_dir_modified < temp: 309 313 is_modified = True 310 314 self.last_time_dir_modified = temp … … 317 321 new models were added else return empty dictionary 318 322 """ 323 self.plugins = [] 319 324 new_plugins = self.findModels() 320 if len(new_plugins) > 0: 321 for name, plug in new_plugins.iteritems(): 322 if name not in self.stored_plugins.keys(): 323 self.stored_plugins[name] = plug 324 self.plugins.append(plug) 325 self.model_dictionary[name] = plug 326 self.model_combobox.set_list("Plugin Models", self.plugins) 325 if new_plugins: 326 for name, plug in new_plugins.items(): 327 self.stored_plugins[name] = plug 328 self.plugins.append(plug) 329 self.model_dictionary[name] = plug 330 self.model_combobox.set_list(CUSTOM_MODEL, self.plugins) 327 331 return self.model_combobox.get_list() 328 332 else:
Note: See TracChangeset
for help on using the changeset viewer.