Changeset 80c2c85 in sasview for sasview/setup_mac.py


Ignore:
Timestamp:
Jun 28, 2016 5:10:33 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
3aa2f3c
Parents:
899e084 (diff), 5552396 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into sasview-cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasview/setup_mac.py

    r3d8e3c7 r899e084  
    1212""" 
    1313from setuptools import setup 
    14 import periodictable.xsf 
    15 import sas.sascalc.dataloader.readers 
    1614import os 
    1715import string 
    18 import local_config 
    1916import pytz 
    2017import sys 
     
    2926sys.path.insert(0, build_path) 
    3027print "BUILDING PATH INSIDE", build_path 
     28 
     29from sas.sasview import local_config 
     30 
    3131ICON = local_config.SetupIconFile_mac 
    3232EXTENSIONS_LIST = [] 
     33RESOURCES_FILES = [] 
    3334DATA_FILES = [] 
    34 RESOURCES_FILES = [] 
    3535 
    3636#Periodictable data file 
    37 DATA_FILES = periodictable.data_files() 
     37import periodictable 
     38DATA_FILES += periodictable.data_files() 
    3839#invariant and calculator help doc 
    39 import sas.sasgui.perspectives.fitting as fitting 
     40from sas.sasgui.perspectives import fitting 
    4041DATA_FILES += fitting.data_files() 
    41 import sas.sasgui.perspectives.calculator as calculator 
     42from sas.sasgui.perspectives import calculator 
    4243DATA_FILES += calculator.data_files() 
    43 import sas.sasgui.perspectives.invariant as invariant 
     44from sas.sasgui.perspectives import invariant 
    4445DATA_FILES += invariant.data_files() 
    45 import sasmodels as models 
    46 DATA_FILES += models.data_files() 
    47 import sas.sasgui.guiframe as guiframe 
     46import sasmodels 
     47DATA_FILES += sasmodels.data_files() 
     48from sas.sasgui import guiframe 
    4849DATA_FILES += guiframe.data_files() 
    4950 
    5051#CANSAxml reader data files 
    51 RESOURCES_FILES.append(os.path.join(sas.sascalc.dataloader.readers.get_data_path(),'defaults.json')) 
    52  
    53 # Locate libxml2 library 
    54 lib_locs = ['/usr/local/lib', '/usr/lib'] 
    55 libxml_path = None 
    56 for item in lib_locs: 
    57     libxml_path_test = '%s/libxml2.2.dylib' % item 
    58     if os.path.isfile(libxml_path_test): 
    59         libxml_path = libxml_path_test 
    60 if libxml_path == None: 
    61     raise RuntimeError, "Could not find libxml2 on the system" 
    62  
    63 APP = ['sasview.py'] 
    64 DATA_FILES += ['images','test','media', 'custom_config.py', 'local_config.py', 
    65                'default_categories.json'] 
     52from sas.sascalc.dataloader import readers 
     53RESOURCES_FILES.append(os.path.join(readers.get_data_path(),'defaults.json')) 
     54 
     55# Copy the config files 
     56sasview_path = os.path.join('..','src','sas','sasview') 
     57custom_config_file = os.path.join(sasview_path, 'custom_config.py') 
     58local_config_file = os.path.join(sasview_path, 'local_config.py') 
     59DATA_FILES.append(('.', [custom_config_file])) 
     60DATA_FILES.append(('config', [custom_config_file])) 
     61DATA_FILES.append(('.', [local_config_file])) 
     62 
     63# default_categories.json is beside the config files 
     64category_config = os.path.join(sasview_path, 'default_categories.json') 
     65if os.path.isfile(category_config): 
     66    DATA_FILES.append(('.', [category_config])) 
     67 
    6668if os.path.isfile("BUILD_NUMBER"): 
    67     DATA_FILES.append("BUILD_NUMBER") 
     69    DATA_FILES.append(('.', ["BUILD_NUMBER"])) 
     70 
     71images_dir = local_config.icon_path 
     72media_dir = local_config.media_path 
     73images_dir = local_config.icon_path 
     74test_dir = local_config.test_path 
     75test_1d_dir = os.path.join(test_dir, "1d_data") 
     76test_2d_dir = os.path.join(test_dir, "2d_data") 
     77test_save_dir = os.path.join(test_dir, "save_states") 
     78test_upcoming_dir = os.path.join(test_dir, "upcoming_formats") 
     79 
     80# Copying the images directory to the distribution directory. 
     81for f in findall(images_dir): 
     82    DATA_FILES.append(("images", [f])) 
     83 
     84# Copying the HTML help docs 
     85for f in findall(media_dir): 
     86    DATA_FILES.append(("media", [f])) 
     87 
     88# Copying the sample data user data 
     89for f in findall(test_1d_dir): 
     90    DATA_FILES.append(("test\\1d_data", [f])) 
     91 
     92# Copying the sample data user data 
     93for f in findall(test_2d_dir): 
     94    DATA_FILES.append(("test\\2d_data", [f])) 
     95 
     96# Copying the sample data user data 
     97for f in findall(test_save_dir): 
     98    DATA_FILES.append(("test\\save_states", [f])) 
     99 
     100# Copying the sample data user data 
     101for f in findall(test_upcoming_dir): 
     102    DATA_FILES.append(("test\\upcoming_formats", [f])) 
     103 
     104# Copying opencl include files 
     105for f in findall(opencl_include_dir): 
     106    DATA_FILES.append(("includes\\pyopencl", [f])) 
    68107 
    69108# See if the documentation has been built, and if so include it. 
     
    119158                                   CFBundleTypeRole="Shell" )],) 
    120159 
     160# Locate libxml2 library 
     161lib_locs = ['/usr/local/lib', '/usr/lib'] 
     162libxml_path = None 
     163for item in lib_locs: 
     164    libxml_path_test = '%s/libxml2.2.dylib' % item 
     165    if os.path.isfile(libxml_path_test): 
     166        libxml_path = libxml_path_test 
     167if libxml_path == None: 
     168    raise RuntimeError, "Could not find libxml2 on the system" 
     169 
    121170#Get version - NB nasty hack. Need to find correct way to give path to installed sasview (AJJ) 
    122171#h5py has been added to packages. It requires hdf5 to be installed separetly 
    123172# 
    124 import __init__ as sasviewver 
    125  
    126 VERSION = sasviewver.__version__ 
     173 
     174from sas.sasview import __version__ as VERSION 
    127175APPNAME = "SasView "+VERSION 
    128176DMGNAME = "SasView-"+VERSION+"-MacOSX" 
    129  
    130 APP = ['sasview.py'] 
    131 DATA_FILES += ['images','test','media'] 
     177APP = ['sasview_gui.py'] 
    132178 
    133179EXCLUDES = ['PyQt4', 'sip', 'QtGui'] 
Note: See TracChangeset for help on using the changeset viewer.