Changeset efe730d in sasview for src/sas/sasgui/guiframe/startup_configuration.py
- Timestamp:
- Jun 25, 2016 4:07:33 AM (8 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:
- 899e084
- Parents:
- 9501661
- git-author:
- Paul Kienzle <pkienzle@…> (06/25/16 02:23:59)
- git-committer:
- Paul Kienzle <pkienzle@…> (06/25/16 04:07:33)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/startup_configuration.py
rd85c194 refe730d 9 9 #copyright 2009, University of Tennessee 10 10 ################################################################################ 11 import os 12 import copy 13 11 14 import wx 12 import os 13 import sys 14 import copy 15 #import sas.sasgui.guiframe.gui_manager as gui 16 from sas.sasgui.guiframe.events import StatusEvent 15 16 from sas.sasgui.customdir import get_custom_config_path 17 17 from sas.sasgui.guiframe.gui_style import GUIFRAME 18 18 from sas.sasgui.guiframe import gui_manager as CURRENT 19 from sas.sasgui.guiframe.customdir import SetupCustom 19 20 20 21 # default configuration 21 22 DEFAULT_STRINGS = {'GUIFRAME_WIDTH':-1, … … 64 65 # parent 65 66 self.parent = parent 66 self.path = SetupCustom().find_dir()67 67 self._gui = gui 68 68 # font size … … 189 189 def write_custom_config(self): 190 190 """ 191 Write custom configuration 192 """ 193 fname = os.path.join(self.path, 'custom_config.py') 194 self.write_string(fname, self.return_string) 195 196 def write_string(self, fname, strings): 197 """ 198 Write and Save file 199 """ 200 201 try: 202 out_f = open(fname,'w') 203 except : 204 raise #RuntimeError, "Error: Can not change the configuration..." 205 out_f.write("#Application appearance custom configuration\n" ) 206 for key, item in strings.iteritems(): 207 if (key == 'DEFAULT_PERSPECTIVE') or \ 208 (key == 'DEFAULT_OPEN_FOLDER' and item != None): 209 out_f.write("%s = \"%s\"\n" % (key,str(item))) 210 else: 211 out_f.write("%s = %s\n" % (key,str(item))) 212 213 out_f.close() 214 191 Write custom configuration 192 """ 193 path = get_custom_config_path() 194 with open(path, 'w') as out_f: 195 out_f.write("#Application appearance custom configuration\n" ) 196 for key, item in self.return_string.iteritems(): 197 if (key == 'DEFAULT_PERSPECTIVE') or \ 198 (key == 'DEFAULT_OPEN_FOLDER' and item != None): 199 out_f.write("%s = \"%s\"\n" % (key,str(item))) 200 else: 201 out_f.write("%s = %s\n" % (key,str(item)))
Note: See TracChangeset
for help on using the changeset viewer.