a bit better like that
This commit is contained in:
parent
40a5e98f51
commit
af5c1ca4c3
1 changed files with 1 additions and 4 deletions
|
@ -99,13 +99,10 @@ class GajimCore:
|
||||||
def init_cfg_file(self):
|
def init_cfg_file(self):
|
||||||
"""Initialize configuration file"""
|
"""Initialize configuration file"""
|
||||||
if self.mode == 'server':
|
if self.mode == 'server':
|
||||||
#TODO: only one should be needed
|
|
||||||
default_file = "[Profile]\naccounts = \nlog = 0\n\n[Core]\ndelauth = 1\nalwaysauth = 0\nmodules = logger gtkgui\ndelroster = 1\n"
|
|
||||||
default_tab = {'Profile': {'accounts': '', 'log': 0}, 'Core': \
|
default_tab = {'Profile': {'accounts': '', 'log': 0}, 'Core': \
|
||||||
{'delauth': 1, 'alwaysauth': 0, 'modules': 'logger gtkgui', \
|
{'delauth': 1, 'alwaysauth': 0, 'modules': 'logger gtkgui', \
|
||||||
'delroster': 1}}
|
'delroster': 1}}
|
||||||
else:
|
else:
|
||||||
default_file = "[Profile]\nlog = 0\n\n[Core_client]\nhost = \nport = 8255\nmodules = gtkgui\n"
|
|
||||||
default_tab = {'Profile': {'log': 0}, 'Core_client': {'host': \
|
default_tab = {'Profile': {'log': 0}, 'Core_client': {'host': \
|
||||||
'localhost', 'port': 8255, 'modules': 'gtkgui'}}
|
'localhost', 'port': 8255, 'modules': 'gtkgui'}}
|
||||||
fname = os.path.expanduser(CONFPATH)
|
fname = os.path.expanduser(CONFPATH)
|
||||||
|
@ -128,7 +125,6 @@ class GajimCore:
|
||||||
except:
|
except:
|
||||||
print _("creating %s") % fname
|
print _("creating %s") % fname
|
||||||
fic = open(fname, "w")
|
fic = open(fname, "w")
|
||||||
fic.write(default_file)
|
|
||||||
fic.close()
|
fic.close()
|
||||||
self.cfgParser = common.optparser.OptionsParser(CONFPATH)
|
self.cfgParser = common.optparser.OptionsParser(CONFPATH)
|
||||||
self.parse()
|
self.parse()
|
||||||
|
@ -140,6 +136,7 @@ class GajimCore:
|
||||||
if not self.cfgParser.tab[part].has_key(option):
|
if not self.cfgParser.tab[part].has_key(option):
|
||||||
self.cfgParser.tab[part][option] = default_tab[part][option]
|
self.cfgParser.tab[part][option] = default_tab[part][option]
|
||||||
self.cfgParser.writeCfgFile()
|
self.cfgParser.writeCfgFile()
|
||||||
|
self.parse()
|
||||||
# END init_cfg_file
|
# END init_cfg_file
|
||||||
|
|
||||||
def parse(self):
|
def parse(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue