repo
stringlengths
7
55
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
19
28.4k
docstring
stringlengths
1
46.9k
docstring_tokens
listlengths
1
1.97k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
idlesign/uwsgiconf
uwsgiconf/options/networking.py
Networking.set_bsd_socket_params
def set_bsd_socket_params(self, port_reuse=None): """Sets BSD-sockets related params. :param bool port_reuse: Enable REUSE_PORT flag on socket to allow multiple instances binding on the same address (BSD only). """ self._set('reuse-port', port_reuse, cast=bool) ret...
python
def set_bsd_socket_params(self, port_reuse=None): """Sets BSD-sockets related params. :param bool port_reuse: Enable REUSE_PORT flag on socket to allow multiple instances binding on the same address (BSD only). """ self._set('reuse-port', port_reuse, cast=bool) ret...
[ "def", "set_bsd_socket_params", "(", "self", ",", "port_reuse", "=", "None", ")", ":", "self", ".", "_set", "(", "'reuse-port'", ",", "port_reuse", ",", "cast", "=", "bool", ")", "return", "self", ".", "_section" ]
Sets BSD-sockets related params. :param bool port_reuse: Enable REUSE_PORT flag on socket to allow multiple instances binding on the same address (BSD only).
[ "Sets", "BSD", "-", "sockets", "related", "params", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/networking.py#L107-L116
train
idlesign/uwsgiconf
uwsgiconf/options/networking.py
Networking.register_socket
def register_socket(self, socket): """Registers the given socket(s) for further use. :param Socket|list[Socket] socket: Socket type object. See ``.sockets``. """ sockets = self._sockets for socket in listify(socket): uses_shared = isinstance(socket.address, Socket...
python
def register_socket(self, socket): """Registers the given socket(s) for further use. :param Socket|list[Socket] socket: Socket type object. See ``.sockets``. """ sockets = self._sockets for socket in listify(socket): uses_shared = isinstance(socket.address, Socket...
[ "def", "register_socket", "(", "self", ",", "socket", ")", ":", "sockets", "=", "self", ".", "_sockets", "for", "socket", "in", "listify", "(", "socket", ")", ":", "uses_shared", "=", "isinstance", "(", "socket", ".", "address", ",", "SocketShared", ")", ...
Registers the given socket(s) for further use. :param Socket|list[Socket] socket: Socket type object. See ``.sockets``.
[ "Registers", "the", "given", "socket", "(", "s", ")", "for", "further", "use", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/networking.py#L121-L158
train
idlesign/uwsgiconf
uwsgiconf/options/networking.py
Networking.set_sni_params
def set_sni_params(self, name, cert, key, ciphers=None, client_ca=None, wildcard=False): """Allows setting Server Name Identification (virtual hosting for SSL nodes) params. * http://uwsgi.readthedocs.io/en/latest/SNI.html :param str|unicode name: Node/server/host name. :param str|uni...
python
def set_sni_params(self, name, cert, key, ciphers=None, client_ca=None, wildcard=False): """Allows setting Server Name Identification (virtual hosting for SSL nodes) params. * http://uwsgi.readthedocs.io/en/latest/SNI.html :param str|unicode name: Node/server/host name. :param str|uni...
[ "def", "set_sni_params", "(", "self", ",", "name", ",", "cert", ",", "key", ",", "ciphers", "=", "None", ",", "client_ca", "=", "None", ",", "wildcard", "=", "False", ")", ":", "command", "=", "'sni'", "if", "wildcard", ":", "command", "+=", "'-regexp'...
Allows setting Server Name Identification (virtual hosting for SSL nodes) params. * http://uwsgi.readthedocs.io/en/latest/SNI.html :param str|unicode name: Node/server/host name. :param str|unicode cert: Certificate file. :param str|unicode key: Private key file. :param str|...
[ "Allows", "setting", "Server", "Name", "Identification", "(", "virtual", "hosting", "for", "SSL", "nodes", ")", "params", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/networking.py#L206-L243
train
idlesign/uwsgiconf
uwsgiconf/options/networking.py
Networking.set_sni_dir_params
def set_sni_dir_params(self, dir, ciphers=None): """Enable checking for cert/key/client_ca file in the specified directory and create a sni/ssl context on demand. Expected filenames: * <sni-name>.crt * <sni-name>.key * <sni-name>.ca - this file is optional ...
python
def set_sni_dir_params(self, dir, ciphers=None): """Enable checking for cert/key/client_ca file in the specified directory and create a sni/ssl context on demand. Expected filenames: * <sni-name>.crt * <sni-name>.key * <sni-name>.ca - this file is optional ...
[ "def", "set_sni_dir_params", "(", "self", ",", "dir", ",", "ciphers", "=", "None", ")", ":", "self", ".", "_set", "(", "'sni-dir'", ",", "dir", ")", "self", ".", "_set", "(", "'sni-dir-ciphers'", ",", "ciphers", ")", "return", "self", ".", "_section" ]
Enable checking for cert/key/client_ca file in the specified directory and create a sni/ssl context on demand. Expected filenames: * <sni-name>.crt * <sni-name>.key * <sni-name>.ca - this file is optional * http://uwsgi.readthedocs.io/en/latest/SNI.html#mass...
[ "Enable", "checking", "for", "cert", "/", "key", "/", "client_ca", "file", "in", "the", "specified", "directory", "and", "create", "a", "sni", "/", "ssl", "context", "on", "demand", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/networking.py#L245-L271
train
idlesign/uwsgiconf
uwsgiconf/options/queue.py
Queue.enable
def enable(self, size, block_size=None, store=None, store_sync_interval=None): """Enables shared queue of the given size. :param int size: Queue size. :param int block_size: Block size in bytes. Default: 8 KiB. :param str|unicode store: Persist the queue into file. :param int...
python
def enable(self, size, block_size=None, store=None, store_sync_interval=None): """Enables shared queue of the given size. :param int size: Queue size. :param int block_size: Block size in bytes. Default: 8 KiB. :param str|unicode store: Persist the queue into file. :param int...
[ "def", "enable", "(", "self", ",", "size", ",", "block_size", "=", "None", ",", "store", "=", "None", ",", "store_sync_interval", "=", "None", ")", ":", "self", ".", "_set", "(", "'queue'", ",", "size", ")", "self", ".", "_set", "(", "'queue-blocksize'...
Enables shared queue of the given size. :param int size: Queue size. :param int block_size: Block size in bytes. Default: 8 KiB. :param str|unicode store: Persist the queue into file. :param int store_sync_interval: Store sync interval in master cycles (usually seconds).
[ "Enables", "shared", "queue", "of", "the", "given", "size", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/queue.py#L15-L32
train
idlesign/uwsgiconf
uwsgiconf/options/locks.py
Locks.set_basic_params
def set_basic_params(self, count=None, thunder_lock=None, lock_engine=None): """ :param int count: Create the specified number of shared locks. :param bool thunder_lock: Serialize accept() usage (if possible) Could improve performance on Linux with robust pthread mutexes. ...
python
def set_basic_params(self, count=None, thunder_lock=None, lock_engine=None): """ :param int count: Create the specified number of shared locks. :param bool thunder_lock: Serialize accept() usage (if possible) Could improve performance on Linux with robust pthread mutexes. ...
[ "def", "set_basic_params", "(", "self", ",", "count", "=", "None", ",", "thunder_lock", "=", "None", ",", "lock_engine", "=", "None", ")", ":", "self", ".", "_set", "(", "'thunder-lock'", ",", "thunder_lock", ",", "cast", "=", "bool", ")", "self", ".", ...
:param int count: Create the specified number of shared locks. :param bool thunder_lock: Serialize accept() usage (if possible) Could improve performance on Linux with robust pthread mutexes. http://uwsgi.readthedocs.io/en/latest/articles/SerializingAccept.html :param str|unic...
[ ":", "param", "int", "count", ":", "Create", "the", "specified", "number", "of", "shared", "locks", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/locks.py#L11-L30
train
idlesign/uwsgiconf
uwsgiconf/options/locks.py
Locks.set_ipcsem_params
def set_ipcsem_params(self, ftok=None, persistent=None): """Sets ipcsem lock engine params. :param str|unicode ftok: Set the ipcsem key via ftok() for avoiding duplicates. :param bool persistent: Do not remove ipcsem's on shutdown. """ self._set('ftok', ftok) self._set...
python
def set_ipcsem_params(self, ftok=None, persistent=None): """Sets ipcsem lock engine params. :param str|unicode ftok: Set the ipcsem key via ftok() for avoiding duplicates. :param bool persistent: Do not remove ipcsem's on shutdown. """ self._set('ftok', ftok) self._set...
[ "def", "set_ipcsem_params", "(", "self", ",", "ftok", "=", "None", ",", "persistent", "=", "None", ")", ":", "self", ".", "_set", "(", "'ftok'", ",", "ftok", ")", "self", ".", "_set", "(", "'persistent-ipcsem'", ",", "persistent", ",", "cast", "=", "bo...
Sets ipcsem lock engine params. :param str|unicode ftok: Set the ipcsem key via ftok() for avoiding duplicates. :param bool persistent: Do not remove ipcsem's on shutdown.
[ "Sets", "ipcsem", "lock", "engine", "params", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/locks.py#L32-L43
train
idlesign/uwsgiconf
uwsgiconf/options/locks.py
Locks.lock_file
def lock_file(self, fpath, after_setup=False, wait=False): """Locks the specified file. :param str|unicode fpath: File path. :param bool after_setup: True - after logging/daemon setup False - before starting :param bool wait: True - wait if locked...
python
def lock_file(self, fpath, after_setup=False, wait=False): """Locks the specified file. :param str|unicode fpath: File path. :param bool after_setup: True - after logging/daemon setup False - before starting :param bool wait: True - wait if locked...
[ "def", "lock_file", "(", "self", ",", "fpath", ",", "after_setup", "=", "False", ",", "wait", "=", "False", ")", ":", "command", "=", "'flock-wait'", "if", "wait", "else", "'flock'", "if", "after_setup", ":", "command", "=", "'%s2'", "%", "command", "sel...
Locks the specified file. :param str|unicode fpath: File path. :param bool after_setup: True - after logging/daemon setup False - before starting :param bool wait: True - wait if locked False - exit if locked
[ "Locks", "the", "specified", "file", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/locks.py#L45-L66
train
idlesign/uwsgiconf
uwsgiconf/runtime/rpc.py
register_rpc
def register_rpc(name=None): """Decorator. Allows registering a function for RPC. * http://uwsgi.readthedocs.io/en/latest/RPC.html Example: .. code-block:: python @register_rpc() def expose_me(): do() :param str|unicode name: RPC function name to ass...
python
def register_rpc(name=None): """Decorator. Allows registering a function for RPC. * http://uwsgi.readthedocs.io/en/latest/RPC.html Example: .. code-block:: python @register_rpc() def expose_me(): do() :param str|unicode name: RPC function name to ass...
[ "def", "register_rpc", "(", "name", "=", "None", ")", ":", "def", "wrapper", "(", "func", ")", ":", "func_name", "=", "func", ".", "__name__", "rpc_name", "=", "name", "or", "func_name", "uwsgi", ".", "register_rpc", "(", "rpc_name", ",", "func", ")", ...
Decorator. Allows registering a function for RPC. * http://uwsgi.readthedocs.io/en/latest/RPC.html Example: .. code-block:: python @register_rpc() def expose_me(): do() :param str|unicode name: RPC function name to associate with decorated functi...
[ "Decorator", ".", "Allows", "registering", "a", "function", "for", "RPC", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/rpc.py#L7-L36
train
idlesign/uwsgiconf
uwsgiconf/runtime/rpc.py
make_rpc_call
def make_rpc_call(func_name, args=None, remote=None): """Performs an RPC function call (local or remote) with the given arguments. :param str|unicode func_name: RPC function name to call. :param Iterable args: Function arguments. :param str|unicode remote: :rtype: bytes|str :raises ValueErr...
python
def make_rpc_call(func_name, args=None, remote=None): """Performs an RPC function call (local or remote) with the given arguments. :param str|unicode func_name: RPC function name to call. :param Iterable args: Function arguments. :param str|unicode remote: :rtype: bytes|str :raises ValueErr...
[ "def", "make_rpc_call", "(", "func_name", ",", "args", "=", "None", ",", "remote", "=", "None", ")", ":", "args", "=", "args", "or", "[", "]", "args", "=", "[", "encode", "(", "str", "(", "arg", ")", ")", "for", "arg", "in", "args", "]", "if", ...
Performs an RPC function call (local or remote) with the given arguments. :param str|unicode func_name: RPC function name to call. :param Iterable args: Function arguments. :param str|unicode remote: :rtype: bytes|str :raises ValueError: If unable to call RPC function.
[ "Performs", "an", "RPC", "function", "call", "(", "local", "or", "remote", ")", "with", "the", "given", "arguments", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/rpc.py#L39-L61
train
idlesign/uwsgiconf
uwsgiconf/options/empire.py
Empire.set_emperor_command_params
def set_emperor_command_params( self, command_socket=None, wait_for_command=None, wait_for_command_exclude=None): """Emperor commands related parameters. * http://uwsgi-docs.readthedocs.io/en/latest/tutorials/EmperorSubscriptions.html :param str|unicode command_socket: ...
python
def set_emperor_command_params( self, command_socket=None, wait_for_command=None, wait_for_command_exclude=None): """Emperor commands related parameters. * http://uwsgi-docs.readthedocs.io/en/latest/tutorials/EmperorSubscriptions.html :param str|unicode command_socket: ...
[ "def", "set_emperor_command_params", "(", "self", ",", "command_socket", "=", "None", ",", "wait_for_command", "=", "None", ",", "wait_for_command_exclude", "=", "None", ")", ":", "self", ".", "_set", "(", "'emperor-command-socket'", ",", "command_socket", ")", "s...
Emperor commands related parameters. * http://uwsgi-docs.readthedocs.io/en/latest/tutorials/EmperorSubscriptions.html :param str|unicode command_socket: Enable the Emperor command socket. It is a channel allowing external process to govern vassals. :param bool wait_for_command: Al...
[ "Emperor", "commands", "related", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/empire.py#L62-L81
train
idlesign/uwsgiconf
uwsgiconf/options/empire.py
Empire.set_vassals_wrapper_params
def set_vassals_wrapper_params(self, wrapper=None, overrides=None, fallbacks=None): """Binary wrapper for vassals parameters. :param str|unicode wrapper: Set a binary wrapper for vassals. :param str|unicode|list[str|unicode] overrides: Set a binary wrapper for vassals to try before the default...
python
def set_vassals_wrapper_params(self, wrapper=None, overrides=None, fallbacks=None): """Binary wrapper for vassals parameters. :param str|unicode wrapper: Set a binary wrapper for vassals. :param str|unicode|list[str|unicode] overrides: Set a binary wrapper for vassals to try before the default...
[ "def", "set_vassals_wrapper_params", "(", "self", ",", "wrapper", "=", "None", ",", "overrides", "=", "None", ",", "fallbacks", "=", "None", ")", ":", "self", ".", "_set", "(", "'emperor-wrapper'", ",", "wrapper", ")", "self", ".", "_set", "(", "'emperor-w...
Binary wrapper for vassals parameters. :param str|unicode wrapper: Set a binary wrapper for vassals. :param str|unicode|list[str|unicode] overrides: Set a binary wrapper for vassals to try before the default one :param str|unicode|list[str|unicode] fallbacks: Set a binary wrapper for vassals ...
[ "Binary", "wrapper", "for", "vassals", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/empire.py#L83-L99
train
idlesign/uwsgiconf
uwsgiconf/options/empire.py
Empire.set_throttle_params
def set_throttle_params(self, level=None, level_max=None): """Throttling options. * http://uwsgi-docs.readthedocs.io/en/latest/Emperor.html#throttling * http://uwsgi-docs.readthedocs.io/en/latest/Emperor.html#loyalty :param int level: Set throttling level (in milliseconds) for bad beha...
python
def set_throttle_params(self, level=None, level_max=None): """Throttling options. * http://uwsgi-docs.readthedocs.io/en/latest/Emperor.html#throttling * http://uwsgi-docs.readthedocs.io/en/latest/Emperor.html#loyalty :param int level: Set throttling level (in milliseconds) for bad beha...
[ "def", "set_throttle_params", "(", "self", ",", "level", "=", "None", ",", "level_max", "=", "None", ")", ":", "self", ".", "_set", "(", "'emperor-throttle'", ",", "level", ")", "self", ".", "_set", "(", "'emperor-max-throttle'", ",", "level_max", ")", "re...
Throttling options. * http://uwsgi-docs.readthedocs.io/en/latest/Emperor.html#throttling * http://uwsgi-docs.readthedocs.io/en/latest/Emperor.html#loyalty :param int level: Set throttling level (in milliseconds) for bad behaving vassals. Default: 1000. :param int level_max: Set maximu...
[ "Throttling", "options", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/empire.py#L101-L116
train
idlesign/uwsgiconf
uwsgiconf/options/empire.py
Empire.set_tolerance_params
def set_tolerance_params(self, for_heartbeat=None, for_cursed_vassals=None): """Various tolerance options. :param int for_heartbeat: Set the Emperor tolerance about heartbeats. * http://uwsgi-docs.readthedocs.io/en/latest/Emperor.html#heartbeat-system :param int for_cursed_vassals...
python
def set_tolerance_params(self, for_heartbeat=None, for_cursed_vassals=None): """Various tolerance options. :param int for_heartbeat: Set the Emperor tolerance about heartbeats. * http://uwsgi-docs.readthedocs.io/en/latest/Emperor.html#heartbeat-system :param int for_cursed_vassals...
[ "def", "set_tolerance_params", "(", "self", ",", "for_heartbeat", "=", "None", ",", "for_cursed_vassals", "=", "None", ")", ":", "self", ".", "_set", "(", "'emperor-required-heartbeat'", ",", "for_heartbeat", ")", "self", ".", "_set", "(", "'emperor-curse-toleranc...
Various tolerance options. :param int for_heartbeat: Set the Emperor tolerance about heartbeats. * http://uwsgi-docs.readthedocs.io/en/latest/Emperor.html#heartbeat-system :param int for_cursed_vassals: Set the Emperor tolerance about cursed vassals. * http://uwsgi-docs.readt...
[ "Various", "tolerance", "options", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/empire.py#L118-L133
train
idlesign/uwsgiconf
uwsgiconf/options/empire.py
Empire.set_mode_tyrant_params
def set_mode_tyrant_params(self, enable=None, links_no_follow=None, use_initgroups=None): """Tyrant mode (secure multi-user hosting). In Tyrant mode the Emperor will run the vassal using the UID/GID of the vassal configuration file. * http://uwsgi-docs.readthedocs.io/en/latest/Emperor....
python
def set_mode_tyrant_params(self, enable=None, links_no_follow=None, use_initgroups=None): """Tyrant mode (secure multi-user hosting). In Tyrant mode the Emperor will run the vassal using the UID/GID of the vassal configuration file. * http://uwsgi-docs.readthedocs.io/en/latest/Emperor....
[ "def", "set_mode_tyrant_params", "(", "self", ",", "enable", "=", "None", ",", "links_no_follow", "=", "None", ",", "use_initgroups", "=", "None", ")", ":", "self", ".", "_set", "(", "'emperor-tyrant'", ",", "enable", ",", "cast", "=", "bool", ")", "self",...
Tyrant mode (secure multi-user hosting). In Tyrant mode the Emperor will run the vassal using the UID/GID of the vassal configuration file. * http://uwsgi-docs.readthedocs.io/en/latest/Emperor.html#tyrant-mode-secure-multi-user-hosting :param enable: Puts the Emperor in Tyrant mode. ...
[ "Tyrant", "mode", "(", "secure", "multi", "-", "user", "hosting", ")", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/empire.py#L135-L154
train
idlesign/uwsgiconf
uwsgiconf/options/empire.py
Empire.set_mode_broodlord_params
def set_mode_broodlord_params( self, zerg_count=None, vassal_overload_sos_interval=None, vassal_queue_items_sos=None): """This mode is a way for a vassal to ask for reinforcements to the Emperor. Reinforcements are new vassals spawned on demand generally bound on the same socket...
python
def set_mode_broodlord_params( self, zerg_count=None, vassal_overload_sos_interval=None, vassal_queue_items_sos=None): """This mode is a way for a vassal to ask for reinforcements to the Emperor. Reinforcements are new vassals spawned on demand generally bound on the same socket...
[ "def", "set_mode_broodlord_params", "(", "self", ",", "zerg_count", "=", "None", ",", "vassal_overload_sos_interval", "=", "None", ",", "vassal_queue_items_sos", "=", "None", ")", ":", "self", ".", "_set", "(", "'emperor-broodlord'", ",", "zerg_count", ")", "self"...
This mode is a way for a vassal to ask for reinforcements to the Emperor. Reinforcements are new vassals spawned on demand generally bound on the same socket. .. warning:: If you are looking for a way to dynamically adapt the number of workers of an instance, check the Cheaper subsystem - ...
[ "This", "mode", "is", "a", "way", "for", "a", "vassal", "to", "ask", "for", "reinforcements", "to", "the", "Emperor", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/empire.py#L156-L181
train
idlesign/uwsgiconf
uwsgiconf/options/workers.py
Workers.run_command_as_worker
def run_command_as_worker(self, command, after_post_fork_hook=False): """Run the specified command as worker. :param str|unicode command: :param bool after_post_fork_hook: Whether to run it after `post_fork` hook. """ self._set('worker-exec2' if after_post_fork_hook else 'work...
python
def run_command_as_worker(self, command, after_post_fork_hook=False): """Run the specified command as worker. :param str|unicode command: :param bool after_post_fork_hook: Whether to run it after `post_fork` hook. """ self._set('worker-exec2' if after_post_fork_hook else 'work...
[ "def", "run_command_as_worker", "(", "self", ",", "command", ",", "after_post_fork_hook", "=", "False", ")", ":", "self", ".", "_set", "(", "'worker-exec2'", "if", "after_post_fork_hook", "else", "'worker-exec'", ",", "command", ",", "multi", "=", "True", ")", ...
Run the specified command as worker. :param str|unicode command: :param bool after_post_fork_hook: Whether to run it after `post_fork` hook.
[ "Run", "the", "specified", "command", "as", "worker", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/workers.py#L106-L116
train
idlesign/uwsgiconf
uwsgiconf/options/workers.py
Workers.set_count_auto
def set_count_auto(self, count=None): """Sets workers count. By default sets it to detected number of available cores :param int count: """ count = count or self._section.vars.CPU_CORES self._set('workers', count) return self._section
python
def set_count_auto(self, count=None): """Sets workers count. By default sets it to detected number of available cores :param int count: """ count = count or self._section.vars.CPU_CORES self._set('workers', count) return self._section
[ "def", "set_count_auto", "(", "self", ",", "count", "=", "None", ")", ":", "count", "=", "count", "or", "self", ".", "_section", ".", "vars", ".", "CPU_CORES", "self", ".", "_set", "(", "'workers'", ",", "count", ")", "return", "self", ".", "_section" ...
Sets workers count. By default sets it to detected number of available cores :param int count:
[ "Sets", "workers", "count", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/workers.py#L118-L129
train
idlesign/uwsgiconf
uwsgiconf/options/workers.py
Workers.set_thread_params
def set_thread_params( self, enable=None, count=None, count_offload=None, stack_size=None, no_wait=None): """Sets threads related params. :param bool enable: Enable threads in the embedded languages. This will allow to spawn threads in your app. .. warning:: Threads...
python
def set_thread_params( self, enable=None, count=None, count_offload=None, stack_size=None, no_wait=None): """Sets threads related params. :param bool enable: Enable threads in the embedded languages. This will allow to spawn threads in your app. .. warning:: Threads...
[ "def", "set_thread_params", "(", "self", ",", "enable", "=", "None", ",", "count", "=", "None", ",", "count_offload", "=", "None", ",", "stack_size", "=", "None", ",", "no_wait", "=", "None", ")", ":", "self", ".", "_set", "(", "'enable-threads'", ",", ...
Sets threads related params. :param bool enable: Enable threads in the embedded languages. This will allow to spawn threads in your app. .. warning:: Threads will simply *not work* if this option is not enabled. There will likely be no error, just no execution of your t...
[ "Sets", "threads", "related", "params", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/workers.py#L131-L174
train
idlesign/uwsgiconf
uwsgiconf/options/workers.py
Workers.set_mules_params
def set_mules_params( self, mules=None, touch_reload=None, harakiri_timeout=None, farms=None, reload_mercy=None, msg_buffer=None, msg_buffer_recv=None): """Sets mules related params. http://uwsgi.readthedocs.io/en/latest/Mules.html Mules are worker processes living in t...
python
def set_mules_params( self, mules=None, touch_reload=None, harakiri_timeout=None, farms=None, reload_mercy=None, msg_buffer=None, msg_buffer_recv=None): """Sets mules related params. http://uwsgi.readthedocs.io/en/latest/Mules.html Mules are worker processes living in t...
[ "def", "set_mules_params", "(", "self", ",", "mules", "=", "None", ",", "touch_reload", "=", "None", ",", "harakiri_timeout", "=", "None", ",", "farms", "=", "None", ",", "reload_mercy", "=", "None", ",", "msg_buffer", "=", "None", ",", "msg_buffer_recv", ...
Sets mules related params. http://uwsgi.readthedocs.io/en/latest/Mules.html Mules are worker processes living in the uWSGI stack but not reachable via socket connections, that can be used as a generic subsystem to offload tasks. :param int|list mules: Add the specified mules or number...
[ "Sets", "mules", "related", "params", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/workers.py#L176-L241
train
idlesign/uwsgiconf
uwsgiconf/options/workers.py
Workers.set_reload_params
def set_reload_params( self, min_lifetime=None, max_lifetime=None, max_requests=None, max_requests_delta=None, max_addr_space=None, max_rss=None, max_uss=None, max_pss=None, max_addr_space_forced=None, max_rss_forced=None, watch_interval_forced=None, mercy=Non...
python
def set_reload_params( self, min_lifetime=None, max_lifetime=None, max_requests=None, max_requests_delta=None, max_addr_space=None, max_rss=None, max_uss=None, max_pss=None, max_addr_space_forced=None, max_rss_forced=None, watch_interval_forced=None, mercy=Non...
[ "def", "set_reload_params", "(", "self", ",", "min_lifetime", "=", "None", ",", "max_lifetime", "=", "None", ",", "max_requests", "=", "None", ",", "max_requests_delta", "=", "None", ",", "max_addr_space", "=", "None", ",", "max_rss", "=", "None", ",", "max_...
Sets workers reload parameters. :param int min_lifetime: A worker cannot be destroyed/reloaded unless it has been alive for N seconds (default 60). This is an anti-fork-bomb measure. Since 1.9 :param int max_lifetime: Reload workers after this many seconds. Disabled by default....
[ "Sets", "workers", "reload", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/workers.py#L243-L319
train
idlesign/uwsgiconf
uwsgiconf/options/workers.py
Workers.set_reload_on_exception_params
def set_reload_on_exception_params(self, do_reload=None, etype=None, evalue=None, erepr=None): """Sets workers reload on exceptions parameters. :param bool do_reload: Reload a worker when an exception is raised. :param str etype: Reload a worker when a specific exception type is raised. ...
python
def set_reload_on_exception_params(self, do_reload=None, etype=None, evalue=None, erepr=None): """Sets workers reload on exceptions parameters. :param bool do_reload: Reload a worker when an exception is raised. :param str etype: Reload a worker when a specific exception type is raised. ...
[ "def", "set_reload_on_exception_params", "(", "self", ",", "do_reload", "=", "None", ",", "etype", "=", "None", ",", "evalue", "=", "None", ",", "erepr", "=", "None", ")", ":", "self", ".", "_set", "(", "'reload-on-exception'", ",", "do_reload", ",", "cast...
Sets workers reload on exceptions parameters. :param bool do_reload: Reload a worker when an exception is raised. :param str etype: Reload a worker when a specific exception type is raised. :param str evalue: Reload a worker when a specific exception value is raised. :param str erepr...
[ "Sets", "workers", "reload", "on", "exceptions", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/workers.py#L321-L338
train
idlesign/uwsgiconf
uwsgiconf/options/workers.py
Workers.set_harakiri_params
def set_harakiri_params(self, timeout=None, verbose=None, disable_for_arh=None): """Sets workers harakiri parameters. :param int timeout: Harakiri timeout in seconds. Every request that will take longer than the seconds specified in the harakiri timeout will be dropped and the c...
python
def set_harakiri_params(self, timeout=None, verbose=None, disable_for_arh=None): """Sets workers harakiri parameters. :param int timeout: Harakiri timeout in seconds. Every request that will take longer than the seconds specified in the harakiri timeout will be dropped and the c...
[ "def", "set_harakiri_params", "(", "self", ",", "timeout", "=", "None", ",", "verbose", "=", "None", ",", "disable_for_arh", "=", "None", ")", ":", "self", ".", "_set", "(", "'harakiri'", ",", "timeout", ")", "self", ".", "_set", "(", "'harakiri-verbose'",...
Sets workers harakiri parameters. :param int timeout: Harakiri timeout in seconds. Every request that will take longer than the seconds specified in the harakiri timeout will be dropped and the corresponding worker is thereafter recycled. :param bool verbose: Haraki...
[ "Sets", "workers", "harakiri", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/workers.py#L340-L360
train
idlesign/uwsgiconf
uwsgiconf/options/workers.py
Workers.set_zerg_server_params
def set_zerg_server_params(self, socket, clients_socket_pool=None): """Zerg mode. Zerg server params. When your site load is variable, it would be nice to be able to add workers dynamically. Enabling Zerg mode you can allow zerg clients to attach to your already running server and help ...
python
def set_zerg_server_params(self, socket, clients_socket_pool=None): """Zerg mode. Zerg server params. When your site load is variable, it would be nice to be able to add workers dynamically. Enabling Zerg mode you can allow zerg clients to attach to your already running server and help ...
[ "def", "set_zerg_server_params", "(", "self", ",", "socket", ",", "clients_socket_pool", "=", "None", ")", ":", "if", "clients_socket_pool", ":", "self", ".", "_set", "(", "'zergpool'", ",", "'%s:%s'", "%", "(", "socket", ",", "','", ".", "join", "(", "lis...
Zerg mode. Zerg server params. When your site load is variable, it would be nice to be able to add workers dynamically. Enabling Zerg mode you can allow zerg clients to attach to your already running server and help it in the work. * http://uwsgi-docs.readthedocs.io/en/latest/Zerg.html...
[ "Zerg", "mode", ".", "Zerg", "server", "params", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/workers.py#L362-L392
train
idlesign/uwsgiconf
uwsgiconf/options/workers.py
Workers.set_zerg_client_params
def set_zerg_client_params(self, server_sockets, use_fallback_socket=None): """Zerg mode. Zergs params. :param str|unicode|list[str|unicode] server_sockets: Attaches zerg to a zerg server. :param bool use_fallback_socket: Fallback to normal sockets if the zerg server is not available ...
python
def set_zerg_client_params(self, server_sockets, use_fallback_socket=None): """Zerg mode. Zergs params. :param str|unicode|list[str|unicode] server_sockets: Attaches zerg to a zerg server. :param bool use_fallback_socket: Fallback to normal sockets if the zerg server is not available ...
[ "def", "set_zerg_client_params", "(", "self", ",", "server_sockets", ",", "use_fallback_socket", "=", "None", ")", ":", "self", ".", "_set", "(", "'zerg'", ",", "server_sockets", ",", "multi", "=", "True", ")", "if", "use_fallback_socket", "is", "not", "None",...
Zerg mode. Zergs params. :param str|unicode|list[str|unicode] server_sockets: Attaches zerg to a zerg server. :param bool use_fallback_socket: Fallback to normal sockets if the zerg server is not available
[ "Zerg", "mode", ".", "Zergs", "params", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/workers.py#L394-L410
train
idlesign/uwsgiconf
uwsgiconf/formatters.py
format_print_text
def format_print_text(text, color_fg=None, color_bg=None): """Format given text using ANSI formatting escape sequences. Could be useful gfor print command. :param str|unicode text: :param str|unicode color_fg: text (foreground) color :param str|unicode color_bg: text (background) color :rtype:...
python
def format_print_text(text, color_fg=None, color_bg=None): """Format given text using ANSI formatting escape sequences. Could be useful gfor print command. :param str|unicode text: :param str|unicode color_fg: text (foreground) color :param str|unicode color_bg: text (background) color :rtype:...
[ "def", "format_print_text", "(", "text", ",", "color_fg", "=", "None", ",", "color_bg", "=", "None", ")", ":", "from", ".", "config", "import", "Section", "color_fg", "=", "{", "'black'", ":", "'30'", ",", "'red'", ":", "'31'", ",", "'reder'", ":", "'9...
Format given text using ANSI formatting escape sequences. Could be useful gfor print command. :param str|unicode text: :param str|unicode color_fg: text (foreground) color :param str|unicode color_bg: text (background) color :rtype: str|unicode
[ "Format", "given", "text", "using", "ANSI", "formatting", "escape", "sequences", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/formatters.py#L3-L66
train
idlesign/uwsgiconf
uwsgiconf/formatters.py
FormatterBase.iter_options
def iter_options(self): """Iterates configuration sections groups options.""" for section in self.sections: name = str(section) for key, value in section._get_options(): yield name, key, value
python
def iter_options(self): """Iterates configuration sections groups options.""" for section in self.sections: name = str(section) for key, value in section._get_options(): yield name, key, value
[ "def", "iter_options", "(", "self", ")", ":", "for", "section", "in", "self", ".", "sections", ":", "name", "=", "str", "(", "section", ")", "for", "key", ",", "value", "in", "section", ".", "_get_options", "(", ")", ":", "yield", "name", ",", "key",...
Iterates configuration sections groups options.
[ "Iterates", "configuration", "sections", "groups", "options", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/formatters.py#L75-L80
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.set_memory_params
def set_memory_params(self, ksm_interval=None, no_swap=None): """Set memory related parameters. :param int ksm_interval: Kernel Samepage Merging frequency option, that can reduce memory usage. Accepts a number of requests (or master process cycles) to run page scanner after. .....
python
def set_memory_params(self, ksm_interval=None, no_swap=None): """Set memory related parameters. :param int ksm_interval: Kernel Samepage Merging frequency option, that can reduce memory usage. Accepts a number of requests (or master process cycles) to run page scanner after. .....
[ "def", "set_memory_params", "(", "self", ",", "ksm_interval", "=", "None", ",", "no_swap", "=", "None", ")", ":", "self", ".", "_set", "(", "'ksm'", ",", "ksm_interval", ")", "self", ".", "_set", "(", "'never_swap'", ",", "no_swap", ",", "cast", "=", "...
Set memory related parameters. :param int ksm_interval: Kernel Samepage Merging frequency option, that can reduce memory usage. Accepts a number of requests (or master process cycles) to run page scanner after. .. note:: Linux only. * http://uwsgi.readthedocs.io/en/latest/...
[ "Set", "memory", "related", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L209-L225
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.daemonize
def daemonize(self, log_into, after_app_loading=False): """Daemonize uWSGI. :param str|unicode log_into: Logging destination: * File: /tmp/mylog.log * UPD: 192.168.1.2:1717 .. note:: This will require an UDP server to manage log messages. U...
python
def daemonize(self, log_into, after_app_loading=False): """Daemonize uWSGI. :param str|unicode log_into: Logging destination: * File: /tmp/mylog.log * UPD: 192.168.1.2:1717 .. note:: This will require an UDP server to manage log messages. U...
[ "def", "daemonize", "(", "self", ",", "log_into", ",", "after_app_loading", "=", "False", ")", ":", "self", ".", "_set", "(", "'daemonize2'", "if", "after_app_loading", "else", "'daemonize'", ",", "log_into", ")", "return", "self", ".", "_section" ]
Daemonize uWSGI. :param str|unicode log_into: Logging destination: * File: /tmp/mylog.log * UPD: 192.168.1.2:1717 .. note:: This will require an UDP server to manage log messages. Use ``networking.register_socket('192.168.1.2:1717, type=networking....
[ "Daemonize", "uWSGI", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L227-L246
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.change_dir
def change_dir(self, to, after_app_loading=False): """Chdir to specified directory before or after apps loading. :param str|unicode to: Target directory. :param bool after_app_loading: *True* - after load *False* - before load """ self._set('chd...
python
def change_dir(self, to, after_app_loading=False): """Chdir to specified directory before or after apps loading. :param str|unicode to: Target directory. :param bool after_app_loading: *True* - after load *False* - before load """ self._set('chd...
[ "def", "change_dir", "(", "self", ",", "to", ",", "after_app_loading", "=", "False", ")", ":", "self", ".", "_set", "(", "'chdir2'", "if", "after_app_loading", "else", "'chdir'", ",", "to", ")", "return", "self", ".", "_section" ]
Chdir to specified directory before or after apps loading. :param str|unicode to: Target directory. :param bool after_app_loading: *True* - after load *False* - before load
[ "Chdir", "to", "specified", "directory", "before", "or", "after", "apps", "loading", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L248-L260
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.set_owner_params
def set_owner_params(self, uid=None, gid=None, add_gids=None, set_asap=False): """Set process owner params - user, group. :param str|unicode|int uid: Set uid to the specified username or uid. :param str|unicode|int gid: Set gid to the specified groupname or gid. :param list|str|unicod...
python
def set_owner_params(self, uid=None, gid=None, add_gids=None, set_asap=False): """Set process owner params - user, group. :param str|unicode|int uid: Set uid to the specified username or uid. :param str|unicode|int gid: Set gid to the specified groupname or gid. :param list|str|unicod...
[ "def", "set_owner_params", "(", "self", ",", "uid", "=", "None", ",", "gid", "=", "None", ",", "add_gids", "=", "None", ",", "set_asap", "=", "False", ")", ":", "prefix", "=", "'immediate-'", "if", "set_asap", "else", "''", "self", ".", "_set", "(", ...
Set process owner params - user, group. :param str|unicode|int uid: Set uid to the specified username or uid. :param str|unicode|int gid: Set gid to the specified groupname or gid. :param list|str|unicode|int add_gids: Add the specified group id to the process credentials. This op...
[ "Set", "process", "owner", "params", "-", "user", "group", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L262-L287
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.get_owner
def get_owner(self, default=True): """Return (User ID, Group ID) tuple :param bool default: Whether to return default if not set. :rtype: tuple[int, int] """ uid, gid = self.owner if not uid and default: uid = os.getuid() if not gid and default: ...
python
def get_owner(self, default=True): """Return (User ID, Group ID) tuple :param bool default: Whether to return default if not set. :rtype: tuple[int, int] """ uid, gid = self.owner if not uid and default: uid = os.getuid() if not gid and default: ...
[ "def", "get_owner", "(", "self", ",", "default", "=", "True", ")", ":", "uid", ",", "gid", "=", "self", ".", "owner", "if", "not", "uid", "and", "default", ":", "uid", "=", "os", ".", "getuid", "(", ")", "if", "not", "gid", "and", "default", ":",...
Return (User ID, Group ID) tuple :param bool default: Whether to return default if not set. :rtype: tuple[int, int]
[ "Return", "(", "User", "ID", "Group", "ID", ")", "tuple" ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L289-L303
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.set_hook
def set_hook(self, phase, action): """Allows setting hooks (attaching actions) for various uWSGI phases. :param str|unicode phase: See constants in ``.phases``. :param str|unicode|list|HookAction|list[HookAction] action: """ self._set('hook-%s' % phase, action, multi=True) ...
python
def set_hook(self, phase, action): """Allows setting hooks (attaching actions) for various uWSGI phases. :param str|unicode phase: See constants in ``.phases``. :param str|unicode|list|HookAction|list[HookAction] action: """ self._set('hook-%s' % phase, action, multi=True) ...
[ "def", "set_hook", "(", "self", ",", "phase", ",", "action", ")", ":", "self", ".", "_set", "(", "'hook-%s'", "%", "phase", ",", "action", ",", "multi", "=", "True", ")", "return", "self", ".", "_section" ]
Allows setting hooks (attaching actions) for various uWSGI phases. :param str|unicode phase: See constants in ``.phases``. :param str|unicode|list|HookAction|list[HookAction] action:
[ "Allows", "setting", "hooks", "(", "attaching", "actions", ")", "for", "various", "uWSGI", "phases", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L305-L315
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.set_hook_touch
def set_hook_touch(self, fpath, action): """Allows running certain action when the specified file is touched. :param str|unicode fpath: File path. :param str|unicode|list|HookAction|list[HookAction] action: """ self._set('hook-touch', '%s %s' % (fpath, action), multi=True) ...
python
def set_hook_touch(self, fpath, action): """Allows running certain action when the specified file is touched. :param str|unicode fpath: File path. :param str|unicode|list|HookAction|list[HookAction] action: """ self._set('hook-touch', '%s %s' % (fpath, action), multi=True) ...
[ "def", "set_hook_touch", "(", "self", ",", "fpath", ",", "action", ")", ":", "self", ".", "_set", "(", "'hook-touch'", ",", "'%s %s'", "%", "(", "fpath", ",", "action", ")", ",", "multi", "=", "True", ")", "return", "self", ".", "_section" ]
Allows running certain action when the specified file is touched. :param str|unicode fpath: File path. :param str|unicode|list|HookAction|list[HookAction] action:
[ "Allows", "running", "certain", "action", "when", "the", "specified", "file", "is", "touched", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L317-L327
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.set_hook_after_request
def set_hook_after_request(self, func): """Run the specified function/symbol (C level) after each request. :param str|unicode func: """ self._set('after-request-hook', func, multi=True) return self._section
python
def set_hook_after_request(self, func): """Run the specified function/symbol (C level) after each request. :param str|unicode func: """ self._set('after-request-hook', func, multi=True) return self._section
[ "def", "set_hook_after_request", "(", "self", ",", "func", ")", ":", "self", ".", "_set", "(", "'after-request-hook'", ",", "func", ",", "multi", "=", "True", ")", "return", "self", ".", "_section" ]
Run the specified function/symbol (C level) after each request. :param str|unicode func:
[ "Run", "the", "specified", "function", "/", "symbol", "(", "C", "level", ")", "after", "each", "request", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L329-L337
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.set_on_exit_params
def set_on_exit_params(self, skip_hooks=None, skip_teardown=None): """Set params related to process exit procedure. :param bool skip_hooks: Skip ``EXIT`` phase hook. .. note:: Ignored by the master. :param bool skip_teardown: Allows skipping teardown (finalization) processes for s...
python
def set_on_exit_params(self, skip_hooks=None, skip_teardown=None): """Set params related to process exit procedure. :param bool skip_hooks: Skip ``EXIT`` phase hook. .. note:: Ignored by the master. :param bool skip_teardown: Allows skipping teardown (finalization) processes for s...
[ "def", "set_on_exit_params", "(", "self", ",", "skip_hooks", "=", "None", ",", "skip_teardown", "=", "None", ")", ":", "self", ".", "_set", "(", "'skip-atexit'", ",", "skip_hooks", ",", "cast", "=", "bool", ")", "self", ".", "_set", "(", "'skip-atexit-tear...
Set params related to process exit procedure. :param bool skip_hooks: Skip ``EXIT`` phase hook. .. note:: Ignored by the master. :param bool skip_teardown: Allows skipping teardown (finalization) processes for some plugins. .. note:: Ignored by the master. Suppor...
[ "Set", "params", "related", "to", "process", "exit", "procedure", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L339-L358
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.run_command_on_event
def run_command_on_event(self, command, phase=phases.ASAP): """Run the given command on a given phase. :param str|unicode command: :param str|unicode phase: See constants in ``Phases`` class. """ self._set('exec-%s' % phase, command, multi=True) return self._section
python
def run_command_on_event(self, command, phase=phases.ASAP): """Run the given command on a given phase. :param str|unicode command: :param str|unicode phase: See constants in ``Phases`` class. """ self._set('exec-%s' % phase, command, multi=True) return self._section
[ "def", "run_command_on_event", "(", "self", ",", "command", ",", "phase", "=", "phases", ".", "ASAP", ")", ":", "self", ".", "_set", "(", "'exec-%s'", "%", "phase", ",", "command", ",", "multi", "=", "True", ")", "return", "self", ".", "_section" ]
Run the given command on a given phase. :param str|unicode command: :param str|unicode phase: See constants in ``Phases`` class.
[ "Run", "the", "given", "command", "on", "a", "given", "phase", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L360-L370
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.run_command_on_touch
def run_command_on_touch(self, command, target): """Run command when the specified file is modified/touched. :param str|unicode command: :param str|unicode target: File path. """ self._set('touch-exec', '%s %s' % (target, command), multi=True) return self._section
python
def run_command_on_touch(self, command, target): """Run command when the specified file is modified/touched. :param str|unicode command: :param str|unicode target: File path. """ self._set('touch-exec', '%s %s' % (target, command), multi=True) return self._section
[ "def", "run_command_on_touch", "(", "self", ",", "command", ",", "target", ")", ":", "self", ".", "_set", "(", "'touch-exec'", ",", "'%s %s'", "%", "(", "target", ",", "command", ")", ",", "multi", "=", "True", ")", "return", "self", ".", "_section" ]
Run command when the specified file is modified/touched. :param str|unicode command: :param str|unicode target: File path.
[ "Run", "command", "when", "the", "specified", "file", "is", "modified", "/", "touched", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L372-L382
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.set_pid_file
def set_pid_file(self, fpath, before_priv_drop=True, safe=False): """Creates pidfile before or after privileges drop. :param str|unicode fpath: File path. :param bool before_priv_drop: Whether to create pidfile before privileges are dropped. .. note:: Vacuum is made after privileg...
python
def set_pid_file(self, fpath, before_priv_drop=True, safe=False): """Creates pidfile before or after privileges drop. :param str|unicode fpath: File path. :param bool before_priv_drop: Whether to create pidfile before privileges are dropped. .. note:: Vacuum is made after privileg...
[ "def", "set_pid_file", "(", "self", ",", "fpath", ",", "before_priv_drop", "=", "True", ",", "safe", "=", "False", ")", ":", "command", "=", "'pidfile'", "if", "not", "before_priv_drop", ":", "command", "+=", "'2'", "if", "safe", ":", "command", "=", "'s...
Creates pidfile before or after privileges drop. :param str|unicode fpath: File path. :param bool before_priv_drop: Whether to create pidfile before privileges are dropped. .. note:: Vacuum is made after privileges drop, so it may not be able to delete PID file if it was c...
[ "Creates", "pidfile", "before", "or", "after", "privileges", "drop", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L384-L410
train
idlesign/uwsgiconf
uwsgiconf/options/main_process.py
MainProcess.set_naming_params
def set_naming_params(self, autonaming=None, prefix=None, suffix=None, name=None): """Setups processes naming parameters. :param bool autonaming: Automatically set process name to something meaningful. Generated process names may be 'uWSGI Master', 'uWSGI Worker #', etc. :param str...
python
def set_naming_params(self, autonaming=None, prefix=None, suffix=None, name=None): """Setups processes naming parameters. :param bool autonaming: Automatically set process name to something meaningful. Generated process names may be 'uWSGI Master', 'uWSGI Worker #', etc. :param str...
[ "def", "set_naming_params", "(", "self", ",", "autonaming", "=", "None", ",", "prefix", "=", "None", ",", "suffix", "=", "None", ",", "name", "=", "None", ")", ":", "self", ".", "_set", "(", "'auto-procname'", ",", "autonaming", ",", "cast", "=", "bool...
Setups processes naming parameters. :param bool autonaming: Automatically set process name to something meaningful. Generated process names may be 'uWSGI Master', 'uWSGI Worker #', etc. :param str|unicode prefix: Add prefix to process names. :param str|unicode suffix: Append strin...
[ "Setups", "processes", "naming", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L412-L430
train
idlesign/uwsgiconf
uwsgiconf/cli.py
errorprint
def errorprint(): """Print out descriptions from ConfigurationError.""" try: yield except ConfigurationError as e: click.secho('%s' % e, err=True, fg='red') sys.exit(1)
python
def errorprint(): """Print out descriptions from ConfigurationError.""" try: yield except ConfigurationError as e: click.secho('%s' % e, err=True, fg='red') sys.exit(1)
[ "def", "errorprint", "(", ")", ":", "try", ":", "yield", "except", "ConfigurationError", "as", "e", ":", "click", ".", "secho", "(", "'%s'", "%", "e", ",", "err", "=", "True", ",", "fg", "=", "'red'", ")", "sys", ".", "exit", "(", "1", ")" ]
Print out descriptions from ConfigurationError.
[ "Print", "out", "descriptions", "from", "ConfigurationError", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/cli.py#L13-L20
train
idlesign/uwsgiconf
uwsgiconf/cli.py
run
def run(conf, only): """Runs uWSGI passing to it using the default or another `uwsgiconf` configuration module. """ with errorprint(): config = ConfModule(conf) spawned = config.spawn_uwsgi(only) for alias, pid in spawned: click.secho("Spawned uWSGI for configuration al...
python
def run(conf, only): """Runs uWSGI passing to it using the default or another `uwsgiconf` configuration module. """ with errorprint(): config = ConfModule(conf) spawned = config.spawn_uwsgi(only) for alias, pid in spawned: click.secho("Spawned uWSGI for configuration al...
[ "def", "run", "(", "conf", ",", "only", ")", ":", "with", "errorprint", "(", ")", ":", "config", "=", "ConfModule", "(", "conf", ")", "spawned", "=", "config", ".", "spawn_uwsgi", "(", "only", ")", "for", "alias", ",", "pid", "in", "spawned", ":", ...
Runs uWSGI passing to it using the default or another `uwsgiconf` configuration module.
[ "Runs", "uWSGI", "passing", "to", "it", "using", "the", "default", "or", "another", "uwsgiconf", "configuration", "module", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/cli.py#L39-L48
train
idlesign/uwsgiconf
uwsgiconf/cli.py
compile
def compile(conf): """Compiles classic uWSGI configuration file using the default or given `uwsgiconf` configuration module. """ with errorprint(): config = ConfModule(conf) for conf in config.configurations: conf.format(do_print=True)
python
def compile(conf): """Compiles classic uWSGI configuration file using the default or given `uwsgiconf` configuration module. """ with errorprint(): config = ConfModule(conf) for conf in config.configurations: conf.format(do_print=True)
[ "def", "compile", "(", "conf", ")", ":", "with", "errorprint", "(", ")", ":", "config", "=", "ConfModule", "(", "conf", ")", "for", "conf", "in", "config", ".", "configurations", ":", "conf", ".", "format", "(", "do_print", "=", "True", ")" ]
Compiles classic uWSGI configuration file using the default or given `uwsgiconf` configuration module.
[ "Compiles", "classic", "uWSGI", "configuration", "file", "using", "the", "default", "or", "given", "uwsgiconf", "configuration", "module", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/cli.py#L53-L61
train
idlesign/uwsgiconf
uwsgiconf/cli.py
sysinit
def sysinit(systype, conf, project): """Outputs configuration for system initialization subsystem.""" click.secho(get_config( systype, conf=ConfModule(conf).configurations[0], conf_path=conf, project_name=project, ))
python
def sysinit(systype, conf, project): """Outputs configuration for system initialization subsystem.""" click.secho(get_config( systype, conf=ConfModule(conf).configurations[0], conf_path=conf, project_name=project, ))
[ "def", "sysinit", "(", "systype", ",", "conf", ",", "project", ")", ":", "click", ".", "secho", "(", "get_config", "(", "systype", ",", "conf", "=", "ConfModule", "(", "conf", ")", ".", "configurations", "[", "0", "]", ",", "conf_path", "=", "conf", ...
Outputs configuration for system initialization subsystem.
[ "Outputs", "configuration", "for", "system", "initialization", "subsystem", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/cli.py#L68-L76
train
idlesign/uwsgiconf
uwsgiconf/cli.py
probe_plugins
def probe_plugins(): """Runs uWSGI to determine what plugins are available and prints them out. Generic plugins come first then after blank line follow request plugins. """ plugins = UwsgiRunner().get_plugins() for plugin in sorted(plugins.generic): click.secho(plugin) click.secho(''...
python
def probe_plugins(): """Runs uWSGI to determine what plugins are available and prints them out. Generic plugins come first then after blank line follow request plugins. """ plugins = UwsgiRunner().get_plugins() for plugin in sorted(plugins.generic): click.secho(plugin) click.secho(''...
[ "def", "probe_plugins", "(", ")", ":", "plugins", "=", "UwsgiRunner", "(", ")", ".", "get_plugins", "(", ")", "for", "plugin", "in", "sorted", "(", "plugins", ".", "generic", ")", ":", "click", ".", "secho", "(", "plugin", ")", "click", ".", "secho", ...
Runs uWSGI to determine what plugins are available and prints them out. Generic plugins come first then after blank line follow request plugins.
[ "Runs", "uWSGI", "to", "determine", "what", "plugins", "are", "available", "and", "prints", "them", "out", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/cli.py#L80-L94
train
idlesign/uwsgiconf
uwsgiconf/runtime/signals.py
Signal.register_handler
def register_handler(self, target=None): """Decorator for a function to be used as a signal handler. :param str|unicode target: Where this signal will be delivered to. Default: ``worker``. * ``workers`` - run the signal handler on all the workers * ``workerN`` - run the signal...
python
def register_handler(self, target=None): """Decorator for a function to be used as a signal handler. :param str|unicode target: Where this signal will be delivered to. Default: ``worker``. * ``workers`` - run the signal handler on all the workers * ``workerN`` - run the signal...
[ "def", "register_handler", "(", "self", ",", "target", "=", "None", ")", ":", "target", "=", "target", "or", "'worker'", "sign_num", "=", "self", ".", "num", "def", "wrapper", "(", "func", ")", ":", "_LOG", ".", "debug", "(", "\"Registering '%s' as signal ...
Decorator for a function to be used as a signal handler. :param str|unicode target: Where this signal will be delivered to. Default: ``worker``. * ``workers`` - run the signal handler on all the workers * ``workerN`` - run the signal handler only on worker N * ``worker``/`...
[ "Decorator", "for", "a", "function", "to", "be", "used", "as", "a", "signal", "handler", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/signals.py#L48-L79
train
idlesign/uwsgiconf
uwsgiconf/options/spooler.py
Spooler.add
def add(self, work_dir, external=False): """Run a spooler on the specified directory. :param str|unicode work_dir: .. note:: Placeholders can be used to build paths, e.g.: {project_runtime_dir}/spool/ See ``Section.project_name`` and ``Section.runtime_dir``. :param b...
python
def add(self, work_dir, external=False): """Run a spooler on the specified directory. :param str|unicode work_dir: .. note:: Placeholders can be used to build paths, e.g.: {project_runtime_dir}/spool/ See ``Section.project_name`` and ``Section.runtime_dir``. :param b...
[ "def", "add", "(", "self", ",", "work_dir", ",", "external", "=", "False", ")", ":", "command", "=", "'spooler'", "if", "external", ":", "command", "+=", "'-external'", "self", ".", "_set", "(", "command", ",", "self", ".", "_section", ".", "replace_plac...
Run a spooler on the specified directory. :param str|unicode work_dir: .. note:: Placeholders can be used to build paths, e.g.: {project_runtime_dir}/spool/ See ``Section.project_name`` and ``Section.runtime_dir``. :param bool external: map spoolers requests to a spooler dir...
[ "Run", "a", "spooler", "on", "the", "specified", "directory", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/spooler.py#L64-L82
train
idlesign/uwsgiconf
uwsgiconf/presets/empire.py
Broodlord.configure
def configure(self): """Configures broodlord mode and returns emperor and zerg sections. :rtype: tuple """ section_emperor = self.section_emperor section_zerg = self.section_zerg socket = self.socket section_emperor.workers.set_zerg_server_params(socket=socket)...
python
def configure(self): """Configures broodlord mode and returns emperor and zerg sections. :rtype: tuple """ section_emperor = self.section_emperor section_zerg = self.section_zerg socket = self.socket section_emperor.workers.set_zerg_server_params(socket=socket)...
[ "def", "configure", "(", "self", ")", ":", "section_emperor", "=", "self", ".", "section_emperor", "section_zerg", "=", "self", ".", "section_zerg", "socket", "=", "self", ".", "socket", "section_emperor", ".", "workers", ".", "set_zerg_server_params", "(", "soc...
Configures broodlord mode and returns emperor and zerg sections. :rtype: tuple
[ "Configures", "broodlord", "mode", "and", "returns", "emperor", "and", "zerg", "sections", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/presets/empire.py#L54-L74
train
idlesign/uwsgiconf
uwsgiconf/presets/nice.py
Section.get_log_format_default
def get_log_format_default(self): """Returns default log message format. .. note:: Some params may be missing. """ vars = self.logging.vars format_default = ( '[pid: %s|app: %s|req: %s/%s] %s (%s) {%s vars in %s bytes} [%s] %s %s => ' 'generated %s byte...
python
def get_log_format_default(self): """Returns default log message format. .. note:: Some params may be missing. """ vars = self.logging.vars format_default = ( '[pid: %s|app: %s|req: %s/%s] %s (%s) {%s vars in %s bytes} [%s] %s %s => ' 'generated %s byte...
[ "def", "get_log_format_default", "(", "self", ")", ":", "vars", "=", "self", ".", "logging", ".", "vars", "format_default", "=", "(", "'[pid: %s|app: %s|req: %s/%s] %s (%s) {%s vars in %s bytes} [%s] %s %s => '", "'generated %s bytes in %s %s%s(%s %s) %s headers in %s bytes (%s swi...
Returns default log message format. .. note:: Some params may be missing.
[ "Returns", "default", "log", "message", "format", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/presets/nice.py#L83-L118
train
idlesign/uwsgiconf
uwsgiconf/presets/nice.py
Section.configure_owner
def configure_owner(self, owner='www-data'): """Shortcut to set process owner data. :param str|unicode owner: Sets user and group. Default: ``www-data``. """ if owner is not None: self.main_process.set_owner_params(uid=owner, gid=owner) return self
python
def configure_owner(self, owner='www-data'): """Shortcut to set process owner data. :param str|unicode owner: Sets user and group. Default: ``www-data``. """ if owner is not None: self.main_process.set_owner_params(uid=owner, gid=owner) return self
[ "def", "configure_owner", "(", "self", ",", "owner", "=", "'www-data'", ")", ":", "if", "owner", "is", "not", "None", ":", "self", ".", "main_process", ".", "set_owner_params", "(", "uid", "=", "owner", ",", "gid", "=", "owner", ")", "return", "self" ]
Shortcut to set process owner data. :param str|unicode owner: Sets user and group. Default: ``www-data``.
[ "Shortcut", "to", "set", "process", "owner", "data", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/presets/nice.py#L120-L129
train
idlesign/uwsgiconf
uwsgiconf/options/alarms.py
Alarms.set_basic_params
def set_basic_params(self, msg_size=None, cheap=None, anti_loop_timeout=None): """ :param int msg_size: Set the max size of an alarm message in bytes. Default: 8192. :param bool cheap: Use main alarm thread rather than create dedicated threads for curl-based alarms :param i...
python
def set_basic_params(self, msg_size=None, cheap=None, anti_loop_timeout=None): """ :param int msg_size: Set the max size of an alarm message in bytes. Default: 8192. :param bool cheap: Use main alarm thread rather than create dedicated threads for curl-based alarms :param i...
[ "def", "set_basic_params", "(", "self", ",", "msg_size", "=", "None", ",", "cheap", "=", "None", ",", "anti_loop_timeout", "=", "None", ")", ":", "self", ".", "_set", "(", "'alarm-msg-size'", ",", "msg_size", ")", "self", ".", "_set", "(", "'alarm-cheap'",...
:param int msg_size: Set the max size of an alarm message in bytes. Default: 8192. :param bool cheap: Use main alarm thread rather than create dedicated threads for curl-based alarms :param int anti_loop_timeout: Tune the anti-loop alarm system. Default: 3 seconds.
[ ":", "param", "int", "msg_size", ":", "Set", "the", "max", "size", "of", "an", "alarm", "message", "in", "bytes", ".", "Default", ":", "8192", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/alarms.py#L32-L46
train
idlesign/uwsgiconf
uwsgiconf/options/alarms.py
Alarms.register_alarm
def register_alarm(self, alarm): """Register (create) an alarm. :param AlarmType|list[AlarmType] alarm: Alarm. """ for alarm in listify(alarm): if alarm not in self._alarms: self._set('alarm', alarm, multi=True) self._alarms.append(alarm) ...
python
def register_alarm(self, alarm): """Register (create) an alarm. :param AlarmType|list[AlarmType] alarm: Alarm. """ for alarm in listify(alarm): if alarm not in self._alarms: self._set('alarm', alarm, multi=True) self._alarms.append(alarm) ...
[ "def", "register_alarm", "(", "self", ",", "alarm", ")", ":", "for", "alarm", "in", "listify", "(", "alarm", ")", ":", "if", "alarm", "not", "in", "self", ".", "_alarms", ":", "self", ".", "_set", "(", "'alarm'", ",", "alarm", ",", "multi", "=", "T...
Register (create) an alarm. :param AlarmType|list[AlarmType] alarm: Alarm.
[ "Register", "(", "create", ")", "an", "alarm", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/alarms.py#L55-L66
train
idlesign/uwsgiconf
uwsgiconf/options/alarms.py
Alarms.alarm_on_log
def alarm_on_log(self, alarm, matcher, skip=False): """Raise (or skip) the specified alarm when a log line matches the specified regexp. :param AlarmType|list[AlarmType] alarm: Alarm. :param str|unicode matcher: Regular expression to match log line. :param bool skip: """ ...
python
def alarm_on_log(self, alarm, matcher, skip=False): """Raise (or skip) the specified alarm when a log line matches the specified regexp. :param AlarmType|list[AlarmType] alarm: Alarm. :param str|unicode matcher: Regular expression to match log line. :param bool skip: """ ...
[ "def", "alarm_on_log", "(", "self", ",", "alarm", ",", "matcher", ",", "skip", "=", "False", ")", ":", "self", ".", "register_alarm", "(", "alarm", ")", "value", "=", "'%s %s'", "%", "(", "','", ".", "join", "(", "map", "(", "attrgetter", "(", "'alia...
Raise (or skip) the specified alarm when a log line matches the specified regexp. :param AlarmType|list[AlarmType] alarm: Alarm. :param str|unicode matcher: Regular expression to match log line. :param bool skip:
[ "Raise", "(", "or", "skip", ")", "the", "specified", "alarm", "when", "a", "log", "line", "matches", "the", "specified", "regexp", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/alarms.py#L68-L86
train
idlesign/uwsgiconf
uwsgiconf/options/alarms.py
Alarms.alarm_on_fd_ready
def alarm_on_fd_ready(self, alarm, fd, message, byte_count=None): """Triggers the alarm when the specified file descriptor is ready for read. This is really useful for integration with the Linux eventfd() facility. Pretty low-level and the basis of most of the alarm plugins. * http://u...
python
def alarm_on_fd_ready(self, alarm, fd, message, byte_count=None): """Triggers the alarm when the specified file descriptor is ready for read. This is really useful for integration with the Linux eventfd() facility. Pretty low-level and the basis of most of the alarm plugins. * http://u...
[ "def", "alarm_on_fd_ready", "(", "self", ",", "alarm", ",", "fd", ",", "message", ",", "byte_count", "=", "None", ")", ":", "self", ".", "register_alarm", "(", "alarm", ")", "value", "=", "fd", "if", "byte_count", ":", "value", "+=", "':%s'", "%", "byt...
Triggers the alarm when the specified file descriptor is ready for read. This is really useful for integration with the Linux eventfd() facility. Pretty low-level and the basis of most of the alarm plugins. * http://uwsgi-docs.readthedocs.io/en/latest/Changelog-1.9.7.html#alarm-fd :pa...
[ "Triggers", "the", "alarm", "when", "the", "specified", "file", "descriptor", "is", "ready", "for", "read", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/alarms.py#L88-L119
train
idlesign/uwsgiconf
uwsgiconf/options/alarms.py
Alarms.alarm_on_segfault
def alarm_on_segfault(self, alarm): """Raise the specified alarm when the segmentation fault handler is executed. Sends a backtrace. :param AlarmType|list[AlarmType] alarm: Alarm. """ self.register_alarm(alarm) for alarm in listify(alarm): self._set('alarm-...
python
def alarm_on_segfault(self, alarm): """Raise the specified alarm when the segmentation fault handler is executed. Sends a backtrace. :param AlarmType|list[AlarmType] alarm: Alarm. """ self.register_alarm(alarm) for alarm in listify(alarm): self._set('alarm-...
[ "def", "alarm_on_segfault", "(", "self", ",", "alarm", ")", ":", "self", ".", "register_alarm", "(", "alarm", ")", "for", "alarm", "in", "listify", "(", "alarm", ")", ":", "self", ".", "_set", "(", "'alarm-segfault'", ",", "alarm", ".", "alias", ",", "...
Raise the specified alarm when the segmentation fault handler is executed. Sends a backtrace. :param AlarmType|list[AlarmType] alarm: Alarm.
[ "Raise", "the", "specified", "alarm", "when", "the", "segmentation", "fault", "handler", "is", "executed", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/alarms.py#L133-L145
train
idlesign/uwsgiconf
uwsgiconf/sysinit.py
get_config
def get_config(systype, conf, conf_path, runner=None, project_name=None): """Returns init system configuration file contents. :param str|unicode systype: System type alias, e.g. systemd, upstart :param Section|Configuration conf: Configuration/Section object. :param str|unicode conf_path: File path to ...
python
def get_config(systype, conf, conf_path, runner=None, project_name=None): """Returns init system configuration file contents. :param str|unicode systype: System type alias, e.g. systemd, upstart :param Section|Configuration conf: Configuration/Section object. :param str|unicode conf_path: File path to ...
[ "def", "get_config", "(", "systype", ",", "conf", ",", "conf_path", ",", "runner", "=", "None", ",", "project_name", "=", "None", ")", ":", "runner", "=", "runner", "or", "(", "'%s run'", "%", "Finder", ".", "uwsgiconf", "(", ")", ")", "conf_path", "="...
Returns init system configuration file contents. :param str|unicode systype: System type alias, e.g. systemd, upstart :param Section|Configuration conf: Configuration/Section object. :param str|unicode conf_path: File path to a configuration file or a command producing such a configuration. :param str|...
[ "Returns", "init", "system", "configuration", "file", "contents", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/sysinit.py#L120-L144
train
idlesign/uwsgiconf
demos/onefile.py
app_1
def app_1(env, start_response): """This is simple WSGI application that will be served by uWSGI.""" from uwsgiconf.runtime.environ import uwsgi_env start_response('200 OK', [('Content-Type','text/html')]) data = [ '<h1>uwsgiconf demo: one file</h1>', '<div>uWSGI version: %s</div>' % ...
python
def app_1(env, start_response): """This is simple WSGI application that will be served by uWSGI.""" from uwsgiconf.runtime.environ import uwsgi_env start_response('200 OK', [('Content-Type','text/html')]) data = [ '<h1>uwsgiconf demo: one file</h1>', '<div>uWSGI version: %s</div>' % ...
[ "def", "app_1", "(", "env", ",", "start_response", ")", ":", "from", "uwsgiconf", ".", "runtime", ".", "environ", "import", "uwsgi_env", "start_response", "(", "'200 OK'", ",", "[", "(", "'Content-Type'", ",", "'text/html'", ")", "]", ")", "data", "=", "["...
This is simple WSGI application that will be served by uWSGI.
[ "This", "is", "simple", "WSGI", "application", "that", "will", "be", "served", "by", "uWSGI", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/demos/onefile.py#L20-L34
train
idlesign/uwsgiconf
demos/onefile.py
app_2
def app_2(env, start_response): """This is another simple WSGI application that will be served by uWSGI.""" import random start_response('200 OK', [('Content-Type','text/html')]) data = [ '<h1>uwsgiconf demo: one file second app</h1>', '<div>Some random number for you: %s</div>' % ra...
python
def app_2(env, start_response): """This is another simple WSGI application that will be served by uWSGI.""" import random start_response('200 OK', [('Content-Type','text/html')]) data = [ '<h1>uwsgiconf demo: one file second app</h1>', '<div>Some random number for you: %s</div>' % ra...
[ "def", "app_2", "(", "env", ",", "start_response", ")", ":", "import", "random", "start_response", "(", "'200 OK'", ",", "[", "(", "'Content-Type'", ",", "'text/html'", ")", "]", ")", "data", "=", "[", "'<h1>uwsgiconf demo: one file second app</h1>'", ",", "'<di...
This is another simple WSGI application that will be served by uWSGI.
[ "This", "is", "another", "simple", "WSGI", "application", "that", "will", "be", "served", "by", "uWSGI", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/demos/onefile.py#L37-L50
train
idlesign/uwsgiconf
demos/onefile.py
configure
def configure(): """Configure uWSGI. This returns several configuration objects, which will be used to spawn several uWSGI processes. Applications are on 127.0.0.1 on ports starting from 8000. """ import os from uwsgiconf.presets.nice import PythonSection FILE = os.path.abspath(__fil...
python
def configure(): """Configure uWSGI. This returns several configuration objects, which will be used to spawn several uWSGI processes. Applications are on 127.0.0.1 on ports starting from 8000. """ import os from uwsgiconf.presets.nice import PythonSection FILE = os.path.abspath(__fil...
[ "def", "configure", "(", ")", ":", "import", "os", "from", "uwsgiconf", ".", "presets", ".", "nice", "import", "PythonSection", "FILE", "=", "os", ".", "path", ".", "abspath", "(", "__file__", ")", "port", "=", "8000", "configurations", "=", "[", "]", ...
Configure uWSGI. This returns several configuration objects, which will be used to spawn several uWSGI processes. Applications are on 127.0.0.1 on ports starting from 8000.
[ "Configure", "uWSGI", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/demos/onefile.py#L53-L101
train
jin10086/copyheaders
copyheaders/copyheaders.py
headers_raw_to_dict
def headers_raw_to_dict(headers_raw): r""" Convert raw headers (single multi-line bytestring) to a dictionary. For example: >>> from copyheaders import headers_raw_to_dict >>> headers_raw_to_dict(b"Content-type: text/html\n\rAccept: gzip\n\n") # doctest: +SKIP {'Content-type': ['text/htm...
python
def headers_raw_to_dict(headers_raw): r""" Convert raw headers (single multi-line bytestring) to a dictionary. For example: >>> from copyheaders import headers_raw_to_dict >>> headers_raw_to_dict(b"Content-type: text/html\n\rAccept: gzip\n\n") # doctest: +SKIP {'Content-type': ['text/htm...
[ "def", "headers_raw_to_dict", "(", "headers_raw", ")", ":", "if", "headers_raw", "is", "None", ":", "return", "None", "headers", "=", "headers_raw", ".", "splitlines", "(", ")", "headers_tuples", "=", "[", "header", ".", "split", "(", "b':'", ",", "1", ")"...
r""" Convert raw headers (single multi-line bytestring) to a dictionary. For example: >>> from copyheaders import headers_raw_to_dict >>> headers_raw_to_dict(b"Content-type: text/html\n\rAccept: gzip\n\n") # doctest: +SKIP {'Content-type': ['text/html'], 'Accept': ['gzip']} Incorrect in...
[ "r", "Convert", "raw", "headers", "(", "single", "multi", "-", "line", "bytestring", ")", "to", "a", "dictionary", "." ]
195479ac1c8620e0490c75c5d4d768faf5dcbf8f
https://github.com/jin10086/copyheaders/blob/195479ac1c8620e0490c75c5d4d768faf5dcbf8f/copyheaders/copyheaders.py#L1-L39
train
idlesign/uwsgiconf
uwsgiconf/options/logging.py
Logging.log_into
def log_into(self, target, before_priv_drop=True): """Simple file or UDP logging. .. note:: This doesn't require any Logger plugin and can be used if no log routing is required. :param str|unicode target: Filepath or UDP address. :param bool before_priv_drop: Whether to lo...
python
def log_into(self, target, before_priv_drop=True): """Simple file or UDP logging. .. note:: This doesn't require any Logger plugin and can be used if no log routing is required. :param str|unicode target: Filepath or UDP address. :param bool before_priv_drop: Whether to lo...
[ "def", "log_into", "(", "self", ",", "target", ",", "before_priv_drop", "=", "True", ")", ":", "command", "=", "'logto'", "if", "not", "before_priv_drop", ":", "command", "+=", "'2'", "self", ".", "_set", "(", "command", ",", "target", ")", "return", "se...
Simple file or UDP logging. .. note:: This doesn't require any Logger plugin and can be used if no log routing is required. :param str|unicode target: Filepath or UDP address. :param bool before_priv_drop: Whether to log data before or after privileges drop.
[ "Simple", "file", "or", "UDP", "logging", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L108-L126
train
idlesign/uwsgiconf
uwsgiconf/options/logging.py
Logging.set_file_params
def set_file_params( self, reopen_on_reload=None, trucate_on_statup=None, max_size=None, rotation_fname=None, touch_reopen=None, touch_rotate=None, owner=None, mode=None): """Set various parameters related to file logging. :param bool reopen_on_reload: Reopen log after reload. ...
python
def set_file_params( self, reopen_on_reload=None, trucate_on_statup=None, max_size=None, rotation_fname=None, touch_reopen=None, touch_rotate=None, owner=None, mode=None): """Set various parameters related to file logging. :param bool reopen_on_reload: Reopen log after reload. ...
[ "def", "set_file_params", "(", "self", ",", "reopen_on_reload", "=", "None", ",", "trucate_on_statup", "=", "None", ",", "max_size", "=", "None", ",", "rotation_fname", "=", "None", ",", "touch_reopen", "=", "None", ",", "touch_rotate", "=", "None", ",", "ow...
Set various parameters related to file logging. :param bool reopen_on_reload: Reopen log after reload. :param bool trucate_on_statup: Truncate log on startup. :param int max_size: Set maximum logfile size in bytes after which log should be rotated. :param str|unicode rotation_fname: ...
[ "Set", "various", "parameters", "related", "to", "file", "logging", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L128-L166
train
idlesign/uwsgiconf
uwsgiconf/options/logging.py
Logging.set_filters
def set_filters(self, include=None, exclude=None, write_errors=None, write_errors_tolerance=None, sigpipe=None): """Set various log data filters. :param str|unicode|list include: Show only log lines matching the specified regexp. .. note:: Requires enabled PCRE support. :param str...
python
def set_filters(self, include=None, exclude=None, write_errors=None, write_errors_tolerance=None, sigpipe=None): """Set various log data filters. :param str|unicode|list include: Show only log lines matching the specified regexp. .. note:: Requires enabled PCRE support. :param str...
[ "def", "set_filters", "(", "self", ",", "include", "=", "None", ",", "exclude", "=", "None", ",", "write_errors", "=", "None", ",", "write_errors_tolerance", "=", "None", ",", "sigpipe", "=", "None", ")", ":", "if", "write_errors", "is", "not", "None", "...
Set various log data filters. :param str|unicode|list include: Show only log lines matching the specified regexp. .. note:: Requires enabled PCRE support. :param str|unicode|list exclude: Do not show log lines matching the specified regexp. .. note:: Requires enabled PCRE sup...
[ "Set", "various", "log", "data", "filters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L168-L209
train
idlesign/uwsgiconf
uwsgiconf/options/logging.py
Logging.set_requests_filters
def set_requests_filters( self, slower=None, bigger=None, status_4xx=None, status_5xx=None, no_body=None, sendfile=None, io_errors=None): """Set various log data filters. :param int slower: Log requests slower than the specified number of milliseconds. :param int bigger...
python
def set_requests_filters( self, slower=None, bigger=None, status_4xx=None, status_5xx=None, no_body=None, sendfile=None, io_errors=None): """Set various log data filters. :param int slower: Log requests slower than the specified number of milliseconds. :param int bigger...
[ "def", "set_requests_filters", "(", "self", ",", "slower", "=", "None", ",", "bigger", "=", "None", ",", "status_4xx", "=", "None", ",", "status_5xx", "=", "None", ",", "no_body", "=", "None", ",", "sendfile", "=", "None", ",", "io_errors", "=", "None", ...
Set various log data filters. :param int slower: Log requests slower than the specified number of milliseconds. :param int bigger: Log requests bigger than the specified size in bytes. :param status_4xx: Log requests with a 4xx response. :param status_5xx: Log requests with a 5xx res...
[ "Set", "various", "log", "data", "filters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L211-L239
train
idlesign/uwsgiconf
uwsgiconf/options/logging.py
Logging.set_master_logging_params
def set_master_logging_params( self, enable=None, dedicate_thread=None, buffer=None, sock_stream=None, sock_stream_requests_only=None): """Sets logging params for delegating logging to master process. :param bool enable: Delegate logging to master process. Delegate t...
python
def set_master_logging_params( self, enable=None, dedicate_thread=None, buffer=None, sock_stream=None, sock_stream_requests_only=None): """Sets logging params for delegating logging to master process. :param bool enable: Delegate logging to master process. Delegate t...
[ "def", "set_master_logging_params", "(", "self", ",", "enable", "=", "None", ",", "dedicate_thread", "=", "None", ",", "buffer", "=", "None", ",", "sock_stream", "=", "None", ",", "sock_stream_requests_only", "=", "None", ")", ":", "self", ".", "_set", "(", ...
Sets logging params for delegating logging to master process. :param bool enable: Delegate logging to master process. Delegate the write of the logs to the master process (this will put all of the logging I/O to a single process). Useful for system with advanced I/O schedule...
[ "Sets", "logging", "params", "for", "delegating", "logging", "to", "master", "process", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L241-L274
train
idlesign/uwsgiconf
uwsgiconf/options/logging.py
Logging.add_logger
def add_logger(self, logger, requests_only=False, for_single_worker=False): """Set/add a common logger or a request requests only. :param str|unicode|list|Logger|list[Logger] logger: :param bool requests_only: Logger used only for requests information messages. :param bool for_single_...
python
def add_logger(self, logger, requests_only=False, for_single_worker=False): """Set/add a common logger or a request requests only. :param str|unicode|list|Logger|list[Logger] logger: :param bool requests_only: Logger used only for requests information messages. :param bool for_single_...
[ "def", "add_logger", "(", "self", ",", "logger", ",", "requests_only", "=", "False", ",", "for_single_worker", "=", "False", ")", ":", "if", "for_single_worker", ":", "command", "=", "'worker-logger-req'", "if", "requests_only", "else", "'worker-logger'", "else", ...
Set/add a common logger or a request requests only. :param str|unicode|list|Logger|list[Logger] logger: :param bool requests_only: Logger used only for requests information messages. :param bool for_single_worker: Logger to be used in single-worker setup.
[ "Set", "/", "add", "a", "common", "logger", "or", "a", "request", "requests", "only", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L283-L302
train
idlesign/uwsgiconf
uwsgiconf/options/logging.py
Logging.add_logger_route
def add_logger_route(self, logger, matcher, requests_only=False): """Log to the specified named logger if regexp applied on log item matches. :param str|unicode|list|Logger|list[Logger] logger: Logger to associate route with. :param str|unicode matcher: Regular expression to apply to log item....
python
def add_logger_route(self, logger, matcher, requests_only=False): """Log to the specified named logger if regexp applied on log item matches. :param str|unicode|list|Logger|list[Logger] logger: Logger to associate route with. :param str|unicode matcher: Regular expression to apply to log item....
[ "def", "add_logger_route", "(", "self", ",", "logger", ",", "matcher", ",", "requests_only", "=", "False", ")", ":", "command", "=", "'log-req-route'", "if", "requests_only", "else", "'log-route'", "for", "logger", "in", "listify", "(", "logger", ")", ":", "...
Log to the specified named logger if regexp applied on log item matches. :param str|unicode|list|Logger|list[Logger] logger: Logger to associate route with. :param str|unicode matcher: Regular expression to apply to log item. :param bool requests_only: Matching should be used only for request...
[ "Log", "to", "the", "specified", "named", "logger", "if", "regexp", "applied", "on", "log", "item", "matches", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L304-L319
train
idlesign/uwsgiconf
uwsgiconf/options/logging.py
Logging.add_logger_encoder
def add_logger_encoder(self, encoder, logger=None, requests_only=False, for_single_worker=False): """Add an item in the log encoder or request encoder chain. * http://uwsgi-docs.readthedocs.io/en/latest/LogEncoders.html .. note:: Encoders automatically enable master log handling (see ``.se...
python
def add_logger_encoder(self, encoder, logger=None, requests_only=False, for_single_worker=False): """Add an item in the log encoder or request encoder chain. * http://uwsgi-docs.readthedocs.io/en/latest/LogEncoders.html .. note:: Encoders automatically enable master log handling (see ``.se...
[ "def", "add_logger_encoder", "(", "self", ",", "encoder", ",", "logger", "=", "None", ",", "requests_only", "=", "False", ",", "for_single_worker", "=", "False", ")", ":", "if", "for_single_worker", ":", "command", "=", "'worker-log-req-encoder'", "if", "request...
Add an item in the log encoder or request encoder chain. * http://uwsgi-docs.readthedocs.io/en/latest/LogEncoders.html .. note:: Encoders automatically enable master log handling (see ``.set_master_logging_params()``). .. note:: For best performance consider allocating a thread ...
[ "Add", "an", "item", "in", "the", "log", "encoder", "or", "request", "encoder", "chain", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L321-L357
train
theacodes/cmarkgfm
src/cmarkgfm/build_cmark.py
_compiler_type
def _compiler_type(): """ Gets the compiler type from distutils. On Windows with MSVC it will be "msvc". On macOS and linux it is "unix". Borrowed from https://github.com/pyca/cryptography/blob\ /05b34433fccdc2fec0bb014c3668068169d769fd/src/_cffi_src/utils.py#L78 """ dist = dist...
python
def _compiler_type(): """ Gets the compiler type from distutils. On Windows with MSVC it will be "msvc". On macOS and linux it is "unix". Borrowed from https://github.com/pyca/cryptography/blob\ /05b34433fccdc2fec0bb014c3668068169d769fd/src/_cffi_src/utils.py#L78 """ dist = dist...
[ "def", "_compiler_type", "(", ")", ":", "dist", "=", "distutils", ".", "dist", ".", "Distribution", "(", ")", "dist", ".", "parse_config_files", "(", ")", "cmd", "=", "dist", ".", "get_command_obj", "(", "'build'", ")", "cmd", ".", "ensure_finalized", "(",...
Gets the compiler type from distutils. On Windows with MSVC it will be "msvc". On macOS and linux it is "unix". Borrowed from https://github.com/pyca/cryptography/blob\ /05b34433fccdc2fec0bb014c3668068169d769fd/src/_cffi_src/utils.py#L78
[ "Gets", "the", "compiler", "type", "from", "distutils", ".", "On", "Windows", "with", "MSVC", "it", "will", "be", "msvc", ".", "On", "macOS", "and", "linux", "it", "is", "unix", ".", "Borrowed", "from", "https", ":", "//", "github", ".", "com", "/", ...
742cc59c7dadbee3c1f54b86167840bd0d3f2d49
https://github.com/theacodes/cmarkgfm/blob/742cc59c7dadbee3c1f54b86167840bd0d3f2d49/src/cmarkgfm/build_cmark.py#L41-L54
train
idlesign/uwsgiconf
uwsgiconf/options/monitoring.py
Monitoring.set_metrics_params
def set_metrics_params(self, enable=None, store_dir=None, restore=None, no_cores=None): """Sets basic Metrics subsystem params. uWSGI metrics subsystem allows you to manage "numbers" from your apps. When enabled, the subsystem configures a vast amount of metrics (like requests per-core...
python
def set_metrics_params(self, enable=None, store_dir=None, restore=None, no_cores=None): """Sets basic Metrics subsystem params. uWSGI metrics subsystem allows you to manage "numbers" from your apps. When enabled, the subsystem configures a vast amount of metrics (like requests per-core...
[ "def", "set_metrics_params", "(", "self", ",", "enable", "=", "None", ",", "store_dir", "=", "None", ",", "restore", "=", "None", ",", "no_cores", "=", "None", ")", ":", "self", ".", "_set", "(", "'enable-metrics'", ",", "enable", ",", "cast", "=", "bo...
Sets basic Metrics subsystem params. uWSGI metrics subsystem allows you to manage "numbers" from your apps. When enabled, the subsystem configures a vast amount of metrics (like requests per-core, memory usage, etc) but, in addition to this, you can configure your own metrics, such as ...
[ "Sets", "basic", "Metrics", "subsystem", "params", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/monitoring.py#L93-L129
train
idlesign/uwsgiconf
uwsgiconf/options/monitoring.py
Monitoring.set_metrics_threshold
def set_metrics_threshold(self, name, value, check_interval=None, reset_to=None, alarm=None, alarm_message=None): """Sets metric threshold parameters. :param str|unicode name: Metric name. :param int value: Threshold value. :param int reset_to: Reset value to when threshold is reached...
python
def set_metrics_threshold(self, name, value, check_interval=None, reset_to=None, alarm=None, alarm_message=None): """Sets metric threshold parameters. :param str|unicode name: Metric name. :param int value: Threshold value. :param int reset_to: Reset value to when threshold is reached...
[ "def", "set_metrics_threshold", "(", "self", ",", "name", ",", "value", ",", "check_interval", "=", "None", ",", "reset_to", "=", "None", ",", "alarm", "=", "None", ",", "alarm_message", "=", "None", ")", ":", "if", "alarm", "is", "not", "None", "and", ...
Sets metric threshold parameters. :param str|unicode name: Metric name. :param int value: Threshold value. :param int reset_to: Reset value to when threshold is reached. :param int check_interval: Threshold check interval in seconds. :param str|unicode|AlarmType alarm: Alarm...
[ "Sets", "metric", "threshold", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/monitoring.py#L131-L163
train
idlesign/uwsgiconf
uwsgiconf/options/monitoring.py
Monitoring.set_stats_params
def set_stats_params( self, address=None, enable_http=None, minify=None, no_cores=None, no_metrics=None, push_interval=None): """Enables stats server on the specified address. * http://uwsgi.readthedocs.io/en/latest/StatsServer.html :param str|unicode address: Address/s...
python
def set_stats_params( self, address=None, enable_http=None, minify=None, no_cores=None, no_metrics=None, push_interval=None): """Enables stats server on the specified address. * http://uwsgi.readthedocs.io/en/latest/StatsServer.html :param str|unicode address: Address/s...
[ "def", "set_stats_params", "(", "self", ",", "address", "=", "None", ",", "enable_http", "=", "None", ",", "minify", "=", "None", ",", "no_cores", "=", "None", ",", "no_metrics", "=", "None", ",", "push_interval", "=", "None", ")", ":", "self", ".", "_...
Enables stats server on the specified address. * http://uwsgi.readthedocs.io/en/latest/StatsServer.html :param str|unicode address: Address/socket to make stats available on. Examples: * 127.0.0.1:1717 * /tmp/statsock * :5050 :param...
[ "Enables", "stats", "server", "on", "the", "specified", "address", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/monitoring.py#L165-L198
train
idlesign/uwsgiconf
uwsgiconf/options/monitoring.py
Monitoring.register_stats_pusher
def register_stats_pusher(self, pusher): """Registers a pusher to be used for pushing statistics to various remotes/locals. :param Pusher|list[Pusher] pusher: """ for pusher in listify(pusher): self._set('stats-push', pusher, multi=True) return self._section
python
def register_stats_pusher(self, pusher): """Registers a pusher to be used for pushing statistics to various remotes/locals. :param Pusher|list[Pusher] pusher: """ for pusher in listify(pusher): self._set('stats-push', pusher, multi=True) return self._section
[ "def", "register_stats_pusher", "(", "self", ",", "pusher", ")", ":", "for", "pusher", "in", "listify", "(", "pusher", ")", ":", "self", ".", "_set", "(", "'stats-push'", ",", "pusher", ",", "multi", "=", "True", ")", "return", "self", ".", "_section" ]
Registers a pusher to be used for pushing statistics to various remotes/locals. :param Pusher|list[Pusher] pusher:
[ "Registers", "a", "pusher", "to", "be", "used", "for", "pushing", "statistics", "to", "various", "remotes", "/", "locals", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/monitoring.py#L200-L209
train
idlesign/uwsgiconf
uwsgiconf/options/monitoring.py
Monitoring.enable_snmp
def enable_snmp(self, address, community_string): """Enables SNMP. uWSGI server embeds a tiny SNMP server that you can use to integrate your web apps with your monitoring infrastructure. * http://uwsgi.readthedocs.io/en/latest/SNMP.html .. note:: SNMP server is started in the ...
python
def enable_snmp(self, address, community_string): """Enables SNMP. uWSGI server embeds a tiny SNMP server that you can use to integrate your web apps with your monitoring infrastructure. * http://uwsgi.readthedocs.io/en/latest/SNMP.html .. note:: SNMP server is started in the ...
[ "def", "enable_snmp", "(", "self", ",", "address", ",", "community_string", ")", ":", "self", ".", "_set", "(", "'snmp'", ",", "address", ")", "self", ".", "_set", "(", "'snmp-community'", ",", "community_string", ")", "return", "self", ".", "_section" ]
Enables SNMP. uWSGI server embeds a tiny SNMP server that you can use to integrate your web apps with your monitoring infrastructure. * http://uwsgi.readthedocs.io/en/latest/SNMP.html .. note:: SNMP server is started in the master process after dropping the privileges. If ...
[ "Enables", "SNMP", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/monitoring.py#L211-L235
train
idlesign/uwsgiconf
uwsgiconf/options/applications.py
Applications.mount
def mount(self, mountpoint, app, into_worker=False): """Load application under mountpoint. Example: * .mount('', 'app0.py') -- Root URL part * .mount('/app1', 'app1.py') -- URL part * .mount('/pinax/here', '/var/www/pinax/deploy/pinax.wsgi') * .mount('the...
python
def mount(self, mountpoint, app, into_worker=False): """Load application under mountpoint. Example: * .mount('', 'app0.py') -- Root URL part * .mount('/app1', 'app1.py') -- URL part * .mount('/pinax/here', '/var/www/pinax/deploy/pinax.wsgi') * .mount('the...
[ "def", "mount", "(", "self", ",", "mountpoint", ",", "app", ",", "into_worker", "=", "False", ")", ":", "# todo check worker mount -- uwsgi_init_worker_mount_app() expects worker://", "self", ".", "_set", "(", "'worker-mount'", "if", "into_worker", "else", "'mount'", ...
Load application under mountpoint. Example: * .mount('', 'app0.py') -- Root URL part * .mount('/app1', 'app1.py') -- URL part * .mount('/pinax/here', '/var/www/pinax/deploy/pinax.wsgi') * .mount('the_app3', 'app3.py') -- Variable value: application alias (can be...
[ "Load", "application", "under", "mountpoint", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/applications.py#L40-L68
train
idlesign/uwsgiconf
uwsgiconf/options/applications.py
Applications.switch_into_lazy_mode
def switch_into_lazy_mode(self, affect_master=None): """Load apps in workers instead of master. This option may have memory usage implications as Copy-on-Write semantics can not be used. .. note:: Consider using ``touch_chain_reload`` option in ``workers`` basic params for ...
python
def switch_into_lazy_mode(self, affect_master=None): """Load apps in workers instead of master. This option may have memory usage implications as Copy-on-Write semantics can not be used. .. note:: Consider using ``touch_chain_reload`` option in ``workers`` basic params for ...
[ "def", "switch_into_lazy_mode", "(", "self", ",", "affect_master", "=", "None", ")", ":", "self", ".", "_set", "(", "'lazy'", "if", "affect_master", "else", "'lazy-apps'", ",", "True", ",", "cast", "=", "bool", ")", "return", "self", ".", "_section" ]
Load apps in workers instead of master. This option may have memory usage implications as Copy-on-Write semantics can not be used. .. note:: Consider using ``touch_chain_reload`` option in ``workers`` basic params for lazy apps reloading. :param bool affect_master: If **Tr...
[ "Load", "apps", "in", "workers", "instead", "of", "master", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/applications.py#L70-L88
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterHttp.set_basic_params
def set_basic_params( self, workers=None, zerg_server=None, fallback_node=None, concurrent_events=None, cheap_mode=None, stats_server=None, quiet=None, buffer_size=None, keepalive=None, resubscribe_addresses=None): """ :param int workers: Number of worker processes to...
python
def set_basic_params( self, workers=None, zerg_server=None, fallback_node=None, concurrent_events=None, cheap_mode=None, stats_server=None, quiet=None, buffer_size=None, keepalive=None, resubscribe_addresses=None): """ :param int workers: Number of worker processes to...
[ "def", "set_basic_params", "(", "self", ",", "workers", "=", "None", ",", "zerg_server", "=", "None", ",", "fallback_node", "=", "None", ",", "concurrent_events", "=", "None", ",", "cheap_mode", "=", "None", ",", "stats_server", "=", "None", ",", "quiet", ...
:param int workers: Number of worker processes to spawn. :param str|unicode zerg_server: Attach the router to a zerg server. :param str|unicode fallback_node: Fallback to the specified node in case of error. :param int concurrent_events: Set the maximum number of concurrent events router can ...
[ ":", "param", "int", "workers", ":", "Number", "of", "worker", "processes", "to", "spawn", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L319-L364
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterHttp.set_connections_params
def set_connections_params( self, harakiri=None, timeout_socket=None, retry_delay=None, timeout_headers=None, timeout_backend=None): """Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (s...
python
def set_connections_params( self, harakiri=None, timeout_socket=None, retry_delay=None, timeout_headers=None, timeout_backend=None): """Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (s...
[ "def", "set_connections_params", "(", "self", ",", "harakiri", "=", "None", ",", "timeout_socket", "=", "None", ",", "retry_delay", "=", "None", ",", "timeout_headers", "=", "None", ",", "timeout_backend", "=", "None", ")", ":", "super", "(", "RouterHttp", "...
Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). Used to set the SPDY timeout. This is the maximum amount of inactivity after the SPDY connection is closed. De...
[ "Sets", "connection", "-", "related", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L366-L397
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterHttp.set_manage_params
def set_manage_params( self, chunked_input=None, chunked_output=None, gzip=None, websockets=None, source_method=None, rtsp=None, proxy_protocol=None): """Allows enabling various automatic management mechanics. * http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.html#http-route...
python
def set_manage_params( self, chunked_input=None, chunked_output=None, gzip=None, websockets=None, source_method=None, rtsp=None, proxy_protocol=None): """Allows enabling various automatic management mechanics. * http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.html#http-route...
[ "def", "set_manage_params", "(", "self", ",", "chunked_input", "=", "None", ",", "chunked_output", "=", "None", ",", "gzip", "=", "None", ",", "websockets", "=", "None", ",", "source_method", "=", "None", ",", "rtsp", "=", "None", ",", "proxy_protocol", "=...
Allows enabling various automatic management mechanics. * http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.html#http-router-keepalive-auto-chunking-auto-gzip-and-transparent-websockets :param bool chunked_input: Automatically detect chunked input requests and put the session in raw mode. :...
[ "Allows", "enabling", "various", "automatic", "management", "mechanics", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L399-L434
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterHttp.set_owner_params
def set_owner_params(self, uid=None, gid=None): """Drop http router privileges to specified user and group. :param str|unicode|int uid: Set uid to the specified username or uid. :param str|unicode|int gid: Set gid to the specified groupname or gid. """ self._set_aliased('uid',...
python
def set_owner_params(self, uid=None, gid=None): """Drop http router privileges to specified user and group. :param str|unicode|int uid: Set uid to the specified username or uid. :param str|unicode|int gid: Set gid to the specified groupname or gid. """ self._set_aliased('uid',...
[ "def", "set_owner_params", "(", "self", ",", "uid", "=", "None", ",", "gid", "=", "None", ")", ":", "self", ".", "_set_aliased", "(", "'uid'", ",", "uid", ")", "self", ".", "_set_aliased", "(", "'gid'", ",", "gid", ")", "return", "self" ]
Drop http router privileges to specified user and group. :param str|unicode|int uid: Set uid to the specified username or uid. :param str|unicode|int gid: Set gid to the specified groupname or gid.
[ "Drop", "http", "router", "privileges", "to", "specified", "user", "and", "group", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L436-L447
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterSsl.set_connections_params
def set_connections_params(self, harakiri=None, timeout_socket=None, retry_delay=None, retry_max=None): """Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). Default: 60. :param int...
python
def set_connections_params(self, harakiri=None, timeout_socket=None, retry_delay=None, retry_max=None): """Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). Default: 60. :param int...
[ "def", "set_connections_params", "(", "self", ",", "harakiri", "=", "None", ",", "timeout_socket", "=", "None", ",", "retry_delay", "=", "None", ",", "retry_max", "=", "None", ")", ":", "super", "(", "RouterSsl", ",", "self", ")", ".", "set_connections_param...
Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). Default: 60. :param int retry_delay: Retry connections to dead static nodes after the specified amount of seconds. Default: 30...
[ "Sets", "connection", "-", "related", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L569-L586
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterFast.set_basic_params
def set_basic_params( self, workers=None, zerg_server=None, fallback_node=None, concurrent_events=None, cheap_mode=None, stats_server=None, quiet=None, buffer_size=None, fallback_nokey=None, subscription_key=None, emperor_command_socket=None): """ :param int workers: ...
python
def set_basic_params( self, workers=None, zerg_server=None, fallback_node=None, concurrent_events=None, cheap_mode=None, stats_server=None, quiet=None, buffer_size=None, fallback_nokey=None, subscription_key=None, emperor_command_socket=None): """ :param int workers: ...
[ "def", "set_basic_params", "(", "self", ",", "workers", "=", "None", ",", "zerg_server", "=", "None", ",", "fallback_node", "=", "None", ",", "concurrent_events", "=", "None", ",", "cheap_mode", "=", "None", ",", "stats_server", "=", "None", ",", "quiet", ...
:param int workers: Number of worker processes to spawn. :param str|unicode zerg_server: Attach the router to a zerg server. :param str|unicode fallback_node: Fallback to the specified node in case of error. :param int concurrent_events: Set the maximum number of concurrent events router can ...
[ ":", "param", "int", "workers", ":", "Number", "of", "worker", "processes", "to", "spawn", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L599-L644
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterFast.set_resubscription_params
def set_resubscription_params(self, addresses=None, bind_to=None): """You can specify a dgram address (udp or unix) on which all of the subscriptions request will be forwarded to (obviously changing the node address to the router one). The system could be useful to build 'federated' setup. ...
python
def set_resubscription_params(self, addresses=None, bind_to=None): """You can specify a dgram address (udp or unix) on which all of the subscriptions request will be forwarded to (obviously changing the node address to the router one). The system could be useful to build 'federated' setup. ...
[ "def", "set_resubscription_params", "(", "self", ",", "addresses", "=", "None", ",", "bind_to", "=", "None", ")", ":", "self", ".", "_set_aliased", "(", "'resubscribe'", ",", "addresses", ",", "multi", "=", "True", ")", "self", ".", "_set_aliased", "(", "'...
You can specify a dgram address (udp or unix) on which all of the subscriptions request will be forwarded to (obviously changing the node address to the router one). The system could be useful to build 'federated' setup. * http://uwsgi.readthedocs.io/en/latest/Changelog-2.0.1.html#resubscripti...
[ "You", "can", "specify", "a", "dgram", "address", "(", "udp", "or", "unix", ")", "on", "which", "all", "of", "the", "subscriptions", "request", "will", "be", "forwarded", "to", "(", "obviously", "changing", "the", "node", "address", "to", "the", "router", ...
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L646-L662
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterFast.set_connections_params
def set_connections_params(self, harakiri=None, timeout_socket=None, retry_delay=None, retry_max=None, defer=None): """Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). Default: 60. ...
python
def set_connections_params(self, harakiri=None, timeout_socket=None, retry_delay=None, retry_max=None, defer=None): """Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). Default: 60. ...
[ "def", "set_connections_params", "(", "self", ",", "harakiri", "=", "None", ",", "timeout_socket", "=", "None", ",", "retry_delay", "=", "None", ",", "retry_max", "=", "None", ",", "defer", "=", "None", ")", ":", "super", "(", "RouterFast", ",", "self", ...
Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). Default: 60. :param int retry_delay: Retry connections to dead static nodes after the specified amount of seconds. Default: 3...
[ "Sets", "connection", "-", "related", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L664-L684
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterFast.set_postbuffering_params
def set_postbuffering_params(self, size=None, store_dir=None): """Sets buffering params. Web-proxies like nginx are "buffered", so they wait til the whole request (and its body) has been read, and then it sends it to the backends. :param int size: The size (in bytes) of the request bod...
python
def set_postbuffering_params(self, size=None, store_dir=None): """Sets buffering params. Web-proxies like nginx are "buffered", so they wait til the whole request (and its body) has been read, and then it sends it to the backends. :param int size: The size (in bytes) of the request bod...
[ "def", "set_postbuffering_params", "(", "self", ",", "size", "=", "None", ",", "store_dir", "=", "None", ")", ":", "self", ".", "_set_aliased", "(", "'post-buffering'", ",", "size", ")", "self", ".", "_set_aliased", "(", "'post-buffering-dir'", ",", "store_dir...
Sets buffering params. Web-proxies like nginx are "buffered", so they wait til the whole request (and its body) has been read, and then it sends it to the backends. :param int size: The size (in bytes) of the request body after which the body will be stored to disk (as a temporary ...
[ "Sets", "buffering", "params", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L686-L701
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterRaw.set_connections_params
def set_connections_params( self, harakiri=None, timeout_socket=None, retry_delay=None, retry_max=None, use_xclient=None): """Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). ...
python
def set_connections_params( self, harakiri=None, timeout_socket=None, retry_delay=None, retry_max=None, use_xclient=None): """Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). ...
[ "def", "set_connections_params", "(", "self", ",", "harakiri", "=", "None", ",", "timeout_socket", "=", "None", ",", "retry_delay", "=", "None", ",", "retry_max", "=", "None", ",", "use_xclient", "=", "None", ")", ":", "super", "(", "RouterRaw", ",", "self...
Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). Default: 60. :param int retry_delay: Retry connections to dead static nodes after the specified amount of seconds. Default: 3...
[ "Sets", "connection", "-", "related", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L726-L747
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterForkPty.set_connections_params
def set_connections_params(self, harakiri=None, timeout_socket=None): """Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). Default: 60. """ self._set_aliased('harakiri', ha...
python
def set_connections_params(self, harakiri=None, timeout_socket=None): """Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). Default: 60. """ self._set_aliased('harakiri', ha...
[ "def", "set_connections_params", "(", "self", ",", "harakiri", "=", "None", ",", "timeout_socket", "=", "None", ")", ":", "self", ".", "_set_aliased", "(", "'harakiri'", ",", "harakiri", ")", "self", ".", "_set_aliased", "(", "'timeout'", ",", "timeout_socket"...
Sets connection-related parameters. :param int harakiri: Set gateway harakiri timeout (seconds). :param int timeout_socket: Node socket timeout (seconds). Default: 60.
[ "Sets", "connection", "-", "related", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L814-L825
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterForkPty.set_window_params
def set_window_params(self, cols=None, rows=None): """Sets pty window params. :param int cols: :param int rows: """ self._set_aliased('cols', cols) self._set_aliased('rows', rows) return self
python
def set_window_params(self, cols=None, rows=None): """Sets pty window params. :param int cols: :param int rows: """ self._set_aliased('cols', cols) self._set_aliased('rows', rows) return self
[ "def", "set_window_params", "(", "self", ",", "cols", "=", "None", ",", "rows", "=", "None", ")", ":", "self", ".", "_set_aliased", "(", "'cols'", ",", "cols", ")", "self", ".", "_set_aliased", "(", "'rows'", ",", "rows", ")", "return", "self" ]
Sets pty window params. :param int cols: :param int rows:
[ "Sets", "pty", "window", "params", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L827-L837
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterTunTap.set_basic_params
def set_basic_params(self, use_credentials=None, stats_server=None): """ :param str|unicode use_credentials: Enable check of SCM_CREDENTIALS for tuntap client/server. :param str|unicode stats_server: Router stats server address to run at. """ self._set_aliased('use-credentials'...
python
def set_basic_params(self, use_credentials=None, stats_server=None): """ :param str|unicode use_credentials: Enable check of SCM_CREDENTIALS for tuntap client/server. :param str|unicode stats_server: Router stats server address to run at. """ self._set_aliased('use-credentials'...
[ "def", "set_basic_params", "(", "self", ",", "use_credentials", "=", "None", ",", "stats_server", "=", "None", ")", ":", "self", ".", "_set_aliased", "(", "'use-credentials'", ",", "use_credentials", ")", "self", ".", "_set_aliased", "(", "'router-stats'", ",", ...
:param str|unicode use_credentials: Enable check of SCM_CREDENTIALS for tuntap client/server. :param str|unicode stats_server: Router stats server address to run at.
[ ":", "param", "str|unicode", "use_credentials", ":", "Enable", "check", "of", "SCM_CREDENTIALS", "for", "tuntap", "client", "/", "server", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L885-L895
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterTunTap.register_route
def register_route(self, src, dst, gateway): """Adds a routing rule to the tuntap router. :param str|unicode src: Source/mask. :param str|unicode dst: Destination/mask. :param str|unicode gateway: Gateway address. """ self._set_aliased('router-route', ' '.join((src, d...
python
def register_route(self, src, dst, gateway): """Adds a routing rule to the tuntap router. :param str|unicode src: Source/mask. :param str|unicode dst: Destination/mask. :param str|unicode gateway: Gateway address. """ self._set_aliased('router-route', ' '.join((src, d...
[ "def", "register_route", "(", "self", ",", "src", ",", "dst", ",", "gateway", ")", ":", "self", ".", "_set_aliased", "(", "'router-route'", ",", "' '", ".", "join", "(", "(", "src", ",", "dst", ",", "gateway", ")", ")", ",", "multi", "=", "True", "...
Adds a routing rule to the tuntap router. :param str|unicode src: Source/mask. :param str|unicode dst: Destination/mask. :param str|unicode gateway: Gateway address.
[ "Adds", "a", "routing", "rule", "to", "the", "tuntap", "router", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L897-L909
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterTunTap.device_add_rule
def device_add_rule(self, direction, action, src, dst, target=None): """Adds a tuntap device rule. To be used in a vassal. :param str|unicode direction: Direction: * in * out. :param str|unicode action: Action: * allow * deny ...
python
def device_add_rule(self, direction, action, src, dst, target=None): """Adds a tuntap device rule. To be used in a vassal. :param str|unicode direction: Direction: * in * out. :param str|unicode action: Action: * allow * deny ...
[ "def", "device_add_rule", "(", "self", ",", "direction", ",", "action", ",", "src", ",", "dst", ",", "target", "=", "None", ")", ":", "value", "=", "[", "direction", ",", "src", ",", "dst", ",", "action", "]", "if", "target", ":", "value", ".", "ap...
Adds a tuntap device rule. To be used in a vassal. :param str|unicode direction: Direction: * in * out. :param str|unicode action: Action: * allow * deny * route * gateway. :param str|unicode src: Source/mask. ...
[ "Adds", "a", "tuntap", "device", "rule", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L929-L962
train
idlesign/uwsgiconf
uwsgiconf/options/routing_routers.py
RouterTunTap.add_firewall_rule
def add_firewall_rule(self, direction, action, src=None, dst=None): """Adds a firewall rule to the router. The TunTap router includes a very simple firewall for governing vassal's traffic. The first matching rule stops the chain, if no rule applies, the policy is "allow". :param str|un...
python
def add_firewall_rule(self, direction, action, src=None, dst=None): """Adds a firewall rule to the router. The TunTap router includes a very simple firewall for governing vassal's traffic. The first matching rule stops the chain, if no rule applies, the policy is "allow". :param str|un...
[ "def", "add_firewall_rule", "(", "self", ",", "direction", ",", "action", ",", "src", "=", "None", ",", "dst", "=", "None", ")", ":", "value", "=", "[", "action", "]", "if", "src", ":", "value", ".", "extend", "(", "(", "src", ",", "dst", ")", ")...
Adds a firewall rule to the router. The TunTap router includes a very simple firewall for governing vassal's traffic. The first matching rule stops the chain, if no rule applies, the policy is "allow". :param str|unicode direction: Direction: * in * out :param...
[ "Adds", "a", "firewall", "rule", "to", "the", "router", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L964-L992
train
idlesign/uwsgiconf
uwsgiconf/config.py
configure_uwsgi
def configure_uwsgi(configurator_func): """Allows configuring uWSGI using Configuration objects returned by the given configuration function. .. code-block: python # In configuration module, e.g `uwsgicfg.py` from uwsgiconf.config import configure_uwsgi configure_uwsgi(get_config...
python
def configure_uwsgi(configurator_func): """Allows configuring uWSGI using Configuration objects returned by the given configuration function. .. code-block: python # In configuration module, e.g `uwsgicfg.py` from uwsgiconf.config import configure_uwsgi configure_uwsgi(get_config...
[ "def", "configure_uwsgi", "(", "configurator_func", ")", ":", "from", ".", "settings", "import", "ENV_CONF_READY", ",", "ENV_CONF_ALIAS", ",", "CONFIGS_MODULE_ATTR", "if", "os", ".", "environ", ".", "get", "(", "ENV_CONF_READY", ")", ":", "# This call is from uWSGI ...
Allows configuring uWSGI using Configuration objects returned by the given configuration function. .. code-block: python # In configuration module, e.g `uwsgicfg.py` from uwsgiconf.config import configure_uwsgi configure_uwsgi(get_configurations) :param callable configurator_fu...
[ "Allows", "configuring", "uWSGI", "using", "Configuration", "objects", "returned", "by", "the", "given", "configuration", "function", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L663-L759
train
idlesign/uwsgiconf
uwsgiconf/config.py
Section.replace_placeholders
def replace_placeholders(self, value): """Replaces placeholders that can be used e.g. in filepaths. Supported placeholders: * {project_runtime_dir} * {project_name} * {runtime_dir} :param str|unicode|list[str|unicode]|None value: :rtype: None|str|uni...
python
def replace_placeholders(self, value): """Replaces placeholders that can be used e.g. in filepaths. Supported placeholders: * {project_runtime_dir} * {project_name} * {runtime_dir} :param str|unicode|list[str|unicode]|None value: :rtype: None|str|uni...
[ "def", "replace_placeholders", "(", "self", ",", "value", ")", ":", "if", "not", "value", ":", "return", "value", "is_list", "=", "isinstance", "(", "value", ",", "list", ")", "values", "=", "[", "]", "for", "value", "in", "listify", "(", "value", ")",...
Replaces placeholders that can be used e.g. in filepaths. Supported placeholders: * {project_runtime_dir} * {project_name} * {runtime_dir} :param str|unicode|list[str|unicode]|None value: :rtype: None|str|unicode|list[str|unicode]
[ "Replaces", "placeholders", "that", "can", "be", "used", "e", ".", "g", ".", "in", "filepaths", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L180-L210
train
idlesign/uwsgiconf
uwsgiconf/config.py
Section.get_runtime_dir
def get_runtime_dir(self, default=True): """Directory to store runtime files. See ``.replace_placeholders()`` .. note:: This can be used to store PID files, sockets, master FIFO, etc. :param bool default: Whether to return [system] default if not set. :rtype: str|unicode ...
python
def get_runtime_dir(self, default=True): """Directory to store runtime files. See ``.replace_placeholders()`` .. note:: This can be used to store PID files, sockets, master FIFO, etc. :param bool default: Whether to return [system] default if not set. :rtype: str|unicode ...
[ "def", "get_runtime_dir", "(", "self", ",", "default", "=", "True", ")", ":", "dir_", "=", "self", ".", "_runtime_dir", "if", "not", "dir_", "and", "default", ":", "uid", "=", "self", ".", "main_process", ".", "get_owner", "(", ")", "[", "0", "]", "d...
Directory to store runtime files. See ``.replace_placeholders()`` .. note:: This can be used to store PID files, sockets, master FIFO, etc. :param bool default: Whether to return [system] default if not set. :rtype: str|unicode
[ "Directory", "to", "store", "runtime", "files", ".", "See", ".", "replace_placeholders", "()" ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L224-L240
train
idlesign/uwsgiconf
uwsgiconf/config.py
Section.print_stamp
def print_stamp(self): """Prints out a stamp containing useful information, such as what and when has generated this configuration. """ from . import VERSION print_out = partial(self.print_out, format_options='red') print_out('This configuration was automatically genera...
python
def print_stamp(self): """Prints out a stamp containing useful information, such as what and when has generated this configuration. """ from . import VERSION print_out = partial(self.print_out, format_options='red') print_out('This configuration was automatically genera...
[ "def", "print_stamp", "(", "self", ")", ":", "from", ".", "import", "VERSION", "print_out", "=", "partial", "(", "self", ".", "print_out", ",", "format_options", "=", "'red'", ")", "print_out", "(", "'This configuration was automatically generated using'", ")", "p...
Prints out a stamp containing useful information, such as what and when has generated this configuration.
[ "Prints", "out", "a", "stamp", "containing", "useful", "information", "such", "as", "what", "and", "when", "has", "generated", "this", "configuration", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L272-L283
train
idlesign/uwsgiconf
uwsgiconf/config.py
Section.print_out
def print_out(self, value, indent=None, format_options=None, asap=False): """Prints out the given value. :param value: :param str|unicode indent: :param dict|str|unicode format_options: text color :param bool asap: Print as soon as possible. """ if indent is ...
python
def print_out(self, value, indent=None, format_options=None, asap=False): """Prints out the given value. :param value: :param str|unicode indent: :param dict|str|unicode format_options: text color :param bool asap: Print as soon as possible. """ if indent is ...
[ "def", "print_out", "(", "self", ",", "value", ",", "indent", "=", "None", ",", "format_options", "=", "None", ",", "asap", "=", "False", ")", ":", "if", "indent", "is", "None", ":", "indent", "=", "'> '", "text", "=", "indent", "+", "str", "(", ...
Prints out the given value. :param value: :param str|unicode indent: :param dict|str|unicode format_options: text color :param bool asap: Print as soon as possible.
[ "Prints", "out", "the", "given", "value", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L285-L315
train
idlesign/uwsgiconf
uwsgiconf/config.py
Section.print_variables
def print_variables(self): """Prints out magic variables available in config files alongside with their values and descriptions. May be useful for debugging. http://uwsgi-docs.readthedocs.io/en/latest/Configuration.html#magic-variables """ print_out = partial(self.print...
python
def print_variables(self): """Prints out magic variables available in config files alongside with their values and descriptions. May be useful for debugging. http://uwsgi-docs.readthedocs.io/en/latest/Configuration.html#magic-variables """ print_out = partial(self.print...
[ "def", "print_variables", "(", "self", ")", ":", "print_out", "=", "partial", "(", "self", ".", "print_out", ",", "format_options", "=", "'green'", ")", "print_out", "(", "'===== variables ====='", ")", "for", "var", ",", "hint", "in", "self", ".", "vars", ...
Prints out magic variables available in config files alongside with their values and descriptions. May be useful for debugging. http://uwsgi-docs.readthedocs.io/en/latest/Configuration.html#magic-variables
[ "Prints", "out", "magic", "variables", "available", "in", "config", "files", "alongside", "with", "their", "values", "and", "descriptions", ".", "May", "be", "useful", "for", "debugging", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L317-L334
train
idlesign/uwsgiconf
uwsgiconf/config.py
Section.set_plugins_params
def set_plugins_params(self, plugins=None, search_dirs=None, autoload=None, required=False): """Sets plugin-related parameters. :param list|str|unicode|OptionsGroup|list[OptionsGroup] plugins: uWSGI plugins to load :param list|str|unicode search_dirs: Directories to search for uWSGI plugins. ...
python
def set_plugins_params(self, plugins=None, search_dirs=None, autoload=None, required=False): """Sets plugin-related parameters. :param list|str|unicode|OptionsGroup|list[OptionsGroup] plugins: uWSGI plugins to load :param list|str|unicode search_dirs: Directories to search for uWSGI plugins. ...
[ "def", "set_plugins_params", "(", "self", ",", "plugins", "=", "None", ",", "search_dirs", "=", "None", ",", "autoload", "=", "None", ",", "required", "=", "False", ")", ":", "plugins", "=", "plugins", "or", "[", "]", "command", "=", "'need-plugin'", "if...
Sets plugin-related parameters. :param list|str|unicode|OptionsGroup|list[OptionsGroup] plugins: uWSGI plugins to load :param list|str|unicode search_dirs: Directories to search for uWSGI plugins. :param bool autoload: Try to automatically load plugins when unknown options are found. ...
[ "Sets", "plugin", "-", "related", "parameters", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L336-L361
train
idlesign/uwsgiconf
uwsgiconf/config.py
Section.set_fallback
def set_fallback(self, target): """Sets a fallback configuration for section. Re-exec uWSGI with the specified config when exit code is 1. :param str|unicode|Section target: File path or Section to include. """ if isinstance(target, Section): target = ':' + target.n...
python
def set_fallback(self, target): """Sets a fallback configuration for section. Re-exec uWSGI with the specified config when exit code is 1. :param str|unicode|Section target: File path or Section to include. """ if isinstance(target, Section): target = ':' + target.n...
[ "def", "set_fallback", "(", "self", ",", "target", ")", ":", "if", "isinstance", "(", "target", ",", "Section", ")", ":", "target", "=", "':'", "+", "target", ".", "name", "self", ".", "_set", "(", "'fallback-config'", ",", "target", ")", "return", "se...
Sets a fallback configuration for section. Re-exec uWSGI with the specified config when exit code is 1. :param str|unicode|Section target: File path or Section to include.
[ "Sets", "a", "fallback", "configuration", "for", "section", "." ]
475407acb44199edbf7e0a66261bfeb51de1afae
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L363-L375
train