Changeset 916f5c0 in sasview for fittingview
- Timestamp:
- Dec 8, 2011 11:44:28 AM (13 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- f2b843c
- Parents:
- d760c0a
- Location:
- fittingview/src/sans/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/fitpanel.py
r09b3505 r916f5c0 127 127 self.model_list_box = temp 128 128 return temp 129 129 130 def reset_pmodel_list(self): 131 """ 132 """ 133 temp = self.menu_mng.pulgins_reset() 134 if len(temp): 135 self.model_list_box = temp 136 return temp 137 130 138 def get_page_by_id(self, uid): 131 139 """ -
fittingview/src/sans/perspectives/fitting/models.py
r5d1c1f4 r916f5c0 175 175 """ 176 176 if name not in self.mydict.keys(): 177 self. mydict[name] = mylist177 self.reset_list(name, mylist) 178 178 179 def reset_list(self, name, mylist): 180 """ 181 :param name: the type of the list 182 :param mylist: the list to add 183 """ 184 self.mydict[name] = mylist 179 185 180 186 def get_list(self): … … 466 472 is_modified = False 467 473 if os.path.isdir(PLUGIN_DIR): 468 # getmtime doesn't seem to work well: use getatime 469 temp = os.path.getatime(PLUGIN_DIR) 474 temp = os.path.getmtime(PLUGIN_DIR) 470 475 if self.last_time_dir_modified != temp: 471 476 is_modified = True … … 490 495 return {} 491 496 492 497 def pulgins_reset(self): 498 """ 499 return a dictionary of model 500 """ 501 self.plugins = [] 502 new_plugins = _findModels(dir) 503 for name, plug in new_plugins.iteritems(): 504 for stored_name, stored_plug in self.stored_plugins.iteritems(): 505 if name == stored_name: 506 del self.stored_plugins[name] 507 break 508 self.stored_plugins[name] = plug 509 self.plugins.append(plug) 510 from sans.models.ReflectivityModel import ReflectivityModel 511 from sans.models.ReflectivityIIModel import ReflectivityIIModel 512 self.plugins.append(ReflectivityModel) 513 self.plugins.append(ReflectivityIIModel) 514 self.model_combobox.reset_list("Customized Models", self.plugins) 515 return self.model_combobox.get_list() 516 493 517 def populate_menu(self, modelmenu, event_owner): 494 518 """ … … 681 705 return self.__modelmanager.update() 682 706 707 def pulgins_reset(self): 708 return self.__modelmanager.pulgins_reset() 709 683 710 def populate_menu(self, modelmenu, event_owner): 684 711 return self.__modelmanager.populate_menu(modelmenu, event_owner)
Note: See TracChangeset
for help on using the changeset viewer.