Changeset 0d13814 in sasview for src/sas/qtgui/path_prepare.py
- Timestamp:
- Jul 27, 2017 2:05:50 AM (7 years ago)
- Branches:
- 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
- Children:
- 7adc2a8
- Parents:
- b00414d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/path_prepare.py
- Property mode changed from 100755 to 100644
rded2ce3 r0d13814 5 5 import os 6 6 import sys 7 8 def exe_run(): 9 """ 10 Check if the process is run as .exe or as .py 11 Primitive extension check of the name of the running process 12 """ 13 # Could be checking for .exe, but on mac/linux this wouldn't work well 14 return os.path.splitext(sys.argv[0])[1].lower() != ".py" 15 7 16 def addpath(path): 8 17 """ … … 25 34 return mod 26 35 27 root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")) 28 addpath(os.path.join(root, 'src')) 29 #addpath(os.path.join(root, '../sasmodels/')) 30 import sas 31 from distutils.util import get_platform 32 sas.sasview = import_package('sas.sasview', os.path.join(root,'sasview')) 33 platform = '%s-%s'%(get_platform(),sys.version[:3]) 34 build_path = os.path.join(root, 'build','lib.'+platform) 35 sys.path.append(build_path) 36 root = "" 37 if exe_run(): 38 root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) 39 addpath(os.path.join(root, 'src')) 40 addpath('src') 41 else: 42 root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")) 43 addpath(os.path.join(root, 'src')) 44 addpath('src') 45 # Add the local build directory to PYTHONPATH 46 from distutils.util import get_platform 47 platform = '%s-%s'%(get_platform(),sys.version[:3]) 48 build_path = os.path.join(root, 'build','lib.'+platform) 49 sys.path.append(build_path) 50
Note: See TracChangeset
for help on using the changeset viewer.