TaskDocumenter
Document task definitions.
Attributes
| Attribute | Type | Description |
|---|---|---|
| objtype | string = 'task' | The type of object being documented, used by Sphinx to identify this class as a 'task' documenter. |
| member_order | integer = 11 | The 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
| Name | Type | Description |
|---|---|---|
| member | object | The member object to check for compatibility with this documenter |
| membername | string | The name of the member being inspected |
| isattr | boolean | Flag indicating if the member is an attribute of the parent |
| parent | object | The parent object containing the member |
Returns
| Type | Description |
|---|---|
boolean | True 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
| Type | Description |
|---|---|
string | A 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
| Name | Type | Description |
|---|---|---|
| all_members | boolean = False | Whether to document all members regardless of their visibility |
Returns
| Type | Description |
|---|---|
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
| Type | Description |
|---|---|
boolean | True if the wrapped function's module matches the expected module name, otherwise falls back to the superclass check |