summaryrefslogtreecommitdiff
path: root/scripts/journal-note
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/journal-note')
-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: