source: sasview/sansview/setup_mac.py @ 1b28ff5

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 1b28ff5 was ea5fa58, checked in by Jae Cho <jhjcho@…>, 12 years ago

category stuffs start working in interp. environment

  • Property mode set to 100644
File size: 4.2 KB
RevLine 
[fa597990]1"""
2This is a setup.py script partly generated by py2applet
3
4Usage:
5    python setup.py py2app
[fd67a9e]6   
7   
8NOTES:
9   12/01/2011: When seeing an error related to pytz.zoneinfo not being found, change the following line in py2app/recipes/matplotlib.py
10               mf.import_hook('pytz.tzinfo', m, ['UTC'])
[495acc2]11   12/05/2011: Needs macholib >= 1.4.3 and py2app >= 0.6.4 to create a 64-bit app
[fa597990]12"""
13from setuptools import setup
14import periodictable.xsf
15import sans.dataloader.readers 
16import os
17import string
18import local_config
[9ba6bba]19import pytz
[bc69dcc]20import sys
[0f2c15d]21import platform
[fa597990]22
23ICON = local_config.SetupIconFile_mac
24EXTENSIONS_LIST = []
25DATA_FILES = []
26RESOURCES_FILES = []
27
28#Periodictable data file
29DATA_FILES = periodictable.data_files()
30#invariant and calculator help doc
[0986586]31import sans.perspectives.fitting as fitting
32DATA_FILES += fitting.data_files()
[fa597990]33import sans.perspectives.calculator as calculator
34DATA_FILES += calculator.data_files()
35import sans.perspectives.invariant as invariant
36DATA_FILES += invariant.data_files()
37import sans.models as models
38DATA_FILES += models.data_files()
39import sans.guiframe as guiframe
40DATA_FILES += guiframe.data_files()
41
42#CANSAxml reader data files
43RESOURCES_FILES.append(os.path.join(sans.dataloader.readers.get_data_path(),'defaults.xml'))
44
45# Locate libxml2 library
46lib_locs = ['/usr/local/lib', '/usr/lib']
47libxml_path = None
48for item in lib_locs:
49    libxml_path_test = '%s/libxml2.2.dylib' % item
50    if os.path.isfile(libxml_path_test): 
51        libxml_path = libxml_path_test
52if libxml_path == None:
53    raise RuntimeError, "Could not find libxml2 on the system"
54
55APP = ['sansview.py']
[ea5fa58]56DATA_FILES += ['images','test','media', 'custom_config.py', 'local_config.py',
57               'default_categories.p']
[d6202e30]58if os.path.isfile("BUILD_NUMBER"):
59    DATA_FILES.append("BUILD_NUMBER")
60   
[fa597990]61# locate file extensions
62def find_extension():
63    """
64    Describe the extensions that can be read by the current application
65    """
66    try:
67        list = []
68        EXCEPTION_LIST = ['*', '.', '']
69        from sans.dataloader.loader import Loader
70        wild_cards = Loader().get_wildcards()
71        for item in wild_cards:
72            #['All (*.*)|*.*']
73            file_type, ext = string.split(item, "|*.", 1)
74            if ext.strip() not in EXCEPTION_LIST and ext.strip() not in list:
75                list.append(ext)
76    except:
[495acc2]77        pass
[fa597990]78    try:
79        file_type, ext = string.split(local_config.APPLICATION_WLIST, "|*.", 1)
80        if ext.strip() not in EXCEPTION_LIST and ext.strip() not in list:
81            list.append(ext)
82    except:
[495acc2]83        pass
[fa597990]84    try:
85        for item in local_config.PLUGINS_WLIST:
86            file_type, ext = string.split(item, "|*.", 1)
87            if ext.strip() not in EXCEPTION_LIST and ext.strip() not in list:
88                list.append(ext) 
89    except:
[495acc2]90        pass
[fa597990]91   
92    return list
93
94EXTENSIONS_LIST = find_extension()
95
96 
97plist = dict(CFBundleDocumentTypes=[dict(CFBundleTypeExtensions=EXTENSIONS_LIST,
98                                         CFBundleTypeIconFile=ICON,
[c329f4d]99                                   CFBundleTypeName="sasview file",
[fa597990]100                                   CFBundleTypeRole="Shell" )],)
101
102APP = ['sansview.py']
[8ca5890]103DATA_FILES += ['images','test','media']
[fd67a9e]104
[dffb5b2]105EXCLUDES = ['PyQt4', 'sip', 'QtGui']
[fd67a9e]106
[495acc2]107OPTIONS = {'argv_emulation': True,
[270cc72e]108           'packages': ['lxml','numpy', 'scipy', 'pytz', 'encodings',
[e558e0b]109                        'encodings','matplotlib', 'periodictable',
110                        'reportlab',
111                        'reportlab.graphics.charts',
112                        'reportlab.graphics.samples',
113                        'reportlab.graphics.widgets',
114                        'reportlab.graphics.barcode',
115                        'reportlab.graphics',
116                        'reportlab.lib',
117                        'reportlab.pdfbase',
118                        'reportlab.pdfgen',
119                        'reportlab.platypus'],
[fa597990]120           'iconfile': ICON,
121           'frameworks':[libxml_path],
122           'resources': RESOURCES_FILES,
123           'plist':plist,
[fd67a9e]124           'excludes' : EXCLUDES,
[fa597990]125           }
126setup(
[a338547]127    name="sasview",
[fa597990]128    app=APP,
129    data_files=DATA_FILES,
130    include_package_data= True,
131    options={'py2app': OPTIONS},
132    setup_requires=['py2app'],
133)
Note: See TracBrowser for help on using the repository browser.