From 0a1966e3b3197b44164ccb41f07f8ac9933741d4 Mon Sep 17 00:00:00 2001 From: Justin Proffitt Date: Sun, 28 Jul 2019 21:57:53 -0400 Subject: [PATCH 01/24] Add '-not' flag for excluding tags from filter --- jrnl/Journal.py | 9 +++++++-- jrnl/cli.py | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/jrnl/Journal.py b/jrnl/Journal.py index 94e89144..cfb85d1e 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -176,7 +176,7 @@ class Journal(object): tag_counts = set([(tags.count(tag), tag) for tag in tags]) return [Tag(tag, count=count) for count, tag in sorted(tag_counts)] - def filter(self, tags=[], start_date=None, end_date=None, starred=False, strict=False, short=False): + def filter(self, tags=[], start_date=None, end_date=None, starred=False, strict=False, short=False, exclude=[]): """Removes all entries from the journal that don't match the filter. tags is a list of tags, each being a string that starts with one of the @@ -187,19 +187,24 @@ class Journal(object): starred limits journal to starred entries If strict is True, all tags must be present in an entry. If false, the - entry is kept if any tag is present.""" + + exclude is a list of the tags which should not appear in the results. + entry is kept if any tag is present, unless they appear in exclude.""" self.search_tags = set([tag.lower() for tag in tags]) + excluded_tags = set([tag.lower() for tag in exclude]) end_date = time.parse(end_date, inclusive=True) start_date = time.parse(start_date) # If strict mode is on, all tags have to be present in entry tagged = self.search_tags.issubset if strict else self.search_tags.intersection + excluded = lambda tags: len([tag for tag in tags if tag in excluded_tags]) > 0 result = [ entry for entry in self.entries if (not tags or tagged(entry.tags)) and (not starred or entry.starred) and (not start_date or entry.date >= start_date) and (not end_date or entry.date <= end_date) + and (not exclude or not excluded(entry.tags)) ] self.entries = result diff --git a/jrnl/cli.py b/jrnl/cli.py index 72eff470..7ddd1052 100644 --- a/jrnl/cli.py +++ b/jrnl/cli.py @@ -39,6 +39,7 @@ def parse_args(args=None): reading.add_argument('-and', dest='strict', action="store_true", help='Filter by tags using AND (default: OR)') reading.add_argument('-starred', dest='starred', action="store_true", help='Show only starred entries') reading.add_argument('-n', dest='limit', default=None, metavar="N", help="Shows the last n entries matching the filter. '-n 3' and '-3' have the same effect.", nargs="?", type=int) + reading.add_argument('-not', dest='excluded', nargs='+', default=[], metavar="E", help="Exclude entries with these tags") exporting = parser.add_argument_group('Export / Import', 'Options for transmogrifying your journal') exporting.add_argument('-s', '--short', dest='short', action="store_true", help='Show only titles or line containing the search tags') @@ -234,7 +235,8 @@ def run(manual_args=None): start_date=args.start_date, end_date=args.end_date, strict=args.strict, short=args.short, - starred=args.starred) + starred=args.starred, + exclude=args.excluded) journal.limit(args.limit) # Reading mode From 451360995430d3a68616e263583d614a3103961a Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Mon, 13 Nov 2017 18:04:24 -0700 Subject: [PATCH 02/24] Switch to hashmark Markdown headers on export Closes #487 --- jrnl/plugins/markdown_exporter.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/jrnl/plugins/markdown_exporter.py b/jrnl/plugins/markdown_exporter.py index 147e8ac5..0a237af4 100644 --- a/jrnl/plugins/markdown_exporter.py +++ b/jrnl/plugins/markdown_exporter.py @@ -68,12 +68,10 @@ class MarkdownExporter(TextExporter): for e in journal.entries: if not e.date.year == year: year = e.date.year - out.append(str(year)) - out.append("=" * len(str(year)) + "\n") + out.append("# " + str(year)) if not e.date.month == month: month = e.date.month - out.append(e.date.strftime("%B")) - out.append('-' * len(e.date.strftime("%B")) + "\n") + out.append("## " + e.date.strftime("%B")) out.append(cls.export_entry(e, False)) result = "\n".join(out) return result From 1884a6ce23f14aaf45950e74aa6f8ff75a21074d Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Thu, 1 Aug 2019 21:00:53 -0600 Subject: [PATCH 03/24] [Markdown Export] deal with linebreaks in jrnl files --- features/exporting.feature | 6 ++---- jrnl/plugins/markdown_exporter.py | 11 +++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/features/exporting.feature b/features/exporting.feature index 1b4285ed..db2ef5b3 100644 --- a/features/exporting.feature +++ b/features/exporting.feature @@ -42,11 +42,9 @@ Feature: Exporting a Journal When we run "jrnl --export markdown" Then the output should be """ - 2015 - ==== + # 2015 - April - ----- + ## April ### 2015-04-14 13:23 Heading Test diff --git a/jrnl/plugins/markdown_exporter.py b/jrnl/plugins/markdown_exporter.py index 0a237af4..19b5404d 100644 --- a/jrnl/plugins/markdown_exporter.py +++ b/jrnl/plugins/markdown_exporter.py @@ -3,6 +3,7 @@ from __future__ import absolute_import, unicode_literals, print_function from .text_exporter import TextExporter +import os import re import sys from ..util import WARNING_COLOR, RESET_COLOR @@ -30,17 +31,17 @@ class MarkdownExporter(TextExporter): previous_line = '' warn_on_heading_level = False for line in body.splitlines(True): - if re.match(r"#+ ", line): + if re.match(r"^#+ ", line): """ATX style headings""" newbody = newbody + previous_line + heading + line - if re.match(r"#######+ ", heading + line): + if re.match(r"^#######+ ", heading + line): warn_on_heading_level = True line = '' - elif re.match(r"=+$", line) and not re.match(r"^$", previous_line): + elif re.match(r"^=+$", line.rstrip()) and not re.match(r"^$", previous_line.strip()): """Setext style H1""" newbody = newbody + heading + "# " + previous_line line = '' - elif re.match(r"-+$", line) and not re.match(r"^$", previous_line): + elif re.match(r"^-+$", line.rstrip()) and not re.match(r"^$", previous_line.strip()): """Setext style H2""" newbody = newbody + heading + "## " + previous_line line = '' @@ -69,9 +70,11 @@ class MarkdownExporter(TextExporter): if not e.date.year == year: year = e.date.year out.append("# " + str(year)) + out.append("") if not e.date.month == month: month = e.date.month out.append("## " + e.date.strftime("%B")) + out.append("") out.append(cls.export_entry(e, False)) result = "\n".join(out) return result From e95290f92f22b93d31875b185446bbc538436a8a Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Thu, 1 Aug 2019 21:21:55 -0600 Subject: [PATCH 04/24] [YAML Exporter] apply fix just applied to Markdown Exporter --- jrnl/plugins/yaml_exporter.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jrnl/plugins/yaml_exporter.py b/jrnl/plugins/yaml_exporter.py index 1442adcc..c0735811 100644 --- a/jrnl/plugins/yaml_exporter.py +++ b/jrnl/plugins/yaml_exporter.py @@ -3,6 +3,7 @@ from __future__ import absolute_import, unicode_literals, print_function from .text_exporter import TextExporter +import os import re import sys from ..util import WARNING_COLOR, ERROR_COLOR, RESET_COLOR @@ -34,17 +35,17 @@ class YAMLExporter(TextExporter): previous_line = '' warn_on_heading_level = False for line in entry.body.splitlines(True): - if re.match(r"#+ ", line): + if re.match(r"^#+ ", line): """ATX style headings""" newbody = newbody + previous_line + heading + line - if re.match(r"#######+ ", heading + line): + if re.match(r"^#######+ ", heading + line): warn_on_heading_level = True line = '' - elif re.match(r"=+$", line) and not re.match(r"^$", previous_line): + elif re.match(r"^=+$", line.rstrip()) and not re.match(r"^$", previous_line.strip()): """Setext style H1""" newbody = newbody + heading + "# " + previous_line line = '' - elif re.match(r"-+$", line) and not re.match(r"^$", previous_line): + elif re.match(r"^-+$", line.rstrip()) and not re.match(r"^$", previous_line.strip()): """Setext style H2""" newbody = newbody + heading + "## " + previous_line line = '' From 18ba16ad66aed4eb048840881000de5b599f0c17 Mon Sep 17 00:00:00 2001 From: Greg Bodnar Date: Sat, 3 Aug 2019 16:48:10 +1200 Subject: [PATCH 05/24] Add failing test for configuring an encrypted journal --- features/data/configs/multiple.yaml | 3 +++ features/multiple_journals.feature | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/features/data/configs/multiple.yaml b/features/data/configs/multiple.yaml index 1bbb872f..2e282232 100644 --- a/features/data/configs/multiple.yaml +++ b/features/data/configs/multiple.yaml @@ -9,6 +9,9 @@ journals: ideas: features/journals/nothing.journal simple: features/journals/simple.journal work: features/journals/work.journal + new_encrypted: + encrypt: true + journal: features/journals/new_encrypted.journal linewrap: 80 password: '' tagsymbols: '@' diff --git a/features/multiple_journals.feature b/features/multiple_journals.feature index fb26eef8..af032b03 100644 --- a/features/multiple_journals.feature +++ b/features/multiple_journals.feature @@ -39,3 +39,8 @@ Feature: Multiple journals Given we use the config "bug343.yaml" When we run "jrnl a long day in the office" Then we should see the message "No default journal configured" + + Scenario: Don't crash if no file exists for a configured encrypted journal + Given we use the config "multiple.yaml" + When we run "jrnl new_encrypted Adding first entry" + Then journal "new_encrypted" should have 1 entry From 5548d680a66abf2ea59339e2461e7ba153de8d11 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 3 Aug 2019 12:08:31 -0700 Subject: [PATCH 06/24] reduce the number of days an issue can be open with no activity before marked stale We will increase this again later, but we want to clean out the backlog of old issues sooner, if possible. This will allow us to do that. --- .github/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/stale.yml b/.github/stale.yml index e556fa98..470349fb 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -1,5 +1,5 @@ # Number of days of inactivity before an issue becomes stale -daysUntilStale: 60 +daysUntilStale: 30 # Number of days of inactivity before a stale issue is closed daysUntilClose: 7 # Issues with these labels will never be considered stale From da62e542458dd12e8de0e0d45d73e23b5c14d6be Mon Sep 17 00:00:00 2001 From: Greg Bodnar Date: Sun, 4 Aug 2019 08:40:15 +1200 Subject: [PATCH 07/24] Overload open for EncryptedJournal This avoids the execution path that calls EncryptedJournal._create() without a password parameter. It results in duplication of code that requests and stores a password, which should be factored out in a subsequent change. --- jrnl/EncryptedJournal.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/jrnl/EncryptedJournal.py b/jrnl/EncryptedJournal.py index a29db554..9a1822e0 100644 --- a/jrnl/EncryptedJournal.py +++ b/jrnl/EncryptedJournal.py @@ -5,7 +5,13 @@ from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes import hashlib from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC from cryptography.hazmat.backends import default_backend +import sys +import os import base64 +import getpass +import logging + +log = logging.getLogger() def make_key(password): @@ -27,6 +33,33 @@ class EncryptedJournal(Journal.Journal): super(EncryptedJournal, self).__init__(name, **kwargs) self.config['encrypt'] = True + def open(self, filename=None): + """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): + password = getpass.getpass("Enter password for new journal: ") + if password: + if util.yesno("Do you want to store the password in your keychain?", default=True): + util.set_keychain(self.name, password) + else: + util.set_keychain(self.name, None) + self.config['password'] = password + text = "" + self._store(filename, text) + util.prompt("[Journal '{0}' created at {1}]".format(self.name, filename)) + else: + util.prompt("No password supplied for encrypted journal") + sys.exit(1) + else: + text = self._load(filename) + self.entries = self._parse(text) + self.sort() + log.debug("opened %s with %d entries", self.__class__.__name__, len(self)) + return self + + def _load(self, filename, password=None): """Loads an encrypted journal from a file and tries to decrypt it. If password is not provided, will look for password in the keychain From 02f853b5455f51d3196c718846c2e2bd0af9561e Mon Sep 17 00:00:00 2001 From: Greg Bodnar Date: Sun, 4 Aug 2019 08:44:17 +1200 Subject: [PATCH 08/24] Modify test to test for returned strings The entered string for the password is not being used by the test and I don't understand why. --- features/multiple_journals.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/multiple_journals.feature b/features/multiple_journals.feature index af032b03..1d4943ee 100644 --- a/features/multiple_journals.feature +++ b/features/multiple_journals.feature @@ -42,5 +42,5 @@ Feature: Multiple journals Scenario: Don't crash if no file exists for a configured encrypted journal Given we use the config "multiple.yaml" - When we run "jrnl new_encrypted Adding first entry" - Then journal "new_encrypted" should have 1 entry + When we run "jrnl new_encrypted Adding first entry" and enter "these three eyes" + Then we should see the message "Journal 'new_encrypted' created" From 290bb96daab4d71713286aeb68a49e6ad17e32e3 Mon Sep 17 00:00:00 2001 From: Greg Bodnar Date: Sun, 4 Aug 2019 13:21:40 +1200 Subject: [PATCH 09/24] Use util wrapper for getpass This allows for tests to run without prompting for user input. --- jrnl/EncryptedJournal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jrnl/EncryptedJournal.py b/jrnl/EncryptedJournal.py index 9a1822e0..a83651e4 100644 --- a/jrnl/EncryptedJournal.py +++ b/jrnl/EncryptedJournal.py @@ -39,7 +39,7 @@ class EncryptedJournal(Journal.Journal): filename = filename or self.config['journal'] if not os.path.exists(filename): - password = getpass.getpass("Enter password for new journal: ") + password = util.getpass("Enter password for new journal: ") if password: if util.yesno("Do you want to store the password in your keychain?", default=True): util.set_keychain(self.name, password) From 960573c103ea75173dec7cd59f6e2c3137f098e5 Mon Sep 17 00:00:00 2001 From: Dawid Zych Date: Wed, 7 Aug 2019 19:12:04 +0200 Subject: [PATCH 10/24] Handle KeyboardInterrupt when installing journal --- jrnl/cli.py | 9 +++++++-- jrnl/install.py | 7 ++++++- jrnl/upgrade.py | 12 +++++++----- jrnl/util.py | 4 ++++ 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/jrnl/cli.py b/jrnl/cli.py index 72eff470..6d88685a 100644 --- a/jrnl/cli.py +++ b/jrnl/cli.py @@ -13,7 +13,7 @@ from . import Journal from . import util from . import install from . import plugins -from .util import ERROR_COLOR, RESET_COLOR +from .util import ERROR_COLOR, RESET_COLOR, UserAbort import jrnl import argparse import sys @@ -143,7 +143,12 @@ def run(manual_args=None): print(util.py2encode(version_str)) sys.exit(0) - config = install.load_or_install_jrnl() + try: + config = install.load_or_install_jrnl() + except UserAbort as err: + util.prompt("\n{}".format(err)) + sys.exit(1) + if args.ls: util.prnt(list_journals(config)) sys.exit(0) diff --git a/jrnl/install.py b/jrnl/install.py index 7cc8f880..e24d36af 100644 --- a/jrnl/install.py +++ b/jrnl/install.py @@ -12,6 +12,7 @@ from . import upgrade from . import __version__ from .Journal import PlainJournal from .EncryptedJournal import EncryptedJournal +from .util import UserAbort import yaml import logging @@ -90,7 +91,11 @@ def load_or_install_jrnl(): return config else: log.debug('Configuration file not found, installing jrnl...') - return install() + try: + config = install() + except KeyboardInterrupt: + raise UserAbort("Installation aborted") + return config def install(): diff --git a/jrnl/upgrade.py b/jrnl/upgrade.py index 3784c9f6..12d5054b 100644 --- a/jrnl/upgrade.py +++ b/jrnl/upgrade.py @@ -4,7 +4,7 @@ from . import __version__ from . import Journal from . import util from .EncryptedJournal import EncryptedJournal -import sys +from .util import UserAbort import os import codecs @@ -76,10 +76,12 @@ older versions of jrnl anymore. for journal, path in other_journals.items(): util.prompt(" {:{pad}} -> {}".format(journal, path, pad=longest_journal_name)) - cont = util.yesno("\nContinue upgrading jrnl?", default=False) - if not cont: - util.prompt("jrnl NOT upgraded, exiting.") - sys.exit(1) + try: + cont = util.yesno("\nContinue upgrading jrnl?", default=False) + if not cont: + raise KeyboardInterrupt + except KeyboardInterrupt: + raise UserAbort("jrnl NOT upgraded, exiting.") for journal_name, path in encrypted_journals.items(): util.prompt("\nUpgrading encrypted '{}' journal stored in {}...".format(journal_name, path)) diff --git a/jrnl/util.py b/jrnl/util.py index 7f6688d8..bc36ba9b 100644 --- a/jrnl/util.py +++ b/jrnl/util.py @@ -47,6 +47,10 @@ SENTENCE_SPLITTER = re.compile(r""" )""", re.UNICODE | re.VERBOSE) +class UserAbort(Exception): + pass + + def getpass(prompt="Password: "): if not TEST: return gp.getpass(bytes(prompt)) From 31a4607a7de70c8c1df4903475cdb472105dcc07 Mon Sep 17 00:00:00 2001 From: Justin Proffitt Date: Wed, 7 Aug 2019 20:58:35 -0400 Subject: [PATCH 11/24] Add tests for the excluding tags with -not --- features/tagging.feature | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/features/tagging.feature b/features/tagging.feature index cc686673..2cbf7ce1 100644 --- a/features/tagging.feature +++ b/features/tagging.feature @@ -50,3 +50,35 @@ Feature: Tagging @foo : 1 @bar : 1 """ + + Scenario: Excluding a tag should filter it + Given we use the config "basic.yaml" + When we run "jrnl today: @foo came over, we went to a bar" + When we run "jrnl I have decided I did not enjoy that @bar" + When we run "jrnl --tags -not @bar" + Then the output should be + """ + @foo : 1 + """ + + Scenario: Excluding a tag should filter an entry, even if an unfiltered tag is in that entry + Given we use the config "basic.yaml" + When we run "jrnl today: I do @not think this will show up @thought" + When we run "jrnl today: I think this will show up @thought" + When we run "jrnl --tags -not @not" + Then the output should be + """ + @thought : 1 + """ + + Scenario: Excluding multiple tags should filter them + Given we use the config "basic.yaml" + When we run "jrnl today: I do @not think this will show up @thought" + When we run "jrnl today: I think this will show up @thought" + When we run "jrnl today: This should @never show up @thought" + When we run "jrnl today: What a nice day for filtering @thought" + When we run "jrnl --tags -not @not @never" + Then the output should be + """ + @thought : 2 + """ From e189ac12febf634d83136a29bcb904cb4f163284 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 10 Aug 2019 12:17:36 -0700 Subject: [PATCH 12/24] fix a few linting errors --- jrnl/Journal.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/jrnl/Journal.py b/jrnl/Journal.py index 94e89144..230171e5 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -118,7 +118,6 @@ class Journal(object): last_entry_pos = match.end() entries.append(Entry.Entry(self, date=new_date)) - # If no entries were found, treat all the existing text as an entry made now if not entries: entries.append(Entry.Entry(self, date=time.parse("now"))) @@ -218,7 +217,11 @@ class Journal(object): if not date: colon_pos = first_line.find(": ") if colon_pos > 0: - date = time.parse(raw[:colon_pos], default_hour=self.config['default_hour'], default_minute=self.config['default_minute']) + date = time.parse( + raw[:colon_pos], + default_hour=self.config['default_hour'], + default_minute=self.config['default_minute'] + ) if date: # Parsed successfully, strip that from the raw text starred = raw[:colon_pos].strip().endswith("*") raw = raw[colon_pos + 1:].strip() @@ -325,7 +328,10 @@ def open_journal(name, config, legacy=False): from . import DayOneJournal return DayOneJournal.DayOne(**config).open() else: - util.prompt(u"[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) if not config['encrypt']: From 1350bcad1ba9b8c99cbfb2357cd4564147954529 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 10 Aug 2019 13:35:03 -0700 Subject: [PATCH 13/24] #631 Escape data in square brackets --- features/data/journals/simple_jrnl-1-9-5.journal | 10 ++++++++++ features/regression.feature | 9 +++++---- jrnl/Journal.py | 5 ++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/features/data/journals/simple_jrnl-1-9-5.journal b/features/data/journals/simple_jrnl-1-9-5.journal index f660305b..7bb6c5ac 100644 --- a/features/data/journals/simple_jrnl-1-9-5.journal +++ b/features/data/journals/simple_jrnl-1-9-5.journal @@ -1,3 +1,13 @@ 2010-06-10 15:00 A life without chocolate is like a bad analogy. 2013-06-10 15:40 He said "[this] is the best time to be alive". +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada +quis est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus pellentesque +augue et venenatis facilisis. + +[2019-08-03 12:55] Some chat log or something + +Suspendisse potenti. Sed dignissim sed nisl eu consequat. Aenean ante ex, +elementum ut interdum et, mattis eget lacus. In commodo nulla nec tellus +placerat, sed ultricies metus bibendum. Duis eget venenatis erat. In at dolor +dui. diff --git a/features/regression.feature b/features/regression.feature index cfd76df1..21078a1c 100644 --- a/features/regression.feature +++ b/features/regression.feature @@ -43,15 +43,16 @@ Feature: Zapped bugs should stay dead. | Hope to get a lot of traffic. """ - Scenario: Upgrade and parse journals with square brackets - Given we use the config "upgrade_from_195.json" - When we run "jrnl -2" and enter "Y" - Then the output should contain + Scenario: Upgrade and parse journals with square brackets + Given we use the config "upgrade_from_195.json" + When we run "jrnl -9" and enter "Y" + Then the output should contain """ 2010-06-10 15:00 A life without chocolate is like a bad analogy. 2013-06-10 15:40 He said "[this] is the best time to be alive". """ + Then the journal should have 2 entries Scenario: Integers in square brackets should not be read as dates Given we use the config "brackets.yaml" diff --git a/jrnl/Journal.py b/jrnl/Journal.py index 230171e5..cf336bdc 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -283,6 +283,7 @@ class LegacyJournal(Journal): # Initialise our current entry entries = [] current_entry = None + new_date_format_regex = re.compile(r'(^\[[^\]]+\].*?$)') for line in journal_txt.splitlines(): line = line.rstrip() try: @@ -302,7 +303,9 @@ class LegacyJournal(Journal): current_entry = Entry.Entry(self, date=new_date, text=line[date_length + 1:], starred=starred) except ValueError: # Happens when we can't parse the start of the line as an date. - # In this case, just append line to our body. + # In this case, just append line to our body (after some + # escaping for the new format). + line = new_date_format_regex.sub(r' \1', line) if current_entry: current_entry.text += line + u"\n" From d9d83447d0615e3f44d62b390810ad30c03c78ed Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 10 Aug 2019 16:21:38 -0700 Subject: [PATCH 14/24] move stablebot back up to 60 days now that backlog is a bit more cleared out --- .github/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/stale.yml b/.github/stale.yml index 470349fb..e556fa98 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -1,5 +1,5 @@ # Number of days of inactivity before an issue becomes stale -daysUntilStale: 30 +daysUntilStale: 60 # Number of days of inactivity before a stale issue is closed daysUntilClose: 7 # Issues with these labels will never be considered stale From 8fe8f9d5c97494099658aa6fd5754f64e8fb4388 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 10 Aug 2019 16:45:54 -0700 Subject: [PATCH 15/24] =?UTF-8?q?change=20pinned=20label=20to=20a=20super?= =?UTF-8?q?=20cool=20emoji=20=E2=AD=90=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/stale.yml b/.github/stale.yml index e556fa98..323b3928 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -4,7 +4,7 @@ daysUntilStale: 60 daysUntilClose: 7 # Issues with these labels will never be considered stale exemptLabels: - - pinned + - ':star:' - security # Label to use when marking an issue as stale staleLabel: stale From 2c994418037a86896a98de916ec18202fca97083 Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Fri, 23 Aug 2019 18:38:05 -0700 Subject: [PATCH 16/24] Smaller doc fixes, fixes #486 --- README.md | 2 +- docs/advanced.md | 16 +++++++--------- docs/recipes.md | 49 +++++++++++++++++++++++++++--------------------- docs/usage.md | 17 +++++++++-------- 4 files changed, 45 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index e43857d4..0f444ab2 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Optionally, your journal can be encrypted using the [256-bit AES](http://en.wiki ### Why keep a journal? -Journals aren't just for angsty teenagers and people who have too much time on their summer vacation. A journal helps you to keep track of the things you get done and how you did them. Your imagination may be limitless, but your memory isn't. For personal use, make it a good habit to write at least 20 words a day. Just to reflect what made this day special, why you haven't wasted it. For professional use, consider a text-based journal to be the perfect complement to your GTD todo list - a documentation of what and how you've done it. +Journals aren't just for people who have too much time on their summer vacation. A journal helps you to keep track of the things you get done and how you did them. Your imagination may be limitless, but your memory isn't. For personal use, make it a good habit to write at least 20 words a day. Just to reflect what made this day special, why you haven't wasted it. For professional use, consider a text-based journal to be the perfect complement to your GTD todo list - a documentation of what and how you've done it. In a Nutshell ------------- diff --git a/docs/advanced.md b/docs/advanced.md index 6a78da95..2a6fd6b4 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -135,13 +135,11 @@ that journal. this option will most likely result in your journal file being impossible to load. -### Known Issues +## Known Issues - - The Windows shell prior to Windows 7 has issues with unicode - encoding. If you want to use non-ascii characters, change the - codepage with `chcp 1252` before using - `jrnl` (Thanks to Yves Pouplard for - solving this!) - - `jrnl`relies on the PyCrypto - package to encrypt journals, which has some known problems with - installing on Windows and within virtual environments. +### Unicode on Windows + +The Windows shell prior to Windows 7 has issues with unicode encoding. +To use non-ascii characters, first tweak Python to recognize the encoding by adding `'cp65001': 'utf_8'`, to `Lib/encoding/aliases.py`. Then, change the codepage with `chcp 1252` before using `jrnl`. + +(Related issue: [#486](https://github.com/jrnl-org/jrnl/issues/486)) diff --git a/docs/recipes.md b/docs/recipes.md index 1c272e05..7af5b246 100644 --- a/docs/recipes.md +++ b/docs/recipes.md @@ -15,9 +15,8 @@ And will get something like `@melo: 9`, meaning there are 9 entries where both `@alberto` and `@melo` are tagged. How does this work? First, `jrnl @alberto` will filter the journal to only entries containing the tag `@alberto`, and then the `--tags` option will print out how often -each tag occurred in this filtered -journal. Finally, we pipe this to `grep` which will only display the -line containing `@melo`. +each tag occurred in this filtered journal. Finally, we pipe this to +`grep` which will only display the line containing `@melo`. ### Combining filters @@ -66,17 +65,19 @@ If you do that often, consider creating a function in your `.bashrc` or ``` sh jrnlimport () { - echo `stat -f %Sm -t '%d %b %Y at %H:%M: ' $1` `cat $1` | jrnl + echo `stat -f %Sm -t '%d %b %Y at %H:%M: ' $1` `cat $1` | jrnl } ``` ### Using templates Say you always want to use the same template for creating new entries. -If you have an `external editor ` set up, you can use this : +If you have an [external editor](../advanced) set up, you can use this: - jrnl < my_template.txt - $ jrnl -1 --edit +```sh +jrnl < my_template.txt +jrnl -1 --edit +``` Another nice solution that allows you to define individual prompts comes from [Jacobo de @@ -105,8 +106,10 @@ close the file to save the changes to jrnl. To use Sublime Text, install the command line tools for Sublime Text and configure your `.jrnl_config` like this: -``` javascript -"editor": "subl -w" +``` json +{ + "editor": "subl -w" +} ``` Note the `-w` flag to make sure jrnl waits for Sublime Text to close the @@ -118,8 +121,10 @@ Similar to Sublime Text, MacVim must be started with a flag that tells the the process to wait until the file is closed before passing control back to journal. In the case of MacVim, this is `-f`: -``` javascript -"editor": "mvim -f" +``` json +{ + "editor": "mvim -f" +} ``` ### iA Writer @@ -128,8 +133,10 @@ On OS X, you can use the fabulous [iA Writer](http://www.iawriter.com/mac) to write entries. Configure your `.jrnl_config` like this: -``` javascript -"editor": "open -b pro.writer.mac -Wn" +``` json +{ + "editor": "open -b pro.writer.mac -Wn" +} ``` What does this do? `open -b ...` opens a file using the application @@ -142,9 +149,7 @@ you can find the right string to use by inspecting iA Writer's `Info.plist` file in your shell: ``` sh -$ grep -A 1 CFBundleIdentifier /Applications/iA\ Writer.app/Contents/Info.plist - CFBundleIdentifier - pro.writer.mac +grep -A 1 CFBundleIdentifier /Applications/iA\ Writer.app/Contents/Info.plist ``` ### Notepad++ on Windows @@ -152,8 +157,10 @@ $ grep -A 1 CFBundleIdentifier /Applications/iA\ Writer.app/Contents/Info.plist To set [Notepad++](http://notepad-plus-plus.org/) as your editor, edit the jrnl config file (`.jrnl_config`) like this: -``` javascript -"editor": "C:\\Program Files (x86)\\Notepad++\\notepad++.exe -multiInst -nosession", +``` json +{ + "editor": "C:\\Program Files (x86)\\Notepad++\\notepad++.exe -multiInst -nosession", +} ``` The double backslashes are needed so jrnl can read the file path @@ -164,9 +171,9 @@ its own Notepad++ window. To set [Visual Studo Code](https://code.visualstudio.com) as your editor on Linux, edit `.jrnl_config` like this: -```javascript +```json { - "editor": "/usr/bin/code --wait", + "editor": "/usr/bin/code --wait", } ``` @@ -183,7 +190,7 @@ Then you can add: ```javascript { - "editor": "code --wait", + "editor": "code --wait", } ``` diff --git a/docs/usage.md b/docs/usage.md index 0ad8e056..fa5050a0 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -37,7 +37,8 @@ jrnl today at 3am: I just met Steve Buscemi in a bar! He looked funny. !!! note Most shell contains a certain number of reserved characters, such as `#` and `*`. Unbalanced quotes, parenthesis, and so on will also get into - the way of your editing. For writing longer entries, just enter `jrnl` + the way of your editing. + For writing longer entries, just enter `jrnl` and hit `return`. Only then enter the text of your journal entry. Alternatively, `use an external editor `). @@ -75,9 +76,9 @@ The following options are equivalent: - `jrnl Best day of my life.*` !!! note - Just make sure that the asterisk sign is **not** surrounded by - whitespaces, e.g. `jrnl Best day of my life! *` will **not** work (the - reason being that the `*` sign has a special meaning on most shells). + Just make sure that the asterisk sign is **not** surrounded by + whitespaces, e.g. `jrnl Best day of my life! *` will **not** work (the + reason being that the `*` sign has a special meaning on most shells). ## Viewing @@ -126,9 +127,9 @@ You can change which symbols you'd like to use for tagging in the configuration. !!! note - `jrnl @pinkie @WorldDomination` will switch to viewing mode because - although **no** command line arguments are given, all the input strings - look like tags - *jrnl* will assume you want to filter by tag. + `jrnl @pinkie @WorldDomination` will switch to viewing mode because + although **no** command line arguments are given, all the input strings + look like tags - *jrnl* will assume you want to filter by tag. ## Editing older entries @@ -164,7 +165,7 @@ DayOne journals can be edited exactly the same way, however the output looks a little bit different because of the way DayOne stores its entries: -``` output +```md # af8dbd0d43fb55458f11aad586ea2abf 2013-05-02 15:30 I told everyone I built my @robot wife for sex. But late at night when we're alone we mostly play Battleship. From 47117b4ef5f6a6fcab76479b4346e8ad2bf9ac4d Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Fri, 23 Aug 2019 18:39:49 -0700 Subject: [PATCH 17/24] Found and removed another angsty teenager --- docs/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/overview.md b/docs/overview.md index c634ae8e..8a0ec10f 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -17,7 +17,7 @@ AES](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard). ## Why keep a journal? -Journals aren't just for angsty teenagers and people who have too much +Journals aren't just for people who have too much time on their summer vacation. A journal helps you to keep track of the things you get done and how you did them. Your imagination may be limitless, but your memory isn't. From 3bfd9f487b67d74b8990a8fd5e0141510b94db54 Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison <4383304+micahellison@users.noreply.github.com> Date: Sat, 24 Aug 2019 13:50:10 -0700 Subject: [PATCH 18/24] [GH-632] confirming that each journal can be parsed during upgrade, and aborting upgrade if not --- features/encryption.feature | 11 ----------- features/regression.feature | 11 ----------- features/upgrade.feature | 23 +++++++++++++++++++++++ jrnl/Journal.py | 13 ++++++++++++- jrnl/upgrade.py | 23 +++++++++++++++++------ 5 files changed, 52 insertions(+), 29 deletions(-) create mode 100644 features/upgrade.feature diff --git a/features/encryption.feature b/features/encryption.feature index ebb3cc02..82d971eb 100644 --- a/features/encryption.feature +++ b/features/encryption.feature @@ -29,14 +29,3 @@ When we run "jrnl simple -n 1" Then we should not see the message "Password" and the output should contain "2013-06-10 15:40 Life is good" - - Scenario: Upgrading a journal encrypted with jrnl 1.x - Given we use the config "encrypted_old.json" - When we run "jrnl -n 1" and enter - """ - Y - bad doggie no biscuit - bad doggie no biscuit - """ - Then we should see the message "Password" - and the output should contain "2013-06-10 15:40 Life is good" diff --git a/features/regression.feature b/features/regression.feature index 21078a1c..3e644b19 100644 --- a/features/regression.feature +++ b/features/regression.feature @@ -43,17 +43,6 @@ Feature: Zapped bugs should stay dead. | Hope to get a lot of traffic. """ - Scenario: Upgrade and parse journals with square brackets - Given we use the config "upgrade_from_195.json" - When we run "jrnl -9" and enter "Y" - Then the output should contain - """ - 2010-06-10 15:00 A life without chocolate is like a bad analogy. - - 2013-06-10 15:40 He said "[this] is the best time to be alive". - """ - Then the journal should have 2 entries - Scenario: Integers in square brackets should not be read as dates Given we use the config "brackets.yaml" When we run "jrnl -1" diff --git a/features/upgrade.feature b/features/upgrade.feature new file mode 100644 index 00000000..bce026b8 --- /dev/null +++ b/features/upgrade.feature @@ -0,0 +1,23 @@ +Feature: Upgrading Journals from 1.x.x to 2.x.x + + Scenario: Upgrade and parse journals with square brackets + Given we use the config "upgrade_from_195.json" + When we run "jrnl -9" and enter "Y" + Then the output should contain + """ + 2010-06-10 15:00 A life without chocolate is like a bad analogy. + + 2013-06-10 15:40 He said "[this] is the best time to be alive". + """ + Then the journal should have 2 entries + + Scenario: Upgrading a journal encrypted with jrnl 1.x + Given we use the config "encrypted_old.json" + When we run "jrnl -n 1" and enter + """ + Y + bad doggie no biscuit + bad doggie no biscuit + """ + Then we should see the message "Password" + and the output should contain "2013-06-10 15:40 Life is good" diff --git a/jrnl/Journal.py b/jrnl/Journal.py index cf336bdc..7feb49a6 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -84,9 +84,20 @@ class Journal(object): def write(self, filename=None): """Dumps the journal into the config file, overwriting it""" filename = filename or self.config['journal'] - text = "\n".join([e.__unicode__() for e in self.entries]) + text = self._to_text() self._store(filename, text) + def validate_parsing(self): + """Confirms that the jrnl is still parsed correctly after being dumped to text.""" + new_entries = self._parse(self._to_text()) + for i, entry in enumerate(self.entries): + if entry != new_entries[i]: + return False + return True + + def _to_text(self): + return "\n".join([e.__unicode__() for e in self.entries]) + def _load(self, filename): raise NotImplementedError diff --git a/jrnl/upgrade.py b/jrnl/upgrade.py index 3784c9f6..1f4f999a 100644 --- a/jrnl/upgrade.py +++ b/jrnl/upgrade.py @@ -44,6 +44,7 @@ older versions of jrnl anymore. encrypted_journals = {} plain_journals = {} other_journals = {} + all_journals = [] for journal_name, journal_conf in config['journals'].items(): if isinstance(journal_conf, dict): @@ -85,17 +86,27 @@ older versions of jrnl anymore. util.prompt("\nUpgrading encrypted '{}' journal stored in {}...".format(journal_name, path)) backup(path, binary=True) old_journal = Journal.open_journal(journal_name, util.scope_config(config, journal_name), legacy=True) - new_journal = EncryptedJournal.from_journal(old_journal) - new_journal.write() - util.prompt(" Done.") + all_journals.append(EncryptedJournal.from_journal(old_journal)) for journal_name, path in plain_journals.items(): util.prompt("\nUpgrading plain text '{}' journal stored in {}...".format(journal_name, path)) backup(path) old_journal = Journal.open_journal(journal_name, util.scope_config(config, journal_name), legacy=True) - new_journal = Journal.PlainJournal.from_journal(old_journal) - new_journal.write() - util.prompt(" Done.") + all_journals.append(Journal.PlainJournal.from_journal(old_journal)) + + # loop through lists to validate + failed_journals = [j for j in all_journals if not j.validate_parsing()] + if len(failed_journals) > 0: + util.prompt("\nThe following journal{} failed to upgrade:\n{}".format( + 's' if len(failed_journals) > 1 else '', "\n".join(j.name for j in failed_journals)) + ) + + util.prompt("Aborting upgrade.") + return + + # write all journals - or - don't + for j in all_journals: + j.write() util.prompt("\nUpgrading config...") backup(config_path) From a4e881942a17cde05cd16b2bc34e92998ed9dea7 Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison <4383304+micahellison@users.noreply.github.com> Date: Sat, 24 Aug 2019 15:01:23 -0700 Subject: [PATCH 19/24] [GH-632] raising exception in upgrade.py on fail Handling it in install.py to prevent config from being overwritten when upgrade fails --- jrnl/install.py | 10 +++++++++- jrnl/upgrade.py | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/jrnl/install.py b/jrnl/install.py index 7cc8f880..68cfb6ea 100644 --- a/jrnl/install.py +++ b/jrnl/install.py @@ -14,6 +14,7 @@ from .Journal import PlainJournal from .EncryptedJournal import EncryptedJournal import yaml import logging +import sys DEFAULT_CONFIG_NAME = 'jrnl.yaml' DEFAULT_JOURNAL_NAME = 'journal.txt' @@ -85,8 +86,15 @@ def load_or_install_jrnl(): if os.path.exists(config_path): log.debug('Reading configuration from file %s', config_path) config = util.load_config(config_path) - upgrade.upgrade_jrnl_if_necessary(config_path) + + try: + upgrade.upgrade_jrnl_if_necessary(config_path) + except upgrade.UpgradeValidationException: + util.prompt("Aborting upgrade. Exiting.") + sys.exit(1) + upgrade_config(config) + return config else: log.debug('Configuration file not found, installing jrnl...') diff --git a/jrnl/upgrade.py b/jrnl/upgrade.py index 1f4f999a..b3d39984 100644 --- a/jrnl/upgrade.py +++ b/jrnl/upgrade.py @@ -96,12 +96,14 @@ older versions of jrnl anymore. # loop through lists to validate failed_journals = [j for j in all_journals if not j.validate_parsing()] + if len(failed_journals) > 0: util.prompt("\nThe following journal{} failed to upgrade:\n{}".format( 's' if len(failed_journals) > 1 else '', "\n".join(j.name for j in failed_journals)) ) - util.prompt("Aborting upgrade.") + raise UpgradeValidationException + return # write all journals - or - don't @@ -112,3 +114,7 @@ older versions of jrnl anymore. backup(config_path) util.prompt("\nWe're all done here and you can start enjoying jrnl 2.".format(config_path)) + +class UpgradeValidationException(Exception): + """Raised when the contents of an upgraded journal do not match the old journal""" + pass From 4d0640e613761a2007533db2669e03fe583c829a Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison <4383304+micahellison@users.noreply.github.com> Date: Sat, 24 Aug 2019 15:14:15 -0700 Subject: [PATCH 20/24] [GH-632] removing unnecessary whitespace --- jrnl/install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jrnl/install.py b/jrnl/install.py index 68cfb6ea..9b6965fa 100644 --- a/jrnl/install.py +++ b/jrnl/install.py @@ -86,7 +86,7 @@ def load_or_install_jrnl(): if os.path.exists(config_path): log.debug('Reading configuration from file %s', config_path) config = util.load_config(config_path) - + try: upgrade.upgrade_jrnl_if_necessary(config_path) except upgrade.UpgradeValidationException: @@ -94,7 +94,7 @@ def load_or_install_jrnl(): sys.exit(1) upgrade_config(config) - + return config else: log.debug('Configuration file not found, installing jrnl...') From 244165664b125da0b3c2897e6d1ddc3d6f1c6ce6 Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison <4383304+micahellison@users.noreply.github.com> Date: Sat, 24 Aug 2019 15:25:05 -0700 Subject: [PATCH 21/24] [GH-632] removing unreachable return statement --- jrnl/upgrade.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/jrnl/upgrade.py b/jrnl/upgrade.py index b3d39984..4e315f82 100644 --- a/jrnl/upgrade.py +++ b/jrnl/upgrade.py @@ -104,8 +104,6 @@ older versions of jrnl anymore. raise UpgradeValidationException - return - # write all journals - or - don't for j in all_journals: j.write() From be35904912efe6284fff70461830fe0ab65ca60b Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison <4383304+micahellison@users.noreply.github.com> Date: Sat, 24 Aug 2019 15:47:13 -0700 Subject: [PATCH 22/24] [GH-632] adding call to action to report issue when upgrade fails --- jrnl/install.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jrnl/install.py b/jrnl/install.py index 9b6965fa..417497aa 100644 --- a/jrnl/install.py +++ b/jrnl/install.py @@ -90,7 +90,10 @@ def load_or_install_jrnl(): try: upgrade.upgrade_jrnl_if_necessary(config_path) except upgrade.UpgradeValidationException: - util.prompt("Aborting upgrade. Exiting.") + util.prompt("Aborting upgrade.") + util.prompt("Please tell us about this problem at the following URL:") + util.prompt("https://github.com/jrnl-org/jrnl/issues/new?title=UpgradeValidationException") + util.prompt("Exiting.") sys.exit(1) upgrade_config(config) From f9ff5196791fe01d454cf7158f5ddafa9aada6b3 Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Wed, 18 Sep 2019 10:33:01 -0700 Subject: [PATCH 23/24] Fix references to Sphinx in contributing.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 56a59a61..989ccf7e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ If you use jrnl, you can totally make our day by just saying "thanks for the cod Docs & Typos ------------ -If you find a typo or a mistake in the docs, please fix it right away and send a pull request. The Right Way™ to fix the docs is to edit the `docs/*.rst` files on the **master** branch. You can see the result if you run `make html` inside the project's root directory, and then open `docs/_build/html/index.html` in your browser. Note that this requires [lessc](http://lesscss.org/) and [Sphinx](https://pypi.python.org/pypi/Sphinx) to be installed. Changes to the CSS or Javascript should be made on `docs/_themes/jrnl/`. The `gh-pages` branch is automatically maintained and updates from `master`; you should never have to edit that. +If you find a typo or a mistake in the docs, please fix it right away and send a pull request. The Right Way™ to fix the docs is to edit the `docs/*.md` files on the **master** branch. You can see the result if you run `make html` inside the project's root directory, which will open a browser that hot-reloads as you change the docs. This requires [mkdocs](https://www.mkdocs.org) to be installed. The `gh-pages` branch is automatically maintained and updates from `master`; you should never have to edit that. Bugs ---- From 9bc0340280042154d0cbc154243ebb1b63e515eb Mon Sep 17 00:00:00 2001 From: etienne Date: Tue, 24 Sep 2019 17:13:05 +0200 Subject: [PATCH 24/24] Change pyYAML required version Full Loader only avalaible from v5.1: --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1cc8a3c5..9d06b96f 100644 --- a/setup.py +++ b/setup.py @@ -85,7 +85,7 @@ setup( "six>=1.10.0", "cryptography>=1.4", "tzlocal>=1.2", - "pyyaml>=3.11", + "pyyaml>=5.1", "keyring>=7.3", "passlib>=1.6.2", "pyxdg>=0.25",