create config file with 0600 [and remove \n from print!!!!!
This commit is contained in:
parent
5570639beb
commit
6e29a8b524
|
@ -2,7 +2,7 @@
|
||||||
## Gajim Team:
|
## Gajim Team:
|
||||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||||
## - Vincent Hanquez <tab@snarc.org>
|
## - Vincent Hanquez <tab@snarc.org>
|
||||||
## - Nikos Kouremenos <kourem@gmail.com>
|
## - Nikos Kouremenos <kourem@gmail.com>
|
||||||
##
|
##
|
||||||
## Copyright (C) 2003-2005 Gajim Team
|
## Copyright (C) 2003-2005 Gajim Team
|
||||||
##
|
##
|
||||||
|
@ -47,8 +47,8 @@ class OptionsParser:
|
||||||
fd = open(self.__filename)
|
fd = open(self.__filename)
|
||||||
except:
|
except:
|
||||||
if os.path.exists(self.__filename):
|
if os.path.exists(self.__filename):
|
||||||
#it is file about file
|
#it is file about file FIXME: bad comment
|
||||||
print _('error: cannot open %s for reading\n') % self.__filename
|
print _('error: cannot open %s for reading') % self.__filename
|
||||||
return
|
return
|
||||||
|
|
||||||
for line in fd.readlines():
|
for line in fd.readlines():
|
||||||
|
@ -74,10 +74,11 @@ class OptionsParser:
|
||||||
try:
|
try:
|
||||||
fd = open(self.__tempfile, 'w')
|
fd = open(self.__tempfile, 'w')
|
||||||
except:
|
except:
|
||||||
#we cannot write file in a directory
|
#chances are we cannot write file in a directory
|
||||||
err_str = _('Unable to write file in %s\n') % base_dir
|
err_str = _('Unable to write file in %s') % base_dir
|
||||||
print err_str
|
print err_str
|
||||||
return err_str
|
return err_str
|
||||||
|
os.chmod(self.__filename, 0600)
|
||||||
try:
|
try:
|
||||||
gajim.config.foreach(self.write_line, fd)
|
gajim.config.foreach(self.write_line, fd)
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
|
|
Loading…
Reference in New Issue