mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-13 09:58:31 +02:00
get rid of old PlainJournal class
This commit is contained in:
parent
07d1db6b00
commit
7c6e34deda
2 changed files with 4 additions and 8 deletions
|
@ -379,10 +379,6 @@ class Journal:
|
||||||
self.entries = mod_entries
|
self.entries = mod_entries
|
||||||
|
|
||||||
|
|
||||||
class PlainJournal(Journal):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class LegacyJournal(Journal):
|
class LegacyJournal(Journal):
|
||||||
"""Legacy class to support opening journals formatted with the jrnl 1.x
|
"""Legacy class to support opening journals formatted with the jrnl 1.x
|
||||||
standard. Main difference here is that in 1.x, timestamps were not cuddled
|
standard. Main difference here is that in 1.x, timestamps were not cuddled
|
||||||
|
@ -474,9 +470,9 @@ def open_journal(journal_name, config, legacy=False):
|
||||||
from jrnl import FolderJournal
|
from jrnl import FolderJournal
|
||||||
|
|
||||||
return FolderJournal.Folder(journal_name, **config).open()
|
return FolderJournal.Folder(journal_name, **config).open()
|
||||||
return PlainJournal(journal_name, **config).open()
|
return Journal(journal_name, **config).open()
|
||||||
|
|
||||||
if legacy:
|
if legacy:
|
||||||
config["encrypt"] = "jrnlv1"
|
config["encrypt"] = "jrnlv1"
|
||||||
return LegacyJournal(journal_name, **config).open()
|
return LegacyJournal(journal_name, **config).open()
|
||||||
return PlainJournal(journal_name, **config).open()
|
return Journal(journal_name, **config).open()
|
||||||
|
|
|
@ -136,7 +136,7 @@ def upgrade_jrnl(config_path):
|
||||||
logging.debug(f"Clearing encryption method for '{journal_name}' journal")
|
logging.debug(f"Clearing encryption method for '{journal_name}' journal")
|
||||||
|
|
||||||
# Update the encryption method
|
# Update the encryption method
|
||||||
new_journal = Journal.PlainJournal.from_journal(old_journal)
|
new_journal = Journal.Journal.from_journal(old_journal)
|
||||||
new_journal.config["encrypt"] = "jrnlv2"
|
new_journal.config["encrypt"] = "jrnlv2"
|
||||||
new_journal._get_encryption_method()
|
new_journal._get_encryption_method()
|
||||||
# Copy over password (jrnlv1 only supported password-based encryption)
|
# Copy over password (jrnlv1 only supported password-based encryption)
|
||||||
|
@ -159,7 +159,7 @@ def upgrade_jrnl(config_path):
|
||||||
old_journal = Journal.open_journal(
|
old_journal = Journal.open_journal(
|
||||||
journal_name, scope_config(config, journal_name), legacy=True
|
journal_name, scope_config(config, journal_name), legacy=True
|
||||||
)
|
)
|
||||||
all_journals.append(Journal.PlainJournal.from_journal(old_journal))
|
all_journals.append(Journal.Journal.from_journal(old_journal))
|
||||||
|
|
||||||
# loop through lists to validate
|
# loop through lists to validate
|
||||||
failed_journals = [j for j in all_journals if not j.validate_parsing()]
|
failed_journals = [j for j in all_journals if not j.validate_parsing()]
|
||||||
|
|
Loading…
Add table
Reference in a new issue