Changeset 3aa2f3c in sasview
- Timestamp:
- Jun 28, 2016 5:10:33 PM (8 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, 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
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sasview/setup_exe.py
r899e084 r3aa2f3c 33 33 root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 34 34 platform = '%s-%s'%(get_platform(), sys.version[:3]) 35 doc_path = os.path.join(root, 'build', 'lib.'+platform, 'doc') 35 36 build_path = os.path.join(root, 'sasview-install', 'Lib', 'site-packages') 36 37 sys.path.insert(0, build_path) 37 doc_path = os.path.join(root, 'build', 'lib.'+platform, 'doc')38 38 39 39 from sas.sasview import local_config … … 177 177 matplotlibdata = findall(matplotlibdatadir) 178 178 179 site_loc = get_python_lib()180 opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl")181 182 179 DATA_FILES = [] 183 180 … … 243 240 images_dir = local_config.icon_path 244 241 media_dir = local_config.media_path 245 images_dir = local_config.icon_path246 242 test_dir = local_config.test_path 247 243 test_1d_dir = os.path.join(test_dir, "1d_data") … … 260 256 # Copying the sample data user data 261 257 for 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])) 263 259 264 260 # Copying the sample data user data 265 261 for 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])) 267 263 268 264 # Copying the sample data user data 269 265 for 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])) 271 267 272 268 # Copying the sample data user data 273 269 for 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])) 275 271 276 272 # Copying opencl include files 273 site_loc = get_python_lib() 274 opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl") 277 275 for f in findall(opencl_include_dir): 278 DATA_FILES.append(( "includes\\pyopencl", [f]))276 DATA_FILES.append((os.path.join("includes","pyopencl"), [f])) 279 277 280 278 # See if the documentation has been built, and if so include it. -
sasview/setup_mac.py
r899e084 r3aa2f3c 14 14 import os 15 15 import string 16 import pytz17 16 import sys 18 import platform19 17 #Extending recursion limit 20 18 sys.setrecursionlimit(10000) 21 19 20 import macholib_patch 21 22 22 from distutils.util import get_platform 23 from distutils.filelist import findall 24 from distutils.sysconfig import get_python_lib 23 25 root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 24 26 platform = '%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 27 doc_path = os.path.join(root, 'build', 'lib.'+platform, 'doc') 28 env = os.path.join(root, 'sasview-install', 'lib', 'python2.7', 'site-packages') 29 #sys.path.insert(0, env) 30 31 print "BUILDING PATH INSIDE", env 28 32 29 33 from sas.sasview import local_config 30 34 31 35 ICON = local_config.SetupIconFile_mac 32 EXTENSIONS_LIST = []33 36 RESOURCES_FILES = [] 34 37 DATA_FILES = [] … … 71 74 images_dir = local_config.icon_path 72 75 media_dir = local_config.media_path 73 images_dir = local_config.icon_path74 76 test_dir = local_config.test_path 75 77 test_1d_dir = os.path.join(test_dir, "1d_data") … … 88 90 # Copying the sample data user data 89 91 for 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])) 91 93 92 94 # Copying the sample data user data 93 95 for 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])) 95 97 96 98 # Copying the sample data user data 97 99 for 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])) 99 101 100 102 # Copying the sample data user data 101 103 for 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])) 103 105 104 106 # Copying opencl include files 107 site_loc = get_python_lib() 108 opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl") 105 109 for f in findall(opencl_include_dir): 106 DATA_FILES.append(( "includes\\pyopencl", [f]))110 DATA_FILES.append((os.path.join("includes","pyopencl"), [f])) 107 111 108 112 # See if the documentation has been built, and if so include it. 109 doc_path = os.path.join(build_path, "doc")110 113 print doc_path 111 114 if os.path.exists(doc_path): -
src/sas/sasgui/__init__.py
refe730d r3aa2f3c 1 import sys 1 2 import os 3 from os.path import exists, expanduser, dirname, realpath, join as joinpath 4 5 def dirn(path, n): 6 path = realpath(path) 7 for _ in range(n): 8 path = dirname(path) 9 return path 2 10 3 11 # Set up config directories 4 12 def 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): 7 15 os.mkdir(path) 8 16 return path 9 17 18 10 19 def 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): 16 26 return path 17 27 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") 21 41 return path 22 42
Note: See TracChangeset
for help on using the changeset viewer.