Changeset ce7fce5 in sasview


Ignore:
Timestamp:
Apr 5, 2011 11:26:42 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:
93de635d
Parents:
7d0d6c0
Message:

working on double click to open file with sansview for mac

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/setup_mac.py

    r7d0d6c0 rce7fce5  
    1010from distutils.sysconfig import get_python_lib 
    1111import os 
     12import string 
     13import local_config 
    1214 
     15ICON = local_config.SetupIconFile_mac 
     16EXTENSIONS_LIST = [] 
    1317DATA_FILES = [] 
    1418RESOURCES_FILES = [] 
     
    1620#Periodictable data file 
    1721DATA_FILES = periodictable.data_files() 
    18  
    1922#invariant and calculator help doc 
    2023import sans.perspectives.calculator as calculator 
     
    4245APP = ['sansview.py'] 
    4346DATA_FILES += ['images','test','plugins','media'] 
    44 plist = dict(CFBundleDocumentTypes=[dict(CFBundleTypeExtensions=["svs"], 
    45                                          CFBundleTypeIconFile='images/ball.icns', 
     47# locate file extensions 
     48def find_extension(): 
     49    """ 
     50    Describe the extensions that can be read by the current application 
     51    """ 
     52    try: 
     53        list = [] 
     54        EXCEPTION_LIST = ['*', '.', ''] 
     55        from DataLoader.loader import Loader 
     56        wild_cards = Loader().get_wildcards() 
     57        for item in wild_cards: 
     58            #['All (*.*)|*.*'] 
     59            file_type, ext = string.split(item, "|*.", 1) 
     60            if ext.strip() not in EXCEPTION_LIST and ext.strip() not in list: 
     61                list.append(ext) 
     62    except: 
     63        pass 
     64    try: 
     65        file_type, ext = string.split(local_config.APPLICATION_WLIST, "|*.", 1) 
     66        if ext.strip() not in EXCEPTION_LIST and ext.strip() not in list: 
     67            list.append(ext) 
     68    except: 
     69        pass 
     70    try: 
     71        for item in local_config.PLUGINS_WLIST: 
     72            file_type, ext = string.split(item, "|*.", 1) 
     73            if ext.strip() not in EXCEPTION_LIST and ext.strip() not in list: 
     74                list.append(ext)  
     75    except: 
     76        pass 
     77     
     78    return list 
     79 
     80EXTENSIONS_LIST = find_extension() 
     81 
     82  
     83plist = dict(CFBundleDocumentTypes=[dict(CFBundleTypeExtensions=EXTENSIONS_LIST, 
     84                                         CFBundleTypeIconFile=ICON, 
    4685                                   CFBundleTypeName="sansview file", 
    4786                                   CFBundleTypeRole="shell" )],) 
    48                                          #)],) 
     87                                        
    4988APP = ['sansview.py'] 
    5089DATA_FILES += ['images','test','plugins','media'] 
    5190OPTIONS = {'argv_emulation': True, 
    5291           'packages': ['lxml','periodictable'], 
    53            'iconfile': 'images/ball.icns', 
     92           'iconfile': ICON, 
    5493           'frameworks':[libxml_path], 
    5594           'resources': RESOURCES_FILES, 
Note: See TracChangeset for help on using the changeset viewer.