bugfix when no config file is present

This commit is contained in:
Yann Leboulanger 2005-02-26 23:16:42 +00:00
parent d6d205b9b2
commit 73cf85b57e
2 changed files with 1 additions and 2 deletions

View File

@ -297,13 +297,13 @@ class GajimCore:
fic = open(fname, "w") fic = open(fname, "w")
fic.close() fic.close()
self.cfgParser = common.optparser.OptionsParser(CONFPATH) self.cfgParser = common.optparser.OptionsParser(CONFPATH)
self.parse()
for part in default_tab.keys(): for part in default_tab.keys():
if not self.cfgParser.tab.has_key(part): if not self.cfgParser.tab.has_key(part):
self.cfgParser.tab[part] = {} self.cfgParser.tab[part] = {}
for option in default_tab[part].keys(): for option in default_tab[part].keys():
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.parse()
# END init_cfg_file # END init_cfg_file
def parse(self): def parse(self):

View File

@ -33,7 +33,6 @@ class OptionsParser:
print 'error cannot open file %s\n' % (self.__fname); print 'error cannot open file %s\n' % (self.__fname);
return return
self.tab = {}
section = '' section = ''
for line in fd.readlines(): for line in fd.readlines():
if line[0] in "#;": if line[0] in "#;":