7.3.2.1.6. DispatcherDocumenter¶
- class DispatcherDocumenter(directive: DocumenterBridge, name: str, indent: str = '')[source]¶
Specialized Documenter subclass for dispatchers.
Methods
Add content from docstrings, attribute documentation and user.
Add the directive header and options to the generated content.
add_line
Append one line of generated reST to the output.
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 the signature (arguments and return annotation) of the object.
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 the real module name of an object to document.
get_sourcename
Import the object given by self.modname and self.objpath and set it as self.object.
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 the NewType object.
Attributes
blue_cache
code
config
indentation by which to indent the directive content
default_opt
directivetype
env
is_doctest
member_order
order if autodoc_member_order is set to 'groupwise'
modname
object
objpath
name by which the directive is called (auto...) and the default generated directive name
option_spec
parent
priority
priority if multiple documenters return True from can_document_member
titles_allowed
true if the generated content may contain titles
- 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.
- 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.