- Timestamp:
- Apr 5, 2011 10:12:26 AM (14 years ago)
- 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:
- ce7fce5
- Parents:
- 7afb2e5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/setup_mac.py
r7afb2e5 r7d0d6c0 10 10 from distutils.sysconfig import get_python_lib 11 11 import os 12 import string13 import local_config14 12 15 ICON = local_config.SetupIconFile_mac16 13 DATA_FILES = [] 17 14 RESOURCES_FILES = [] 18 EXTENSIONS_LIST = []19 15 20 16 #Periodictable data file 21 17 DATA_FILES = periodictable.data_files() 22 #add guiframe data file 23 import sans.guiframe as guiframe 24 DATA_FILES += guiframe.data_files() 18 25 19 #invariant and calculator help doc 26 20 import sans.perspectives.calculator as calculator … … 30 24 import sans.models as models 31 25 DATA_FILES += models.data_files() 26 import sans.guiframe as guiframe 27 DATA_FILES += guiframe.data_files() 32 28 33 29 #CANSAxml reader data files 34 RESOURCES_FILES.append(os.path.join(DataLoader.readers.get_data_path(), 35 'defaults.xml')) 36 # locate file extensions 37 def find_extension(): 38 """ 39 Describe the extensions that can be read by the current application 40 """ 41 try: 42 list = [] 43 EXCEPTION_LIST = ['*', '.', ''] 44 #(ext, type, name, flags) 45 from DataLoader.loader import Loader 46 wild_cards = Loader().get_wildcards() 47 for item in wild_cards: 48 #['All (*.*)|*.*'] 49 file_type, ext = string.split(item, "|*.", 1) 50 if ext.strip() not in EXCEPTION_LIST and ext.strip() not in list: 51 list.append((ext, 'string', file_type)) 52 except: 53 raise 54 try: 55 file_type, ext = string.split(local_config.APPLICATION_WLIST, "|*.", 1) 56 if ext.strip() not in EXCEPTION_LIST and ext.strip() not in list: 57 list.append((ext, 'string', file_type)) 58 except: 59 raise 60 try: 61 for item in local_config.PLUGINS_WLIST: 62 file_type, ext = string.split(item, "|*.", 1) 63 if ext.strip() not in EXCEPTION_LIST and ext.strip() not in list: 64 list.append((ext, 'string', file_type)) 65 except: 66 raise 67 68 return list 69 70 EXTENSIONS_LIST = find_extension() 71 temp = [] 72 for (ext, _, file_type) in EXTENSIONS_LIST: 73 val= dict(CFBundleTypeTypeExtensions=[str(ext)], 74 CFBundleTypeIconFile=ICON, 75 #CFBundleTypeName=str(file_type), 76 CFBundleTypeRole="Viewer") 77 temp.append(val) 78 79 PLIST = dict(CFBundleDocumentTypes=temp, ) 80 print temp 81 print PLIST 30 RESOURCES_FILES.append(os.path.join(DataLoader.readers.get_data_path(),'defaults.xml')) 82 31 83 32 # Locate libxml2 library … … 93 42 APP = ['sansview.py'] 94 43 DATA_FILES += ['images','test','plugins','media'] 44 plist = dict(CFBundleDocumentTypes=[dict(CFBundleTypeExtensions=["svs"], 45 CFBundleTypeIconFile='images/ball.icns', 46 CFBundleTypeName="sansview file", 47 CFBundleTypeRole="shell" )],) 48 #)],) 49 APP = ['sansview.py'] 50 DATA_FILES += ['images','test','plugins','media'] 95 51 OPTIONS = {'argv_emulation': True, 96 52 'packages': ['lxml','periodictable'], 97 'iconfile': ICON,53 'iconfile': 'images/ball.icns', 98 54 'frameworks':[libxml_path], 99 55 'resources': RESOURCES_FILES, 100 'plist': PLIST56 'plist':plist, 101 57 } 102 103 58 setup( 104 59 app=APP, … … 108 63 setup_requires=['py2app'], 109 64 ) 110
Note: See TracChangeset
for help on using the changeset viewer.