diff --git a/jrnl/EncryptedJournal.py b/jrnl/EncryptedJournal.py index 08ca2397..704a091a 100644 --- a/jrnl/EncryptedJournal.py +++ b/jrnl/EncryptedJournal.py @@ -27,7 +27,6 @@ from jrnl.messages import MsgText from jrnl.messages import MsgType - def make_key(password): password = password.encode("utf-8") kdf = PBKDF2HMAC( diff --git a/jrnl/config.py b/jrnl/config.py index 7ded61ad..2b07b14b 100644 --- a/jrnl/config.py +++ b/jrnl/config.py @@ -198,7 +198,11 @@ def get_journal_name(args, config): if args.journal_name not in config["journals"]: raise JrnlException( - Message(MsgText.NoDefaultJournal, MsgType.ERROR, { "journals": list_journals(config)}), + Message( + MsgText.NoDefaultJournal, + MsgType.ERROR, + {"journals": list_journals(config)}, + ), ) logging.debug("Using journal name: %s", args.journal_name) diff --git a/jrnl/editor.py b/jrnl/editor.py index 481f1e13..24c625de 100644 --- a/jrnl/editor.py +++ b/jrnl/editor.py @@ -31,7 +31,11 @@ def get_text_from_editor(config, template=""): subprocess.call(split_args(config["editor"]) + [tmpfile]) except FileNotFoundError: raise JrnlException( - Message(MsgText.EditorMisconfigured, MsgType.ERROR, { "editor_key": config["editor"] }) + Message( + MsgText.EditorMisconfigured, + MsgType.ERROR, + {"editor_key": config["editor"]}, + ) ) with open(tmpfile, "r", encoding="utf-8") as f: diff --git a/jrnl/install.py b/jrnl/install.py index 5ec8d0cc..306b44e1 100644 --- a/jrnl/install.py +++ b/jrnl/install.py @@ -23,7 +23,6 @@ from jrnl.messages import MsgText from jrnl.messages import MsgType - def upgrade_config(config_data, alt_config_path=None): """Checks if there are keys missing in a given config dict, and if so, updates the config file accordingly. This essentially automatically ports jrnl installations if new config parameters are introduced in later @@ -54,7 +53,9 @@ def find_default_config(): def find_alt_config(alt_config): if not os.path.exists(alt_config): raise JrnlException( - Message(MsgText.AltConfigNotFound, MsgType.ERROR, { "config_file": alt_config }) + Message( + MsgText.AltConfigNotFound, MsgType.ERROR, {"config_file": alt_config} + ) ) return alt_config diff --git a/jrnl/jrnl.py b/jrnl/jrnl.py index 4e824f85..969a2742 100644 --- a/jrnl/jrnl.py +++ b/jrnl/jrnl.py @@ -136,7 +136,9 @@ def write_mode(args, config, journal, **kwargs): if not raw: logging.error("Write mode: couldn't get raw text") - raise JrnlException(Message(MsgText.JrnlExceptionMessage.NoTextReceived, MsgType.ERROR)) + raise JrnlException( + Message(MsgText.JrnlExceptionMessage.NoTextReceived, MsgType.ERROR) + ) logging.debug( 'Write mode: appending raw text to journal "%s": %s', args.journal_name, raw @@ -200,7 +202,13 @@ def _get_editor_template(config, **kwargs): logging.debug("Write mode: template loaded: %s", template) except OSError: logging.error("Write mode: template not loaded") - raise JrnlException(Message(MsgText.CantReadTemplate, MsgType.ERROR, { "template": config["template"] })) + raise JrnlException( + Message( + MsgText.CantReadTemplate, + MsgType.ERROR, + {"template": config["template"]}, + ) + ) return template @@ -238,7 +246,11 @@ def _edit_search_results(config, journal, old_entries, **kwargs): """ if not config["editor"]: raise JrnlException( - Message(MsgText.EditorNotConfigured, MsgType.ERROR, {"config_file": get_config_path()}) + Message( + MsgText.EditorNotConfigured, + MsgType.ERROR, + {"config_file": get_config_path()}, + ) ) # separate entries we are not editing diff --git a/jrnl/upgrade.py b/jrnl/upgrade.py index 761b18fa..60fcfffa 100644 --- a/jrnl/upgrade.py +++ b/jrnl/upgrade.py @@ -20,7 +20,6 @@ from jrnl.messages import MsgText from jrnl.messages import MsgType - def backup(filename, binary=False): print(f" Created a backup at {filename}.backup", file=sys.stderr) filename = os.path.expanduser(os.path.expandvars(filename))