diff --git a/jrnl/Journal.py b/jrnl/Journal.py index 12e638ec..74c82470 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -53,6 +53,11 @@ class Journal(object): """Opens the journal file defined in the config and parses it into a list of Entries. Entries have the form (date, title, body).""" filename = filename or self.config['journal'] + + if not os.path.exists(filename): + util.prompt("[Journal '{0}' created at {1}]".format(self.name, filename)) + self._create(filename) + text = self._load(filename) self.entries = self._parse(text) self.sort() @@ -101,7 +106,7 @@ class Journal(object): current_entry = Entry.Entry( self, date=new_date, - title=line[len(date_blob) + 1:], + title=line[len(date_blob):], starred=starred ) elif current_entry: diff --git a/jrnl/cli.py b/jrnl/cli.py index 0fd91371..6492e85f 100644 --- a/jrnl/cli.py +++ b/jrnl/cli.py @@ -102,13 +102,6 @@ def decrypt(journal, filename=None): util.prompt("Journal decrypted to {0}.".format(filename or new_journal.config['journal'])) -def touch_journal(filename): - """If filename does not exist, touch the file""" - if not os.path.exists(filename): - util.prompt("[Journal created at {0}]".format(filename)) - Journal.PlainJournal._create(filename) - - def list_journals(config): """List the journals specified in the configuration file""" sep = "\n"