Ignore:
Timestamp:
Sep 20, 2017 12:13:53 PM (7 years ago)
Author:
GitHub <noreply@…>
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:
d76c43a, fca1f50
Parents:
2a399ca (diff), 13374be (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.
git-author:
Paul Kienzle <pkienzle@…> (09/20/17 12:13:53)
git-committer:
GitHub <noreply@…> (09/20/17 12:13:53)
Message:

Merge pull request #94 from SasView?/4_1_issues

4.1.1 updates

File:
1 edited

Legend:

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

    r632fda9 r13374be  
    2121from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 
    2222from sasmodels.sasview_model import load_custom_model, load_standard_models 
     23from sas.sasgui.perspectives.fitting.fitpage import CUSTOM_MODEL 
    2324 
    2425logger = logging.getLogger(__name__) 
     
    266267        temp = {} 
    267268        if self.is_changed(): 
    268             return  _find_models() 
     269            temp =  _find_models() 
     270            self.last_time_dir_modified = time.time() 
     271            return temp 
    269272        logger.info("plugin model : %s" % str(temp)) 
    270273        return temp 
     
    323326        if os.path.isdir(plugin_dir): 
    324327            temp = os.path.getmtime(plugin_dir) 
    325             if  self.last_time_dir_modified != temp: 
     328            if  self.last_time_dir_modified < temp: 
    326329                is_modified = True 
    327330                self.last_time_dir_modified = temp 
     
    334337        new models were added else return empty dictionary 
    335338        """ 
     339        self.plugins = [] 
    336340        new_plugins = self.findModels() 
    337         if len(new_plugins) > 0: 
    338             for name, plug in  new_plugins.iteritems(): 
    339                 if name not in self.stored_plugins.keys(): 
    340                     self.stored_plugins[name] = plug 
    341                     self.plugins.append(plug) 
    342                     self.model_dictionary[name] = plug 
    343             self.model_combobox.set_list("Plugin Models", self.plugins) 
     341        if new_plugins: 
     342            for name, plug in  new_plugins.items(): 
     343                self.stored_plugins[name] = plug 
     344                self.plugins.append(plug) 
     345                self.model_dictionary[name] = plug 
     346            self.model_combobox.set_list(CUSTOM_MODEL, self.plugins) 
    344347            return self.model_combobox.get_list() 
    345348        else: 
Note: See TracChangeset for help on using the changeset viewer.