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

Support for Sphinx compatibility.

Class CacheT Undocumented
Class IntersphinxCache An Intersphinx cache.
Class SphinxInventory Sphinx inventory handler.
Class SphinxInventoryWriter Sphinx inventory handler.
Exception InvalidMaxAge Raised when a string cannot be parsed as a maximum age.
Exception SphinxInventoryError Undocumented
Function parseMaxAge Parse a string into a maximum age dictionary.
Function prepareCache Prepare an Intersphinx cache.
Constant MAX_AGE_DEFAULT Undocumented
Constant MAX_AGE_HELP Undocumented
Constant USER_INTERSPHINX_CACHE Undocumented
Variable logger Logger used to report full-tracebacks verbose mode activated.
Class _Unit A unit of time for maximum age parsing.
Function _parseInventoryLine Parse a single line from a Sphinx inventory.
Constant _PROPOSE_VERBOSE Undocumented
Variable _maxAgeUnitNames Undocumented
Variable _maxAgeUnits Undocumented
def parseMaxAge(maxAge: str) -> dict[str, int]: (source)

Parse a string into a maximum age dictionary.

Parameters
maxAge:strA string consisting of an integer number followed by a single character unit.
Returns
dict[str, int]A dictionary whose keys match datetime.timedelta's arguments.
Raises
InvalidMaxAgewhen a string cannot be parsed.
def prepareCache(clearCache: bool, enableCache: bool, cachePath: str, maxAge: str, *, sessionFactory: Callable[[], requests.Session] = requests.Session, verbosity: int = 0) -> IntersphinxCache: (source)

Prepare an Intersphinx cache.

Parameters
clearCache:boolRemove the cache?
enableCache:boolEnable the cache?
cachePath:strPath of the cache directory.
maxAge:strThe maximum age in seconds of cached Intersphinx objects.inv files.
sessionFactory:Callable[[], requests.Session](optional) A zero-argument callable that returns a requests.Session.
verbosity:intUndocumented
Returns
IntersphinxCacheA IntersphinxCache instance.
MAX_AGE_DEFAULT: str = (source)

Undocumented

Value
'1w'
MAX_AGE_HELP = (source)

Undocumented

Value
textwrap.dedent(f'\n    The maximum age of any entry in the cache.  Of the forma
t\n    <int><unit> where <unit> is one of {_maxAgeUnitNames}.\n    ')
USER_INTERSPHINX_CACHE = (source)

Undocumented

Value
platformdirs.user_cache_dir('pydoctor')

Logger used to report full-tracebacks verbose mode activated.

def _parseInventoryLine(line: str) -> tuple[str, str, int, str, str]: (source)

Parse a single line from a Sphinx inventory.

Raises
ValueErrorIf the line does not conform to the syntax.
_PROPOSE_VERBOSE: str = (source)

Undocumented

Value
' (use -v to log traceback)'
_maxAgeUnitNames = (source)

Undocumented

_maxAgeUnits = (source)

Undocumented