mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Made Journal.import_ more concise.
This commit is contained in:
parent
6258465f5d
commit
93ea6a2a6a
1 changed files with 1 additions and 5 deletions
|
@ -34,11 +34,7 @@ class Journal(object):
|
|||
return len(self.entries)
|
||||
|
||||
def import_(self, other_journal_txt):
|
||||
other_entries = self._parse(other_journal_txt)
|
||||
entries_set = frozenset(self.entries)
|
||||
for other_entry in other_entries:
|
||||
if other_entry not in entries_set:
|
||||
self.entries.append(other_entry)
|
||||
self.entries = list(frozenset(self.entries) | frozenset(self._parse(other_journal_txt)))
|
||||
self.sort()
|
||||
|
||||
def open(self, filename=None):
|
||||
|
|
Loading…
Add table
Reference in a new issue