get rid of old exception

This commit is contained in:
Jonathan Wren 2022-02-19 17:00:52 -08:00
parent 94feae735e
commit 35cdd7bd59
2 changed files with 6 additions and 15 deletions

View file

@ -5,10 +5,6 @@ import textwrap
from enum import Enum from enum import Enum
class UserAbort(Exception):
pass
class JrnlExceptionMessage(Enum): class JrnlExceptionMessage(Enum):
ConfigDirectoryIsFile = """ ConfigDirectoryIsFile = """
The path to your jrnl configuration directory is a file, not a directory: The path to your jrnl configuration directory is a file, not a directory:

View file

@ -14,7 +14,6 @@ from .config import scope_config
from .config import get_config_path from .config import get_config_path
from .editor import get_text_from_editor from .editor import get_text_from_editor
from .editor import get_text_from_stdin from .editor import get_text_from_stdin
from .exception import UserAbort
from . import time from . import time
from .override import apply_overrides from .override import apply_overrides
@ -38,18 +37,14 @@ def run(args):
return args.preconfig_cmd(args) return args.preconfig_cmd(args)
# Load the config, and extract journal name # Load the config, and extract journal name
try: config = install.load_or_install_jrnl(args.config_file_path)
config = install.load_or_install_jrnl(args.config_file_path) original_config = config.copy()
original_config = config.copy()
# Apply config overrides # Apply config overrides
config = apply_overrides(args, config) config = apply_overrides(args, config)
args = get_journal_name(args, config) args = get_journal_name(args, config)
config = scope_config(config, args.journal_name) config = scope_config(config, args.journal_name)
except UserAbort as err:
print(f"\n{err}", file=sys.stderr)
sys.exit(1)
# Run post-config command now that config is ready # Run post-config command now that config is ready
if callable(args.postconfig_cmd): if callable(args.postconfig_cmd):