update upgrade module to use new message handling

This commit is contained in:
Jonathan Wren 2022-05-01 04:25:32 -07:00
parent f1119e1593
commit 93650f9927
2 changed files with 3 additions and 2 deletions

View file

@ -94,7 +94,7 @@ class MsgText(Enum):
NoDefaultJournal = "No default journal configured\n{journals}" NoDefaultJournal = "No default journal configured\n{journals}"
FileDoesNotExist = "{filename} does not exist" DoesNotExist = "{name} does not exist"
# --- Journal status ---# # --- Journal status ---#
JournalNotSaved = "Entry NOT saved to journal" JournalNotSaved = "Entry NOT saved to journal"

View file

@ -37,7 +37,7 @@ def backup(filename, binary=False):
except FileNotFoundError: except FileNotFoundError:
print_msg( print_msg(
Message(MsgText.FileDoesNotExist, MsgType.WARNING, {"filename": filename}) Message(MsgText.DoesNotExist, MsgType.WARNING, {"name": filename})
) )
cont = yesno(f"\nCreate {filename}?", default=False) cont = yesno(f"\nCreate {filename}?", default=False)
if not cont: if not cont:
@ -73,6 +73,7 @@ def upgrade_jrnl(config_path):
path = os.path.expanduser(path) path = os.path.expanduser(path)
else: else:
print(f"\nError: {path} does not exist.") print(f"\nError: {path} does not exist.")
print_msg(Message(MsgText.DoesNotExist, MsgType.ERROR, {"name": path}))
continue continue
if encrypt: if encrypt: