示例#1
0
 def __init__(self):
     PrefComponent.__init__(self, 'PostOffice')
     p = SP()
     self.setting = p.read_setting('pref.postoffice_config')
     self.passwd = None
     self.username = None
     self.parent = None
示例#2
0
 def on_button(self, ev):
     parent_window = ev.GetEventObject().GetTopLevelParent()
     dlg = FileHelperDialog(parent_window)
     a = dlg.ShowModal()
     if a == wx.ID_OK:
         p = SP().set_rule('file',
                           {'name': '', 'ext': '', 'action': '',
                            'action_txt': '', 'use': False})
         p.write_setting(pref, dlg.var)
示例#3
0
    def __init__(self, parent, id=-1, title="File Action Setting"):

        p = SP().set_rule('file', 
                          {'name':'', 'ext':'', 'action':'',
                           'action_txt':'', 'use':False})
        self.var = p.read_setting(pref)
        
        wx.Dialog.__init__(self, parent, id, title,
                           style = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
        
        self.mainSizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(self.mainSizer)

        self.cb = wx.ComboBox(self, wx.ID_ANY, 
                      size=(-1, -1),
                      style=wx.CB_READONLY,
                      choices = [x['name'] for x in self.var['file']])
        self.mainSizer.Add(self.cb, 0, wx.ALL, 3)
        
        l = [["rule",   '', 200, None],
             ["action", '', 235, {'nlines':3}],
             ["note", '', 0, None],
             [None, False, 3,  {'text': 'Use'}],]        

        self.elp = EditListPanel(self, l, edge = 0, call_sendevent = self)
        self.elp.GetSizer().AddGrowableRow(1)              
        
        self.mainSizer.Add(self.elp, 1, wx.ALL|wx.EXPAND, 2)
        
        self.buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
        self.bnew = wx.Button(self, label="New...", id=wx.ID_ANY)
        self.bdel = wx.Button(self, label="Delete...", id=wx.ID_ANY)
        self.bok = wx.Button(self, label="OK", id=wx.ID_OK)
        

        self.buttonSizer.Add(self.bnew, 0, wx.ALL, 7)
        self.buttonSizer.Add(self.bdel, 0, wx.ALL, 7 )
        self.buttonSizer.AddStretchSpacer(1)
        self.buttonSizer.Add(self.bok, 0, wx.ALL, 7 )
        self.mainSizer.Add(self.buttonSizer, 0, wx.ALL|wx.EXPAND, 0)
        self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK)
        self.Bind(wx.EVT_BUTTON, self.onNew, self.bnew)
        self.Bind(wx.EVT_BUTTON, self.onDel, self.bdel)
        self.cb.Bind(wx.EVT_COMBOBOX, self.onCBHit)
        wx.CallAfter(self.Layout)

        self.set_panels_2_index0()
示例#4
0
 def save_setting(self):
     p = SP()
     p.write_setting(config_name(), self.setting)
示例#5
0
    def __init__(self):
        PrefComponent.__init__(self, 'HelperApp')
        p = SP()

        self.setting = p.read_setting(config_name())
示例#6
0
 def save_setting(self):
     p = SP()
     p.write_setting('pref.general_config', iFigureConfig.setting)
示例#7
0
 def __init__(self):
     PrefComponent.__init__(self, 'General')
     if iFigureConfig.setting is None:
         p = SP()
         iFigureConfig.setting = p.read_setting('pref.general_config')
示例#8
0
if not os.path.exists(file):
    os.mkdir(file)
    file = os.path.join(file, '__init__.py')
    fid = open(file, 'w')
    fid.close()

geom_file = os.path.join(rcdir, 'gui_geom')

usr_template_dir = os.path.join(rcdir, 'template')
if not os.path.exists(usr_template_dir):
    os.mkdir(usr_template_dir)
usr_script_template_dir = os.path.join(usr_template_dir, 'script')
if not os.path.exists(usr_script_template_dir):
    os.mkdir(usr_script_template_dir)

p = SP()
s = p.read_setting('pref.general_config')
if s['root_work_directory'] == '\'default\'':
    #    tempdir_base=os.path.join(tempfile.gettempdir(), 'piscope_'+os.getenv('USER'))
    tempdir_base = os.path.join(tempfile.gettempdir(), 'piscope_'+usr)
    if not os.path.exists(tempdir_base):
        os.makedirs(tempdir_base)
#    tempdir_base=os.path.join(tempdir_base, os.getenv('USER'))
#    if not os.path.exists(tempdir_base):
#        os.mkdir(tempdir_base)
else:
    tempdir_base = os.path.expanduser(s['root_work_directory'])
    tempdir_base = os.path.join(tempdir_base, 'piscope_'+usr)
    if not os.path.exists(tempdir_base):
        os.makedirs(tempdir_base)
示例#9
0
 def save_setting(self):
     p = SP()
     p.write_setting('pref.appearance_config', self.setting)
示例#10
0
 def __init__(self):
     PrefComponent.__init__(self, 'Appearance')
     p = SP()
     self.setting = p.read_setting('pref.appearance_config')
示例#11
0
 def save_setting(self):
     p = SP()
     p.write_setting('pref.postoffice_config', self.setting)
示例#12
0
 def save_setting(self):
     p = SP()
     p.write_setting('pref.advanced_config', self.setting)
示例#13
0
 def __init__(self):
     PrefComponent.__init__(self, 'Advanced')
     p = SP()
     self.setting = p.read_setting('pref.advanced_config')