This document describes the current stable version of Celery (4.0). 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: -
Command.
Parser
¶ alias of
ArgumentParser
-
exception
Command.
UsageError
(reason, status=None)¶ Exception raised for malformed arguments.
-
status
= 64¶
-
-
Command.
args
= u''¶
-
Command.
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.
Parameters: - q (str) – the question to ask (don’t include questionark)
- choice (Tuple[str]) – tuple of possible choices, must be lowercase.
- default (Any) – Default value if any.
-
Command.
colored
¶
-
Command.
description
= u''¶
-
Command.
doc
= None¶
-
Command.
enable_config_from_cmdline
= False¶
-
Command.
epilog
= None¶
-
Command.
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
.
-
Command.
get_cls_by_name
(name, imp=<function import_from_cwd>)¶
-
Command.
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.Parameters: - prog_name (str) – The program name (
argv[0]
). - argv (List[str]) – Rest of command-line arguments.
- prog_name (str) – The program name (
-
Command.
leaf
= True¶
-
Command.
namespace
= None¶
-
Command.
no_color
¶
-
Command.
option_list
= None¶
-
Command.
prog_name
= u'celery'¶
-
Command.
respects_app_option
= True¶
-
Command.
show_body
= True¶
-
Command.
show_reply
= True¶
-
Command.
supports_args
= True¶
-
Command.
version
= u'4.0.0 (latentcall)'¶
-
-
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 _check_action>, <function _check_type>, <function _check_choice>, <function _check_dest>, <function _check_const>, <function _check_nargs>, <function _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
= {'int': <function check_builtin>, 'float': <function check_builtin>, 'complex': <function check_builtin>, 'long': <function check_builtin>, 'choice': <function check_choice>}¶