Changeset 3aa2f3c in sasview


Ignore:
Timestamp:
Jun 28, 2016 7: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:
74d9780
Parents:
80c2c85
Message:

working mac build with revised tree

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sasview/setup_exe.py

    r899e084 r3aa2f3c  
    3333root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 
    3434platform = '%s-%s'%(get_platform(), sys.version[:3]) 
     35doc_path = os.path.join(root, 'build', 'lib.'+platform, 'doc') 
    3536build_path = os.path.join(root, 'sasview-install', 'Lib', 'site-packages') 
    3637sys.path.insert(0, build_path) 
    37 doc_path = os.path.join(root, 'build', 'lib.'+platform, 'doc') 
    3838 
    3939from sas.sasview import local_config 
     
    177177matplotlibdata = findall(matplotlibdatadir) 
    178178 
    179 site_loc = get_python_lib() 
    180 opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl") 
    181  
    182179DATA_FILES = [] 
    183180 
     
    243240images_dir = local_config.icon_path 
    244241media_dir = local_config.media_path 
    245 images_dir = local_config.icon_path 
    246242test_dir = local_config.test_path 
    247243test_1d_dir = os.path.join(test_dir, "1d_data") 
     
    260256# Copying the sample data user data 
    261257for f in findall(test_1d_dir): 
    262     DATA_FILES.append(("test\\1d_data", [f])) 
     258    DATA_FILES.append((os.path.join("test","1d_data"), [f])) 
    263259 
    264260# Copying the sample data user data 
    265261for f in findall(test_2d_dir): 
    266     DATA_FILES.append(("test\\2d_data", [f])) 
     262    DATA_FILES.append((os.path.join("test","2d_data"), [f])) 
    267263 
    268264# Copying the sample data user data 
    269265for f in findall(test_save_dir): 
    270     DATA_FILES.append(("test\\save_states", [f])) 
     266    DATA_FILES.append((os.path.join("test","save_states"), [f])) 
    271267 
    272268# Copying the sample data user data 
    273269for f in findall(test_upcoming_dir): 
    274     DATA_FILES.append(("test\\upcoming_formats", [f])) 
     270    DATA_FILES.append((os.path.join("test","upcoming_formats"), [f])) 
    275271 
    276272# Copying opencl include files 
     273site_loc = get_python_lib() 
     274opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl") 
    277275for f in findall(opencl_include_dir): 
    278     DATA_FILES.append(("includes\\pyopencl", [f])) 
     276    DATA_FILES.append((os.path.join("includes","pyopencl"), [f])) 
    279277 
    280278# See if the documentation has been built, and if so include it. 
  • sasview/setup_mac.py

    r899e084 r3aa2f3c  
    1414import os 
    1515import string 
    16 import pytz 
    1716import sys 
    18 import platform 
    1917#Extending recursion limit 
    2018sys.setrecursionlimit(10000) 
    2119 
     20import macholib_patch 
     21 
    2222from distutils.util import get_platform 
     23from distutils.filelist import findall 
     24from distutils.sysconfig import get_python_lib 
    2325root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 
    2426platform = '%s-%s'%(get_platform(),sys.version[:3]) 
    25 build_path = os.path.join(root, 'build','lib.'+platform) 
    26 sys.path.insert(0, build_path) 
    27 print "BUILDING PATH INSIDE", build_path 
     27doc_path = os.path.join(root, 'build', 'lib.'+platform, 'doc') 
     28env = os.path.join(root, 'sasview-install', 'lib', 'python2.7', 'site-packages') 
     29#sys.path.insert(0, env) 
     30 
     31print "BUILDING PATH INSIDE", env 
    2832 
    2933from sas.sasview import local_config 
    3034 
    3135ICON = local_config.SetupIconFile_mac 
    32 EXTENSIONS_LIST = [] 
    3336RESOURCES_FILES = [] 
    3437DATA_FILES = [] 
     
    7174images_dir = local_config.icon_path 
    7275media_dir = local_config.media_path 
    73 images_dir = local_config.icon_path 
    7476test_dir = local_config.test_path 
    7577test_1d_dir = os.path.join(test_dir, "1d_data") 
     
    8890# Copying the sample data user data 
    8991for f in findall(test_1d_dir): 
    90     DATA_FILES.append(("test\\1d_data", [f])) 
     92    DATA_FILES.append((os.path.join("test","1d_data"), [f])) 
    9193 
    9294# Copying the sample data user data 
    9395for f in findall(test_2d_dir): 
    94     DATA_FILES.append(("test\\2d_data", [f])) 
     96    DATA_FILES.append((os.path.join("test","2d_data"), [f])) 
    9597 
    9698# Copying the sample data user data 
    9799for f in findall(test_save_dir): 
    98     DATA_FILES.append(("test\\save_states", [f])) 
     100    DATA_FILES.append((os.path.join("test","save_states"), [f])) 
    99101 
    100102# Copying the sample data user data 
    101103for f in findall(test_upcoming_dir): 
    102     DATA_FILES.append(("test\\upcoming_formats", [f])) 
     104    DATA_FILES.append((os.path.join("test","upcoming_formats"), [f])) 
    103105 
    104106# Copying opencl include files 
     107site_loc = get_python_lib() 
     108opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl") 
    105109for f in findall(opencl_include_dir): 
    106     DATA_FILES.append(("includes\\pyopencl", [f])) 
     110    DATA_FILES.append((os.path.join("includes","pyopencl"), [f])) 
    107111 
    108112# See if the documentation has been built, and if so include it. 
    109 doc_path = os.path.join(build_path, "doc") 
    110113print doc_path 
    111114if os.path.exists(doc_path): 
  • src/sas/sasgui/__init__.py

    refe730d r3aa2f3c  
     1import sys 
    12import os 
     3from os.path import exists, expanduser, dirname, realpath, join as joinpath 
     4 
     5def dirn(path, n): 
     6    path = realpath(path) 
     7    for _ in range(n): 
     8        path = dirname(path) 
     9    return path 
    210 
    311# Set up config directories 
    412def make_user_folder(): 
    5     path = os.path.join(os.path.expanduser("~"),'.sasview') 
    6     if not os.path.exists(path): 
     13    path = joinpath(expanduser("~"),'.sasview') 
     14    if not exists(path): 
    715        os.mkdir(path) 
    816    return path 
    917 
     18 
    1019def find_app_folder(): 
    11     # If the directory containing sasview.py exists, then we are not running 
    12     # frozen and the current path is the app path. 
    13     root = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) 
    14     path = os.path.join(root, 'sasview') 
    15     if os.path.exists(path): 
     20    # We are starting out with the following info: 
     21    #     __file__ = .../sas/sasgui/__init__.pyc 
     22    # Check if the sister path .../sas/sasview exists, and use it as the 
     23    # app directory.  This will only be the case if the app is not frozen. 
     24    path = joinpath(dirn(__file__, 2), 'sasview') 
     25    if exists(path): 
    1626        return path 
    1727 
    18     # If we are running frozen, then skip from: 
    19     #    library.zip/sas/sasview 
    20     path = os.path.dirname(os.path.dirname(root)) 
     28    # If we are running frozen, then root is a parent directory 
     29    if sys.platform == 'darwin': 
     30        # Here is the path to the file on the mac: 
     31        #     .../Sasview.app/Contents/Resources/lib/python2.7/site-packages.zip/sas/sasgui/__init__.pyc 
     32        # We want the path to the Resources directory. 
     33        path = dirn(__file__, 6) 
     34    elif os.name == 'nt': 
     35        # Here is the path to the file on windows: 
     36        #     ../Sasview/library.zip/sas/sasgui/__init__.pyc 
     37        # We want the path to the Sasview directory. 
     38        path = dirn(__file__, 4) 
     39    else: 
     40        raise RuntimeError("Couldn't find the app directory") 
    2141    return path 
    2242 
Note: See TracChangeset for help on using the changeset viewer.