Been digging through the source to track down how it does it. Managed to find it. It does use a central consistent method, which does use a tempfile. However, it does not (as of yet) force a sync. I'm working on getting that added to the code now. Here's the python routine it uses:
self.__filename: the full path to the user's configuration file.
self.__tempfile: the same path and filename but with a dot prefix
@Theo,
Been digging through the source to track down how it does it. Managed to find it. It does use a central consistent method, which does use a tempfile. However, it does not (as of yet) force a sync. I'm working on getting that added to the code now. Here's the python routine it uses:
self.__filename: the full path to the user's configuration file.
self.__tempfile: the same path and filename but with a dot prefix
def write(self): split(self. __filename) join(base_ dir, '.' + filename) __tempfile, 'w') config. foreach( self.write_ line, f) exists( self.__ filename) : remove( self.__ filename) self.__ tempfile, self.__filename) self.__ filename, 0600)
(base_dir, filename) = os.path.
self.__tempfile = os.path.
try:
f = open(self.
except IOError, e:
return str(e)
try:
gajim.
except IOError, e:
return str(e)
f.close()
if os.path.
# win32 needs this
try:
os.
except Exception:
pass
try:
os.rename(
except IOError, e:
return str(e)
os.chmod(