Changes in / [81b1f4d:2f17d40] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/models.py
r56a282c ra1b8fee 163 163 164 164 165 def _find _models():165 def _findModels(dir): 166 166 """ 167 167 Find custom models 168 168 """ 169 169 # List of plugin objects 170 dir ectory= find_plugins_dir()170 dir = find_plugins_dir() 171 171 # Go through files in plug-in directory 172 if not os.path.isdir(dir ectory):173 msg = "SasView couldn't locate Model plugin folder %r." % dir ectory172 if not os.path.isdir(dir): 173 msg = "SasView couldn't locate Model plugin folder %r." % dir 174 174 logger.warning(msg) 175 175 return {} 176 176 177 plugin_log("looking for models in: %s" % str(dir ectory))178 # compile_file(directory) #always recompile the folder plugin179 logger.info("plugin model dir: %s" % str(dir ectory))177 plugin_log("looking for models in: %s" % str(dir)) 178 #compile_file(dir) #always recompile the folder plugin 179 logger.info("plugin model dir: %s" % str(dir)) 180 180 181 181 plugins = {} 182 for filename in os.listdir(dir ectory):182 for filename in os.listdir(dir): 183 183 name, ext = os.path.splitext(filename) 184 184 if ext == '.py' and not name == '__init__': 185 path = os.path.abspath(os.path.join(dir ectory, filename))185 path = os.path.abspath(os.path.join(dir, filename)) 186 186 try: 187 187 model = load_custom_model(path) … … 193 193 plugin_log(msg) 194 194 logger.warning("Failed to load plugin %r. See %s for details" 195 % (path, PLUGIN_LOG))196 195 % (path, PLUGIN_LOG)) 196 197 197 return plugins 198 198 … … 264 264 temp = {} 265 265 if self.is_changed(): 266 return _find _models()266 return _findModels(dir) 267 267 logger.info("plugin model : %s" % str(temp)) 268 268 return temp … … 339 339 """ 340 340 self.plugins = [] 341 new_plugins = _find _models()341 new_plugins = _findModels(dir) 342 342 for name, plug in new_plugins.iteritems(): 343 343 for stored_name, stored_plug in self.stored_plugins.iteritems():
Note: See TracChangeset
for help on using the changeset viewer.