Changeset 632fda9 in sasview for src


Ignore:
Timestamp:
Sep 15, 2017 4:52:44 AM (7 years ago)
Author:
lewis
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:
fca1f50
Parents:
2504b5a
Message:

Fix old style plugin models not causing sasview to run

File:
1 edited

Legend:

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

    r33dc18f r632fda9  
    299299        for name, plug in self.stored_plugins.iteritems(): 
    300300            self.model_dictionary[name] = plug 
    301             if plug.is_structure_factor: 
     301            # TODO: Remove 'hasattr' statements when old style plugin models 
     302            # are no longer supported. All sasmodels models will have 
     303            # the required attributes. 
     304            if hasattr(plug, 'is_structure_factor') and plug.is_structure_factor: 
    302305                self.struct_list.append(plug) 
    303306                self.plugins.remove(plug) 
    304             elif plug.is_form_factor: 
     307            elif hasattr(plug, 'is_form_factor') and plug.is_form_factor: 
    305308                self.multiplication_factor.append(plug) 
    306             if plug.is_multiplicity_model: 
     309            if hasattr(plug, 'is_multiplicity_model') and plug.is_multiplicity_model: 
    307310                self.multi_func_list.append(plug) 
    308311 
Note: See TracChangeset for help on using the changeset viewer.