Changes in / [97f05432:e207c3f] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow.py
- Property mode changed from 100644 to 100755
r2366fb2 rf51ed67 9 9 import SasviewLogger 10 10 11 def updatePaths():12 # Update paths13 # TEMPORARY KLUDGE TO ALLOW INSTALL-LESS RUNS14 # THIS WILL GO AWAY ONCE MERGED15 #######################################################################16 import imp17 import os18 import sys19 def addpath(path):20 """21 Add a directory to the python path environment, and to the PYTHONPATH22 environment variable for subprocesses.23 """24 path = os.path.abspath(path)25 if 'PYTHONPATH' in os.environ:26 PYTHONPATH = path + os.pathsep + os.environ['PYTHONPATH']27 else:28 PYTHONPATH = path29 os.environ['PYTHONPATH'] = PYTHONPATH30 sys.path.insert(0, path)31 32 def import_package(modname, path):33 """Import a package into a particular point in the python namespace"""34 mod = imp.load_source(modname, os.path.abspath(os.path.join(path,'__init__.py')))35 sys.modules[modname] = mod36 mod.__path__ = [os.path.abspath(path)]37 return mod38 39 root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", ".."))40 addpath(os.path.join(root, 'src'))41 #addpath(os.path.join(root, '../sasmodels/'))42 import sas43 from distutils.util import get_platform44 sas.sasview = import_package('sas.sasview', os.path.join(root,'sasview'))45 platform = '%s-%s'%(get_platform(),sys.version[:3])46 build_path = os.path.join(root, 'build','lib.'+platform)47 sys.path.append(build_path)48 #######################################################################49 50 11 class MainSasViewWindow(QtGui.QMainWindow, Ui_MainWindow): 51 12 # Main window of the application … … 57 18 self.workspace = QtGui.QWorkspace(self) 58 19 self.setCentralWidget(self.workspace) 59 60 updatePaths()61 20 62 21 # Create the gui manager
Note: See TracChangeset
for help on using the changeset viewer.