partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | Workers.set_zerg_client_params | 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 | uwsgiconf/options/workers.py | 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):
"""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",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/workers.py#L394-L410 | [
"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",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | format_print_text | 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 | uwsgiconf/formatters.py | 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):
"""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:... | [
"Format",
"given",
"text",
"using",
"ANSI",
"formatting",
"escape",
"sequences",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/formatters.py#L3-L66 | [
"def",
"format_print_text",
"(",
"text",
",",
"color_fg",
"=",
"None",
",",
"color_bg",
"=",
"None",
")",
":",
"from",
".",
"config",
"import",
"Section",
"color_fg",
"=",
"{",
"'black'",
":",
"'30'",
",",
"'red'",
":",
"'31'",
",",
"'reder'",
":",
"'9... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | FormatterBase.iter_options | Iterates configuration sections groups options. | uwsgiconf/formatters.py | 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):
"""Iterates configuration sections groups options."""
for section in self.sections:
name = str(section)
for key, value in section._get_options():
yield name, key, value | [
"Iterates",
"configuration",
"sections",
"groups",
"options",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/formatters.py#L75-L80 | [
"def",
"iter_options",
"(",
"self",
")",
":",
"for",
"section",
"in",
"self",
".",
"sections",
":",
"name",
"=",
"str",
"(",
"section",
")",
"for",
"key",
",",
"value",
"in",
"section",
".",
"_get_options",
"(",
")",
":",
"yield",
"name",
",",
"key",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.set_memory_params | 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/... | uwsgiconf/options/main_process.py | 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):
"""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.
..... | [
"Set",
"memory",
"related",
"parameters",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L209-L225 | [
"def",
"set_memory_params",
"(",
"self",
",",
"ksm_interval",
"=",
"None",
",",
"no_swap",
"=",
"None",
")",
":",
"self",
".",
"_set",
"(",
"'ksm'",
",",
"ksm_interval",
")",
"self",
".",
"_set",
"(",
"'never_swap'",
",",
"no_swap",
",",
"cast",
"=",
"... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.daemonize | 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.... | uwsgiconf/options/main_process.py | 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):
"""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... | [
"Daemonize",
"uWSGI",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L227-L246 | [
"def",
"daemonize",
"(",
"self",
",",
"log_into",
",",
"after_app_loading",
"=",
"False",
")",
":",
"self",
".",
"_set",
"(",
"'daemonize2'",
"if",
"after_app_loading",
"else",
"'daemonize'",
",",
"log_into",
")",
"return",
"self",
".",
"_section"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.change_dir | 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 | uwsgiconf/options/main_process.py | 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):
"""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... | [
"Chdir",
"to",
"specified",
"directory",
"before",
"or",
"after",
"apps",
"loading",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L248-L260 | [
"def",
"change_dir",
"(",
"self",
",",
"to",
",",
"after_app_loading",
"=",
"False",
")",
":",
"self",
".",
"_set",
"(",
"'chdir2'",
"if",
"after_app_loading",
"else",
"'chdir'",
",",
"to",
")",
"return",
"self",
".",
"_section"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.set_owner_params | 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... | uwsgiconf/options/main_process.py | 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):
"""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... | [
"Set",
"process",
"owner",
"params",
"-",
"user",
"group",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L262-L287 | [
"def",
"set_owner_params",
"(",
"self",
",",
"uid",
"=",
"None",
",",
"gid",
"=",
"None",
",",
"add_gids",
"=",
"None",
",",
"set_asap",
"=",
"False",
")",
":",
"prefix",
"=",
"'immediate-'",
"if",
"set_asap",
"else",
"''",
"self",
".",
"_set",
"(",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.get_owner | Return (User ID, Group ID) tuple
:param bool default: Whether to return default if not set.
:rtype: tuple[int, int] | uwsgiconf/options/main_process.py | 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):
"""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:
... | [
"Return",
"(",
"User",
"ID",
"Group",
"ID",
")",
"tuple"
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L289-L303 | [
"def",
"get_owner",
"(",
"self",
",",
"default",
"=",
"True",
")",
":",
"uid",
",",
"gid",
"=",
"self",
".",
"owner",
"if",
"not",
"uid",
"and",
"default",
":",
"uid",
"=",
"os",
".",
"getuid",
"(",
")",
"if",
"not",
"gid",
"and",
"default",
":",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.set_hook | 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: | uwsgiconf/options/main_process.py | 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):
"""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)
... | [
"Allows",
"setting",
"hooks",
"(",
"attaching",
"actions",
")",
"for",
"various",
"uWSGI",
"phases",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L305-L315 | [
"def",
"set_hook",
"(",
"self",
",",
"phase",
",",
"action",
")",
":",
"self",
".",
"_set",
"(",
"'hook-%s'",
"%",
"phase",
",",
"action",
",",
"multi",
"=",
"True",
")",
"return",
"self",
".",
"_section"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.set_hook_touch | Allows running certain action when the specified file is touched.
:param str|unicode fpath: File path.
:param str|unicode|list|HookAction|list[HookAction] action: | uwsgiconf/options/main_process.py | 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):
"""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)
... | [
"Allows",
"running",
"certain",
"action",
"when",
"the",
"specified",
"file",
"is",
"touched",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L317-L327 | [
"def",
"set_hook_touch",
"(",
"self",
",",
"fpath",
",",
"action",
")",
":",
"self",
".",
"_set",
"(",
"'hook-touch'",
",",
"'%s %s'",
"%",
"(",
"fpath",
",",
"action",
")",
",",
"multi",
"=",
"True",
")",
"return",
"self",
".",
"_section"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.set_hook_after_request | Run the specified function/symbol (C level) after each request.
:param str|unicode func: | uwsgiconf/options/main_process.py | 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):
"""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 | [
"Run",
"the",
"specified",
"function",
"/",
"symbol",
"(",
"C",
"level",
")",
"after",
"each",
"request",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L329-L337 | [
"def",
"set_hook_after_request",
"(",
"self",
",",
"func",
")",
":",
"self",
".",
"_set",
"(",
"'after-request-hook'",
",",
"func",
",",
"multi",
"=",
"True",
")",
"return",
"self",
".",
"_section"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.set_on_exit_params | 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... | uwsgiconf/options/main_process.py | 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):
"""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... | [
"Set",
"params",
"related",
"to",
"process",
"exit",
"procedure",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L339-L358 | [
"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... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.run_command_on_event | Run the given command on a given phase.
:param str|unicode command:
:param str|unicode phase: See constants in ``Phases`` class. | uwsgiconf/options/main_process.py | 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):
"""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 | [
"Run",
"the",
"given",
"command",
"on",
"a",
"given",
"phase",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L360-L370 | [
"def",
"run_command_on_event",
"(",
"self",
",",
"command",
",",
"phase",
"=",
"phases",
".",
"ASAP",
")",
":",
"self",
".",
"_set",
"(",
"'exec-%s'",
"%",
"phase",
",",
"command",
",",
"multi",
"=",
"True",
")",
"return",
"self",
".",
"_section"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.run_command_on_touch | Run command when the specified file is modified/touched.
:param str|unicode command:
:param str|unicode target: File path. | uwsgiconf/options/main_process.py | 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):
"""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 | [
"Run",
"command",
"when",
"the",
"specified",
"file",
"is",
"modified",
"/",
"touched",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L372-L382 | [
"def",
"run_command_on_touch",
"(",
"self",
",",
"command",
",",
"target",
")",
":",
"self",
".",
"_set",
"(",
"'touch-exec'",
",",
"'%s %s'",
"%",
"(",
"target",
",",
"command",
")",
",",
"multi",
"=",
"True",
")",
"return",
"self",
".",
"_section"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.set_pid_file | 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... | uwsgiconf/options/main_process.py | 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):
"""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... | [
"Creates",
"pidfile",
"before",
"or",
"after",
"privileges",
"drop",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L384-L410 | [
"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... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | MainProcess.set_naming_params | 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... | uwsgiconf/options/main_process.py | 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):
"""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... | [
"Setups",
"processes",
"naming",
"parameters",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/main_process.py#L412-L430 | [
"def",
"set_naming_params",
"(",
"self",
",",
"autonaming",
"=",
"None",
",",
"prefix",
"=",
"None",
",",
"suffix",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"self",
".",
"_set",
"(",
"'auto-procname'",
",",
"autonaming",
",",
"cast",
"=",
"bool... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | errorprint | Print out descriptions from ConfigurationError. | uwsgiconf/cli.py | 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():
"""Print out descriptions from ConfigurationError."""
try:
yield
except ConfigurationError as e:
click.secho('%s' % e, err=True, fg='red')
sys.exit(1) | [
"Print",
"out",
"descriptions",
"from",
"ConfigurationError",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/cli.py#L13-L20 | [
"def",
"errorprint",
"(",
")",
":",
"try",
":",
"yield",
"except",
"ConfigurationError",
"as",
"e",
":",
"click",
".",
"secho",
"(",
"'%s'",
"%",
"e",
",",
"err",
"=",
"True",
",",
"fg",
"=",
"'red'",
")",
"sys",
".",
"exit",
"(",
"1",
")"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | run | Runs uWSGI passing to it using the default or another `uwsgiconf` configuration module. | uwsgiconf/cli.py | 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):
"""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... | [
"Runs",
"uWSGI",
"passing",
"to",
"it",
"using",
"the",
"default",
"or",
"another",
"uwsgiconf",
"configuration",
"module",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/cli.py#L39-L48 | [
"def",
"run",
"(",
"conf",
",",
"only",
")",
":",
"with",
"errorprint",
"(",
")",
":",
"config",
"=",
"ConfModule",
"(",
"conf",
")",
"spawned",
"=",
"config",
".",
"spawn_uwsgi",
"(",
"only",
")",
"for",
"alias",
",",
"pid",
"in",
"spawned",
":",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | compile | Compiles classic uWSGI configuration file using the default
or given `uwsgiconf` configuration module. | uwsgiconf/cli.py | 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):
"""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) | [
"Compiles",
"classic",
"uWSGI",
"configuration",
"file",
"using",
"the",
"default",
"or",
"given",
"uwsgiconf",
"configuration",
"module",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/cli.py#L53-L61 | [
"def",
"compile",
"(",
"conf",
")",
":",
"with",
"errorprint",
"(",
")",
":",
"config",
"=",
"ConfModule",
"(",
"conf",
")",
"for",
"conf",
"in",
"config",
".",
"configurations",
":",
"conf",
".",
"format",
"(",
"do_print",
"=",
"True",
")"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | sysinit | Outputs configuration for system initialization subsystem. | uwsgiconf/cli.py | 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):
"""Outputs configuration for system initialization subsystem."""
click.secho(get_config(
systype,
conf=ConfModule(conf).configurations[0],
conf_path=conf,
project_name=project,
)) | [
"Outputs",
"configuration",
"for",
"system",
"initialization",
"subsystem",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/cli.py#L68-L76 | [
"def",
"sysinit",
"(",
"systype",
",",
"conf",
",",
"project",
")",
":",
"click",
".",
"secho",
"(",
"get_config",
"(",
"systype",
",",
"conf",
"=",
"ConfModule",
"(",
"conf",
")",
".",
"configurations",
"[",
"0",
"]",
",",
"conf_path",
"=",
"conf",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | 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. | uwsgiconf/cli.py | 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():
"""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(''... | [
"Runs",
"uWSGI",
"to",
"determine",
"what",
"plugins",
"are",
"available",
"and",
"prints",
"them",
"out",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/cli.py#L80-L94 | [
"def",
"probe_plugins",
"(",
")",
":",
"plugins",
"=",
"UwsgiRunner",
"(",
")",
".",
"get_plugins",
"(",
")",
"for",
"plugin",
"in",
"sorted",
"(",
"plugins",
".",
"generic",
")",
":",
"click",
".",
"secho",
"(",
"plugin",
")",
"click",
".",
"secho",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Signal.register_handler | 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``/`... | uwsgiconf/runtime/signals.py | 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):
"""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... | [
"Decorator",
"for",
"a",
"function",
"to",
"be",
"used",
"as",
"a",
"signal",
"handler",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/signals.py#L48-L79 | [
"def",
"register_handler",
"(",
"self",
",",
"target",
"=",
"None",
")",
":",
"target",
"=",
"target",
"or",
"'worker'",
"sign_num",
"=",
"self",
".",
"num",
"def",
"wrapper",
"(",
"func",
")",
":",
"_LOG",
".",
"debug",
"(",
"\"Registering '%s' as signal ... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Spooler.add | 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... | uwsgiconf/options/spooler.py | 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):
"""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... | [
"Run",
"a",
"spooler",
"on",
"the",
"specified",
"directory",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/spooler.py#L64-L82 | [
"def",
"add",
"(",
"self",
",",
"work_dir",
",",
"external",
"=",
"False",
")",
":",
"command",
"=",
"'spooler'",
"if",
"external",
":",
"command",
"+=",
"'-external'",
"self",
".",
"_set",
"(",
"command",
",",
"self",
".",
"_section",
".",
"replace_plac... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Broodlord.configure | Configures broodlord mode and returns emperor and zerg sections.
:rtype: tuple | uwsgiconf/presets/empire.py | 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):
"""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)... | [
"Configures",
"broodlord",
"mode",
"and",
"returns",
"emperor",
"and",
"zerg",
"sections",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/presets/empire.py#L54-L74 | [
"def",
"configure",
"(",
"self",
")",
":",
"section_emperor",
"=",
"self",
".",
"section_emperor",
"section_zerg",
"=",
"self",
".",
"section_zerg",
"socket",
"=",
"self",
".",
"socket",
"section_emperor",
".",
"workers",
".",
"set_zerg_server_params",
"(",
"soc... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.get_log_format_default | Returns default log message format.
.. note:: Some params may be missing. | uwsgiconf/presets/nice.py | 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):
"""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... | [
"Returns",
"default",
"log",
"message",
"format",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/presets/nice.py#L83-L118 | [
"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... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.configure_owner | Shortcut to set process owner data.
:param str|unicode owner: Sets user and group. Default: ``www-data``. | uwsgiconf/presets/nice.py | 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'):
"""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 | [
"Shortcut",
"to",
"set",
"process",
"owner",
"data",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/presets/nice.py#L120-L129 | [
"def",
"configure_owner",
"(",
"self",
",",
"owner",
"=",
"'www-data'",
")",
":",
"if",
"owner",
"is",
"not",
"None",
":",
"self",
".",
"main_process",
".",
"set_owner_params",
"(",
"uid",
"=",
"owner",
",",
"gid",
"=",
"owner",
")",
"return",
"self"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Alarms.set_basic_params | :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. | uwsgiconf/options/alarms.py | 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):
"""
: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... | [
":",
"param",
"int",
"msg_size",
":",
"Set",
"the",
"max",
"size",
"of",
"an",
"alarm",
"message",
"in",
"bytes",
".",
"Default",
":",
"8192",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/alarms.py#L32-L46 | [
"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'",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Alarms.register_alarm | Register (create) an alarm.
:param AlarmType|list[AlarmType] alarm: Alarm. | uwsgiconf/options/alarms.py | 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):
"""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)
... | [
"Register",
"(",
"create",
")",
"an",
"alarm",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/alarms.py#L55-L66 | [
"def",
"register_alarm",
"(",
"self",
",",
"alarm",
")",
":",
"for",
"alarm",
"in",
"listify",
"(",
"alarm",
")",
":",
"if",
"alarm",
"not",
"in",
"self",
".",
"_alarms",
":",
"self",
".",
"_set",
"(",
"'alarm'",
",",
"alarm",
",",
"multi",
"=",
"T... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Alarms.alarm_on_log | 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: | uwsgiconf/options/alarms.py | 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):
"""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",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/alarms.py#L68-L86 | [
"def",
"alarm_on_log",
"(",
"self",
",",
"alarm",
",",
"matcher",
",",
"skip",
"=",
"False",
")",
":",
"self",
".",
"register_alarm",
"(",
"alarm",
")",
"value",
"=",
"'%s %s'",
"%",
"(",
"','",
".",
"join",
"(",
"map",
"(",
"attrgetter",
"(",
"'alia... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Alarms.alarm_on_fd_ready | 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... | uwsgiconf/options/alarms.py | 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):
"""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... | [
"Triggers",
"the",
"alarm",
"when",
"the",
"specified",
"file",
"descriptor",
"is",
"ready",
"for",
"read",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/alarms.py#L88-L119 | [
"def",
"alarm_on_fd_ready",
"(",
"self",
",",
"alarm",
",",
"fd",
",",
"message",
",",
"byte_count",
"=",
"None",
")",
":",
"self",
".",
"register_alarm",
"(",
"alarm",
")",
"value",
"=",
"fd",
"if",
"byte_count",
":",
"value",
"+=",
"':%s'",
"%",
"byt... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Alarms.alarm_on_segfault | Raise the specified alarm when the segmentation fault handler is executed.
Sends a backtrace.
:param AlarmType|list[AlarmType] alarm: Alarm. | uwsgiconf/options/alarms.py | 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):
"""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-... | [
"Raise",
"the",
"specified",
"alarm",
"when",
"the",
"segmentation",
"fault",
"handler",
"is",
"executed",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/alarms.py#L133-L145 | [
"def",
"alarm_on_segfault",
"(",
"self",
",",
"alarm",
")",
":",
"self",
".",
"register_alarm",
"(",
"alarm",
")",
"for",
"alarm",
"in",
"listify",
"(",
"alarm",
")",
":",
"self",
".",
"_set",
"(",
"'alarm-segfault'",
",",
"alarm",
".",
"alias",
",",
"... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | get_config | 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|... | uwsgiconf/sysinit.py | 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):
"""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 ... | [
"Returns",
"init",
"system",
"configuration",
"file",
"contents",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/sysinit.py#L120-L144 | [
"def",
"get_config",
"(",
"systype",
",",
"conf",
",",
"conf_path",
",",
"runner",
"=",
"None",
",",
"project_name",
"=",
"None",
")",
":",
"runner",
"=",
"runner",
"or",
"(",
"'%s run'",
"%",
"Finder",
".",
"uwsgiconf",
"(",
")",
")",
"conf_path",
"="... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | app_1 | This is simple WSGI application that will be served by uWSGI. | demos/onefile.py | 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):
"""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>' % ... | [
"This",
"is",
"simple",
"WSGI",
"application",
"that",
"will",
"be",
"served",
"by",
"uWSGI",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/demos/onefile.py#L20-L34 | [
"def",
"app_1",
"(",
"env",
",",
"start_response",
")",
":",
"from",
"uwsgiconf",
".",
"runtime",
".",
"environ",
"import",
"uwsgi_env",
"start_response",
"(",
"'200 OK'",
",",
"[",
"(",
"'Content-Type'",
",",
"'text/html'",
")",
"]",
")",
"data",
"=",
"["... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | app_2 | This is another simple WSGI application that will be served by uWSGI. | demos/onefile.py | 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):
"""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... | [
"This",
"is",
"another",
"simple",
"WSGI",
"application",
"that",
"will",
"be",
"served",
"by",
"uWSGI",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/demos/onefile.py#L37-L50 | [
"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... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | 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. | demos/onefile.py | 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():
"""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... | [
"Configure",
"uWSGI",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/demos/onefile.py#L53-L101 | [
"def",
"configure",
"(",
")",
":",
"import",
"os",
"from",
"uwsgiconf",
".",
"presets",
".",
"nice",
"import",
"PythonSection",
"FILE",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"__file__",
")",
"port",
"=",
"8000",
"configurations",
"=",
"[",
"]",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | headers_raw_to_dict | 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... | copyheaders/copyheaders.py | 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):
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... | [
"r",
"Convert",
"raw",
"headers",
"(",
"single",
"multi",
"-",
"line",
"bytestring",
")",
"to",
"a",
"dictionary",
"."
] | jin10086/copyheaders | python | https://github.com/jin10086/copyheaders/blob/195479ac1c8620e0490c75c5d4d768faf5dcbf8f/copyheaders/copyheaders.py#L1-L39 | [
"def",
"headers_raw_to_dict",
"(",
"headers_raw",
")",
":",
"if",
"headers_raw",
"is",
"None",
":",
"return",
"None",
"headers",
"=",
"headers_raw",
".",
"splitlines",
"(",
")",
"headers_tuples",
"=",
"[",
"header",
".",
"split",
"(",
"b':'",
",",
"1",
")"... | 195479ac1c8620e0490c75c5d4d768faf5dcbf8f |
train | Logging.log_into | 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. | uwsgiconf/options/logging.py | 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):
"""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... | [
"Simple",
"file",
"or",
"UDP",
"logging",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L108-L126 | [
"def",
"log_into",
"(",
"self",
",",
"target",
",",
"before_priv_drop",
"=",
"True",
")",
":",
"command",
"=",
"'logto'",
"if",
"not",
"before_priv_drop",
":",
"command",
"+=",
"'2'",
"self",
".",
"_set",
"(",
"command",
",",
"target",
")",
"return",
"se... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Logging.set_file_params | 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: ... | uwsgiconf/options/logging.py | 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, owner=None, mode=None):
"""Set various parameters related to file logging.
:param bool reopen_on_reload: Reopen log after reload.
... | [
"Set",
"various",
"parameters",
"related",
"to",
"file",
"logging",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L128-L166 | [
"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... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Logging.set_filters | 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... | uwsgiconf/options/logging.py | 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):
"""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... | [
"Set",
"various",
"log",
"data",
"filters",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L168-L209 | [
"def",
"set_filters",
"(",
"self",
",",
"include",
"=",
"None",
",",
"exclude",
"=",
"None",
",",
"write_errors",
"=",
"None",
",",
"write_errors_tolerance",
"=",
"None",
",",
"sigpipe",
"=",
"None",
")",
":",
"if",
"write_errors",
"is",
"not",
"None",
"... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Logging.set_requests_filters | 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... | uwsgiconf/options/logging.py | 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... | [
"Set",
"various",
"log",
"data",
"filters",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L211-L239 | [
"def",
"set_requests_filters",
"(",
"self",
",",
"slower",
"=",
"None",
",",
"bigger",
"=",
"None",
",",
"status_4xx",
"=",
"None",
",",
"status_5xx",
"=",
"None",
",",
"no_body",
"=",
"None",
",",
"sendfile",
"=",
"None",
",",
"io_errors",
"=",
"None",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Logging.set_master_logging_params | 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... | uwsgiconf/options/logging.py | 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):
"""Sets logging params for delegating logging to master process.
:param bool enable: Delegate logging to master process.
Delegate t... | [
"Sets",
"logging",
"params",
"for",
"delegating",
"logging",
"to",
"master",
"process",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L241-L274 | [
"def",
"set_master_logging_params",
"(",
"self",
",",
"enable",
"=",
"None",
",",
"dedicate_thread",
"=",
"None",
",",
"buffer",
"=",
"None",
",",
"sock_stream",
"=",
"None",
",",
"sock_stream_requests_only",
"=",
"None",
")",
":",
"self",
".",
"_set",
"(",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Logging.add_logger | 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. | uwsgiconf/options/logging.py | 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):
"""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_... | [
"Set",
"/",
"add",
"a",
"common",
"logger",
"or",
"a",
"request",
"requests",
"only",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L283-L302 | [
"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",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Logging.add_logger_route | 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... | uwsgiconf/options/logging.py | 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):
"""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.... | [
"Log",
"to",
"the",
"specified",
"named",
"logger",
"if",
"regexp",
"applied",
"on",
"log",
"item",
"matches",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L304-L319 | [
"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",
")",
":",
"... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Logging.add_logger_encoder | 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
... | uwsgiconf/options/logging.py | 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):
"""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... | [
"Add",
"an",
"item",
"in",
"the",
"log",
"encoder",
"or",
"request",
"encoder",
"chain",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/logging.py#L321-L357 | [
"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... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | _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 | src/cmarkgfm/build_cmark.py | 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():
"""
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... | [
"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",
"/",
... | theacodes/cmarkgfm | python | https://github.com/theacodes/cmarkgfm/blob/742cc59c7dadbee3c1f54b86167840bd0d3f2d49/src/cmarkgfm/build_cmark.py#L41-L54 | [
"def",
"_compiler_type",
"(",
")",
":",
"dist",
"=",
"distutils",
".",
"dist",
".",
"Distribution",
"(",
")",
"dist",
".",
"parse_config_files",
"(",
")",
"cmd",
"=",
"dist",
".",
"get_command_obj",
"(",
"'build'",
")",
"cmd",
".",
"ensure_finalized",
"(",... | 742cc59c7dadbee3c1f54b86167840bd0d3f2d49 |
train | Monitoring.set_metrics_params | 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 ... | uwsgiconf/options/monitoring.py | 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):
"""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... | [
"Sets",
"basic",
"Metrics",
"subsystem",
"params",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/monitoring.py#L93-L129 | [
"def",
"set_metrics_params",
"(",
"self",
",",
"enable",
"=",
"None",
",",
"store_dir",
"=",
"None",
",",
"restore",
"=",
"None",
",",
"no_cores",
"=",
"None",
")",
":",
"self",
".",
"_set",
"(",
"'enable-metrics'",
",",
"enable",
",",
"cast",
"=",
"bo... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Monitoring.set_metrics_threshold | 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... | uwsgiconf/options/monitoring.py | 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):
"""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... | [
"Sets",
"metric",
"threshold",
"parameters",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/monitoring.py#L131-L163 | [
"def",
"set_metrics_threshold",
"(",
"self",
",",
"name",
",",
"value",
",",
"check_interval",
"=",
"None",
",",
"reset_to",
"=",
"None",
",",
"alarm",
"=",
"None",
",",
"alarm_message",
"=",
"None",
")",
":",
"if",
"alarm",
"is",
"not",
"None",
"and",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Monitoring.set_stats_params | 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... | uwsgiconf/options/monitoring.py | 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):
"""Enables stats server on the specified address.
* http://uwsgi.readthedocs.io/en/latest/StatsServer.html
:param str|unicode address: Address/s... | [
"Enables",
"stats",
"server",
"on",
"the",
"specified",
"address",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/monitoring.py#L165-L198 | [
"def",
"set_stats_params",
"(",
"self",
",",
"address",
"=",
"None",
",",
"enable_http",
"=",
"None",
",",
"minify",
"=",
"None",
",",
"no_cores",
"=",
"None",
",",
"no_metrics",
"=",
"None",
",",
"push_interval",
"=",
"None",
")",
":",
"self",
".",
"_... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Monitoring.register_stats_pusher | Registers a pusher to be used for pushing statistics to various remotes/locals.
:param Pusher|list[Pusher] pusher: | uwsgiconf/options/monitoring.py | 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):
"""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 | [
"Registers",
"a",
"pusher",
"to",
"be",
"used",
"for",
"pushing",
"statistics",
"to",
"various",
"remotes",
"/",
"locals",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/monitoring.py#L200-L209 | [
"def",
"register_stats_pusher",
"(",
"self",
",",
"pusher",
")",
":",
"for",
"pusher",
"in",
"listify",
"(",
"pusher",
")",
":",
"self",
".",
"_set",
"(",
"'stats-push'",
",",
"pusher",
",",
"multi",
"=",
"True",
")",
"return",
"self",
".",
"_section"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Monitoring.enable_snmp | 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 ... | uwsgiconf/options/monitoring.py | 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):
"""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 ... | [
"Enables",
"SNMP",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/monitoring.py#L211-L235 | [
"def",
"enable_snmp",
"(",
"self",
",",
"address",
",",
"community_string",
")",
":",
"self",
".",
"_set",
"(",
"'snmp'",
",",
"address",
")",
"self",
".",
"_set",
"(",
"'snmp-community'",
",",
"community_string",
")",
"return",
"self",
".",
"_section"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Applications.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... | uwsgiconf/options/applications.py | 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):
"""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... | [
"Load",
"application",
"under",
"mountpoint",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/applications.py#L40-L68 | [
"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'",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Applications.switch_into_lazy_mode | 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... | uwsgiconf/options/applications.py | 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):
"""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 ... | [
"Load",
"apps",
"in",
"workers",
"instead",
"of",
"master",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/applications.py#L70-L88 | [
"def",
"switch_into_lazy_mode",
"(",
"self",
",",
"affect_master",
"=",
"None",
")",
":",
"self",
".",
"_set",
"(",
"'lazy'",
"if",
"affect_master",
"else",
"'lazy-apps'",
",",
"True",
",",
"cast",
"=",
"bool",
")",
"return",
"self",
".",
"_section"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterHttp.set_basic_params | :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 ... | uwsgiconf/options/routing_routers.py | 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=None, buffer_size=None,
keepalive=None, resubscribe_addresses=None):
"""
:param int workers: Number of worker processes to... | [
":",
"param",
"int",
"workers",
":",
"Number",
"of",
"worker",
"processes",
"to",
"spawn",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L319-L364 | [
"def",
"set_basic_params",
"(",
"self",
",",
"workers",
"=",
"None",
",",
"zerg_server",
"=",
"None",
",",
"fallback_node",
"=",
"None",
",",
"concurrent_events",
"=",
"None",
",",
"cheap_mode",
"=",
"None",
",",
"stats_server",
"=",
"None",
",",
"quiet",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterHttp.set_connections_params | 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... | uwsgiconf/options/routing_routers.py | 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):
"""Sets connection-related parameters.
:param int harakiri: Set gateway harakiri timeout (seconds).
:param int timeout_socket: Node socket timeout (s... | [
"Sets",
"connection",
"-",
"related",
"parameters",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L366-L397 | [
"def",
"set_connections_params",
"(",
"self",
",",
"harakiri",
"=",
"None",
",",
"timeout_socket",
"=",
"None",
",",
"retry_delay",
"=",
"None",
",",
"timeout_headers",
"=",
"None",
",",
"timeout_backend",
"=",
"None",
")",
":",
"super",
"(",
"RouterHttp",
"... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterHttp.set_manage_params | 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.
:... | uwsgiconf/options/routing_routers.py | 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=None):
"""Allows enabling various automatic management mechanics.
* http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.html#http-route... | [
"Allows",
"enabling",
"various",
"automatic",
"management",
"mechanics",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L399-L434 | [
"def",
"set_manage_params",
"(",
"self",
",",
"chunked_input",
"=",
"None",
",",
"chunked_output",
"=",
"None",
",",
"gzip",
"=",
"None",
",",
"websockets",
"=",
"None",
",",
"source_method",
"=",
"None",
",",
"rtsp",
"=",
"None",
",",
"proxy_protocol",
"=... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterHttp.set_owner_params | 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. | uwsgiconf/options/routing_routers.py | 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):
"""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',... | [
"Drop",
"http",
"router",
"privileges",
"to",
"specified",
"user",
"and",
"group",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L436-L447 | [
"def",
"set_owner_params",
"(",
"self",
",",
"uid",
"=",
"None",
",",
"gid",
"=",
"None",
")",
":",
"self",
".",
"_set_aliased",
"(",
"'uid'",
",",
"uid",
")",
"self",
".",
"_set_aliased",
"(",
"'gid'",
",",
"gid",
")",
"return",
"self"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterSsl.set_connections_params | 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... | uwsgiconf/options/routing_routers.py | 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):
"""Sets connection-related parameters.
:param int harakiri: Set gateway harakiri timeout (seconds).
:param int timeout_socket: Node socket timeout (seconds). Default: 60.
:param int... | [
"Sets",
"connection",
"-",
"related",
"parameters",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L569-L586 | [
"def",
"set_connections_params",
"(",
"self",
",",
"harakiri",
"=",
"None",
",",
"timeout_socket",
"=",
"None",
",",
"retry_delay",
"=",
"None",
",",
"retry_max",
"=",
"None",
")",
":",
"super",
"(",
"RouterSsl",
",",
"self",
")",
".",
"set_connections_param... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterFast.set_basic_params | :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 ... | uwsgiconf/options/routing_routers.py | 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=None, buffer_size=None,
fallback_nokey=None, subscription_key=None, emperor_command_socket=None):
"""
:param int workers: ... | [
":",
"param",
"int",
"workers",
":",
"Number",
"of",
"worker",
"processes",
"to",
"spawn",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L599-L644 | [
"def",
"set_basic_params",
"(",
"self",
",",
"workers",
"=",
"None",
",",
"zerg_server",
"=",
"None",
",",
"fallback_node",
"=",
"None",
",",
"concurrent_events",
"=",
"None",
",",
"cheap_mode",
"=",
"None",
",",
"stats_server",
"=",
"None",
",",
"quiet",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterFast.set_resubscription_params | 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... | uwsgiconf/options/routing_routers.py | 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):
"""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.
... | [
"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",
... | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L646-L662 | [
"def",
"set_resubscription_params",
"(",
"self",
",",
"addresses",
"=",
"None",
",",
"bind_to",
"=",
"None",
")",
":",
"self",
".",
"_set_aliased",
"(",
"'resubscribe'",
",",
"addresses",
",",
"multi",
"=",
"True",
")",
"self",
".",
"_set_aliased",
"(",
"'... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterFast.set_connections_params | 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... | uwsgiconf/options/routing_routers.py | 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):
"""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",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L664-L684 | [
"def",
"set_connections_params",
"(",
"self",
",",
"harakiri",
"=",
"None",
",",
"timeout_socket",
"=",
"None",
",",
"retry_delay",
"=",
"None",
",",
"retry_max",
"=",
"None",
",",
"defer",
"=",
"None",
")",
":",
"super",
"(",
"RouterFast",
",",
"self",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterFast.set_postbuffering_params | 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 ... | uwsgiconf/options/routing_routers.py | 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):
"""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... | [
"Sets",
"buffering",
"params",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L686-L701 | [
"def",
"set_postbuffering_params",
"(",
"self",
",",
"size",
"=",
"None",
",",
"store_dir",
"=",
"None",
")",
":",
"self",
".",
"_set_aliased",
"(",
"'post-buffering'",
",",
"size",
")",
"self",
".",
"_set_aliased",
"(",
"'post-buffering-dir'",
",",
"store_dir... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterRaw.set_connections_params | 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... | uwsgiconf/options/routing_routers.py | 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):
"""Sets connection-related parameters.
:param int harakiri: Set gateway harakiri timeout (seconds).
:param int timeout_socket: Node socket timeout (seconds). ... | [
"Sets",
"connection",
"-",
"related",
"parameters",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L726-L747 | [
"def",
"set_connections_params",
"(",
"self",
",",
"harakiri",
"=",
"None",
",",
"timeout_socket",
"=",
"None",
",",
"retry_delay",
"=",
"None",
",",
"retry_max",
"=",
"None",
",",
"use_xclient",
"=",
"None",
")",
":",
"super",
"(",
"RouterRaw",
",",
"self... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterForkPty.set_connections_params | Sets connection-related parameters.
:param int harakiri: Set gateway harakiri timeout (seconds).
:param int timeout_socket: Node socket timeout (seconds). Default: 60. | uwsgiconf/options/routing_routers.py | 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):
"""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... | [
"Sets",
"connection",
"-",
"related",
"parameters",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L814-L825 | [
"def",
"set_connections_params",
"(",
"self",
",",
"harakiri",
"=",
"None",
",",
"timeout_socket",
"=",
"None",
")",
":",
"self",
".",
"_set_aliased",
"(",
"'harakiri'",
",",
"harakiri",
")",
"self",
".",
"_set_aliased",
"(",
"'timeout'",
",",
"timeout_socket"... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterForkPty.set_window_params | Sets pty window params.
:param int cols:
:param int rows: | uwsgiconf/options/routing_routers.py | 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):
"""Sets pty window params.
:param int cols:
:param int rows:
"""
self._set_aliased('cols', cols)
self._set_aliased('rows', rows)
return self | [
"Sets",
"pty",
"window",
"params",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L827-L837 | [
"def",
"set_window_params",
"(",
"self",
",",
"cols",
"=",
"None",
",",
"rows",
"=",
"None",
")",
":",
"self",
".",
"_set_aliased",
"(",
"'cols'",
",",
"cols",
")",
"self",
".",
"_set_aliased",
"(",
"'rows'",
",",
"rows",
")",
"return",
"self"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterTunTap.set_basic_params | :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. | uwsgiconf/options/routing_routers.py | 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):
"""
: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'... | [
":",
"param",
"str|unicode",
"use_credentials",
":",
"Enable",
"check",
"of",
"SCM_CREDENTIALS",
"for",
"tuntap",
"client",
"/",
"server",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L885-L895 | [
"def",
"set_basic_params",
"(",
"self",
",",
"use_credentials",
"=",
"None",
",",
"stats_server",
"=",
"None",
")",
":",
"self",
".",
"_set_aliased",
"(",
"'use-credentials'",
",",
"use_credentials",
")",
"self",
".",
"_set_aliased",
"(",
"'router-stats'",
",",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterTunTap.register_route | 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. | uwsgiconf/options/routing_routers.py | 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):
"""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... | [
"Adds",
"a",
"routing",
"rule",
"to",
"the",
"tuntap",
"router",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L897-L909 | [
"def",
"register_route",
"(",
"self",
",",
"src",
",",
"dst",
",",
"gateway",
")",
":",
"self",
".",
"_set_aliased",
"(",
"'router-route'",
",",
"' '",
".",
"join",
"(",
"(",
"src",
",",
"dst",
",",
"gateway",
")",
")",
",",
"multi",
"=",
"True",
"... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterTunTap.device_add_rule | 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.
... | uwsgiconf/options/routing_routers.py | 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):
"""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
... | [
"Adds",
"a",
"tuntap",
"device",
"rule",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L929-L962 | [
"def",
"device_add_rule",
"(",
"self",
",",
"direction",
",",
"action",
",",
"src",
",",
"dst",
",",
"target",
"=",
"None",
")",
":",
"value",
"=",
"[",
"direction",
",",
"src",
",",
"dst",
",",
"action",
"]",
"if",
"target",
":",
"value",
".",
"ap... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | RouterTunTap.add_firewall_rule | 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... | uwsgiconf/options/routing_routers.py | 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):
"""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... | [
"Adds",
"a",
"firewall",
"rule",
"to",
"the",
"router",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/routing_routers.py#L964-L992 | [
"def",
"add_firewall_rule",
"(",
"self",
",",
"direction",
",",
"action",
",",
"src",
"=",
"None",
",",
"dst",
"=",
"None",
")",
":",
"value",
"=",
"[",
"action",
"]",
"if",
"src",
":",
"value",
".",
"extend",
"(",
"(",
"src",
",",
"dst",
")",
")... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | configure_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... | uwsgiconf/config.py | 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):
"""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... | [
"Allows",
"configuring",
"uWSGI",
"using",
"Configuration",
"objects",
"returned",
"by",
"the",
"given",
"configuration",
"function",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L663-L759 | [
"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 ... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.replace_placeholders | 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] | uwsgiconf/config.py | 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):
"""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... | [
"Replaces",
"placeholders",
"that",
"can",
"be",
"used",
"e",
".",
"g",
".",
"in",
"filepaths",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L180-L210 | [
"def",
"replace_placeholders",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"value",
":",
"return",
"value",
"is_list",
"=",
"isinstance",
"(",
"value",
",",
"list",
")",
"values",
"=",
"[",
"]",
"for",
"value",
"in",
"listify",
"(",
"value",
")",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.get_runtime_dir | 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 | uwsgiconf/config.py | 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):
"""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",
"()"
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L224-L240 | [
"def",
"get_runtime_dir",
"(",
"self",
",",
"default",
"=",
"True",
")",
":",
"dir_",
"=",
"self",
".",
"_runtime_dir",
"if",
"not",
"dir_",
"and",
"default",
":",
"uid",
"=",
"self",
".",
"main_process",
".",
"get_owner",
"(",
")",
"[",
"0",
"]",
"d... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.print_stamp | Prints out a stamp containing useful information,
such as what and when has generated this configuration. | uwsgiconf/config.py | 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):
"""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... | [
"Prints",
"out",
"a",
"stamp",
"containing",
"useful",
"information",
"such",
"as",
"what",
"and",
"when",
"has",
"generated",
"this",
"configuration",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L272-L283 | [
"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... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.print_out | 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. | uwsgiconf/config.py | 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):
"""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 ... | [
"Prints",
"out",
"the",
"given",
"value",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L285-L315 | [
"def",
"print_out",
"(",
"self",
",",
"value",
",",
"indent",
"=",
"None",
",",
"format_options",
"=",
"None",
",",
"asap",
"=",
"False",
")",
":",
"if",
"indent",
"is",
"None",
":",
"indent",
"=",
"'> '",
"text",
"=",
"indent",
"+",
"str",
"(",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.print_variables | 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 | uwsgiconf/config.py | 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):
"""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... | [
"Prints",
"out",
"magic",
"variables",
"available",
"in",
"config",
"files",
"alongside",
"with",
"their",
"values",
"and",
"descriptions",
".",
"May",
"be",
"useful",
"for",
"debugging",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L317-L334 | [
"def",
"print_variables",
"(",
"self",
")",
":",
"print_out",
"=",
"partial",
"(",
"self",
".",
"print_out",
",",
"format_options",
"=",
"'green'",
")",
"print_out",
"(",
"'===== variables ====='",
")",
"for",
"var",
",",
"hint",
"in",
"self",
".",
"vars",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.set_plugins_params | 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.
... | uwsgiconf/config.py | 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):
"""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.
... | [
"Sets",
"plugin",
"-",
"related",
"parameters",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L336-L361 | [
"def",
"set_plugins_params",
"(",
"self",
",",
"plugins",
"=",
"None",
",",
"search_dirs",
"=",
"None",
",",
"autoload",
"=",
"None",
",",
"required",
"=",
"False",
")",
":",
"plugins",
"=",
"plugins",
"or",
"[",
"]",
"command",
"=",
"'need-plugin'",
"if... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.set_fallback | 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. | uwsgiconf/config.py | 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):
"""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... | [
"Sets",
"a",
"fallback",
"configuration",
"for",
"section",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L363-L375 | [
"def",
"set_fallback",
"(",
"self",
",",
"target",
")",
":",
"if",
"isinstance",
"(",
"target",
",",
"Section",
")",
":",
"target",
"=",
"':'",
"+",
"target",
".",
"name",
"self",
".",
"_set",
"(",
"'fallback-config'",
",",
"target",
")",
"return",
"se... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.set_placeholder | Placeholders are custom magic variables defined during configuration
time.
.. note:: These are accessible, like any uWSGI option, in your application code via
``.runtime.environ.uwsgi_env.config``.
:param str|unicode key:
:param str|unicode value: | uwsgiconf/config.py | def set_placeholder(self, key, value):
"""Placeholders are custom magic variables defined during configuration
time.
.. note:: These are accessible, like any uWSGI option, in your application code via
``.runtime.environ.uwsgi_env.config``.
:param str|unicode key:
:... | def set_placeholder(self, key, value):
"""Placeholders are custom magic variables defined during configuration
time.
.. note:: These are accessible, like any uWSGI option, in your application code via
``.runtime.environ.uwsgi_env.config``.
:param str|unicode key:
:... | [
"Placeholders",
"are",
"custom",
"magic",
"variables",
"defined",
"during",
"configuration",
"time",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L377-L391 | [
"def",
"set_placeholder",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"self",
".",
"_set",
"(",
"'set-placeholder'",
",",
"'%s=%s'",
"%",
"(",
"key",
",",
"value",
")",
",",
"multi",
"=",
"True",
")",
"return",
"self"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.env | Processes (sets/unsets) environment variable.
If is not given in `set` mode value will be taken from current env.
:param str|unicode key:
:param value:
:param bool unset: Whether to unset this variable.
:param bool asap: If True env variable will be set as soon as possible. | uwsgiconf/config.py | def env(self, key, value=None, unset=False, asap=False):
"""Processes (sets/unsets) environment variable.
If is not given in `set` mode value will be taken from current env.
:param str|unicode key:
:param value:
:param bool unset: Whether to unset this variable.
:par... | def env(self, key, value=None, unset=False, asap=False):
"""Processes (sets/unsets) environment variable.
If is not given in `set` mode value will be taken from current env.
:param str|unicode key:
:param value:
:param bool unset: Whether to unset this variable.
:par... | [
"Processes",
"(",
"sets",
"/",
"unsets",
")",
"environment",
"variable",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L393-L415 | [
"def",
"env",
"(",
"self",
",",
"key",
",",
"value",
"=",
"None",
",",
"unset",
"=",
"False",
",",
"asap",
"=",
"False",
")",
":",
"if",
"unset",
":",
"self",
".",
"_set",
"(",
"'unenv'",
",",
"key",
",",
"multi",
"=",
"True",
")",
"else",
":",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.include | Includes target contents into config.
:param str|unicode|Section|list target: File path or Section to include. | uwsgiconf/config.py | def include(self, target):
"""Includes target contents into config.
:param str|unicode|Section|list target: File path or Section to include.
"""
for target_ in listify(target):
if isinstance(target_, Section):
target_ = ':' + target_.name
self._s... | def include(self, target):
"""Includes target contents into config.
:param str|unicode|Section|list target: File path or Section to include.
"""
for target_ in listify(target):
if isinstance(target_, Section):
target_ = ':' + target_.name
self._s... | [
"Includes",
"target",
"contents",
"into",
"config",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L417-L428 | [
"def",
"include",
"(",
"self",
",",
"target",
")",
":",
"for",
"target_",
"in",
"listify",
"(",
"target",
")",
":",
"if",
"isinstance",
"(",
"target_",
",",
"Section",
")",
":",
"target_",
"=",
"':'",
"+",
"target_",
".",
"name",
"self",
".",
"_set",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Section.derive_from | Creates a new section based on the given.
:param Section section: Section to derive from,
:param str|unicode name: New section name.
:rtype: Section | uwsgiconf/config.py | def derive_from(cls, section, name=None):
"""Creates a new section based on the given.
:param Section section: Section to derive from,
:param str|unicode name: New section name.
:rtype: Section
"""
new_section = deepcopy(section)
if name:
new_secti... | def derive_from(cls, section, name=None):
"""Creates a new section based on the given.
:param Section section: Section to derive from,
:param str|unicode name: New section name.
:rtype: Section
"""
new_section = deepcopy(section)
if name:
new_secti... | [
"Creates",
"a",
"new",
"section",
"based",
"on",
"the",
"given",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L431-L445 | [
"def",
"derive_from",
"(",
"cls",
",",
"section",
",",
"name",
"=",
"None",
")",
":",
"new_section",
"=",
"deepcopy",
"(",
"section",
")",
"if",
"name",
":",
"new_section",
".",
"name",
"=",
"name",
"return",
"new_section"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Configuration._validate_sections | Validates sections types and uniqueness. | uwsgiconf/config.py | def _validate_sections(cls, sections):
"""Validates sections types and uniqueness."""
names = []
for section in sections:
if not hasattr(section, 'name'):
raise ConfigurationError('`sections` attribute requires a list of Section')
name = section.name
... | def _validate_sections(cls, sections):
"""Validates sections types and uniqueness."""
names = []
for section in sections:
if not hasattr(section, 'name'):
raise ConfigurationError('`sections` attribute requires a list of Section')
name = section.name
... | [
"Validates",
"sections",
"types",
"and",
"uniqueness",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L595-L607 | [
"def",
"_validate_sections",
"(",
"cls",
",",
"sections",
")",
":",
"names",
"=",
"[",
"]",
"for",
"section",
"in",
"sections",
":",
"if",
"not",
"hasattr",
"(",
"section",
",",
"'name'",
")",
":",
"raise",
"ConfigurationError",
"(",
"'`sections` attribute r... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Configuration.format | Applies formatting to configuration.
*Currently formats to .ini*
:param bool do_print: Whether to print out formatted config.
:param bool stamp: Whether to add stamp data to the first configuration section.
:rtype: str|unicode | uwsgiconf/config.py | def format(self, do_print=False, stamp=True):
"""Applies formatting to configuration.
*Currently formats to .ini*
:param bool do_print: Whether to print out formatted config.
:param bool stamp: Whether to add stamp data to the first configuration section.
:rtype: str|unicode
... | def format(self, do_print=False, stamp=True):
"""Applies formatting to configuration.
*Currently formats to .ini*
:param bool do_print: Whether to print out formatted config.
:param bool stamp: Whether to add stamp data to the first configuration section.
:rtype: str|unicode
... | [
"Applies",
"formatting",
"to",
"configuration",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L609-L626 | [
"def",
"format",
"(",
"self",
",",
"do_print",
"=",
"False",
",",
"stamp",
"=",
"True",
")",
":",
"if",
"stamp",
"and",
"self",
".",
"sections",
":",
"self",
".",
"sections",
"[",
"0",
"]",
".",
"print_stamp",
"(",
")",
"formatted",
"=",
"IniFormatte... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Configuration.tofile | Saves configuration into a file and returns its path.
Convenience method.
:param str|unicode filepath: Filepath to save configuration into.
If not provided a temporary file will be automatically generated.
:rtype: str|unicode | uwsgiconf/config.py | def tofile(self, filepath=None):
"""Saves configuration into a file and returns its path.
Convenience method.
:param str|unicode filepath: Filepath to save configuration into.
If not provided a temporary file will be automatically generated.
:rtype: str|unicode
""... | def tofile(self, filepath=None):
"""Saves configuration into a file and returns its path.
Convenience method.
:param str|unicode filepath: Filepath to save configuration into.
If not provided a temporary file will be automatically generated.
:rtype: str|unicode
""... | [
"Saves",
"configuration",
"into",
"a",
"file",
"and",
"returns",
"its",
"path",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/config.py#L635-L660 | [
"def",
"tofile",
"(",
"self",
",",
"filepath",
"=",
"None",
")",
":",
"if",
"filepath",
"is",
"None",
":",
"with",
"NamedTemporaryFile",
"(",
"prefix",
"=",
"'%s_'",
"%",
"self",
".",
"alias",
",",
"suffix",
"=",
"'.ini'",
",",
"delete",
"=",
"False",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Python._set_name | Returns plugin name. | uwsgiconf/options/python.py | def _set_name(self, version=AUTO):
"""Returns plugin name."""
name = 'python'
if version:
if version is AUTO:
version = sys.version_info[0]
if version == 2:
version = ''
name = '%s%s' % (name, version)
self.... | def _set_name(self, version=AUTO):
"""Returns plugin name."""
name = 'python'
if version:
if version is AUTO:
version = sys.version_info[0]
if version == 2:
version = ''
name = '%s%s' % (name, version)
self.... | [
"Returns",
"plugin",
"name",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/python.py#L74-L88 | [
"def",
"_set_name",
"(",
"self",
",",
"version",
"=",
"AUTO",
")",
":",
"name",
"=",
"'python'",
"if",
"version",
":",
"if",
"version",
"is",
"AUTO",
":",
"version",
"=",
"sys",
".",
"version_info",
"[",
"0",
"]",
"if",
"version",
"==",
"2",
":",
"... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Python.set_app_args | Sets ``sys.argv`` for python apps.
Examples:
* pyargv="one two three" will set ``sys.argv`` to ``('one', 'two', 'three')``.
:param args: | uwsgiconf/options/python.py | def set_app_args(self, *args):
"""Sets ``sys.argv`` for python apps.
Examples:
* pyargv="one two three" will set ``sys.argv`` to ``('one', 'two', 'three')``.
:param args:
"""
if args:
self._set('pyargv', ' '.join(args))
return self._section | def set_app_args(self, *args):
"""Sets ``sys.argv`` for python apps.
Examples:
* pyargv="one two three" will set ``sys.argv`` to ``('one', 'two', 'three')``.
:param args:
"""
if args:
self._set('pyargv', ' '.join(args))
return self._section | [
"Sets",
"sys",
".",
"argv",
"for",
"python",
"apps",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/python.py#L98-L109 | [
"def",
"set_app_args",
"(",
"self",
",",
"*",
"args",
")",
":",
"if",
"args",
":",
"self",
".",
"_set",
"(",
"'pyargv'",
",",
"' '",
".",
"join",
"(",
"args",
")",
")",
"return",
"self",
".",
"_section"
] | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Python.set_wsgi_params | Set wsgi related parameters.
:param str|unicode module:
* load .wsgi file as the Python application
* load a WSGI module as the application.
.. note:: The module (sans ``.py``) must be importable, ie. be in ``PYTHONPATH``.
Examples:
* mypackage.... | uwsgiconf/options/python.py | def set_wsgi_params(self, module=None, callable_name=None, env_strategy=None):
"""Set wsgi related parameters.
:param str|unicode module:
* load .wsgi file as the Python application
* load a WSGI module as the application.
.. note:: The module (sans ``.py``) must be... | def set_wsgi_params(self, module=None, callable_name=None, env_strategy=None):
"""Set wsgi related parameters.
:param str|unicode module:
* load .wsgi file as the Python application
* load a WSGI module as the application.
.. note:: The module (sans ``.py``) must be... | [
"Set",
"wsgi",
"related",
"parameters",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/python.py#L111-L147 | [
"def",
"set_wsgi_params",
"(",
"self",
",",
"module",
"=",
"None",
",",
"callable_name",
"=",
"None",
",",
"env_strategy",
"=",
"None",
")",
":",
"module",
"=",
"module",
"or",
"''",
"if",
"'/'",
"in",
"module",
":",
"self",
".",
"_set",
"(",
"'wsgi-fi... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Python.set_autoreload_params | Sets autoreload related parameters.
:param int scan_interval: Seconds. Monitor Python modules' modification times to trigger reload.
.. warning:: Use only in development.
:param list|st|unicode ignore_modules: Ignore the specified module during auto-reload scan. | uwsgiconf/options/python.py | def set_autoreload_params(self, scan_interval=None, ignore_modules=None):
"""Sets autoreload related parameters.
:param int scan_interval: Seconds. Monitor Python modules' modification times to trigger reload.
.. warning:: Use only in development.
:param list|st|unicode ignore_mod... | def set_autoreload_params(self, scan_interval=None, ignore_modules=None):
"""Sets autoreload related parameters.
:param int scan_interval: Seconds. Monitor Python modules' modification times to trigger reload.
.. warning:: Use only in development.
:param list|st|unicode ignore_mod... | [
"Sets",
"autoreload",
"related",
"parameters",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/python.py#L158-L171 | [
"def",
"set_autoreload_params",
"(",
"self",
",",
"scan_interval",
"=",
"None",
",",
"ignore_modules",
"=",
"None",
")",
":",
"self",
".",
"_set",
"(",
"'py-auto-reload'",
",",
"scan_interval",
")",
"self",
".",
"_set",
"(",
"'py-auto-reload-ignore'",
",",
"ig... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Python.register_module_alias | Adds an alias for a module.
http://uwsgi-docs.readthedocs.io/en/latest/PythonModuleAlias.html
:param str|unicode alias:
:param str|unicode module_path:
:param bool after_init: add a python module alias after uwsgi module initialization | uwsgiconf/options/python.py | def register_module_alias(self, alias, module_path, after_init=False):
"""Adds an alias for a module.
http://uwsgi-docs.readthedocs.io/en/latest/PythonModuleAlias.html
:param str|unicode alias:
:param str|unicode module_path:
:param bool after_init: add a python module alias af... | def register_module_alias(self, alias, module_path, after_init=False):
"""Adds an alias for a module.
http://uwsgi-docs.readthedocs.io/en/latest/PythonModuleAlias.html
:param str|unicode alias:
:param str|unicode module_path:
:param bool after_init: add a python module alias af... | [
"Adds",
"an",
"alias",
"for",
"a",
"module",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/python.py#L173-L185 | [
"def",
"register_module_alias",
"(",
"self",
",",
"alias",
",",
"module_path",
",",
"after_init",
"=",
"False",
")",
":",
"command",
"=",
"'post-pymodule-alias'",
"if",
"after_init",
"else",
"'pymodule-alias'",
"self",
".",
"_set",
"(",
"command",
",",
"'%s=%s'"... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Python.import_module | Imports a python module.
:param list|str|unicode modules:
:param bool shared: Import a python module in all of the processes.
This is done after fork but before request processing.
:param bool into_spooler: Import a python module in the spooler.
http://uwsgi-docs.readt... | uwsgiconf/options/python.py | def import_module(self, modules, shared=False, into_spooler=False):
"""Imports a python module.
:param list|str|unicode modules:
:param bool shared: Import a python module in all of the processes.
This is done after fork but before request processing.
:param bool into_spoo... | def import_module(self, modules, shared=False, into_spooler=False):
"""Imports a python module.
:param list|str|unicode modules:
:param bool shared: Import a python module in all of the processes.
This is done after fork but before request processing.
:param bool into_spoo... | [
"Imports",
"a",
"python",
"module",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/python.py#L187-L209 | [
"def",
"import_module",
"(",
"self",
",",
"modules",
",",
"shared",
"=",
"False",
",",
"into_spooler",
"=",
"False",
")",
":",
"if",
"all",
"(",
"(",
"shared",
",",
"into_spooler",
")",
")",
":",
"raise",
"ConfigurationError",
"(",
"'Unable to set both `shar... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Subscriptions.set_server_params | Sets subscription server related params.
:param str|unicode client_notify_address: Set the notification socket for subscriptions.
When you subscribe to a server, you can ask it to "acknowledge" the acceptance of your request.
pointing address (Unix socket or UDP), on which your instance... | uwsgiconf/options/subscriptions.py | def set_server_params(
self, client_notify_address=None, mountpoints_depth=None, require_vassal=None,
tolerance=None, tolerance_inactive=None, key_dot_split=None):
"""Sets subscription server related params.
:param str|unicode client_notify_address: Set the notification socket f... | def set_server_params(
self, client_notify_address=None, mountpoints_depth=None, require_vassal=None,
tolerance=None, tolerance_inactive=None, key_dot_split=None):
"""Sets subscription server related params.
:param str|unicode client_notify_address: Set the notification socket f... | [
"Sets",
"subscription",
"server",
"related",
"params",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/subscriptions.py#L32-L64 | [
"def",
"set_server_params",
"(",
"self",
",",
"client_notify_address",
"=",
"None",
",",
"mountpoints_depth",
"=",
"None",
",",
"require_vassal",
"=",
"None",
",",
"tolerance",
"=",
"None",
",",
"tolerance_inactive",
"=",
"None",
",",
"key_dot_split",
"=",
"None... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Subscriptions.set_server_verification_params | Sets peer verification params for subscription server.
These are for secured subscriptions.
:param str|unicode digest_algo: Digest algorithm. Example: SHA1
.. note:: Also requires ``dir_cert`` to be set.
:param str|unicode dir_cert: Certificate directory.
.. note:: A... | uwsgiconf/options/subscriptions.py | def set_server_verification_params(
self, digest_algo=None, dir_cert=None, tolerance=None, no_check_uid=None,
dir_credentials=None, pass_unix_credentials=None):
"""Sets peer verification params for subscription server.
These are for secured subscriptions.
:param str|uni... | def set_server_verification_params(
self, digest_algo=None, dir_cert=None, tolerance=None, no_check_uid=None,
dir_credentials=None, pass_unix_credentials=None):
"""Sets peer verification params for subscription server.
These are for secured subscriptions.
:param str|uni... | [
"Sets",
"peer",
"verification",
"params",
"for",
"subscription",
"server",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/subscriptions.py#L66-L101 | [
"def",
"set_server_verification_params",
"(",
"self",
",",
"digest_algo",
"=",
"None",
",",
"dir_cert",
"=",
"None",
",",
"tolerance",
"=",
"None",
",",
"no_check_uid",
"=",
"None",
",",
"dir_credentials",
"=",
"None",
",",
"pass_unix_credentials",
"=",
"None",
... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Subscriptions.set_client_params | Sets subscribers related params.
:param bool start_unsubscribed: Configure subscriptions but do not send them.
.. note:: Useful with master FIFO.
:param bool clear_on_exit: Force clear instead of unsubscribe during shutdown.
:param bool unsubscribe_on_reload: Force unsubscribe req... | uwsgiconf/options/subscriptions.py | def set_client_params(
self, start_unsubscribed=None, clear_on_exit=None, unsubscribe_on_reload=None,
announce_interval=None):
"""Sets subscribers related params.
:param bool start_unsubscribed: Configure subscriptions but do not send them.
.. note:: Useful with mast... | def set_client_params(
self, start_unsubscribed=None, clear_on_exit=None, unsubscribe_on_reload=None,
announce_interval=None):
"""Sets subscribers related params.
:param bool start_unsubscribed: Configure subscriptions but do not send them.
.. note:: Useful with mast... | [
"Sets",
"subscribers",
"related",
"params",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/subscriptions.py#L103-L123 | [
"def",
"set_client_params",
"(",
"self",
",",
"start_unsubscribed",
"=",
"None",
",",
"clear_on_exit",
"=",
"None",
",",
"unsubscribe_on_reload",
"=",
"None",
",",
"announce_interval",
"=",
"None",
")",
":",
"self",
".",
"_set",
"(",
"'start-unsubscribed'",
",",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | Subscriptions.subscribe | Registers a subscription intent.
:param str|unicode server: Subscription server address (UDP or UNIX socket).
Examples:
* 127.0.0.1:7171
:param str|unicode key: Key to subscribe. Generally the domain name (+ optional '/< mountpoint>').
Examples:
... | uwsgiconf/options/subscriptions.py | def subscribe(
self, server=None, key=None, address=None, address_vassal=None,
balancing_weight=None, balancing_algo=None, modifier=None, signing=None, check_file=None, protocol=None,
sni_cert=None, sni_key=None, sni_client_ca=None):
"""Registers a subscription intent.
... | def subscribe(
self, server=None, key=None, address=None, address_vassal=None,
balancing_weight=None, balancing_algo=None, modifier=None, signing=None, check_file=None, protocol=None,
sni_cert=None, sni_key=None, sni_client_ca=None):
"""Registers a subscription intent.
... | [
"Registers",
"a",
"subscription",
"intent",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/subscriptions.py#L125-L216 | [
"def",
"subscribe",
"(",
"self",
",",
"server",
"=",
"None",
",",
"key",
"=",
"None",
",",
"address",
"=",
"None",
",",
"address_vassal",
"=",
"None",
",",
"balancing_weight",
"=",
"None",
",",
"balancing_algo",
"=",
"None",
",",
"modifier",
"=",
"None",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | find_project_dir | Runs up the stack to find the location of manage.py
which will be considered a project base path.
:rtype: str|unicode | uwsgiconf/contrib/django/uwsgify/toolbox.py | def find_project_dir():
"""Runs up the stack to find the location of manage.py
which will be considered a project base path.
:rtype: str|unicode
"""
frame = inspect.currentframe()
while True:
frame = frame.f_back
fname = frame.f_globals['__file__']
if os.path.basename(... | def find_project_dir():
"""Runs up the stack to find the location of manage.py
which will be considered a project base path.
:rtype: str|unicode
"""
frame = inspect.currentframe()
while True:
frame = frame.f_back
fname = frame.f_globals['__file__']
if os.path.basename(... | [
"Runs",
"up",
"the",
"stack",
"to",
"find",
"the",
"location",
"of",
"manage",
".",
"py",
"which",
"will",
"be",
"considered",
"a",
"project",
"base",
"path",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/contrib/django/uwsgify/toolbox.py#L9-L24 | [
"def",
"find_project_dir",
"(",
")",
":",
"frame",
"=",
"inspect",
".",
"currentframe",
"(",
")",
"while",
"True",
":",
"frame",
"=",
"frame",
".",
"f_back",
"fname",
"=",
"frame",
".",
"f_globals",
"[",
"'__file__'",
"]",
"if",
"os",
".",
"path",
".",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | run_uwsgi | Runs uWSGI using the given section configuration.
:param Section config_section:
:param bool compile_only: Do not run, only compile and output configuration file for run. | uwsgiconf/contrib/django/uwsgify/toolbox.py | def run_uwsgi(config_section, compile_only=False):
"""Runs uWSGI using the given section configuration.
:param Section config_section:
:param bool compile_only: Do not run, only compile and output configuration file for run.
"""
config = config_section.as_configuration()
if compile_only:
... | def run_uwsgi(config_section, compile_only=False):
"""Runs uWSGI using the given section configuration.
:param Section config_section:
:param bool compile_only: Do not run, only compile and output configuration file for run.
"""
config = config_section.as_configuration()
if compile_only:
... | [
"Runs",
"uWSGI",
"using",
"the",
"given",
"section",
"configuration",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/contrib/django/uwsgify/toolbox.py#L234-L248 | [
"def",
"run_uwsgi",
"(",
"config_section",
",",
"compile_only",
"=",
"False",
")",
":",
"config",
"=",
"config_section",
".",
"as_configuration",
"(",
")",
"if",
"compile_only",
":",
"config",
".",
"print_ini",
"(",
")",
"return",
"config_path",
"=",
"config",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | SectionMutator.spawn | Alternative constructor. Creates a mutator and returns section object.
:param dict options:
:param str|unicode dir_base:
:rtype: SectionMutator | uwsgiconf/contrib/django/uwsgify/toolbox.py | def spawn(cls, options=None, dir_base=None):
"""Alternative constructor. Creates a mutator and returns section object.
:param dict options:
:param str|unicode dir_base:
:rtype: SectionMutator
"""
from uwsgiconf.utils import ConfModule
options = options or {
... | def spawn(cls, options=None, dir_base=None):
"""Alternative constructor. Creates a mutator and returns section object.
:param dict options:
:param str|unicode dir_base:
:rtype: SectionMutator
"""
from uwsgiconf.utils import ConfModule
options = options or {
... | [
"Alternative",
"constructor",
".",
"Creates",
"a",
"mutator",
"and",
"returns",
"section",
"object",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/contrib/django/uwsgify/toolbox.py#L77-L114 | [
"def",
"spawn",
"(",
"cls",
",",
"options",
"=",
"None",
",",
"dir_base",
"=",
"None",
")",
":",
"from",
"uwsgiconf",
".",
"utils",
"import",
"ConfModule",
"options",
"=",
"options",
"or",
"{",
"'compile'",
":",
"True",
",",
"}",
"dir_base",
"=",
"os",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | SectionMutator._get_section_existing | Loads config section from existing configuration file (aka uwsgicfg.py)
:param str|unicode name_module:
:param str|unicode name_project:
:rtype: Section | uwsgiconf/contrib/django/uwsgify/toolbox.py | def _get_section_existing(self, name_module, name_project):
"""Loads config section from existing configuration file (aka uwsgicfg.py)
:param str|unicode name_module:
:param str|unicode name_project:
:rtype: Section
"""
from importlib import import_module
from ... | def _get_section_existing(self, name_module, name_project):
"""Loads config section from existing configuration file (aka uwsgicfg.py)
:param str|unicode name_module:
:param str|unicode name_project:
:rtype: Section
"""
from importlib import import_module
from ... | [
"Loads",
"config",
"section",
"from",
"existing",
"configuration",
"file",
"(",
"aka",
"uwsgicfg",
".",
"py",
")"
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/contrib/django/uwsgify/toolbox.py#L117-L133 | [
"def",
"_get_section_existing",
"(",
"self",
",",
"name_module",
",",
"name_project",
")",
":",
"from",
"importlib",
"import",
"import_module",
"from",
"uwsgiconf",
".",
"settings",
"import",
"CONFIGS_MODULE_ATTR",
"config",
"=",
"getattr",
"(",
"import_module",
"("... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | SectionMutator._get_section_new | Creates a new section with default settings.
:param str|unicode dir_base:
:rtype: Section | uwsgiconf/contrib/django/uwsgify/toolbox.py | def _get_section_new(cls, dir_base):
"""Creates a new section with default settings.
:param str|unicode dir_base:
:rtype: Section
"""
from uwsgiconf.presets.nice import PythonSection
from django.conf import settings
wsgi_app = settings.WSGI_APPLICATION
... | def _get_section_new(cls, dir_base):
"""Creates a new section with default settings.
:param str|unicode dir_base:
:rtype: Section
"""
from uwsgiconf.presets.nice import PythonSection
from django.conf import settings
wsgi_app = settings.WSGI_APPLICATION
... | [
"Creates",
"a",
"new",
"section",
"with",
"default",
"settings",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/contrib/django/uwsgify/toolbox.py#L136-L159 | [
"def",
"_get_section_new",
"(",
"cls",
",",
"dir_base",
")",
":",
"from",
"uwsgiconf",
".",
"presets",
".",
"nice",
"import",
"PythonSection",
"from",
"django",
".",
"conf",
"import",
"settings",
"wsgi_app",
"=",
"settings",
".",
"WSGI_APPLICATION",
"path_wsgi",... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | SectionMutator.contribute_static | Contributes static and media file serving settings to an existing section. | uwsgiconf/contrib/django/uwsgify/toolbox.py | def contribute_static(self):
"""Contributes static and media file serving settings to an existing section."""
options = self.options
if options['compile'] or not options['use_static_handler']:
return
from django.core.management import call_command
settings = self.s... | def contribute_static(self):
"""Contributes static and media file serving settings to an existing section."""
options = self.options
if options['compile'] or not options['use_static_handler']:
return
from django.core.management import call_command
settings = self.s... | [
"Contributes",
"static",
"and",
"media",
"file",
"serving",
"settings",
"to",
"an",
"existing",
"section",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/contrib/django/uwsgify/toolbox.py#L161-L175 | [
"def",
"contribute_static",
"(",
"self",
")",
":",
"options",
"=",
"self",
".",
"options",
"if",
"options",
"[",
"'compile'",
"]",
"or",
"not",
"options",
"[",
"'use_static_handler'",
"]",
":",
"return",
"from",
"django",
".",
"core",
".",
"management",
"i... | 475407acb44199edbf7e0a66261bfeb51de1afae |
train | SectionMutator.contribute_error_pages | Contributes generic static error massage pages to an existing section. | uwsgiconf/contrib/django/uwsgify/toolbox.py | def contribute_error_pages(self):
"""Contributes generic static error massage pages to an existing section."""
static_dir = self.settings.STATIC_ROOT
if not static_dir:
# Source static directory is not configured. Use temporary.
import tempfile
static_dir = ... | def contribute_error_pages(self):
"""Contributes generic static error massage pages to an existing section."""
static_dir = self.settings.STATIC_ROOT
if not static_dir:
# Source static directory is not configured. Use temporary.
import tempfile
static_dir = ... | [
"Contributes",
"generic",
"static",
"error",
"massage",
"pages",
"to",
"an",
"existing",
"section",
"."
] | idlesign/uwsgiconf | python | https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/contrib/django/uwsgify/toolbox.py#L177-L189 | [
"def",
"contribute_error_pages",
"(",
"self",
")",
":",
"static_dir",
"=",
"self",
".",
"settings",
".",
"STATIC_ROOT",
"if",
"not",
"static_dir",
":",
"# Source static directory is not configured. Use temporary.",
"import",
"tempfile",
"static_dir",
"=",
"os",
".",
"... | 475407acb44199edbf7e0a66261bfeb51de1afae |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.