Changeset b221176 in sasview for src/sans


Ignore:
Timestamp:
Oct 9, 2013 10:42:24 AM (11 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:
f2148b2
Parents:
aebd16a
Message:

Fix installation and make sure SasView? starts

Location:
src/sans/guiframe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sans/guiframe/CategoryInstaller.py

    r5777106 rb221176  
    4949        returns the dir where default_cat.p should be 
    5050        """ 
     51        import sans.sansview 
    5152        cat_file = "default_categories.p" 
    52         app_dir = sys.path[0] 
    53         if os.path.isfile(app_dir): 
    54             app_dir = os.path.dirname(app_dir) 
    55         n_dir = 12 
    56         for i in range(n_dir):  
    57             path = os.path.join(app_dir, cat_file) 
    58             if os.path.isfile(path): 
    59                 path = os.path.dirname(path) 
    60                 return path 
    61             else: 
    62                 app_dir, _ = os.path.split(app_dir) 
    63                  
    64         raise RuntimeError('Could not find the App folder')          
     53        dir, file_name = os.path.split(sans.sansview.__file__) 
     54        cat_file_path = os.path.join(dir, cat_file) 
     55        if os.path.isfile(cat_file_path): 
     56            cat_file_dir = os.path.dirname(cat_file_path) 
     57            return cat_file_dir 
     58         
     59        raise RuntimeError('CategoryInstaller: Could not find folder containing default categories') 
    6560 
    6661    @staticmethod 
  • src/sans/guiframe/gui_manager.py

    r5777106 rb221176  
    9494        config_module = imp.load_module(file, fObj, path_config, descr)  
    9595    except: 
    96         pass 
     96        logging.error("Error loading %s/%s: %s" % (path, file, sys.exc_value)) 
    9797    finally: 
    9898        if fObj is not None: 
    9999            fObj.close() 
     100    logging.info("GuiManager loaded %s/%s" % (path, file)) 
    100101    return config_module 
    101102 
Note: See TracChangeset for help on using the changeset viewer.