summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-12-07 10:35:22 +0000
committerLars Wirzenius <liw@liw.fi>2010-12-07 10:35:22 +0000
commite682409d2443a8651673ed560fee81e9874f70de (patch)
tree1293c58956e6eab2deca4615fabd65734138535c
parent3d5e54427345f00a9ae3f8e30b697dd0e8929df3 (diff)
downloadliw-automation-e682409d2443a8651673ed560fee81e9874f70de.tar.gz
'new' should run gedit.
-rwxr-xr-xscripts/journal-note6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/journal-note b/scripts/journal-note
index ae1955d..5a41e70 100755
--- a/scripts/journal-note
+++ b/scripts/journal-note
@@ -67,6 +67,9 @@ class App(object):
def drafts(self, opts):
return os.path.join(opts.base, 'drafts')
+ def gedit_file(self, pathname):
+ subprocess.check_call(['gedit', '--new-window', pathname])
+
def new_entry(self, args, opts):
if not args:
raise AppException('Usage: journal-note new TITLE')
@@ -85,6 +88,7 @@ class App(object):
f = open(name, 'w')
f.write(template % values)
f.close()
+ self.gedit_file(name)
def list_entries(self, args, opts):
drafts = self.drafts(opts)
@@ -108,7 +112,7 @@ class App(object):
pathname = os.path.join(self.drafts(opts), args[0] + '.mdwn')
if not os.path.exists(pathname):
raise AppException('draft %s does not exist' % args[0])
- subprocess.check_call(['gedit', '--new-window', pathname])
+ self.gedit_file(pathname)
def finish_entry(self, args, opts):
if not args: