mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 11:38:32 +02:00
update upgrade module to use new message handling
This commit is contained in:
parent
3ccf695f50
commit
48d36ecad9
2 changed files with 6 additions and 3 deletions
|
@ -25,7 +25,6 @@ class MsgText(Enum):
|
|||
return self.value
|
||||
|
||||
# -- Welcome --- #
|
||||
|
||||
WelcomeToJrnl = """
|
||||
Welcome to jrnl {version}!
|
||||
|
||||
|
@ -43,6 +42,8 @@ class MsgText(Enum):
|
|||
older versions of jrnl anymore.
|
||||
"""
|
||||
|
||||
AllDoneUpgrade = "We're all done here and you can start enjoying jrnl 2"
|
||||
|
||||
# --- Exceptions ---#
|
||||
UncaughtException = """
|
||||
{name}
|
||||
|
@ -171,6 +172,8 @@ class MsgText(Enum):
|
|||
Upgrading {journal_type} '{journal_name}' journal stored in {path}...
|
||||
"""
|
||||
|
||||
UpgradingConfig = "Upgrading config..."
|
||||
|
||||
PaddedJournalName = "{journal_name:{pad}} -> {path}"
|
||||
|
||||
# -- Config --- #
|
||||
|
|
|
@ -177,11 +177,11 @@ def upgrade_jrnl(config_path):
|
|||
for j in all_journals:
|
||||
j.write()
|
||||
|
||||
print("\nUpgrading config...", file=sys.stderr)
|
||||
print_msg(Message(MsgText.UpgradingConfig, MsgType.NORMAL))
|
||||
|
||||
backup(config_path)
|
||||
|
||||
print("\nWe're all done here and you can start enjoying jrnl 2.", file=sys.stderr)
|
||||
print_msg(Message(MsgText.AllDoneUpgrade, MsgType.NORMAL))
|
||||
|
||||
|
||||
def is_old_version(config_path):
|
||||
|
|
Loading…
Add table
Reference in a new issue