Compare commits

..

3 Commits

View File

@ -97,7 +97,7 @@ class Message():
path: Optional[pathlib.Path]
# @classmethod
# def from_file(cls: Type[MessageInst], path: str) -> MessageInst:
# def from_file(cls: Type[MessageInst], path: pathlib.Path) -> MessageInst:
# """
# Create a Message from the given file. Expects the following file structure:
# * TagLine (from 'self.tags')
@ -107,7 +107,7 @@ class Message():
# """
# pass
def to_file(self, path: str) -> None:
def to_file(self, path: Optional[pathlib.Path]) -> None:
"""
Write Message to the given file. Creates the following file structure:
* TagLine (from 'self.tags')
@ -116,6 +116,8 @@ class Message():
* Answer.Header
* Answer
"""
if not path and not self.path:
raise MessageError('Got no valid path to write message')
pass
def asdict(self) -> dict[str, Any]: