Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/models.py

    re92a352 r463e7ffc  
    1919from sasmodels.sasview_model import load_custom_model, load_standard_models 
    2020 
     21logger = logging.getLogger(__name__) 
     22 
    2123 
    2224PLUGIN_DIR = 'plugin_models' 
    2325PLUGIN_LOG = os.path.join(os.path.expanduser("~"), '.sasview', PLUGIN_DIR, 
    2426                          "plugins.log") 
     27PLUGIN_NAME_BASE = '[plug-in] ' 
    2528 
    2629def get_model_python_path(): 
     
    167170    if not os.path.isdir(dir): 
    168171        msg = "SasView couldn't locate Model plugin folder %r." % dir 
    169         logging.warning(msg) 
     172        logger.warning(msg) 
    170173        return {} 
    171174 
    172175    plugin_log("looking for models in: %s" % str(dir)) 
    173176    #compile_file(dir)  #always recompile the folder plugin 
    174     logging.info("plugin model dir: %s" % str(dir)) 
     177    logger.info("plugin model dir: %s" % str(dir)) 
    175178 
    176179    plugins = {} 
     
    181184            try: 
    182185                model = load_custom_model(path) 
    183                 model.name = "[plug-in] "+model.name 
     186                model.name = PLUGIN_NAME_BASE + model.name 
    184187                plugins[model.name] = model 
    185188            except Exception: 
     
    187190                msg += "\nwhile accessing model in %r" % path 
    188191                plugin_log(msg) 
    189                 logging.warning("Failed to load plugin %r. See %s for details" 
     192                logger.warning("Failed to load plugin %r. See %s for details" 
    190193                                % (path, PLUGIN_LOG)) 
    191194             
     
    260263        if self.is_changed(): 
    261264            return  _findModels(dir) 
    262         logging.info("plugin model : %s" % str(temp)) 
     265        logger.info("plugin model : %s" % str(temp)) 
    263266        return temp 
    264267 
Note: See TracChangeset for help on using the changeset viewer.