From 599c5a9ea18191f6b5fa874ec65295aaa711f65d Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Thu, 27 Mar 2014 16:12:03 -0700 Subject: [PATCH] More unicode fixes for #119 --- CHANGELOG.md | 1 + jrnl/__init__.py | 2 +- jrnl/cli.py | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f9260a0..30b504d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Changelog ### 1.7 (December 22, 2013) +* __1.7.15__ More unicode fixes * __1.7.14__ Fix for trailing whitespaces (eg. when writing markdown code block) * __1.7.13__ Fix for UTF-8 in DayOne journals * __1.7.12__ Fixes a bug where filtering by tags didn't work for DayOne journals diff --git a/jrnl/__init__.py b/jrnl/__init__.py index 82ff0f1d..52feb877 100644 --- a/jrnl/__init__.py +++ b/jrnl/__init__.py @@ -8,7 +8,7 @@ jrnl is a simple journal application for your command line. from __future__ import absolute_import __title__ = 'jrnl' -__version__ = '1.7.14' +__version__ = '1.7.15' __author__ = 'Manuel Ebert' __license__ = 'MIT License' __copyright__ = 'Copyright 2013 - 2014 Manuel Ebert' diff --git a/jrnl/cli.py b/jrnl/cli.py index abbefea1..10eb8a85 100644 --- a/jrnl/cli.py +++ b/jrnl/cli.py @@ -59,7 +59,7 @@ def guess_mode(args, config): elif any((args.start_date, args.end_date, args.limit, args.strict, args.starred)): # Any sign of displaying stuff? compose = False - elif args.text and all(word[0] in config['tagsymbols'] for word in " ".join(args.text).split()): + elif args.text and all(word[0] in config['tagsymbols'] for word in u" ".join(args.text).split()): # No date and only tags? compose = False @@ -160,7 +160,7 @@ def run(manual_args=None): "entries" in os.listdir(config['journal']): journal = Journal.DayOne(**config) else: - util.prompt("[Error: {0} is a directory, but doesn't seem to be a DayOne journal either.".format(config['journal'])) + util.prompt(u"[Error: {0} is a directory, but doesn't seem to be a DayOne journal either.".format(config['journal'])) sys.exit(1) else: journal = Journal.Journal(journal_name, **config) @@ -241,8 +241,8 @@ def run(manual_args=None): num_deleted = old_num_entries - len(journal) num_edited = len([e for e in journal.entries if e.modified]) prompts = [] - if num_deleted: prompts.append("{0} entries deleted".format(num_deleted)) - if num_edited: prompts.append("{0} entries modified".format(num_edited)) + if num_deleted: prompts.append("{0} {1} deleted".format(num_deleted, "entry" if num_deleted == 1 else "entries")) + if num_edited: prompts.append("{0} {1} modified".format(num_edited, "entry" if num_deleted == 1 else "entries")) if prompts: util.prompt("[{0}]".format(", ".join(prompts).capitalize())) journal.entries += other_entries