This document describes the current stable version of Celery (4.4). For development docs, go here.
celery.bin.base
¶
Base command-line interface.
-
exception
celery.bin.base.
Error
(reason, status=None)[source]¶ Exception raised by commands.
-
status
= 1¶
-
-
exception
celery.bin.base.
UsageError
(reason, status=None)[source]¶ Exception raised for malformed arguments.
-
status
= 64¶
-
-
class
celery.bin.base.
Extensions
(namespace, register)[source]¶ Loads extensions from setuptools entrypoints.
-
class
celery.bin.base.
Command
(app=None, get_app=None, no_color=False, stdout=None, stderr=None, quiet=False, on_error=None, on_usage_error=None)[source]¶ Base class for command-line applications.
- Parameters
app (Celery) – The app to use.
get_app (Callable) – Fucntion returning the current app when no app provided.
-
Parser
¶ alias of
argparse.ArgumentParser
-
args
= ''¶ Arg list used in help.
-
args_name
= 'args'¶ Name of argparse option used for parsing positional args.
-
ask
(q, choices, default=None)[source]¶ Prompt user to choose from a tuple of string values.
If a default is not specified the question will be repeated until the user gives a valid choice.
Matching is case insensitive.
-
property
colored
¶
-
description
= ''¶ Text to print in –help before option list.
-
doc
= None¶
-
enable_config_from_cmdline
= False¶ Enable if the application should support config from the cmdline.
-
epilog
= None¶ Text to print at end of –help
-
execute_from_commandline
(argv=None)[source]¶ Execute application from command-line.
- Parameters
argv (List[str]) – The list of command-line arguments. Defaults to
sys.argv
.
-
get_cls_by_name
(name, imp=<function import_from_cwd>)¶
-
handle_argv
(prog_name, argv, command=None)[source]¶ Parse arguments from argv and dispatch to
run()
.Warning
Exits with an error message if
supports_args
is disabled andargv
contains positional arguments.
-
leaf
= True¶ Set to true if this command doesn’t have sub-commands
-
namespace
= None¶ Default configuration name-space.
-
property
no_color
¶
-
option_list
= None¶ List of options (without preload options).
-
prog_name
= 'celery'¶
-
respects_app_option
= True¶
-
show_body
= True¶
-
show_reply
= True¶
-
supports_args
= True¶ If false the parser will raise an exception if positional args are provided.
-
version
= '4.4.7 (cliffs)'¶ Application version.
-
class
celery.bin.base.
Option
(*opts, **attrs)[source]¶ - Instance attributes:
_short_opts : [string] _long_opts : [string]
action : string type : string dest : string default : any nargs : int const : any choices : [string] callback : function callback_args : (any*) callback_kwargs : { string : any } help : string metavar : string
-
ACTIONS
= ('store', 'store_const', 'store_true', 'store_false', 'append', 'append_const', 'count', 'callback', 'help', 'version')¶
-
ALWAYS_TYPED_ACTIONS
= ('store', 'append')¶
-
ATTRS
= ['action', 'type', 'dest', 'default', 'nargs', 'const', 'choices', 'callback', 'callback_args', 'callback_kwargs', 'help', 'metavar']¶
-
CHECK_METHODS
= [<function Option._check_action>, <function Option._check_type>, <function Option._check_choice>, <function Option._check_dest>, <function Option._check_const>, <function Option._check_nargs>, <function Option._check_callback>]¶
-
CONST_ACTIONS
= ('store_const', 'append_const')¶
-
STORE_ACTIONS
= ('store', 'store_const', 'store_true', 'store_false', 'append', 'append_const', 'count')¶
-
TYPED_ACTIONS
= ('store', 'append', 'callback')¶
-
TYPES
= ('string', 'int', 'long', 'float', 'complex', 'choice')¶
-
TYPE_CHECKER
= {'choice': <function check_choice>, 'complex': <function check_builtin>, 'float': <function check_builtin>, 'int': <function check_builtin>, 'long': <function check_builtin>}¶