Fix failure to import into directory journal (#1314)

* Re-enable failing directory journal import tests
* Appropriately track journal name and modified entries in FolderJournal when importing
* Run make format
This commit is contained in:
Micah Jerome Ellison 2021-08-21 14:42:31 -07:00 committed by GitHub
parent 08350b884b
commit 7109374d42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 10 deletions

View file

@ -67,9 +67,11 @@ class Journal:
return new_journal
def import_(self, other_journal_txt):
self.entries = list(
frozenset(self.entries) | frozenset(self._parse(other_journal_txt))
)
imported_entries = self._parse(other_journal_txt)
for entry in imported_entries:
entry.modified = True
self.entries = list(frozenset(self.entries) | frozenset(imported_entries))
self.sort()
def open(self, filename=None):
@ -414,7 +416,7 @@ def open_journal(journal_name, config, legacy=False):
else:
from . import FolderJournal
return FolderJournal.Folder(**config).open()
return FolderJournal.Folder(journal_name, **config).open()
if not config["encrypt"]:
if legacy: