Projects/worblehat-old
Projects
/
worblehat-old
Archived
12
0
Fork 0

Endret navnet på open_file til run_editor.

Fjernet dessuten lesing av filen, slik at funksjonen gjør kun én ting
(kjøre editor).  Lese filen kan man gjøre etterpå.
This commit is contained in:
Øystein Ingmar Skartsæterhagen 2011-03-06 11:40:57 +00:00
parent 2d697167c2
commit f04f26276c
1 changed files with 1 additions and 3 deletions

View File

@ -196,14 +196,12 @@ def combine_dicts(*dicts):
res.update(d) res.update(d)
return res return res
def open_file(filename): def run_editor(filename):
if os.path.exists(filename): if os.path.exists(filename):
os.system("%s %s || /usr/bin/env vi %s" %(os.getenv("EDITOR"), filename, filename)) os.system("%s %s || /usr/bin/env vi %s" %(os.getenv("EDITOR"), filename, filename))
else: else:
exit("Error: %s: File does not exist!" % filename) exit("Error: %s: File does not exist!" % filename)
return open(filename, 'r').readlines()
cmdline_parsed = parse_cmdline(sys.argv[1:]) cmdline_parsed = parse_cmdline(sys.argv[1:])