Skip to content

Commit

Permalink
StorageType and SearchType docstrings. #325
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon24 committed Nov 3, 2023
1 parent 34f23cd commit a123bf9
Show file tree
Hide file tree
Showing 5 changed files with 419 additions and 113 deletions.
5 changes: 5 additions & 0 deletions docs/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ so the path behaves like the ``database`` argument of :func:`sqlite3.connect`:
the data will disappear when the reader is closed.


.. _lifecycle:

Lifecycle
~~~~~~~~~

Expand All @@ -63,6 +65,9 @@ In either case, you can reuse the reader object after closing it;
database connections will be re-created automatically.



.. _threading:

Threading
~~~~~~~~~

Expand Down
19 changes: 17 additions & 2 deletions docs/internal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,24 @@ Storage
.. autoattribute:: reader.Reader._storage


.. module:: reader._storage
.. module:: reader._types
:noindex:

.. autoclass:: StorageType()
:members:
:special-members: __enter__, __exit__


Search
------

.. autoattribute:: reader.Reader._search


.. module:: reader._types
:noindex:

.. autoclass:: Storage()
.. autoclass:: SearchType
:members:


Expand Down
14 changes: 0 additions & 14 deletions src/reader/_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,20 +1011,6 @@ def add_entry(self, intent: EntryUpdateIntent) -> None:
def delete_entries(
self, entries: Iterable[tuple[str, str]], *, added_by: str | None = None
) -> None:
r"""Delete a list of entries.
Args:
entries (list(tuple(str, str))):
A list of :attr:`~reader.Entry.resource_id`\s.
added_by (str or None):
If given, only delete the entries if their
:attr:`~reader.Entry.added_by` is equal to this.
Raises:
EntryNotFoundError: An entry does not exist.
EntryError: An entry has a different ``added_by`` from the given one.
"""
# This must be atomic (unlike add_or_update_entries()); hence, no paging.
# We'll deal with locking issues only if they start appearing
# (hopefully, there are both fewer entries to be deleted and
Expand Down
Loading

0 comments on commit a123bf9

Please sign in to comment.