Ignore:
Timestamp:
Jun 25, 2016 4:07:33 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
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)
Message:

move sasview to src/sas/sasview and refactor bundled apps for easier debugging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/startup_configuration.py

    rd85c194 refe730d  
    99#copyright 2009, University of Tennessee 
    1010################################################################################ 
     11import os 
     12import copy 
     13 
    1114import 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 
     16from sas.sasgui.customdir import get_custom_config_path 
    1717from sas.sasgui.guiframe.gui_style import GUIFRAME 
    1818from sas.sasgui.guiframe import gui_manager as CURRENT 
    19 from sas.sasgui.guiframe.customdir  import SetupCustom 
     19 
     20 
    2021# default configuration 
    2122DEFAULT_STRINGS = {'GUIFRAME_WIDTH':-1, 
     
    6465        # parent 
    6566        self.parent = parent 
    66         self.path = SetupCustom().find_dir() 
    6767        self._gui = gui 
    6868        # font size  
     
    189189    def write_custom_config(self): 
    190190        """ 
    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.