From 4e9b9c412cc27580f804c386e18b60cef42f4f51 Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Thu, 24 May 2012 16:51:09 +0200 Subject: [PATCH] Opens journal file before allowing user to compose entry, closes #21 --- CHANGELOG.md | 1 + jrnl/jrnl.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3eaaf8c..6828d499 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ Changelog ========= +* [Fixed] Bug where composed entry is lost when the journal file fails to load * Changed directory structure and install scripts (removing the necessity to make an alias from `jrnl` to `jrnl.py`) ### 0.2.4 diff --git a/jrnl/jrnl.py b/jrnl/jrnl.py index 52b0136b..8ebf7079 100755 --- a/jrnl/jrnl.py +++ b/jrnl/jrnl.py @@ -140,6 +140,9 @@ def cli(): print("According to your jrnl_conf, your journal is encrypted, however PyCrypto was not found. To open your journal, install the PyCrypto package from http://www.pycrypto.org.") sys.exit(-1) + # open journal file + journal = Journal.Journal(config=config) + args = parse_args() mode_compose, mode_export = guess_mode(args, config) @@ -153,9 +156,6 @@ def cli(): else: mode_compose = False - # open journal - journal = Journal.Journal(config=config) - # Writing mode if mode_compose: raw = " ".join(args.text).strip()