Changeset 2a8bd705 in sasview
- Timestamp:
- Jul 25, 2017 4:36:48 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:
- b00414d
- Parents:
- 6ff2eb3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
run.py
- Property mode changed from 100644 to 100755
rc416a17 r2a8bd705 21 21 from contextlib import contextmanager 22 22 from os.path import join as joinpath 23 from os.path import abspath, dirname 23 from os.path import abspath, dirname, realpath 24 24 25 25 … … 64 64 # build_path comes from context 65 65 path = joinpath(build_path, *modname.split('.')) + ext 66 # print "importing", modname, "from", path67 66 return imp.load_dynamic(modname, path) 68 67 … … 77 76 # find the directories for the source and build 78 77 from distutils.util import get_platform 79 root = abspath(dirname(__file__)) 78 root = abspath(dirname(sys.argv[0])) 79 80 80 platform = '%s-%s' % (get_platform(), sys.version[:3]) 81 81 build_path = joinpath(root, 'build', 'lib.' + platform) … … 144 144 # Need to add absolute path before actual prepare call, 145 145 # so logging can be done during initialization process too 146 root = abspath(dirname( __file__))146 root = abspath(dirname(realpath(sys.argv[0]))) 147 147 addpath(joinpath(root, 'sasview')) 148 148 from logger_config import SetupLogger -
sasview/local_config.py
rc416a17 r2a8bd705 114 114 #DEFAULT_STYLE = GUIFRAME.MULTIPLE_APPLICATIONS|GUIFRAME.MANAGER_ON\ 115 115 # |GUIFRAME.CALCULATOR_ON|GUIFRAME.TOOLBAR_ON 116 DEFAULT_STYLE = 64 117 116 118 SPLASH_SCREEN_WIDTH = 512 117 119 SPLASH_SCREEN_HEIGHT = 366 -
sasview/sasview.py
rf36e01f r2a8bd705 12 12 # copyright 2009, University of Tennessee 13 13 ################################################################################ 14 import os15 import os.path16 14 import sys 17 import traceback18 15 19 16 from sas.sasview.logger_config import SetupLogger … … 27 24 logger.info("Python: %s" % sys.version) 28 25 29 # Allow the dynamic selection of wxPython via an environment variable, when devs30 # who have multiple versions of the module installed want to pick between them.31 # This variable does not have to be set of course, and through normal usage will32 # probably not be, but this can make things a little easier when upgrading to a33 # new version of wx.34 WX_ENV_VAR = "SASVIEW_WX_VERSION"35 if WX_ENV_VAR in os.environ:36 logger.info("You have set the %s environment variable to %s." % \37 (WX_ENV_VAR, os.environ[WX_ENV_VAR]))38 import wxversion39 if wxversion.checkInstalled(os.environ[WX_ENV_VAR]):40 logger.info("Version %s of wxPython is installed, so using that version." % os.environ[WX_ENV_VAR])41 wxversion.select(os.environ[WX_ENV_VAR])42 else:43 logger.error("Version %s of wxPython is not installed, so using default version." % os.environ[WX_ENV_VAR])44 else:45 logger.info("You have not set the %s environment variable, so using default version of wxPython." % WX_ENV_VAR)46 26 47 import wx48 49 try:50 logger.info("Wx version: %s" % wx.__version__)51 except:52 logger.error("Wx version: error reading version")53 54 import wxcruft55 wxcruft.call_later_fix()56 # wxcruft.trace_new_id()57 58 # Always use private .matplotlib setup to avoid conflicts with other59 # uses of matplotlib60 # Have to check if .sasview exists first61 sasdir = os.path.join(os.path.expanduser("~"),'.sasview')62 if not os.path.exists(sasdir):63 os.mkdir(sasdir)64 mplconfigdir = os.path.join(os.path.expanduser("~"),'.sasview','.matplotlib')65 if not os.path.exists(mplconfigdir):66 os.mkdir(mplconfigdir)67 os.environ['MPLCONFIGDIR'] = mplconfigdir68 27 reload(sys) 69 28 sys.setdefaultencoding("iso-8859-1") 70 from sas.sasgui.guiframe import gui_manager71 from sas.sasgui.guiframe.gui_style import GUIFRAME72 from welcome_panel import WelcomePanel73 29 74 30 PLUGIN_MODEL_DIR = 'plugin_models' 75 31 APP_NAME = 'SasView' 76 32 77 from matplotlib import backend_bases 78 backend_bases.FigureCanvasBase.filetypes.pop('pgf', None) 79 80 class SasView(): 81 """ 82 Main class for running the SasView application 83 """ 84 def __init__(self): 85 """ 86 """ 87 # from gui_manager import ViewApp 88 self.gui = gui_manager.SasViewApp(0) 89 # Set the application manager for the GUI 90 self.gui.set_manager(self) 91 # Add perspectives to the basic application 92 # Additional perspectives can still be loaded 93 # dynamically 94 # Note: py2exe can't find dynamically loaded 95 # modules. We load the fitting module here 96 # to ensure a complete Windows executable build. 97 98 # Fitting perspective 99 try: 100 import sas.sasgui.perspectives.fitting as module 101 fitting_plug = module.Plugin() 102 self.gui.add_perspective(fitting_plug) 103 except Exception: 104 logger.error("%s: could not find Fitting plug-in module"% APP_NAME) 105 logger.error(traceback.format_exc()) 106 107 # P(r) perspective 108 try: 109 import sas.sasgui.perspectives.pr as module 110 pr_plug = module.Plugin() 111 self.gui.add_perspective(pr_plug) 112 except: 113 logger.error("%s: could not find P(r) plug-in module"% APP_NAME) 114 logger.error(traceback.format_exc()) 115 116 # Invariant perspective 117 try: 118 import sas.sasgui.perspectives.invariant as module 119 invariant_plug = module.Plugin() 120 self.gui.add_perspective(invariant_plug) 121 except Exception as e : 122 logger.error("%s: could not find Invariant plug-in module"% \ 123 APP_NAME) 124 logger.error(traceback.format_exc()) 125 126 # Corfunc perspective 127 try: 128 import sas.sasgui.perspectives.corfunc as module 129 corfunc_plug = module.Plugin() 130 self.gui.add_perspective(corfunc_plug) 131 except: 132 logger.error("Unable to load corfunc module") 133 134 # Calculator perspective 135 try: 136 import sas.sasgui.perspectives.calculator as module 137 calculator_plug = module.Plugin() 138 self.gui.add_perspective(calculator_plug) 139 except: 140 logger.error("%s: could not find Calculator plug-in module"% \ 141 APP_NAME) 142 logger.error(traceback.format_exc()) 143 144 # File converter tool 145 try: 146 import sas.sasgui.perspectives.file_converter as module 147 converter_plug = module.Plugin() 148 self.gui.add_perspective(converter_plug) 149 except: 150 logger.error("%s: could not find File Converter plug-in module"% \ 151 APP_NAME) 152 logger.error(traceback.format_exc()) 153 154 # Add welcome page 155 self.gui.set_welcome_panel(WelcomePanel) 156 157 # Build the GUI 158 self.gui.build_gui() 159 # delete unused model folder 160 self.gui.clean_plugin_models(PLUGIN_MODEL_DIR) 161 # Start the main loop 162 self.gui.MainLoop() 163 164 165 def run(): 33 def runSasView(): 166 34 """ 167 35 __main__ method for loading and running SasView … … 169 37 from multiprocessing import freeze_support 170 38 freeze_support() 171 if len(sys.argv) > 1: 172 ## Run sasview as an interactive python interpreter 173 # if sys.argv[1] == "-i": 174 # sys.argv = ["ipython", "--pylab"] 175 # from IPython import start_ipython 176 # sys.exit(start_ipython()) 177 thing_to_run = sys.argv[1] 178 sys.argv = sys.argv[1:] 179 import runpy 180 if os.path.exists(thing_to_run): 181 runpy.run_path(thing_to_run, run_name="__main__") 182 else: 183 runpy.run_module(thing_to_run, run_name="__main__") 184 else: 185 SasView() 39 from sas.qtgui.MainWindow.MainWindow import run 40 run() 186 41 187 42 188 43 if __name__ == "__main__": 189 run ()44 runSasView() -
sasview/sasview.spec
- Property mode changed from 100755 to 100644
re42c8e9d r2a8bd705 51 51 datas.append(('welcome_panel.py','.')) 52 52 53 datas.append((os.path.join(PYTHON_LOC,'Lib','SocketServer.py'),'.')) 54 53 55 # TODO 54 56 # NEED BETTER WAY TO DEAL WITH THESE RELATIVE PATHS 55 57 datas.append((os.path.join('..','..','sasmodels','sasmodels'),'sasmodels')) 56 58 datas.append((os.path.join('..','src','sas','sasgui','perspectives','fitting','plugin_models'),'plugin_models')) 57 58 # precompile sas models into the sasview build path; doesn't matter too much59 # where it is so long as it is a place that will get cleaned up afterwards.60 import sasmodels.core61 dll_path = 'compiled_models'62 if not (os.path.exists(dll_path)):63 os.mkdir(dll_path)64 dll_path2 = os.path.join(dll_path, dll_path)65 if not (os.path.exists(dll_path2)):66 os.mkdir(dll_path2)67 68 compiled_dlls = sasmodels.core.precompile_dlls(dll_path, dtype='double')69 70 # include the compiled models as data; coordinate the target path for the71 # data with installer_generator.py72 datas.append((os.path.join('compiled_models','compiled_models'),'compiled_models'))73 59 74 60 # These depend on whether we have MKL or Atlas numpy … … 114 100 # Spelled out to enable easier editing 115 101 excludes = [] 116 excludes.append('libzmq')117 excludes.append('IPython')118 excludes.append('PyQt4')119 excludes.append('PySide')120 excludes.append('Qt4')121 excludes.append('Tkinter')122 excludes.append('tk')123 excludes.append('tcl')124 # Seems we cannot build on Linux without bundling sip125 if not platform.system() == 'Linux':126 excludes.append('sip')127 excludes.append('sympy')128 excludes.append('pytz')129 excludes.append('sklearn')130 excludes.append('zmq')131 102 132 103 # Need to explicitly exclude sasmodels here!! … … 138 109 'sasmodels.core', 139 110 'pyopencl', 140 'tinycc' 111 'tinycc', 112 'SocketServer' 141 113 ] 142 114 -
src/sas/qtgui/MainWindow/MainWindow.py
rcd2cc745 r2a8bd705 48 48 splash.show() 49 49 50 # fix for pyinstaller packages app to avoid ReactorAlreadyInstalledError 51 import sys 52 if 'twisted.internet.reactor' in sys.modules: 53 del sys.modules['twisted.internet.reactor'] 54 50 55 # DO NOT move the following import to the top! 51 56 # (unless you know what you're doing)
Note: See TracChangeset
for help on using the changeset viewer.