Changeset 33afff7 in sasview for sansview


Ignore:
Timestamp:
Feb 21, 2009 10:42:25 AM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
353041d
Parents:
858f2ae5
Message:

Fixed plug-in model import for windows executable (py2exe) and added clean-up to-do list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/models.py

    rf39511b r33afff7  
     1#TODO: add comments to document this module 
     2#TODO: clean-up the exception handling. 
     3#TODO: clean-up existing comments/documentation.  
     4#      For example, the _getModelList method advertises  
     5#      an 'id' parameter that is not part of the method's signature. 
     6#      It also advertises an ID as return value but it always returns zero. 
     7#TODO: clean-up the FractalAbsModel and PowerLawAbsModel menu items. Those 
     8#      model definitions do not belong here. They belong with the rest of the 
     9#      models. 
     10 
    111import wx 
    212import imp 
     
    616(ModelEvent, EVT_MODEL) = wx.lib.newevent.NewEvent() 
    717 
    8  
    9      
     18# Time is needed by the log method 
     19import time 
     20 
     21# Explicitly import from the pluginmodel module so that py2exe 
     22# places it in the distribution. The Model1DPlugin class is used 
     23# as the base class of plug-in models. 
     24from sans.models.pluginmodel import Model1DPlugin 
    1025     
    1126def log(message): 
    12     print message 
    1327    out = open("plugins.log", 'a') 
    1428    out.write("%10g:  %s\n" % (time.clock(), message)) 
     
    1630 
    1731def findModels(): 
    18     print "looking for models" 
     32    log("looking for models in: %s/plugins" % os.getcwd()) 
    1933    if os.path.isdir('plugins'): 
    2034        return _findModels('plugins') 
     
    4963                        file.close() 
    5064    except: 
     65        # Don't deal with bad plug-in imports. Just skip. 
    5166        pass 
    5267    return plugins 
Note: See TracChangeset for help on using the changeset viewer.