This document describes the current stable version of Celery (3.1). For development docs, go here.
celery.bin.base¶
Preload Options¶
These options are supported by all commands, and usually parsed before command-specific arguments.
-
-A
,
--app
¶
app instance to use (e.g. module.attr_name)
-
-b
,
--broker
¶
url to broker. default is ‘amqp://guest@localhost//’
-
--loader
¶
name of custom loader class to use.
-
--config
¶
Name of the configuration module
Daemon Options¶
These options are supported by commands that can detach into the background (daemon). They will be present in any command that also has a –detach option.
-
-f
,
--logfile
¶
Path to log file. If no logfile is specified, stderr is used.
-
--pidfile
¶
Optional file used to store the process pid.
The program will not start if this file already exists and the pid is still alive.
-
--uid
¶
User id, or user name of the user to run as after detaching.
-
--gid
¶
Group id, or group name of the main group to change to after detaching.
-
--umask
¶
Effective umask (in octal) of the process after detaching. Inherits the umask of the parent process by default.
-
--workdir
¶
Optional directory to change to after detaching.
-
--executable
¶
Executable to use for the detached process.
-
class
celery.bin.base.
HelpFormatter
(indent_increment=2, max_help_position=24, width=None, short_first=1)[source]¶
-
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 – The current app.
- get_app – Callable returning the current app if no app provided.
-
Parser
¶ alias of
OptionParser
-
args
= u''¶
-
ask
(q, choices, default=None)[source]¶ Prompt user to choose from a tuple of string values.
Parameters: - q – the question to ask (do not include questionark)
- choice – tuple of possible choices, must be lowercase.
- default – Default value if any.
If a default is not specified the question will be repeated until the user gives a valid choice.
Matching is done case insensitively.
-
colored
¶
-
description
= u''¶
-
doc
= None¶
-
enable_config_from_cmdline
= False¶
-
epilog
= None¶
-
execute_from_commandline
(argv=None)[source]¶ Execute application from command-line.
Parameters: argv – 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 command-line arguments from
argv
and dispatch torun()
.Parameters: - prog_name – The program name (
argv[0]
). - argv – Command arguments.
Exits with an error message if
supports_args
is disabled andargv
contains positional arguments.- prog_name – The program name (
-
leaf
= True¶
-
namespace
= u'celery'¶
-
no_color
¶
-
option_list
= ()¶
-
preload_options
= (<Option at 0x7f36c81a73f8: -A/--app>, <Option at 0x7f36c8442d40: -b/--broker>, <Option at 0x7f36c84156c8: --loader>, <Option at 0x7f36c8415b00: --config>, <Option at 0x7f36c8415560: --workdir>, <Option at 0x7f36c8415e60: -C/--no-color>, <Option at 0x7f36c8415a70: -q/--quiet>)¶
-
prog_name
= u'celery'¶
-
respects_app_option
= True¶
-
run
(*args, **options)[source]¶ This is the body of the command called by
handle_argv()
.
-
show_body
= True¶
-
show_reply
= True¶
-
supports_args
= True¶
-
version
= '3.1.25 (Cipater)'¶
-
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>}¶