Changeset ba8d326 in sasview for src/sas/sasgui/perspectives/fitting/models.py
- Timestamp:
- Jun 23, 2017 4:16:29 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:
- 98e3f24
- Parents:
- 81b35396
- git-author:
- Paul Kienzle <pkienzle@…> (06/21/17 12:38:48)
- git-committer:
- Paul Kienzle <pkienzle@…> (06/23/17 16:16:29)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/models.py
r8cec26b rba8d326 68 68 try: 69 69 new_instance = model() 70 except :70 except Exception: 71 71 msg = "Plugin %s error in __init__ \n\t: %s %s\n" % (str(name), 72 72 str(sys.exc_type), … … 78 78 try: 79 79 value = new_instance.function() 80 except :80 except Exception: 81 81 msg = "Plugin %s: error writing function \n\t :%s %s\n " % \ 82 82 (str(name), str(sys.exc_type), sys.exc_info()[1]) … … 102 102 103 103 # Find paths needed 104 # TODO: remove unneeded try/except block 104 105 try: 105 106 # For source … … 108 109 else: 109 110 raise 110 except :111 except Exception: 111 112 # Check for data path next to exe/zip file. 112 113 #Look for maximum n_dir up of the current dir to find plugins dir … … 158 159 compileall.compile_dir(dir=dir, ddir=dir, force=0, 159 160 quiet=report_problem) 160 except :161 except Exception: 161 162 return sys.exc_info()[1] 162 163 return None … … 177 178 plugin_log("looking for models in: %s" % str(directory)) 178 179 # compile_file(directory) #always recompile the folder plugin 179 logger.info("plugin model dir: %s" %str(directory))180 logger.info("plugin model dir: %s", str(directory)) 180 181 181 182 plugins = {} … … 192 193 msg += "\nwhile accessing model in %r" % path 193 194 plugin_log(msg) 194 logger.warning("Failed to load plugin %r. See %s for details" 195 % (path, PLUGIN_LOG))195 logger.warning("Failed to load plugin %r. See %s for details", 196 path, PLUGIN_LOG) 196 197 197 198 return plugins … … 230 231 231 232 232 class ModelManagerBase :233 class ModelManagerBase(object): 233 234 """ 234 235 Base class for the model manager … … 265 266 if self.is_changed(): 266 267 return _find_models() 267 logger.info("plugin model : %s" %str(temp))268 logger.info("plugin model : %s", str(temp)) 268 269 return temp 269 270 … … 297 298 for name, plug in self.stored_plugins.iteritems(): 298 299 self.model_dictionary[name] = plug 299 300 300 301 self._get_multifunc_models() 301 302
Note: See TracChangeset
for help on using the changeset viewer.