Example #1
0
 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
Example #2
0
 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
Example #3
0
 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