Changes in / [527a190:46d210d] in sasview
- Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitpage.py
rd85f1d8a r7143065 1236 1236 wx.PostEvent(self.parent, new_event) 1237 1237 # update list of plugins if new plugin is available 1238 custom_model = CUSTOM_MODEL1239 1238 mod_cat = self.categorybox.GetStringSelection() 1240 if mod_cat == custom_model: 1239 if mod_cat == CUSTOM_MODEL: 1240 temp_id = self.model.id 1241 1241 temp = self.parent.update_model_list() 1242 for v in self.parent.model_dictionary.values(): 1243 if v.id == temp_id: 1244 self.model = v() 1245 break 1242 1246 if temp: 1243 1247 self.model_list_box = temp -
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 … … 260 261 temp = {} 261 262 if self.is_changed(): 262 return _findModels(dir) 263 temp = _findModels(dir) 264 self.last_time_dir_modified = time.time() 265 return temp 263 266 logging.info("plugin model : %s" % str(temp)) 264 267 return temp … … 307 310 if os.path.isdir(plugin_dir): 308 311 temp = os.path.getmtime(plugin_dir) 309 if self.last_time_dir_modified !=temp:312 if self.last_time_dir_modified < temp: 310 313 is_modified = True 311 314 self.last_time_dir_modified = temp … … 318 321 new models were added else return empty dictionary 319 322 """ 323 self.plugins = [] 320 324 new_plugins = self.findModels() 321 if len(new_plugins) > 0: 322 for name, plug in new_plugins.iteritems(): 323 if name not in self.stored_plugins.keys(): 324 self.stored_plugins[name] = plug 325 self.plugins.append(plug) 326 self.model_dictionary[name] = plug 327 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) 328 331 return self.model_combobox.get_list() 329 332 else:
Note: See TracChangeset
for help on using the changeset viewer.