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:
parent
2d697167c2
commit
f04f26276c
|
@ -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:])
|
||||||
|
|
Reference in New Issue