Changeset b963b20 in sasview for src/sas/sasview
- Timestamp:
- Sep 24, 2017 11:29:13 PM (7 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:
- b277220, fca1f50
- Parents:
- d3b0c77
- Location:
- src/sas/sasview
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasview/local_config.py
r724af06 rb963b20 145 145 UPDATE_TIMEOUT = 2 146 146 147 #OpenCL option148 SAS_OPENCL = None149 150 147 # Time out for updating sasview 151 148 UPDATE_TIMEOUT = 2 -
src/sas/sasview/sasview.py
rd3b0c77 rb963b20 20 20 reload(sys) 21 21 sys.setdefaultencoding("iso-8859-1") 22 23 import sas 22 24 23 25 APP_NAME = 'SasView' … … 171 173 172 174 173 def setup_mpl(backend='WXAgg'): 174 import sas.sasgui 175 def setup_mpl(backend=None): 175 176 # Always use private .matplotlib setup to avoid conflicts with other 176 mplconfigdir = os.path.join(sas. sasgui.get_user_dir(), '.matplotlib')177 mplconfigdir = os.path.join(sas.get_user_dir(), '.matplotlib') 177 178 if not os.path.exists(mplconfigdir): 178 179 os.mkdir(mplconfigdir) … … 192 193 Prepare sasmodels for running within sasview. 193 194 """ 194 import sas.sasgui195 195 # Set SAS_MODELPATH so sasmodels can find our custom models 196 plugin_dir = os.path.join(sas. sasgui.get_user_dir(), PLUGIN_MODEL_DIR)196 plugin_dir = os.path.join(sas.get_user_dir(), PLUGIN_MODEL_DIR) 197 197 os.environ['SAS_MODELPATH'] = plugin_dir 198 # TODO: SAS_OPENCL flag belongs in setup_sasmodels 199 # this will require restructuring of the config management so that it 200 # can occur outside of sasgui. 198 #Initiliaze enviromental variable with custom setting but only if variable not set 199 SAS_OPENCL = sas.get_custom_config().SAS_OPENCL 200 if SAS_OPENCL and "SAS_OPENCL" not in os.environ: 201 os.environ["SAS_OPENCL"] = SAS_OPENCL 201 202 202 203 def run_gui(): … … 207 208 freeze_support() 208 209 setup_logging() 209 setup_mpl( )210 setup_mpl(backend='WXAgg') 210 211 setup_sasmodels() 211 212 setup_wx() … … 217 218 freeze_support() 218 219 setup_logging() 219 setup_mpl(backend='Agg') 220 # Use default matplotlib backend on mac/linux, but wx on windows. 221 # The problem on mac is that the wx backend requires pythonw. On windows 222 # we are sure to wx since it is the shipped with the app. 223 setup_mpl(backend='WXAgg' if os.name == 'nt' else None) 220 224 setup_sasmodels() 221 225 if len(sys.argv) == 1: -
src/sas/sasview/welcome_panel.py
rd66dbcc rb963b20 10 10 from wx.lib.scrolledpanel import ScrolledPanel 11 11 12 from sas .sasguiimport get_local_config12 from sas import get_local_config 13 13 from sas.sasgui.guiframe.panel_base import PanelBase 14 14 config = get_local_config()
Note: See TracChangeset
for help on using the changeset viewer.