Twisted
Home FAQ Docs Download Timeline Roadmap View Tickets Search
class documentation

An Intersphinx cache.

Class Method fromParameters Construct an instance with the given parameters.
Method close Undocumented
Method get Retrieve a URL using the cache.
Instance Variable session A session that may or may not cache requests.
Instance Variable verbosity Undocumented
def fromParameters(cls, sessionFactory: Callable[[], requests.Session], cachePath: str, maxAgeDictionary: Mapping[str, int], *, verbosity: int = 0) -> IntersphinxCache: (source)

Construct an instance with the given parameters.

Parameters
sessionFactory:Callable[[], requests.Session]A zero-argument callable that returns a requests.Session.
cachePath:strPath of the cache directory.
maxAgeDictionary:Mapping[str, int]A mapping describing the maximum age of any cache entry.
verbosity:intUndocumented
Returns
IntersphinxCacheUndocumented
See Also
parseMaxAge
def close(self): (source)

Undocumented

def get(self, url: str) -> bytes | None: (source)

Retrieve a URL using the cache.

Parameters
url:strThe URL to retrieve.
Returns
bytes | NoneThe body of the URL, or None on failure.
session: requests.Session = (source)

A session that may or may not cache requests.

verbosity: int = (source)

Undocumented