diff --git a/jrnl/FolderJournal.py b/jrnl/FolderJournal.py index 23fdebd94..74f6291bb 100644 --- a/jrnl/FolderJournal.py +++ b/jrnl/FolderJournal.py @@ -83,8 +83,14 @@ def write(self): # print("empty file: {}".format(filename)) os.remove(filename) + def delete_entries(self, entries_to_delete): + """Deletes specific entries from a journal.""" + for entry in entries_to_delete: + self.entries.remove(entry) + self._diff_entry_dates.append(entry.date) + def parse_editable_str(self, edited): - """Parses the output of self.editable_str and updates it's entries.""" + """Parses the output of self.editable_str and updates its entries.""" mod_entries = self._parse(edited) diff_entries = set(self.entries) - set(mod_entries) for e in diff_entries: diff --git a/tests/bdd/features/delete.feature b/tests/bdd/features/delete.feature index f46ef8666..cfbe08ee2 100644 --- a/tests/bdd/features/delete.feature +++ b/tests/bdd/features/delete.feature @@ -17,8 +17,8 @@ Feature: Delete entries from journal | config_file | | basic_onefile.yaml | | basic_encrypted.yaml | - # | basic_folder.yaml | @todo - # | basic_dayone.yaml | @todo + | basic_folder.yaml | + # | basic_dayone.yaml | @todo Scenario Outline: Backing out of interactive delete does not change journal @@ -66,7 +66,7 @@ Feature: Delete entries from journal Examples: Configs | config_file | | basic_onefile.yaml | - # | basic_folder.yaml | @todo + | basic_folder.yaml | # | basic_dayone.yaml | @todo @@ -82,7 +82,7 @@ Feature: Delete entries from journal Examples: Configs | config_file | | basic_onefile.yaml | - # | basic_folder.yaml | @todo + | basic_folder.yaml | # | basic_dayone.yaml | @todo @@ -98,7 +98,7 @@ Feature: Delete entries from journal Examples: Configs | config_file | | basic_onefile.yaml | - # | basic_folder.yaml | @todo + | basic_folder.yaml | # | basic_dayone.yaml | @todo @@ -114,7 +114,7 @@ Feature: Delete entries from journal Examples: Configs | config_file | | basic_onefile.yaml | - # | basic_folder.yaml | @todo + | basic_folder.yaml | # | basic_dayone.yaml | @todo @@ -130,7 +130,7 @@ Feature: Delete entries from journal Examples: Configs | config_file | | basic_onefile.yaml | - # | basic_folder.yaml | @todo + | basic_folder.yaml | # | basic_dayone.yaml | @todo @@ -146,7 +146,7 @@ Feature: Delete entries from journal Examples: Configs | config_file | | basic_onefile.yaml | - # | basic_folder.yaml | @todo + | basic_folder.yaml | # | basic_dayone.yaml | @todo @@ -162,7 +162,7 @@ Feature: Delete entries from journal Examples: Configs | config_file | | basic_onefile.yaml | - # | basic_folder.yaml | @todo + | basic_folder.yaml | # | basic_dayone.yaml | @todo @@ -178,5 +178,5 @@ Feature: Delete entries from journal Examples: Configs | config_file | | basic_onefile.yaml | - # | basic_folder.yaml | @todo + | basic_folder.yaml | # | basic_dayone.yaml | @todo