diff --git a/GTG/core/base_store.py b/GTG/core/base_store.py index e4c070de1..2aa12d85f 100644 --- a/GTG/core/base_store.py +++ b/GTG/core/base_store.py @@ -53,6 +53,9 @@ def __init__(self) -> None: # -------------------------------------------------------------------------- def new(self) -> S: + """Creates a new item in the store. + NOTE: Subclasses may override the signature of this method. + """ raise NotImplementedError @@ -177,6 +180,9 @@ def unparent(self, item_id: UUID, parent_id: UUID) -> None: # -------------------------------------------------------------------------- def from_xml(self, xml: _Element) -> None: + """Load data from XML. + NOTE: Subclasses may override the signature of this method. + """ raise NotImplementedError diff --git a/GTG/core/saved_searches.py b/GTG/core/saved_searches.py index 7a6426f91..4e9a6c610 100644 --- a/GTG/core/saved_searches.py +++ b/GTG/core/saved_searches.py @@ -162,7 +162,7 @@ def to_xml(self) -> _Element: return root - def new(self, name: str, query: str, parent: Optional[UUID] = None) -> SavedSearch: + def new(self, name: str, query: str, parent: Optional[UUID] = None) -> SavedSearch: # type: ignore[override] """Create a new saved search and add it to the store.""" search_id = uuid4() diff --git a/GTG/core/tags.py b/GTG/core/tags.py index 4f3877243..8eabf1e91 100644 --- a/GTG/core/tags.py +++ b/GTG/core/tags.py @@ -245,7 +245,7 @@ def find(self, name: str) -> Tag: return self.lookup_names[name] - def new(self, name: str, parent: Optional[UUID] = None) -> Tag: + def new(self, name: str, parent: Optional[UUID] = None) -> Tag: # type: ignore[override] """Create a new tag and add it to the store.""" name = name if not name.startswith('@') else name[1:] diff --git a/GTG/core/tasks.py b/GTG/core/tasks.py index 1167bbca1..9150ae6a1 100644 --- a/GTG/core/tasks.py +++ b/GTG/core/tasks.py @@ -766,7 +766,7 @@ def duplicate_for_recurrent(self, task: Task) -> Task: return new_task - def new(self, title: str = '', parent: Optional[UUID] = None) -> Task: + def new(self, title: str = '', parent: Optional[UUID] = None) -> Task: # type: ignore[override] """Create a new task and add it to the store.""" tid = uuid4() @@ -784,7 +784,7 @@ def new(self, title: str = '', parent: Optional[UUID] = None) -> Task: return task - def from_xml(self, xml: _Element, tag_store: TagStore) -> None: + def from_xml(self, xml: _Element, tag_store: TagStore) -> None: # type: ignore[override] """Load up tasks from a lxml object.""" elements = list(xml.iter(self.XML_TAG))