CeleryOption
Customized option for Celery.
Attributes
| Attribute | Type | Description |
|---|---|---|
| help_group | string = null | The category or group name used to organize this option within the help output. |
| default_value_from_context | string = null | The key used to look up a dynamic default value from the Click context object (ctx.obj) during execution. |
Constructor
Signature
def CeleryOption(
*args: any,
**kwargs: any
)
Parameters
| Name | Type | Description |
|---|---|---|
| *args | any | Variable length argument list. |
| **kwargs | any | Arbitrary keyword arguments, including 'help_group' and 'default_value_from_context'. |
Signature
def CeleryOption(
*args: tuple,
**kwargs: dict
)
Parameters
| Name | Type | Description |
|---|---|---|
| *args | tuple | Positional arguments passed to the base click.Option constructor. |
| **kwargs | dict | Keyword arguments including 'help_group' for UI categorization and 'default_value_from_context' for dynamic defaults. |
Methods
get_default()
@classmethod
def get_default(
ctx: click.Context,
*args: tuple,
**kwargs: dict
) - > any
Retrieves the default value for the option, potentially resolving it from the application context if a context key is specified. This allows dynamic default values to be pulled from shared configuration stored in the Click context object.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | click.Context | The Click context object containing the application state and configuration. |
| *args | tuple | Variable length argument list passed to the parent class implementation. |
| **kwargs | dict | Arbitrary keyword arguments passed to the parent class implementation. |
Returns
| Type | Description |
|---|---|
any | The default value for the option, either sourced from the context object or the standard default attribute. |