Changes in src/sas/sasgui/perspectives/fitting/models.py [e92a352:463e7ffc] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/models.py
re92a352 r463e7ffc 19 19 from sasmodels.sasview_model import load_custom_model, load_standard_models 20 20 21 logger = logging.getLogger(__name__) 22 21 23 22 24 PLUGIN_DIR = 'plugin_models' 23 25 PLUGIN_LOG = os.path.join(os.path.expanduser("~"), '.sasview', PLUGIN_DIR, 24 26 "plugins.log") 27 PLUGIN_NAME_BASE = '[plug-in] ' 25 28 26 29 def get_model_python_path(): … … 167 170 if not os.path.isdir(dir): 168 171 msg = "SasView couldn't locate Model plugin folder %r." % dir 169 logg ing.warning(msg)172 logger.warning(msg) 170 173 return {} 171 174 172 175 plugin_log("looking for models in: %s" % str(dir)) 173 176 #compile_file(dir) #always recompile the folder plugin 174 logg ing.info("plugin model dir: %s" % str(dir))177 logger.info("plugin model dir: %s" % str(dir)) 175 178 176 179 plugins = {} … … 181 184 try: 182 185 model = load_custom_model(path) 183 model.name = "[plug-in] "+model.name186 model.name = PLUGIN_NAME_BASE + model.name 184 187 plugins[model.name] = model 185 188 except Exception: … … 187 190 msg += "\nwhile accessing model in %r" % path 188 191 plugin_log(msg) 189 logg ing.warning("Failed to load plugin %r. See %s for details"192 logger.warning("Failed to load plugin %r. See %s for details" 190 193 % (path, PLUGIN_LOG)) 191 194 … … 260 263 if self.is_changed(): 261 264 return _findModels(dir) 262 logg ing.info("plugin model : %s" % str(temp))265 logger.info("plugin model : %s" % str(temp)) 263 266 return temp 264 267
Note: See TracChangeset
for help on using the changeset viewer.