mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 19:48:31 +02:00
get rid of old exception
This commit is contained in:
parent
94feae735e
commit
35cdd7bd59
2 changed files with 6 additions and 15 deletions
|
@ -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:
|
||||||
|
|
17
jrnl/jrnl.py
17
jrnl/jrnl.py
|
@ -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):
|
||||||
|
|
Loading…
Add table
Reference in a new issue