Changeset b0b09b9 in sasview for src/sas/qtgui/Perspectives/Fitting/ModelUtilities.py
- Timestamp:
- Oct 26, 2017 3:13:05 AM (7 years ago)
- Branches:
- 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
- Children:
- 895e7359
- Parents:
- def64a0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/ModelUtilities.py
r125c4be rb0b09b9 2 2 Utilities to manage models 3 3 """ 4 from __future__ import print_function 4 5 5 6 6 import traceback … … 68 68 except: 69 69 msg = "Plugin %s error in __init__ \n\t: %s %s\n" % (str(name), 70 str(sys.exc_ type),70 str(sys.exc_info()[0]), 71 71 sys.exc_info()[1]) 72 72 plugin_log(msg) … … 78 78 except: 79 79 msg = "Plugin %s: error writing function \n\t :%s %s\n " % \ 80 (str(name), str(sys.exc_ type), sys.exc_info()[1])80 (str(name), str(sys.exc_info()[0]), sys.exc_info()[1]) 81 81 plugin_log(msg) 82 82 return None … … 138 138 Class to check for problems with specific values 139 139 """ 140 def __ nonzero__(self):140 def __bool__(self): 141 141 type, value, tb = sys.exc_info() 142 142 if type is not None and issubclass(type, py_compile.PyCompileError): 143 143 print("Problem with", repr(value)) 144 raise type , value, tb144 raise type(value).with_traceback(tb) 145 145 return 1 146 146 … … 211 211 212 212 """ 213 if name not in self.mydict.keys():213 if name not in list(self.mydict.keys()): 214 214 self.reset_list(name, mylist) 215 215 … … 292 292 #Looking for plugins 293 293 self.stored_plugins = self.findModels() 294 self.plugins = self.stored_plugins.values()295 for name, plug in self.stored_plugins.ite ritems():294 self.plugins = list(self.stored_plugins.values()) 295 for name, plug in self.stored_plugins.items(): 296 296 self.model_dictionary[name] = plug 297 297 … … 322 322 new_plugins = self.findModels() 323 323 if len(new_plugins) > 0: 324 for name, plug in new_plugins.ite ritems():325 if name not in self.stored_plugins.keys():324 for name, plug in new_plugins.items(): 325 if name not in list(self.stored_plugins.keys()): 326 326 self.stored_plugins[name] = plug 327 327 self.plugins.append(plug) … … 338 338 self.plugins = [] 339 339 new_plugins = _find_models() 340 for name, plug in new_plugins.ite ritems():341 for stored_name, stored_plug in self.stored_plugins.ite ritems():340 for name, plug in new_plugins.items(): 341 for stored_name, stored_plug in self.stored_plugins.items(): 342 342 if name == stored_name: 343 343 del self.stored_plugins[name] … … 358 358 359 359 """ 360 if int(evt.GetId()) in self.form_factor_dict.keys():360 if int(evt.GetId()) in list(self.form_factor_dict.keys()): 361 361 from sasmodels.sasview_model import MultiplicationModel 362 362 self.model_dictionary[MultiplicationModel.__name__] = MultiplicationModel … … 417 417 __modelmanager = ModelManagerBase() 418 418 cat_model_list = [__modelmanager.model_dictionary[model_name] for model_name \ 419 in __modelmanager.model_dictionary.keys() \420 if model_name not in __modelmanager.stored_plugins.keys()]419 in list(__modelmanager.model_dictionary.keys()) \ 420 if model_name not in list(__modelmanager.stored_plugins.keys())] 421 421 422 422 CategoryInstaller.check_install(model_list=cat_model_list)
Note: See TracChangeset
for help on using the changeset viewer.