The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Add an abstract base class for documents

main
Gergely Polonkai 4 months ago
parent 547c6b5205
commit 6bc7fc63b2
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4
  1. 1
      earthsnake/__init__.py
  2. 27
      earthsnake/document/__init__.py

@ -15,3 +15,4 @@ Usage example
__version__ = '0.1.0'
from .identity import Identity
from .document import Document

@ -0,0 +1,27 @@
"""Document handling classes"""
from abc import ABC, abstractmethod
from datetime import datetime
from typing import Optional
from ..identity import Identity
from ..path import Path
class Document(ABC): # pragma: no cover pylint: disable=too-few-public-methods
"""Abstract base class for documents"""
path: Path
author: Identity
timestamp: datetime
signature: str
@abstractmethod
def sign(self, identity: Optional[Identity] = None) -> None:
"""Sign the document as identity
If ``identity`` is ``None``, use ``self.author`` instead.
"""
Loading…
Cancel
Save