Skip to main content

TaskDocumenter

Document task definitions.

Attributes

AttributeTypeDescription
objtypestring = 'task'The type of object being documented, used by Sphinx to identify this class as a 'task' documenter.
member_orderinteger = 11The priority order in which this documenter's output appears relative to other members, set to 11.

Methods


can_document_member()

@classmethod
def can_document_member(
member: object,
membername: string,
isattr: boolean,
parent: object
) - > boolean

Determines if the given member is a task definition that can be documented by this class.

Parameters

NameTypeDescription
memberobjectThe member object to check for compatibility with this documenter
membernamestringThe name of the member being inspected
isattrbooleanFlag indicating if the member is an attribute of the parent
parentobjectThe parent object containing the member

Returns

TypeDescription
booleanTrue if the member is an instance of BaseTask and contains a wrapped function, False otherwise

format_args()

@classmethod
def format_args() - > string

Generates a string representation of the task's function signature, excluding 'self' or 'cls' parameters.

Returns

TypeDescription
stringA formatted string of the wrapped function's arguments, or an empty string if no wrapped function exists

document_members()

@classmethod
def document_members(
all_members: boolean = False
) - > null

Overrides the default member documentation behavior to perform no action for task definitions.

Parameters

NameTypeDescription
all_membersboolean = FalseWhether to document all members regardless of their visibility

Returns

TypeDescription
null

check_module()

@classmethod
def check_module() - > boolean

Verifies if the wrapped task function is defined in the current module, accounting for Celery's local proxy objects.

Returns

TypeDescription
booleanTrue if the wrapped function's module matches the expected module name, otherwise falls back to the superclass check