Changeset 13fe3be in sasview for src/sas/sasgui/perspectives/fitting
- Timestamp:
- May 16, 2017 9:19:23 AM (8 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:
- 7df0ccd
- Parents:
- a67ec83 (diff), 81b1f4d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/models.py
r914ba0a r13fe3be 163 163 164 164 165 def _find Models(dir):165 def _find_models(): 166 166 """ 167 167 Find custom models 168 168 """ 169 169 # List of plugin objects 170 dir = find_plugins_dir()170 directory = find_plugins_dir() 171 171 # Go through files in plug-in directory 172 if not os.path.isdir(dir ):173 msg = "SasView couldn't locate Model plugin folder %r." % dir 172 if not os.path.isdir(directory): 173 msg = "SasView couldn't locate Model plugin folder %r." % directory 174 174 logger.warning(msg) 175 175 return {} 176 176 177 plugin_log("looking for models in: %s" % str(dir ))178 # compile_file(dir) #always recompile the folder plugin179 logger.info("plugin model dir: %s" % str(dir ))177 plugin_log("looking for models in: %s" % str(directory)) 178 # compile_file(directory) #always recompile the folder plugin 179 logger.info("plugin model dir: %s" % str(directory)) 180 180 181 181 plugins = {} 182 for filename in os.listdir(dir ):182 for filename in os.listdir(directory): 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 , filename))185 path = os.path.abspath(os.path.join(directory, 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 195 % (path, PLUGIN_LOG)) 196 196 197 197 return plugins … … 264 264 temp = {} 265 265 if self.is_changed(): 266 return _find Models(dir)266 return _find_models() 267 267 logger.info("plugin model : %s" % str(temp)) 268 268 return temp … … 339 339 """ 340 340 self.plugins = [] 341 new_plugins = _find Models(dir)341 new_plugins = _find_models() 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.