diff --git a/features/steps/core.py b/features/steps/core.py index e0c1d247..b2e9e6a1 100644 --- a/features/steps/core.py +++ b/features/steps/core.py @@ -1,15 +1,14 @@ import ast -from codecs import decode, encode from collections import defaultdict -import json import os +from pathlib import Path import shlex import sys import time from unittest.mock import patch import keyring -import tzlocal +import toml import yaml from behave import given, then, when diff --git a/jrnl/EncryptedJournal.py b/jrnl/EncryptedJournal.py index 9e6fa47f..2a6df460 100644 --- a/jrnl/EncryptedJournal.py +++ b/jrnl/EncryptedJournal.py @@ -3,7 +3,6 @@ import hashlib import logging import os import sys -from typing import Optional from cryptography.fernet import Fernet, InvalidToken from cryptography.hazmat.backends import default_backend diff --git a/jrnl/install.py b/jrnl/install.py index 5070e018..7844d3e2 100644 --- a/jrnl/install.py +++ b/jrnl/install.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -import getpass import glob import logging import os @@ -10,8 +9,6 @@ import xdg.BaseDirectory import yaml from . import __version__, upgrade, util -from .EncryptedJournal import EncryptedJournal -from .Journal import PlainJournal from .util import UserAbort, verify_config if "win32" not in sys.platform: diff --git a/jrnl/plugins/jrnl_importer.py b/jrnl/plugins/jrnl_importer.py index 698ebbe3..9ea9ee26 100644 --- a/jrnl/plugins/jrnl_importer.py +++ b/jrnl/plugins/jrnl_importer.py @@ -3,8 +3,6 @@ import sys -from .. import util - class JRNLImporter: """This plugin imports entries from other jrnl files.""" @@ -16,7 +14,6 @@ class JRNLImporter: """Imports from an existing file if input is specified, and standard input otherwise.""" old_cnt = len(journal.entries) - old_entries = journal.entries if input: with open(input, "r", encoding="utf-8") as f: other_journal_txt = f.read() diff --git a/jrnl/plugins/markdown_exporter.py b/jrnl/plugins/markdown_exporter.py index 7d5eacaf..65cba0fe 100644 --- a/jrnl/plugins/markdown_exporter.py +++ b/jrnl/plugins/markdown_exporter.py @@ -55,6 +55,10 @@ class MarkdownExporter(TextExporter): previous_line = line newbody = newbody + previous_line # add very last line + # make sure the export ends with a blank line + if previous_line not in ["\r", "\n", "\r\n", "\n\r"]: + newbody = newbody + os.linesep + if warn_on_heading_level is True: print( f"{WARNING_COLOR}WARNING{RESET_COLOR}: " diff --git a/pyproject.toml b/pyproject.toml index 2b8e3577..094217d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ include_trailing_comma = true force_grid_wrap = 0 use_parentheses = true line_length = 88 -known_first_party = "jrnl" +known_first_party = ["jrnl", "behave"] force_sort_within_sections = true [build-system]