def edit(self): tmp, path = tempfile.mkstemp('variables', 'config') tmp = file(path, 'w') self.write(tmp) tmp.close() os.system('$EDITOR %s' % path) tmp = file(path, 'r') newconfig = Configuration() newconfig.readfp(tmp) tmp.close() os.remove(path) return newconfig
def edit(self): tmp, path = tempfile.mkstemp('variables', 'config') tmp = file(path, 'w') self.write(tmp) tmp.close() os.system('$EDITOR %s' % path) tmp = file(path, 'r') newconfig = Configuration() newconfig.readfp(tmp) tmp.close() os.remove(path) backupfile = '%s~' % path if os.path.exists(backupfile): os.remove(backupfile) return newconfig
def edit(self): tmp, path = tempfile.mkstemp('variables', 'config') tmp = file(path, 'w') self.write(tmp) tmp.close() os.system('$EDITOR %s' % path) tmp = file(path, 'r') newconfig = Configuration() newconfig.readfp(tmp) tmp.close() #os.remove(path) #backupfile = '%s~' % path #if os.path.exists(backupfile): # os.remove(backupfile) remove_tmpfile(path) return newconfig