Ignore:
Timestamp:
Jun 23, 2017 4:16:29 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
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)
Message:

code cleanup

File:
1 edited

Legend:

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

    r8cec26b rba8d326  
    6868    try: 
    6969        new_instance = model() 
    70     except: 
     70    except Exception: 
    7171        msg = "Plugin %s error in __init__ \n\t: %s %s\n" % (str(name), 
    7272                                                             str(sys.exc_type), 
     
    7878        try: 
    7979            value = new_instance.function() 
    80         except: 
     80        except Exception: 
    8181            msg = "Plugin %s: error writing function \n\t :%s %s\n " % \ 
    8282                    (str(name), str(sys.exc_type), sys.exc_info()[1]) 
     
    102102 
    103103    # Find paths needed 
     104    # TODO: remove unneeded try/except block 
    104105    try: 
    105106        # For source 
     
    108109        else: 
    109110            raise 
    110     except: 
     111    except Exception: 
    111112        # Check for data path next to exe/zip file. 
    112113        #Look for maximum n_dir up of the current dir to find plugins dir 
     
    158159        compileall.compile_dir(dir=dir, ddir=dir, force=0, 
    159160                               quiet=report_problem) 
    160     except: 
     161    except Exception: 
    161162        return sys.exc_info()[1] 
    162163    return None 
     
    177178    plugin_log("looking for models in: %s" % str(directory)) 
    178179    # 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)) 
    180181 
    181182    plugins = {} 
     
    192193                msg += "\nwhile accessing model in %r" % path 
    193194                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) 
    196197 
    197198    return plugins 
     
    230231 
    231232 
    232 class ModelManagerBase: 
     233class ModelManagerBase(object): 
    233234    """ 
    234235    Base class for the model manager 
     
    265266        if self.is_changed(): 
    266267            return  _find_models() 
    267         logger.info("plugin model : %s" % str(temp)) 
     268        logger.info("plugin model : %s", str(temp)) 
    268269        return temp 
    269270 
     
    297298        for name, plug in self.stored_plugins.iteritems(): 
    298299            self.model_dictionary[name] = plug 
    299          
     300 
    300301        self._get_multifunc_models() 
    301302 
Note: See TracChangeset for help on using the changeset viewer.