Skip to content

Commit

Permalink
fixup! more doc (sphinxification)
Browse files Browse the repository at this point in the history
  • Loading branch information
masklinn committed Oct 25, 2023
1 parent 3f07008 commit dbf49ca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
1 change: 0 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@

autodoc_member_order = "bysource"
autodoc_default_flags = ["members", "special-members"]

13 changes: 7 additions & 6 deletions src/ua_parser/caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,28 @@

__all__ = [
"CachingParser",

"Cache", "Clearing", "LRU",
"Cache",
"Clearing",
"LRU",
]


class Cache(abc.ABC):
"""Cache abstract protocol. The :class:`CachingParser` will look
values up, merge what was returned (possibly nothing) with what it
got from its actual parser, and *re-set the result*.
A :class:`Cache` is responsible for its own replacement policy.
"""

@abc.abstractmethod
def __setitem__(self, key: str, value: PartialParseResult):
"""Adds or replace ``value`` to the cache at key ``key``.
"""
"""Adds or replace ``value`` to the cache at key ``key``."""
...

@abc.abstractmethod
def __getitem__(self, key: str) -> Optional[PartialParseResult]:
"""Returns a partial result for ``key`` if there is any.
"""
"""Returns a partial result for ``key`` if there is any."""
...


Expand Down
13 changes: 8 additions & 5 deletions src/ua_parser/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
from typing import *

__all__ = [
"UserAgent", "OS", "Device",

"ParseResult", "DefaultedParseResult",

"Parser", "Domain", "PartialParseResult",
"UserAgent",
"OS",
"Device",
"ParseResult",
"DefaultedParseResult",
"Parser",
"Domain",
"PartialParseResult",
]


Expand Down

0 comments on commit dbf49ca

Please sign in to comment.