message: added function 'rm_file()' and test
This commit is contained in:
@@ -517,6 +517,13 @@ class Message():
|
||||
yaml.dump(data, temp_fd, sort_keys=False)
|
||||
shutil.move(temp_file_path, file_path)
|
||||
|
||||
def rm_file(self) -> None:
|
||||
"""
|
||||
Delete the message file. Ignore empty file_path and not existing files.
|
||||
"""
|
||||
if self.file_path is not None:
|
||||
self.file_path.unlink(missing_ok=True)
|
||||
|
||||
def filter_tags(self, prefix: Optional[str] = None, contain: Optional[str] = None) -> set[Tag]:
|
||||
"""
|
||||
Filter tags based on their prefix (i. e. the tag starts with a given string)
|
||||
|
||||
Reference in New Issue
Block a user