Changeset a0986f6 in sasview


Ignore:
Timestamp:
Apr 27, 2011 9:02:17 AM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
0b6ae5f
Parents:
5683f47
Message:

remove unused directory

File:
1 edited

Legend:

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

    r23ccf07 ra0986f6  
    1818    
    1919PLUGIN_DIR = 'plugins'  
    20 path = os.path.dirname(os.path.sys.path[0]) 
    21 file = os.path.join(path, "plugins.log") 
    22  
    2320 
    2421def log(message): 
    2522    """ 
    2623    """ 
    27     out = open(file, 'a') 
     24    out = open("plugins.log", 'a') 
    2825    out.write("%10g:  %s\n" % (time.clock(), message)) 
    2926    out.close() 
     
    7976    plugins = {} 
    8077    # Go through files in plug-in directory 
     78    #always recompile the folder plugin 
     79    import compileall 
     80    dir = os.path.abspath(PLUGIN_DIR) 
     81    if not os.path.isdir(dir): 
     82        dir = os.path.join(os.getcwd(), PLUGIN_DIR) 
     83    if not os.path.isdir(dir): 
     84        dir = os.path.join(os.path.dirname(__file__), PLUGIN_DIR) 
     85    if not os.path.isdir(dir): 
     86        dir = os.path.join(os.path.dirname(os.path.sys.path[0]), PLUGIN_DIR) 
     87    if not os.path.isdir(dir): 
     88        msg = "SansView couldn't locate Model plugin folder." 
     89        msg += """ "%s" does not exist""" % dir 
     90        logging.warning(msg) 
     91        return plugins 
     92    else: 
     93        log("looking for models in: %s" % str(dir)) 
     94        compileall.compile_dir(dir=dir, ddir=dir, force=1, quiet=True) 
     95        logging.info("pluging model dir: %s\n" % str(dir)) 
    8196    try: 
    8297        list = os.listdir(dir) 
     
    180195        temp = {} 
    181196        if self.is_changed(): 
    182             #always recompile the folder plugin 
    183             import compileall 
    184             if os.path.isdir(os.path.abspath(PLUGIN_DIR)): 
    185                 dir = os.path.abspath(PLUGIN_DIR) 
    186             else: 
    187                 dir = os.path.join(os.path.dirname(os.path.sys.path[0]), 'plugins') 
    188             if not os.path.isdir(dir): 
    189                 log("Could not locate models plugins in: %s" % str(dir)) 
    190             else: 
    191                 log("looking for models in: %s" % str(dir)) 
    192                 compileall.compile_dir(dir=dir, ddir=dir, force=1, quiet=True) 
    193                 return  _findModels(dir) 
     197            return  _findModels(dir) 
    194198        logging.info("pluging model : %s\n" % str(temp)) 
    195199        return temp 
Note: See TracChangeset for help on using the changeset viewer.