7.3.2.1.6. DispatcherDocumenter

class DispatcherDocumenter(directive: DocumenterBridge, name: str, indent: str = '')[source]

Specialized Documenter subclass for dispatchers.

Methods

__init__

add_content

Add content from docstrings, attribute documentation and user.

add_directive_header

Add the directive header and options to the generated content.

add_line

Append one line of generated reST to the output.

can_document_member

Called to see if a member can be documented by this Documenter.

check_module

Check if self.object is really defined in the module given by self.modname.

document_members

Generate reST for member documentation.

filter_members

Filter the given member list.

format_args

Format the argument signature of self.object.

format_name

Format the name of self.object.

format_signature

Format the signature (arguments and return annotation) of the object.

generate

Generate reST for the object given by self.name, and possibly for its members.

get_attr

getattr() override for types such as Zope interfaces.

get_doc

Decode and return lines of the docstring(s) for the object.

get_module_comment

get_object_members

Return (members_check_module, members) where members is a list of (membername, member) pairs of the members of self.object.

get_real_modname

Get the real module name of an object to document.

get_sourcename

import_object

Import the object given by self.modname and self.objpath and set it as self.object.

parse_name

Determine what module to import and what attribute to document.

process_doc

Let the user process the docstrings before adding them.

resolve_name

Resolve the module and name of the object to document given by the arguments and the current module/class.

should_suppress_directive_header

Check directive header should be suppressed.

should_suppress_value_header

Check :value: header should be suppressed.

sort_members

Sort the given member list.

update_annotations

Update __annotations__ to support type_comment and so on.

update_content

Update docstring, for example with TypeVar variance.

__init__(directive: DocumenterBridge, name: str, indent: str = '') None

Attributes

blue_cache

code

content_indent

indentation by which to indent the directive content

default_opt

directivetype

documenters

Returns registered Documenter classes

is_doctest

member_order

order if autodoc_member_order is set to 'groupwise'

objtype

name by which the directive is called (auto...) and the default generated directive name

option_spec

priority

priority if multiple documenters return True from can_document_member

titles_allowed

true if the generated content may contain titles

config

env

modname

parent

object

objpath

content_indent = ''

indentation by which to indent the directive content

objtype = 'dispatcher'

name by which the directive is called (auto…) and the default generated directive name

get_real_modname()[source]

Get the real module name of an object to document.

It can differ from the name of the module through which the object was imported.

classmethod can_document_member(member, *args, **kwargs)[source]

Called to see if a member can be documented by this Documenter.

add_directive_header(sig)[source]

Add the directive header and options to the generated content.

parse_name()[source]

Determine what module to import and what attribute to document.

Returns True and sets self.modname, self.objpath, self.fullname, self.args and self.retann if parsing and resolving was successful.

generate(more_content=None, **kw)[source]

Generate reST for the object given by self.name, and possibly for its members.

If more_content is given, include that content. If real_modname is given, use that module name to find attribute docs. If check_module is True, only generate if the object is defined in the module name it is imported from. If all_members is True, document all members.

import_object(*args, **kwargs)[source]

Import the object given by self.modname and self.objpath and set it as self.object.

Returns True if successful, False if an error occurred.

format_signature()[source]

Format the signature (arguments and return annotation) of the object.

Let the user process it via the autodoc-process-signature event.

add_content(more_content, no_docstring=False)[source]

Add content from docstrings, attribute documentation and user.