From 3978b41456463d6e1e6bde54b95414bed40e257b Mon Sep 17 00:00:00 2001 From: jabirali Date: Sat, 5 Mar 2011 17:39:14 +0000 Subject: [PATCH] =?UTF-8?q?La=20til=20en=20"open=5Ffile"-funksjon=20i=20wo?= =?UTF-8?q?rblehat.py,=20som=20brukes=20for=20=C3=A5=20=C3=A5pne=20filer?= =?UTF-8?q?=20i=20$EDITOR.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/worblehat.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/worblehat.py b/python/worblehat.py index 12cc566..a87a583 100755 --- a/python/worblehat.py +++ b/python/worblehat.py @@ -213,6 +213,13 @@ def combine_dicts(*dicts): res.update(d) return res +def open_file(filename): + if os.path.exists(filename): + os.system("%s %s || /usr/bin/env vi %s" %(os.getenv("EDITOR"), filename, filename)) + else: + exit("Error: %s: File does not exist!" % filename) + + cmdline_parsed = parse_cmdline(sys.argv[1:]) print 'command line parsed to:', cmdline_parsed