diff --git a/jrnl/cli.py b/jrnl/cli.py index fe105e89..32f05f25 100644 --- a/jrnl/cli.py +++ b/jrnl/cli.py @@ -126,7 +126,7 @@ def run(manual_args=None): config = install.install_jrnl(CONFIG_PATH) else: config = util.load_and_fix_json(CONFIG_PATH) - install.upgrade_config(config, config_path=CONFIG_PATH) + install.upgrade_config(config, CONFIG_PATH) if args.ls: print(util.py2encode(list_journals(config))) @@ -235,14 +235,14 @@ def run(manual_args=None): # Not encrypting to a separate file: update config! if not args.encrypt: update_config(original_config, {"encrypt": True}, journal_name, force_local=True) - install.save_config(original_config, config_path=CONFIG_PATH) + install.save_config(original_config, CONFIG_PATH) elif args.decrypt is not False: decrypt(journal, filename=args.decrypt) # Not decrypting to a separate file: update config! if not args.decrypt: update_config(original_config, {"encrypt": False}, journal_name, force_local=True) - install.save_config(original_config, config_path=CONFIG_PATH) + install.save_config(original_config, CONFIG_PATH) elif args.edit: if not config['editor']: diff --git a/jrnl/install.py b/jrnl/install.py index dcb83601..ae57fa3d 100644 --- a/jrnl/install.py +++ b/jrnl/install.py @@ -34,7 +34,7 @@ default_config = { } -def upgrade_config(config, config_path=os.path.expanduser("~/.jrnl_conf")): +def upgrade_config(config, config_path): """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 versions.""" @@ -47,12 +47,12 @@ def upgrade_config(config, config_path=os.path.expanduser("~/.jrnl_conf")): print("[.jrnl_conf updated to newest version]") -def save_config(config=default_config, config_path=os.path.expanduser("~/.jrnl_conf")): +def save_config(config, config_path): with open(config_path, 'w') as f: json.dump(config, f, indent=2) -def install_jrnl(config_path='~/.jrnl_config'): +def install_jrnl(config_path): def autocomplete(text, state): expansions = glob.glob(os.path.expanduser(os.path.expandvars(text))+'*') expansions = [e+"/" if os.path.isdir(e) else e for e in expansions]