config file has a more beautyfull format and 600 mode

This commit is contained in:
Yann Leboulanger 2005-03-11 00:04:39 +00:00
parent 4bed9c30b1
commit edd6088448
2 changed files with 8 additions and 1 deletions

View File

@ -302,6 +302,8 @@ class GajimCore:
except:
print _("creating %s") % fname
fic = open(fname, "w")
import stat
os.chmod(fname, stat.S_IRUSR | stat.S_IWUSR)
fic.close()
self.cfgParser = common.optparser.OptionsParser(CONFPATH)
for part in default_tab.keys():

View File

@ -82,10 +82,15 @@ class OptionsParser:
except:
log.debug("Can't write config %s" % self.__fname)
return 0
index = 0
for s in self.tab.keys():
fd.write('[' + s + ']\n\n')
if index == 0:
fd.write('[' + s + ']\n')
else:
fd.write('\n[' + s + ']\n')
for o in self.tab[s].keys():
fd.write(o + ' = ' + str(self.tab[s][o]) + '\n')
index += 1
return 1
# END writeCfgFile