Changes in / [97f05432:e207c3f] in sasview


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow.py

    • Property mode changed from 100644 to 100755
    r2366fb2 rf51ed67  
    99import SasviewLogger 
    1010 
    11 def updatePaths(): 
    12     # Update paths 
    13     # TEMPORARY KLUDGE TO ALLOW INSTALL-LESS RUNS 
    14     # THIS WILL GO AWAY ONCE MERGED 
    15     ####################################################################### 
    16     import imp 
    17     import os 
    18     import sys 
    19     def addpath(path): 
    20         """ 
    21         Add a directory to the python path environment, and to the PYTHONPATH 
    22         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 = path 
    29         os.environ['PYTHONPATH'] = PYTHONPATH 
    30         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] = mod 
    36         mod.__path__ = [os.path.abspath(path)] 
    37         return mod 
    38  
    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 sas 
    43     from distutils.util import get_platform 
    44     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  
    5011class MainSasViewWindow(QtGui.QMainWindow, Ui_MainWindow): 
    5112    # Main window of the application 
     
    5718        self.workspace = QtGui.QWorkspace(self) 
    5819        self.setCentralWidget(self.workspace) 
    59  
    60         updatePaths() 
    6120 
    6221        # Create the gui manager 
Note: See TracChangeset for help on using the changeset viewer.