Changeset 16bd5ca in sasview for src/sans


Ignore:
Timestamp:
Jan 22, 2014 10:38:42 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:
e090c624
Parents:
76cd1ae
Message:

Find default categories with p2app

File:
1 edited

Legend:

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

    rb221176 r16bd5ca  
    4949        returns the dir where default_cat.p should be 
    5050        """ 
     51        # The default categories file is usually found with the code 
    5152        import sans.sansview 
    5253        cat_file = "default_categories.p" 
    5354        dir, file_name = os.path.split(sans.sansview.__file__) 
    5455        cat_file_path = os.path.join(dir, cat_file) 
     56        if os.path.isfile(cat_file_path): 
     57            cat_file_dir = os.path.dirname(cat_file_path) 
     58            return cat_file_dir 
     59         
     60        # When deploying using py2app, the default categories file 
     61        # can be found in Contents/Resources 
     62        cat_file_path = os.path.join(os.path.dirname(sys.executable), '..', 'Resources', 'default_categories.p') 
    5563        if os.path.isfile(cat_file_path): 
    5664            cat_file_dir = os.path.dirname(cat_file_path) 
Note: See TracChangeset for help on using the changeset viewer.