From fb3d514b4572ef62710bafe4d61d99cb2c7fb48c Mon Sep 17 00:00:00 2001 From: idle sign Date: Fri, 1 May 2020 16:04:06 +0700 Subject: [PATCH] Removed unicode. --- uwsgiconf/base.py | 6 +- uwsgiconf/config.py | 50 +++---- uwsgiconf/contrib/django/uwsgify/toolbox.py | 24 ++-- uwsgiconf/formatters.py | 8 +- uwsgiconf/options/alarms.py | 6 +- uwsgiconf/options/applications.py | 4 +- uwsgiconf/options/caching.py | 20 +-- uwsgiconf/options/empire.py | 20 +-- uwsgiconf/options/locks.py | 6 +- uwsgiconf/options/logging.py | 32 ++--- uwsgiconf/options/logging_encoders.py | 4 +- uwsgiconf/options/logging_loggers.py | 42 +++--- uwsgiconf/options/main_process.py | 40 +++--- uwsgiconf/options/main_process_actions.py | 14 +- uwsgiconf/options/master_process.py | 34 ++--- uwsgiconf/options/monitoring.py | 14 +- uwsgiconf/options/monitoring_collectors.py | 4 +- uwsgiconf/options/monitoring_metric_types.py | 6 +- uwsgiconf/options/monitoring_pushers.py | 36 ++--- uwsgiconf/options/networking.py | 30 ++-- uwsgiconf/options/networking_sockets.py | 36 ++--- uwsgiconf/options/python.py | 30 ++-- uwsgiconf/options/queue.py | 2 +- uwsgiconf/options/routing.py | 22 +-- uwsgiconf/options/routing_actions.py | 78 +++++------ uwsgiconf/options/routing_modifiers.py | 4 +- uwsgiconf/options/routing_routers.py | 138 +++++++++---------- uwsgiconf/options/routing_subjects.py | 2 +- uwsgiconf/options/spooler.py | 6 +- uwsgiconf/options/statics.py | 20 +-- uwsgiconf/options/subscriptions.py | 28 ++-- uwsgiconf/options/workers.py | 10 +- uwsgiconf/presets/empire.py | 4 +- uwsgiconf/presets/nice.py | 16 +-- uwsgiconf/runtime/alarms.py | 4 +- uwsgiconf/runtime/asynced.py | 4 +- uwsgiconf/runtime/caching.py | 22 +-- uwsgiconf/runtime/control.py | 2 +- uwsgiconf/runtime/logging.py | 10 +- uwsgiconf/runtime/monitoring.py | 8 +- uwsgiconf/runtime/mules.py | 12 +- uwsgiconf/runtime/request.py | 4 +- uwsgiconf/runtime/rpc.py | 6 +- uwsgiconf/runtime/scheduling.py | 18 +-- uwsgiconf/runtime/signals.py | 4 +- uwsgiconf/sysinit.py | 14 +- uwsgiconf/utils.py | 32 ++--- uwsgiconf/uwsgi_stub.py | 132 +++++++++--------- 48 files changed, 534 insertions(+), 534 deletions(-) diff --git a/uwsgiconf/base.py b/uwsgiconf/base.py index f2c1eab..8464788 100644 --- a/uwsgiconf/base.py +++ b/uwsgiconf/base.py @@ -76,7 +76,7 @@ class OptionsGroup(object): _section = None # type: Section """Section this option group belongs to.""" - plugin = False # type: bool|str|unicode + plugin = False # type: bool|str """Indication this option group belongs to a plugin.""" name = None @@ -124,7 +124,7 @@ def set_basic_params(self, *args, **kwargs): def _set(self, key, value, condition=True, cast=None, multi=False, plugin=None, priority=None): """ - :param str|unicode key: Option name + :param str key: Option name :param value: Option value. Can be a lis if ``multi``. @@ -136,7 +136,7 @@ def _set(self, key, value, condition=True, cast=None, multi=False, plugin=None, :param bool multi: Indicate that many options can use the same name. - :param str|unicode plugin: Plugin this option exposed by. Activated automatically. + :param str plugin: Plugin this option exposed by. Activated automatically. :param int priority: Option priority indicator. Options with lower numbers will come first. diff --git a/uwsgiconf/config.py b/uwsgiconf/config.py index a0b00c6..f2c3793 100644 --- a/uwsgiconf/config.py +++ b/uwsgiconf/config.py @@ -130,14 +130,14 @@ def __init__( To use placeholder variables when using strict mode, use the ``set-placeholder`` option. - :param str|unicode name: Configuration section name. + :param str name: Configuration section name. - :param str|unicode runtime_dir: Directory to store runtime files. + :param str runtime_dir: Directory to store runtime files. See ``.replace_placeholders()`` .. note:: This can be used to store PID files, sockets, master FIFO, etc. - :param str|unicode project_name: Project name (alias) to be used to differentiate projects. + :param str project_name: Project name (alias) to be used to differentiate projects. See ``.replace_placeholders()``. :param bool style_prints: Enables styling (e.g. colouring) for ``print_`` family methods. @@ -186,8 +186,8 @@ def replace_placeholders(self, value): * {project_name} * {runtime_dir} - :param str|unicode|list[str|unicode]|None value: - :rtype: None|str|unicode|list[str|unicode] + :param str|list[str]|None value: + :rtype: None|str|list[str] """ if not value: @@ -214,7 +214,7 @@ def replace_placeholders(self, value): def project_name(self): """Project name (alias) to be used to differentiate projects. See ``.replace_placeholders()``. - :rtype: str|unicode + :rtype: str """ return self._project_name @@ -230,7 +230,7 @@ def get_runtime_dir(self, default=True): :param bool default: Whether to return [system] default if not set. - :rtype: str|unicode + :rtype: str """ dir_ = self._runtime_dir @@ -243,7 +243,7 @@ def get_runtime_dir(self, default=True): def set_runtime_dir(self, value): """Sets user-defined runtime directory value. - :param str|unicode value: + :param str value: """ self._runtime_dir = value or '' @@ -292,9 +292,9 @@ def print_out(self, value, indent=None, format_options=None, asap=False): :param value: - :param str|unicode indent: + :param str indent: - :param dict|str|unicode format_options: text color + :param dict|str format_options: text color :param bool asap: Print as soon as possible. @@ -341,9 +341,9 @@ def print_variables(self): 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|OptionsGroup|list[OptionsGroup] plugins: uWSGI plugins to load - :param list|str|unicode search_dirs: Directories to search for uWSGI plugins. + :param list|str search_dirs: Directories to search for uWSGI plugins. :param bool autoload: Try to automatically load plugins when unknown options are found. @@ -370,7 +370,7 @@ def set_fallback(self, target): Re-exec uWSGI with the specified config when exit code is 1. - :param str|unicode|Section target: File path or Section to include. + :param str|Section target: File path or Section to include. """ if isinstance(target, Section): target = ':' + target.name @@ -386,9 +386,9 @@ def set_placeholder(self, key, value): .. note:: These are accessible, like any uWSGI option, in your application code via ``.runtime.platform.uwsgi.config``. - :param str|unicode key: + :param str key: - :param str|unicode value: + :param str value: """ self._set('set-placeholder', f'{key}={value}', multi=True) @@ -400,7 +400,7 @@ def env(self, key, value=None, unset=False, asap=False): If is not given in `set` mode value will be taken from current env. - :param str|unicode key: + :param str key: :param value: @@ -426,7 +426,7 @@ def env(self, key, value=None, unset=False, asap=False): def include(self, target): """Includes target contents into config. - :param str|unicode|Section|list target: File path or Section to include. + :param str|Section|list target: File path or Section to include. """ for target_ in listify(target): if isinstance(target_, Section): @@ -442,7 +442,7 @@ def derive_from(cls, section, name=None): :param Section section: Section to derive from, - :param str|unicode name: New section name. + :param str name: New section name. :rtype: Section """ @@ -569,7 +569,7 @@ def get_descriptions(cls): def bootstrap(cls, dsn, allow_shared_sockets=None, **init_kwargs): """Constructs a section object performing it's basic (default) configuration. - :param str|unicode|list[str|unicode] dsn: Data source name, e.g: + :param str|list[str] dsn: Data source name, e.g: * http://127.0.0.1:8000 * https://127.0.0.1:443?cert=/here/there.crt&key=/that/my.key @@ -611,7 +611,7 @@ def __init__(self, sections=None, autoinclude_sections=False, alias=None): :param bool autoinclude_sections: Whether to include in the first sections all subsequent sections. - :param str|unicode alias: Configuration alias. + :param str alias: Configuration alias. This will be used in ``tofile`` as file name. """ @@ -649,8 +649,8 @@ def format(self, do_print=False, stamp=True, formatter='ini'): :param bool do_print: Whether to print out formatted config. :param bool stamp: Whether to add stamp data to the first configuration section. - :param str|unicode formatter: Formatter alias to format options. Default: ini. - :rtype: str|unicode|list + :param str formatter: Formatter alias to format options. Default: ini. + :rtype: str|list """ if stamp and self.sections: self.sections[0].print_stamp() @@ -666,7 +666,7 @@ def format(self, do_print=False, stamp=True, formatter='ini'): def print_ini(self): """Print out this configuration as .ini. - :rtype: str|unicode + :rtype: str """ return self.format(do_print=True) @@ -675,10 +675,10 @@ def tofile(self, filepath=None): Convenience method. - :param str|unicode filepath: Filepath to save configuration into. + :param str filepath: Filepath to save configuration into. If not provided a temporary file will be automatically generated. - :rtype: str|unicode + :rtype: str """ if filepath is None: diff --git a/uwsgiconf/contrib/django/uwsgify/toolbox.py b/uwsgiconf/contrib/django/uwsgify/toolbox.py index 5fc8f45..d2f6ccc 100644 --- a/uwsgiconf/contrib/django/uwsgify/toolbox.py +++ b/uwsgiconf/contrib/django/uwsgify/toolbox.py @@ -15,7 +15,7 @@ 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 + :rtype: str """ frame = inspect.currentframe() @@ -32,8 +32,8 @@ def find_project_dir(): def get_project_name(project_dir): """Return project name from project directory. - :param str|unicode project_dir: - :rtype: str|unicode + :param str project_dir: + :rtype: str """ return os.path.basename(project_dir) @@ -62,8 +62,8 @@ def runtime_dir(self): def get_pid_filepath(self): """Return pidfile path for the given project. - :param str|unicode project_name: - :rtype: str|unicode + :param str project_name: + :rtype: str """ return os.path.join(self.runtime_dir, 'uwsgi.pid') @@ -71,8 +71,8 @@ def get_pid_filepath(self): def get_fifo_filepath(self): """Return master FIFO path for the given project. - :param str|unicode project_name: - :rtype: str|unicode + :param str project_name: + :rtype: str """ return os.path.join(self.runtime_dir, 'uwsgi.fifo') @@ -82,7 +82,7 @@ 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: + :param str dir_base: :rtype: SectionMutator @@ -127,9 +127,9 @@ def spawn(cls, options=None, dir_base=None): def _get_section_existing(self, path_conf, name_module, name_project, embedded=False): """Loads config section from existing configuration file (aka uwsgicfg.py) - :param str|unicode path_conf: Path containing configuration module. - :param str|unicode name_module: Configuration module name. - :param str|unicode name_project: Project (package) name. + :param str path_conf: Path containing configuration module. + :param str name_module: Configuration module name. + :param str name_project: Project (package) name. :param bool embedded: Flag. Do not try to load module file from file system manually, but try to import the module. @@ -167,7 +167,7 @@ def load(): def _get_section_new(cls, dir_base): """Creates a new section with default settings. - :param str|unicode dir_base: + :param str dir_base: :rtype: Section """ diff --git a/uwsgiconf/formatters.py b/uwsgiconf/formatters.py index f93ed8c..ae24077 100644 --- a/uwsgiconf/formatters.py +++ b/uwsgiconf/formatters.py @@ -5,10 +5,10 @@ def format_print_text(text, color_fg=None, color_bg=None): 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 + :param str text: + :param str color_fg: text (foreground) color + :param str color_bg: text (background) color + :rtype: str """ from .config import Section diff --git a/uwsgiconf/options/alarms.py b/uwsgiconf/options/alarms.py index 0e461a7..8d5bb3d 100644 --- a/uwsgiconf/options/alarms.py +++ b/uwsgiconf/options/alarms.py @@ -70,7 +70,7 @@ def alarm_on_log(self, alarm, matcher, skip=False): :param AlarmType|list[AlarmType] alarm: Alarm. - :param str|unicode matcher: Regular expression to match log line. + :param str matcher: Regular expression to match log line. :param bool skip: @@ -93,9 +93,9 @@ def alarm_on_fd_ready(self, alarm, fd, message, byte_count=None): :param AlarmType|list[AlarmType] alarm: Alarm. - :param str|unicode fd: File descriptor. + :param str fd: File descriptor. - :param str|unicode message: Message to send. + :param str message: Message to send. :param int byte_count: Files to read. Default: 1 byte. diff --git a/uwsgiconf/options/applications.py b/uwsgiconf/options/applications.py index 0742ecd..3b4e188 100644 --- a/uwsgiconf/options/applications.py +++ b/uwsgiconf/options/applications.py @@ -49,14 +49,14 @@ def mount(self, mountpoint, app, into_worker=False): * http://uwsgi-docs.readthedocs.io/en/latest/Nginx.html#hosting-multiple-apps-in-the-same-process-aka-managing-script-name-and-path-info - :param str|unicode mountpoint: URL part, or variable value. + :param str mountpoint: URL part, or variable value. .. note:: In case of URL part you may also want to set ``manage_script_name`` basic param to ``True``. .. warning:: In case of URL part a trailing slash may case problems in some cases (e.g. with Django based projects). - :param str|unicode app: App module/file. + :param str app: App module/file. :param bool into_worker: Load application under mountpoint in the specified worker or after workers spawn. diff --git a/uwsgiconf/options/caching.py b/uwsgiconf/options/caching.py index c48137c..b1acbd6 100644 --- a/uwsgiconf/options/caching.py +++ b/uwsgiconf/options/caching.py @@ -42,11 +42,11 @@ def add_item(self, key, value, cache_name=None): This is a commodity option (mainly useful for testing) allowing you to store an item in a uWSGI cache during startup. - :param str|unicode key: + :param str key: :param value: - :param str|unicode cache_name: If not set, default will be used. + :param str cache_name: If not set, default will be used. """ cache_name = cache_name or '' @@ -61,11 +61,11 @@ def add_file(self, filepath, gzip=False, cache_name=None): .. note:: Items are stored with the filepath as is (relative or absolute) as the key. - :param str|unicode filepath: + :param str filepath: :param bool gzip: Use gzip compression. - :param str|unicode cache_name: If not set, default will be used. + :param str cache_name: If not set, default will be used. """ command = 'load-file-in-cache' @@ -94,7 +94,7 @@ def add_cache( Its main purpose is deleting expired keys from the cache. If you want auto-expiring you need to enable the master. - :param str|unicode name: Set the name of the cache. Must be unique in an instance. + :param str name: Set the name of the cache. Must be unique in an instance. :param int max_items: Set the maximum number of cache items. @@ -104,7 +104,7 @@ def add_cache( :param bool no_expire: If ``True`` cache items won't expire even if instructed to do so by cache set method. - :param str|unicode store: Set the filename for the persistent storage. + :param str store: Set the filename for the persistent storage. If it doesn't exist, the system assumes an empty cache and the file will be created. :param int store_sync_interval: Set the number of seconds after which msync() is called @@ -116,7 +116,7 @@ def add_cache( Setting this option will make uWSGI delete the existing file upon mismatch and create a new one. - :param str|unicode hash_algo: Set the hash algorithm used in the hash table. Current options are: + :param str hash_algo: Set the hash algorithm used in the hash table. Current options are: * djb33x (default) * murmur2 @@ -129,9 +129,9 @@ def add_cache( :param int key_size: Set the maximum size of a key, in bytes. Default: 2048. - :param str|unicode|list udp_clients: List of UDP servers which will receive UDP cache updates. + :param str|list udp_clients: List of UDP servers which will receive UDP cache updates. - :param str|unicode |list udp_servers: List of UDP addresses on which to bind the cache + :param str |list udp_servers: List of UDP addresses on which to bind the cache to wait for UDP updates. :param int block_size: Set the size (in bytes) of a single block. @@ -141,7 +141,7 @@ def add_cache( :param int block_count: Set the number of blocks in the cache. Useful only in bitmap mode, otherwise the number of blocks is equal to the maximum number of items. - :param str|unicode|list sync_from: List of uWSGI addresses which the cache subsystem will connect to + :param str|list sync_from: List of uWSGI addresses which the cache subsystem will connect to for getting a full dump of the cache. It can be used for initial cache synchronization. The first node sending a valid dump will stop the procedure. diff --git a/uwsgiconf/options/empire.py b/uwsgiconf/options/empire.py index 4cc7ad9..0f9a876 100644 --- a/uwsgiconf/options/empire.py +++ b/uwsgiconf/options/empire.py @@ -24,19 +24,19 @@ def set_emperor_params( emperor reloads are a bit drastic, reloading all vassals at once. Instead vassals should be reloaded individually when needed, in the manner of the imperial monitor in use. - :param str|unicode|list[str|unicode] vassals_home: Set vassals home and enable Emperor mode. + :param str|list[str] vassals_home: Set vassals home and enable Emperor mode. - :param str|unicode name: Set the Emperor process name. + :param str name: Set the Emperor process name. :param int scan_interval: Set the Emperor scan frequency. Default: 3 seconds. - :param str|unicode pid_file: Write the Emperor pid in the specified file. + :param str pid_file: Write the Emperor pid in the specified file. :param bool spawn_asap: Spawn the Emperor as soon as possible. - :param str|unicode stats_address: Run the Emperor stats server on specified address. + :param str stats_address: Run the Emperor stats server on specified address. - :param str|unicode trigger_socket: Enable the Emperor trigger socket. + :param str trigger_socket: Enable the Emperor trigger socket. :param bool links_no_follow: Do not follow symlinks when checking for mtime. @@ -66,12 +66,12 @@ def set_emperor_command_params( * http://uwsgi-docs.readthedocs.io/en/latest/tutorials/EmperorSubscriptions.html - :param str|unicode command_socket: Enable the Emperor command socket. + :param str command_socket: Enable the Emperor command socket. It is a channel allowing external process to govern vassals. :param bool wait_for_command: Always wait for a 'spawn' Emperor command before starting a vassal. - :param str|unicode|list[str|unicode] wait_for_command_exclude: Vassals that will ignore ``wait_for_command``. + :param str|list[str] wait_for_command_exclude: Vassals that will ignore ``wait_for_command``. """ self._set('emperor-command-socket', command_socket) @@ -83,11 +83,11 @@ def set_emperor_command_params( def set_vassals_wrapper_params(self, wrapper=None, overrides=None, fallbacks=None): """Binary wrapper for vassals parameters. - :param str|unicode wrapper: Set a binary wrapper for vassals. + :param str wrapper: Set a binary wrapper for vassals. - :param str|unicode|list[str|unicode] overrides: Set a binary wrapper for vassals to try before the default one + :param str|list[str] overrides: Set a binary wrapper for vassals to try before the default one - :param str|unicode|list[str|unicode] fallbacks: Set a binary wrapper for vassals to try as a last resort. + :param str|list[str] fallbacks: Set a binary wrapper for vassals to try as a last resort. Allows you to specify an alternative binary to execute when running a vassal and the default binary_path is not found (or returns an error). diff --git a/uwsgiconf/options/locks.py b/uwsgiconf/options/locks.py index efa5d01..7096368 100644 --- a/uwsgiconf/options/locks.py +++ b/uwsgiconf/options/locks.py @@ -17,7 +17,7 @@ def set_basic_params(self, count=None, thunder_lock=None, lock_engine=None): http://uwsgi.readthedocs.io/en/latest/articles/SerializingAccept.html - :param str|unicode lock_engine: Set the lock engine. + :param str lock_engine: Set the lock engine. Example: - ipcsem @@ -32,7 +32,7 @@ def set_basic_params(self, count=None, thunder_lock=None, lock_engine=None): def set_ipcsem_params(self, ftok=None, persistent=None): """Sets ipcsem lock engine params. - :param str|unicode ftok: Set the ipcsem key via ftok() for avoiding duplicates. + :param str ftok: Set the ipcsem key via ftok() for avoiding duplicates. :param bool persistent: Do not remove ipcsem's on shutdown. @@ -45,7 +45,7 @@ def set_ipcsem_params(self, ftok=None, persistent=None): def lock_file(self, fpath, after_setup=False, wait=False): """Locks the specified file. - :param str|unicode fpath: File path. + :param str fpath: File path. :param bool after_setup: True - after logging/daemon setup diff --git a/uwsgiconf/options/logging.py b/uwsgiconf/options/logging.py index d997d2c..686e3fc 100644 --- a/uwsgiconf/options/logging.py +++ b/uwsgiconf/options/logging.py @@ -66,12 +66,12 @@ def set_basic_params( :param bool no_requests: Disable requests logging - only uWSGI internal messages and errors will be logged. - :param str|unicode template: Set advanced format for request logging. + :param str template: Set advanced format for request logging. This template string can use variables from ``Logging.Vars``. - :param str|unicode prefix: Prefix log items with a string. + :param str prefix: Prefix log items with a string. - :param str|unicode|bool prefix_date: Prefix log items with date string. + :param str|bool prefix_date: Prefix log items with date string. .. note:: This can be ``True`` or contain formatting placeholders (e.g. %Y-%m-%d %H:%M:%S) if used with ``apply_strftime``. @@ -111,7 +111,7 @@ def log_into(self, target, before_priv_drop=True): .. 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 str target: Filepath or UDP address. :param bool before_priv_drop: Whether to log data before or after privileges drop. @@ -136,20 +136,20 @@ def set_file_params( :param int max_size: Set maximum logfile size in bytes after which log should be rotated. - :param str|unicode rotation_fname: Set log file name after rotation. + :param str rotation_fname: Set log file name after rotation. - :param str|unicode|list touch_reopen: Trigger log reopen if the specified file + :param str|list touch_reopen: Trigger log reopen if the specified file is modified/touched. .. note:: This can be set to a file touched by ``postrotate`` script of ``logrotate`` to implement rotation. - :param str|unicode|list touch_rotate: Trigger log rotation if the specified file + :param str|list touch_rotate: Trigger log rotation if the specified file is modified/touched. - :param str|unicode owner: Set owner chown() for logs. + :param str owner: Set owner chown() for logs. - :param str|unicode mode: Set mode chmod() for logs. + :param str mode: Set mode chmod() for logs. """ self._set('log-reopen', reopen_on_reload, cast=bool) @@ -168,11 +168,11 @@ def set_file_params( 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. + :param str|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. + :param str|list exclude: Do not show log lines matching the specified regexp. .. note:: Requires enabled PCRE support. @@ -283,7 +283,7 @@ def print_loggers(self): 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 str|list|Logger|list[Logger] logger: :param bool requests_only: Logger used only for requests information messages. @@ -304,9 +304,9 @@ def add_logger(self, logger, requests_only=False, for_single_worker=False): 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|list|Logger|list[Logger] logger: Logger to associate route with. - :param str|unicode matcher: Regular expression to apply to log item. + :param str matcher: Regular expression to apply to log item. :param bool requests_only: Matching should be used only for requests information messages. @@ -328,9 +328,9 @@ def add_logger_encoder(self, encoder, logger=None, requests_only=False, for_sing .. note:: For best performance consider allocating a thread for log sending with ``dedicate_thread``. - :param str|unicode|list|Encoder encoder: Encoder (or a list) to add into processing. + :param str|list|Encoder encoder: Encoder (or a list) to add into processing. - :param str|unicode|Logger logger: Logger apply associate encoders to. + :param str|Logger logger: Logger apply associate encoders to. :param bool requests_only: Encoder to be used only for requests information messages. diff --git a/uwsgiconf/options/logging_encoders.py b/uwsgiconf/options/logging_encoders.py index 4f94937..ff4c0ad 100644 --- a/uwsgiconf/options/logging_encoders.py +++ b/uwsgiconf/options/logging_encoders.py @@ -14,7 +14,7 @@ class EncoderPrefix(Encoder): def __init__(self, value): """ - :param str|unicode value: Value to be used as affix + :param str value: Value to be used as affix """ super(EncoderPrefix, self).__init__(value) @@ -52,7 +52,7 @@ class EncoderFormat(Encoder): def __init__(self, template): """ - :param str|unicode template: Template string. + :param str template: Template string. Available variables are listed in ``FormatEncoder.Vars``. """ diff --git a/uwsgiconf/options/logging_loggers.py b/uwsgiconf/options/logging_loggers.py index 8d017f2..4979f6f 100644 --- a/uwsgiconf/options/logging_loggers.py +++ b/uwsgiconf/options/logging_loggers.py @@ -18,9 +18,9 @@ class LoggerFile(Logger): def __init__(self, filepath, alias=None): """ - :param str|unicode filepath: File path. + :param str filepath: File path. - :param str|unicode alias: Logger alias. + :param str alias: Logger alias. """ super(LoggerFile, self).__init__(alias, filepath) @@ -35,13 +35,13 @@ class LoggerSocket(Logger): def __init__(self, addr_or_path, alias=None): """ - :param str|unicode addr_or_path: Remote address or filepath. + :param str addr_or_path: Remote address or filepath. Examples: * /tmp/uwsgi.logsock * 192.168.173.19:5050 - :param str|unicode alias: Logger alias. + :param str alias: Logger alias. """ super(LoggerSocket, self).__init__(alias, addr_or_path) @@ -56,13 +56,13 @@ class LoggerSyslog(Logger): def __init__(self, app_name=None, facility=None, alias=None): """ - :param str|unicode app_name: + :param str app_name: - :param str|unicode facility: + :param str facility: * https://en.wikipedia.org/wiki/Syslog#Facility - :param str|unicode alias: Logger alias. + :param str alias: Logger alias. """ super(LoggerSyslog, self).__init__(alias, app_name, facility) @@ -77,11 +77,11 @@ class LoggerRsyslog(LoggerSyslog): def __init__(self, app_name=None, host=None, facility=None, split=None, packet_size=None, alias=None): """ - :param str|unicode app_name: + :param str app_name: - :param str|unicode host: Address (host and port) or UNIX socket path. + :param str host: Address (host and port) or UNIX socket path. - :param str|unicode facility: + :param str facility: * https://en.wikipedia.org/wiki/Syslog#Facility @@ -92,7 +92,7 @@ def __init__(self, app_name=None, host=None, facility=None, split=None, packet_s .. warning:: using packets > 1024 breaks RFC 3164 (#4.1) - :param str|unicode alias: Logger alias. + :param str alias: Logger alias. """ super(LoggerRsyslog, self).__init__(app_name, facility, alias=alias) @@ -116,17 +116,17 @@ class LoggerRedis(Logger): def __init__(self, host=None, command=None, prefix=None, alias=None): """ - :param str|unicode host: Default: 127.0.0.1:6379 + :param str host: Default: 127.0.0.1:6379 - :param str|unicode command: Command to be used. Default: publish uwsgi + :param str command: Command to be used. Default: publish uwsgi Examples: * publish foobar * rpush foo - :param str|unicode prefix: Default: + :param str prefix: Default: - :param str|unicode alias: Logger alias. + :param str alias: Logger alias. """ super(LoggerRedis, self).__init__(alias, host, command, prefix) @@ -145,14 +145,14 @@ class LoggerMongo(Logger): def __init__(self, host=None, collection=None, node=None, alias=None): """ - :param str|unicode host: Default: 127.0.0.1:27017 + :param str host: Default: 127.0.0.1:27017 - :param str|unicode collection: Command to be used. Default: uwsgi.logs + :param str collection: Command to be used. Default: uwsgi.logs - :param str|unicode node: An identification string for the instance + :param str node: An identification string for the instance sending logs Default: - :param str|unicode alias: Logger alias. + :param str alias: Logger alias. """ super(LoggerMongo, self).__init__(alias, host, collection, node) @@ -167,12 +167,12 @@ class LoggerZeroMq(Logger): def __init__(self, connection_str, alias=None): """ - :param str|unicode connection_str: + :param str connection_str: Examples: * tcp://192.168.173.18:9191 - :param str|unicode alias: Logger alias. + :param str alias: Logger alias. """ super(LoggerZeroMq, self).__init__(alias, connection_str) diff --git a/uwsgiconf/options/main_process.py b/uwsgiconf/options/main_process.py index 64c450f..8ae97f3 100644 --- a/uwsgiconf/options/main_process.py +++ b/uwsgiconf/options/main_process.py @@ -189,7 +189,7 @@ def set_basic_params( :param bool vacuum: Try to remove all of the generated files/sockets (UNIX sockets and pidfiles) upon exit. - :param str|unicode binary_path: Force uWSGI binary path. + :param str binary_path: Force uWSGI binary path. If you do not have uWSGI in the system path you can force its path with this option to permit the reloading system and the Emperor to easily find the binary to execute. @@ -227,7 +227,7 @@ def set_memory_params(self, ksm_interval=None, no_swap=None): def daemonize(self, log_into, after_app_loading=False): """Daemonize uWSGI. - :param str|unicode log_into: Logging destination: + :param str log_into: Logging destination: * File: /tmp/mylog.log @@ -237,7 +237,7 @@ def daemonize(self, log_into, after_app_loading=False): Use ``networking.register_socket('192.168.1.2:1717, type=networking.SOCK_UDP)`` to start uWSGI UDP server. - :param str|unicode bool after_app_loading: Whether to daemonize after + :param str bool after_app_loading: Whether to daemonize after or before applications loading. """ @@ -248,7 +248,7 @@ def daemonize(self, log_into, after_app_loading=False): 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 str to: Target directory. :param bool after_app_loading: *True* - after load @@ -262,11 +262,11 @@ def change_dir(self, to, after_app_loading=False): 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|int uid: Set uid to the specified username or uid. - :param str|unicode|int gid: Set gid to the specified groupname or gid. + :param str|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. + :param list|str|int add_gids: Add the specified group id to the process credentials. This options allows you to add additional group ids to the current process. You can specify it multiple times. @@ -305,9 +305,9 @@ def get_owner(self, default=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 phase: See constants in ``.phases``. - :param str|unicode|list|HookAction|list[HookAction] action: + :param str|list|HookAction|list[HookAction] action: """ self._set(f'hook-{phase}', action, multi=True) @@ -317,9 +317,9 @@ def set_hook(self, phase, action): 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 fpath: File path. - :param str|unicode|list|HookAction|list[HookAction] action: + :param str|list|HookAction|list[HookAction] action: """ self._set('hook-touch', f'{fpath} {action}', multi=True) @@ -329,7 +329,7 @@ def set_hook_touch(self, fpath, action): def set_hook_after_request(self, func): """Run the specified function/symbol (C level) after each request. - :param str|unicode func: + :param str func: """ self._set('after-request-hook', func, multi=True) @@ -360,9 +360,9 @@ def set_on_exit_params(self, skip_hooks=None, skip_teardown=None): def run_command_on_event(self, command, phase=phases.ASAP): """Run the given command on a given phase. - :param str|unicode command: + :param str command: - :param str|unicode phase: See constants in ``Phases`` class. + :param str phase: See constants in ``Phases`` class. """ self._set(f'exec-{phase}', command, multi=True) @@ -372,9 +372,9 @@ def run_command_on_event(self, command, phase=phases.ASAP): def run_command_on_touch(self, command, target): """Run command when the specified file is modified/touched. - :param str|unicode command: + :param str command: - :param str|unicode target: File path. + :param str target: File path. """ self._set('touch-exec', f'{target} {command}', multi=True) @@ -384,7 +384,7 @@ def run_command_on_touch(self, command, target): 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 str fpath: File path. :param bool before_priv_drop: Whether to create pidfile before privileges are dropped. @@ -415,11 +415,11 @@ def set_naming_params(self, autonaming=None, prefix=None, suffix=None, name=None :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 prefix: Add prefix to process names. - :param str|unicode suffix: Append string to process names. + :param str suffix: Append string to process names. - :param str|unicode name: Set process names to given static value. + :param str name: Set process names to given static value. """ self._set('auto-procname', autonaming, cast=bool) diff --git a/uwsgiconf/options/main_process_actions.py b/uwsgiconf/options/main_process_actions.py index 3f8fda5..d9d79b0 100644 --- a/uwsgiconf/options/main_process_actions.py +++ b/uwsgiconf/options/main_process_actions.py @@ -21,13 +21,13 @@ class ActionMount(HookAction): def __init__(self, mountpoint, fs=None, src=None, flags=None): """ - :param str|unicode mountpoint: + :param str mountpoint: - :param str|unicode fs: Filesystem. Presence indicates mounting. + :param str fs: Filesystem. Presence indicates mounting. - :param str|unicode src: Presence indicates mounting. + :param str src: Presence indicates mounting. - :param str|unicode|list flags: Flags available for the operating system. + :param str|list flags: Flags available for the operating system. As an example on Linux you will options like: bind, recursive, readonly, rec, detach etc. """ @@ -71,7 +71,7 @@ class ActionCall(HookAction): def __init__(self, target, honour_exit_status=False, arg_int=False): """ - :param str|unicode target: Symbol and args. + :param str target: Symbol and args. :param bool honour_exit_status: Expect an int return. Anything != 0 means failure. @@ -177,9 +177,9 @@ class ActionFileWrite(HookAction): def __init__(self, target, text, append=False, newline=False): """ - :param str|unicode target: File to write to. + :param str target: File to write to. - :param str|unicode text: Text to write into file. + :param str text: Text to write into file. :param bool append: Append text instead of rewrite. diff --git a/uwsgiconf/options/master_process.py b/uwsgiconf/options/master_process.py index 1e00eb4..fd5c5fb 100644 --- a/uwsgiconf/options/master_process.py +++ b/uwsgiconf/options/master_process.py @@ -21,7 +21,7 @@ def set_basic_params( :param bool enable: Enable uWSGI master process. - :param str|unicode master_enabled: Set master process name to given value. + :param str master_enabled: Set master process name to given value. :param bool no_orphans: Automatically kill workers if master dies (can be dangerous for availability). @@ -32,7 +32,7 @@ def set_basic_params( .. warning:: You can increase this time if you need to, but it's DISCOURAGED. - :param str|unicode fifo_file: Enables the master FIFO. + :param str fifo_file: Enables the master FIFO. .. note:: Placeholders can be used to build paths, e.g.: {project_runtime_dir}.fifo See ``Section.project_name`` and ``Section.runtime_dir``. @@ -80,7 +80,7 @@ def set_exit_events(self, no_workers=None, idle=None, reload=None, sig_term=None def set_exception_handling_params(self, handler=None, catch=None, no_write_exception=None): """Exception handling related params. - :param str|unicode|list[str|unicode] handler: Register one or more exception handling C-functions. + :param str|list[str] handler: Register one or more exception handling C-functions. :param bool catch: Catch exceptions and report them as http output (including stack trace and env params). @@ -141,21 +141,21 @@ def add_cron_task( .. note:: We use cron2 option available since 1.9.11. - :param str|unicode command: Command to execute on schedule (with or without path). + :param str command: Command to execute on schedule (with or without path). - :param int|str|unicode weekday: Day of a the week number. Defaults to `each`. + :param int|str weekday: Day of a the week number. Defaults to `each`. 0 - Sunday 1 - Monday 2 - Tuesday 3 - Wednesday 4 - Thursday 5 - Friday 6 - Saturday - :param int|str|unicode month: Month number 1-12. Defaults to `each`. + :param int|str month: Month number 1-12. Defaults to `each`. - :param int|str|unicode day: Day of the month number 1-31. Defaults to `each`. + :param int|str day: Day of the month number 1-31. Defaults to `each`. - :param int|str|unicode hour: Hour 0-23. Defaults to `each`. + :param int|str hour: Hour 0-23. Defaults to `each`. - :param int|str|unicode minute: Minute 0-59. Defaults to `each`. + :param int|str minute: Minute 0-59. Defaults to `each`. - :param str|unicode legion: Set legion (cluster) name to use this cron command against. + :param str legion: Set legion (cluster) name to use this cron command against. Such commands are only executed by legion lord node. :param bool unique: Marks command as unique. Default to not unique. @@ -188,7 +188,7 @@ def attach_process_classic(self, command_or_pid_path, background, control=False, http://uwsgi-docs.readthedocs.io/en/latest/AttachingDaemons.html - :param str|unicode command_or_pid_path: + :param str command_or_pid_path: :param bool background: Must indicate whether process is in background. @@ -239,7 +239,7 @@ def attach_process( http://uwsgi-docs.readthedocs.io/en/latest/AttachingDaemons.html - :param str|unicode command: The command line to execute. + :param str command: The command line to execute. :param bool for_legion: Legion daemons will be executed only on the legion lord node, so there will always be a single daemon instance running in each legion. @@ -247,14 +247,14 @@ def attach_process( :param int broken_counter: Maximum attempts before considering a daemon "broken". - :param str|unicode pidfile: The pidfile path to check (enable smart mode). + :param str pidfile: The pidfile path to check (enable smart mode). :param bool control: If True, the daemon becomes a `control` one: if it dies the whole uWSGI instance dies. :param bool daemonize: Daemonize the process (enable smart2 mode). - :param list|str|unicode touch_reload: List of files to check: + :param list|str touch_reload: List of files to check: whenever they are 'touched', the daemon is restarted :param int signal_stop: The signal number to send to the daemon when uWSGI is stopped. @@ -263,11 +263,11 @@ def attach_process( :param bool honour_stdin: The signal number to send to the daemon when uWSGI is reloaded. - :param str|unicode|int uid: Drop privileges to the specified uid. + :param str|int uid: Drop privileges to the specified uid. .. note:: Requires master running as root. - :param str|unicode|int gid: Drop privileges to the specified gid. + :param str|int gid: Drop privileges to the specified gid. .. note:: Requires master running as root. @@ -277,7 +277,7 @@ def attach_process( .. note:: Linux only. - :param str|unicode change_dir: Use chdir() to the specified directory + :param str change_dir: Use chdir() to the specified directory before running the command. """ diff --git a/uwsgiconf/options/monitoring.py b/uwsgiconf/options/monitoring.py index df5d94e..8ac1ecd 100644 --- a/uwsgiconf/options/monitoring.py +++ b/uwsgiconf/options/monitoring.py @@ -105,7 +105,7 @@ def set_metrics_params(self, enable=None, store_dir=None, restore=None, no_cores :param bool enable: Enables the subsystem. - :param str|unicode store_dir: Directory to store metrics. + :param str store_dir: Directory to store metrics. The metrics subsystem can expose all of its metrics in the form of text files in a directory. The content of each file is the value of the metric (updated in real time). @@ -131,7 +131,7 @@ def set_metrics_params(self, enable=None, store_dir=None, restore=None, no_cores 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 str name: Metric name. :param int value: Threshold value. @@ -139,9 +139,9 @@ def set_metrics_threshold(self, name, value, check_interval=None, reset_to=None, :param int check_interval: Threshold check interval in seconds. - :param str|unicode|AlarmType alarm: Alarm to trigger when threshold is reached. + :param str|AlarmType alarm: Alarm to trigger when threshold is reached. - :param str|unicode alarm_message: Message to pass to alarm. If not set metrics name is passed. + :param str alarm_message: Message to pass to alarm. If not set metrics name is passed. """ if alarm is not None and isinstance(alarm, AlarmType): @@ -169,7 +169,7 @@ def set_stats_params( * http://uwsgi.readthedocs.io/en/latest/StatsServer.html - :param str|unicode address: Address/socket to make stats available on. + :param str address: Address/socket to make stats available on. Examples: * 127.0.0.1:1717 @@ -220,13 +220,13 @@ def enable_snmp(self, address, community_string): If you want it to listen on a privileged port, you can either use Capabilities on Linux, or use the ``as-root`` option to run the master process as root. - :param str|unicode address: UDP address to bind to. + :param str address: UDP address to bind to. Examples: * 192.168.1.1:2222 - :param str|unicode community_string: SNMP instance identifier to address it. + :param str community_string: SNMP instance identifier to address it. """ self._set('snmp', address) diff --git a/uwsgiconf/options/monitoring_collectors.py b/uwsgiconf/options/monitoring_collectors.py index f9c5154..5fbba74 100644 --- a/uwsgiconf/options/monitoring_collectors.py +++ b/uwsgiconf/options/monitoring_collectors.py @@ -41,7 +41,7 @@ class CollectorFile(Collector): def __init__(self, fpath, get_slot=None): """ - :param str|unicode fpath: File path. + :param str fpath: File path. :param int get_slot: Get value from the given slot number. Slots: the content is split (using \\n, \\t, spaces, \\r and zero as separator) @@ -68,7 +68,7 @@ class CollectorFunction(Collector): def __init__(self, func): """ - :param str|unicode func: Function to call. + :param str func: Function to call. """ value = KeyValue(locals(), aliases={'func': 'arg1'}) diff --git a/uwsgiconf/options/monitoring_metric_types.py b/uwsgiconf/options/monitoring_metric_types.py index 50024c3..fd62bf8 100644 --- a/uwsgiconf/options/monitoring_metric_types.py +++ b/uwsgiconf/options/monitoring_metric_types.py @@ -14,13 +14,13 @@ def __init__( initial_value=None, collect_interval=None, reset_after_push=None): """ - :param str|unicode name: Metric name. + :param str name: Metric name. .. note:: Only numbers, letters, underscores, dashes and dots. - :param str|unicode alias_for: If set metric will be a simple alias for the specified one. + :param str alias_for: If set metric will be a simple alias for the specified one. - :param str|unicode oid: Metric OID. + :param str oid: Metric OID. Required for SNMP. diff --git a/uwsgiconf/options/monitoring_pushers.py b/uwsgiconf/options/monitoring_pushers.py index 8f1a2c8..bb59595 100644 --- a/uwsgiconf/options/monitoring_pushers.py +++ b/uwsgiconf/options/monitoring_pushers.py @@ -19,9 +19,9 @@ class PusherSocket(Pusher): def __init__(self, address, prefix=None): """ - :param str|unicode address: + :param str address: - :param str|unicode prefix: Arbitrary prefix to differentiate sender. + :param str prefix: Arbitrary prefix to differentiate sender. """ super(PusherSocket, self).__init__(address, prefix) @@ -37,9 +37,9 @@ class PusherRrdtool(Pusher): def __init__(self, target_dir, library=None, push_interval=None): """ - :param str|unicode target_dir: Directory to store rrd files into. + :param str target_dir: Directory to store rrd files into. - :param str|unicode library: Set the name of rrd library. Default: librrd.so. + :param str library: Set the name of rrd library. Default: librrd.so. :param int push_interval: Set push frequency. @@ -58,9 +58,9 @@ class PusherStatsd(Pusher): def __init__(self, address, prefix=None, no_workers=None, all_gauges=None): """ - :param str|unicode address: + :param str address: - :param str|unicode prefix: Arbitrary prefix to differentiate sender. + :param str prefix: Arbitrary prefix to differentiate sender. :param bool no_workers: Disable generation of single worker metrics. @@ -90,17 +90,17 @@ def __init__( use_metrics=None, no_workers=None, timeout=None, retries=None, retries_delay=None, hostname_dots_replacer=None): """ - :param str|unicode|list[str|unicode] address: Host and port. Example: 127.0.0.1:2004 + :param str|list[str] address: Host and port. Example: 127.0.0.1:2004 - :param str|unicode node_realm: Set carbon metrics realm node. + :param str node_realm: Set carbon metrics realm node. - :param str|unicode node_root: Set carbon metrics root node. Default: uwsgi. + :param str node_root: Set carbon metrics root node. Default: uwsgi. :param int push_interval: Set carbon push frequency in seconds. Default: 60. :param bool no_workers: Disable generation of single worker metrics. - :param str|unicode idle_avg_source: Average values source during idle period (no requests). + :param str idle_avg_source: Average values source during idle period (no requests). Variants: * last (default) @@ -118,7 +118,7 @@ def __init__( :param int retries_delay: Set connection retry delay in seconds. Default: 7. - :param str|unicode hostname_dots_replacer: Set char to use as a replacement for + :param str hostname_dots_replacer: Set char to use as a replacement for dots in hostname in `.hostname..metrics_data`` This affects Graphite aggregation mechanics. @@ -151,11 +151,11 @@ class PusherZabbix(Pusher): def __init__(self, address, prefix=None, template=None): """ - :param str|unicode address: + :param str address: - :param str|unicode prefix: Arbitrary prefix to differentiate sender. + :param str prefix: Arbitrary prefix to differentiate sender. - :param str|unicode template: Print (or store to a file) the zabbix template + :param str template: Print (or store to a file) the zabbix template for the current metrics setup. """ @@ -172,9 +172,9 @@ class PusherMongo(Pusher): def __init__(self, address=None, collection=None, push_interval=None): """ - :param str|unicode address: Default: 127.0.0.1:27017 + :param str address: Default: 127.0.0.1:27017 - :param str|unicode collection: MongoDB colection to write into. Default: uwsgi.statistics + :param str collection: MongoDB colection to write into. Default: uwsgi.statistics :param int push_interval: Write interval in seconds. """ @@ -194,9 +194,9 @@ class PusherFile(Pusher): def __init__(self, fpath=None, separator=None, push_interval=None): """ - :param str|unicode fpath: File path. Default: uwsgi.stats + :param str fpath: File path. Default: uwsgi.stats - :param str|unicode separator: New entry separator. Default: \n\n + :param str separator: New entry separator. Default: \n\n :param int push_interval: Write interval in seconds. """ diff --git a/uwsgiconf/options/networking.py b/uwsgiconf/options/networking.py index b708b55..c37a508 100644 --- a/uwsgiconf/options/networking.py +++ b/uwsgiconf/options/networking.py @@ -34,7 +34,7 @@ def from_dsn(cls, dsn, allow_shared_sockets=None): .. note:: This will also automatically use shared sockets to bind to priviledged ports when non root. - :param str|unicode dsn: Data source name, e.g: + :param str dsn: Data source name, e.g: * http://127.0.0.1:8000 * https://127.0.0.1:443?cert=/here/there.crt&key=/that/my.key @@ -101,7 +101,7 @@ def set_basic_params(self, queue_size=None, freebind=None, default_socket_type=N .. note:: Linux only. - :param str|unicode default_socket_type: Force the socket type as default. + :param str default_socket_type: Force the socket type as default. See ``.socket_types``. """ @@ -150,9 +150,9 @@ def set_unix_socket_params(self, abstract=None, permissions=None, owner=None, um would otherwise have no access to the uWSGI socket. When used without a parameter, the permissions will be set to 666. Otherwise the specified chmod value will be used. - :param str|unicode owner: Chown UNIX sockets. + :param str owner: Chown UNIX sockets. - :param str|unicode umask: Set UNIX socket umask. + :param str umask: Set UNIX socket umask. """ self._set('abstract-socket', abstract, cast=bool) @@ -223,7 +223,7 @@ def set_ssl_params( :param bool verbose_errors: Be verbose about SSL errors. - :param str|unicode|bool sessions_cache: Use uWSGI cache for ssl sessions storage. + :param str|bool sessions_cache: Use uWSGI cache for ssl sessions storage. Accepts either bool or cache name string. @@ -233,7 +233,7 @@ def set_ssl_params( :param int sessions_timeout: Set SSL sessions timeout in seconds. Default: 300. - :param str|unicode session_context: Session context identifying string. Can be set to static shared value + :param str session_context: Session context identifying string. Can be set to static shared value to avoid session rejection. Default: a value built from the HTTP server address. @@ -242,9 +242,9 @@ def set_ssl_params( :param int|list[int] raw_options: Set a raw ssl option by its numeric value. - :param str|unicode dir_tmp: Store ssl-related temp files (e.g. pem data) in the specified directory. + :param str dir_tmp: Store ssl-related temp files (e.g. pem data) in the specified directory. - :param str|unicode client_cert_var: Export uWSGI variable ``HTTPS_CC`` containing the raw client certificate. + :param str client_cert_var: Export uWSGI variable ``HTTPS_CC`` containing the raw client certificate. """ self._set('ssl-verbose', verbose_errors, cast=bool) @@ -266,13 +266,13 @@ def set_sni_params(self, name, cert, key, ciphers=None, client_ca=None, wildcard * http://uwsgi.readthedocs.io/en/latest/SNI.html - :param str|unicode name: Node/server/host name. + :param str name: Node/server/host name. - :param str|unicode cert: Certificate file. + :param str cert: Certificate file. - :param str|unicode key: Private key file. + :param str key: Private key file. - :param str|unicode ciphers: Ciphers [alias] string. + :param str ciphers: Ciphers [alias] string. Example: * DEFAULT @@ -281,7 +281,7 @@ def set_sni_params(self, name, cert, key, ciphers=None, client_ca=None, wildcard * https://www.openssl.org/docs/man1.1.0/apps/ciphers.html - :param str|unicode client_ca: Client CA file for client-based auth. + :param str client_ca: Client CA file for client-based auth. .. note: You can prepend ! (exclamation mark) to make client certificate authentication mandatory. @@ -311,9 +311,9 @@ def set_sni_dir_params(self, dir, ciphers=None): * http://uwsgi.readthedocs.io/en/latest/SNI.html#massive-sni-hosting - :param str|unicode dir: + :param str dir: - :param str|unicode ciphers: Ciphers [alias] string. + :param str ciphers: Ciphers [alias] string. Example: * DEFAULT diff --git a/uwsgiconf/options/networking_sockets.py b/uwsgiconf/options/networking_sockets.py index f6cf66d..d0cc249 100644 --- a/uwsgiconf/options/networking_sockets.py +++ b/uwsgiconf/options/networking_sockets.py @@ -13,9 +13,9 @@ class Socket(ParametrizedValue): def __init__(self, address, bound_workers=None, modifier=None): """ - :param str|unicode|SocketShared address: Address ([host]:port or socket file) to bind socket to. + :param str|SocketShared address: Address ([host]:port or socket file) to bind socket to. - :param str|unicode|int|list bound_workers: Map socket to specific workers. + :param str|int|list bound_workers: Map socket to specific workers. As you can bind a uWSGI instance to multiple sockets, you can use this option to map specific workers to specific sockets to implement a sort of in-process Quality of Service scheme. If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them. @@ -62,7 +62,7 @@ class SocketHttp(Socket): def __init__(self, address, http11=False, bound_workers=None, modifier=None): """ - :param str|unicode|SocketShared address: Address ([host]:port or socket file) to bind socket to. + :param str|SocketShared address: Address ([host]:port or socket file) to bind socket to. :param bool http11: Keep-Alive support. If set the server will try to maintain the connection opened if a bunch of rules are respected. @@ -72,7 +72,7 @@ def __init__(self, address, http11=False, bound_workers=None, modifier=None): This has been added to support RTSP protocol for video streaming. - :param str|unicode|int|list bound_workers: Map socket to specific workers. + :param str|int|list bound_workers: Map socket to specific workers. As you can bind a uWSGI instance to multiple sockets, you can use this option to map specific workers to specific sockets to implement a sort of in-process Quality of Service scheme. If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them. @@ -93,13 +93,13 @@ class SocketHttps(Socket): def __init__(self, address, cert, key, ciphers=None, client_ca=None, bound_workers=None, modifier=None): """ - :param str|unicode|SocketShared address: Address ([host]:port or socket file) to bind socket to. + :param str|SocketShared address: Address ([host]:port or socket file) to bind socket to. - :param str|unicode cert: Certificate file. + :param str cert: Certificate file. - :param str|unicode key: Private key file. + :param str key: Private key file. - :param str|unicode ciphers: Ciphers [alias] string. + :param str ciphers: Ciphers [alias] string. Example: * DEFAULT @@ -108,12 +108,12 @@ def __init__(self, address, cert, key, ciphers=None, client_ca=None, bound_worke * https://www.openssl.org/docs/man1.1.0/apps/ciphers.html - :param str|unicode client_ca: Client CA file for client-based auth. + :param str client_ca: Client CA file for client-based auth. .. note: You can prepend ! (exclamation mark) to make client certificate authentication mandatory. - :param str|unicode|int|list bound_workers: Map socket to specific workers. + :param str|int|list bound_workers: Map socket to specific workers. As you can bind a uWSGI instance to multiple sockets, you can use this option to map specific workers to specific sockets to implement a sort of in-process Quality of Service scheme. If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them. @@ -161,11 +161,11 @@ class SocketUwsgi(Socket): def __init__(self, address, persistent=False, bound_workers=None, modifier=None): """ - :param str|unicode|SocketShared address: Address ([host]:port or socket file) to bind socket to. + :param str|SocketShared address: Address ([host]:port or socket file) to bind socket to. :param bool persistent: Use persistent uwsgi protocol (puwsgi). - :param str|unicode|int|list bound_workers: Map socket to specific workers. + :param str|int|list bound_workers: Map socket to specific workers. As you can bind a uWSGI instance to multiple sockets, you can use this option to map specific workers to specific sockets to implement a sort of in-process Quality of Service scheme. If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them. @@ -201,12 +201,12 @@ class SocketFastcgi(Socket): def __init__(self, address, nph=False, bound_workers=None, modifier=None): """ - :param str|unicode|SocketShared address: Address ([host]:port or socket file) to bind socket to. + :param str|SocketShared address: Address ([host]:port or socket file) to bind socket to. :param bool nph: Use NPH mode ("no-parsed-header" - bypass the server completely by sending the complete HTTP header directly to the browser). - :param str|unicode|int|list bound_workers: Map socket to specific workers. + :param str|int|list bound_workers: Map socket to specific workers. As you can bind a uWSGI instance to multiple sockets, you can use this option to map specific workers to specific sockets to implement a sort of in-process Quality of Service scheme. If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them. @@ -227,12 +227,12 @@ class SocketScgi(Socket): def __init__(self, address, nph=False, bound_workers=None, modifier=None): """ - :param str|unicode|SocketShared address: Address ([host]:port or socket file) to bind socket to. + :param str|SocketShared address: Address ([host]:port or socket file) to bind socket to. :param bool nph: Use NPH mode ("no-parsed-header" - bypass the server completely by sending the complete HTTP header directly to the browser). - :param str|unicode|int|list bound_workers: Map socket to specific workers. + :param str|int|list bound_workers: Map socket to specific workers. As you can bind a uWSGI instance to multiple sockets, you can use this option to map specific workers to specific sockets to implement a sort of in-process Quality of Service scheme. If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them. @@ -278,11 +278,11 @@ class SocketShared(Socket): def __init__(self, address, undeferred=False, bound_workers=None, modifier=None): """ - :param str|unicode address: Address ([host]:port or socket file) to bind socket to. + :param str address: Address ([host]:port or socket file) to bind socket to. :param bool undeferred: Use shared socket undeferred mode. - :param str|unicode|int|list bound_workers: Map socket to specific workers. + :param str|int|list bound_workers: Map socket to specific workers. As you can bind a uWSGI instance to multiple sockets, you can use this option to map specific workers to specific sockets to implement a sort of in-process Quality of Service scheme. If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them. diff --git a/uwsgiconf/options/python.py b/uwsgiconf/options/python.py index 94ef2d1..be574a0 100644 --- a/uwsgiconf/options/python.py +++ b/uwsgiconf/options/python.py @@ -24,25 +24,25 @@ def set_basic_params( optimization_level=None): """ - :param str|unicode|int version: Python version plugin supports. + :param str|int version: Python version plugin supports. Example: * 3 - version 3 * - version 2 * - version deduced by uwsgiconf - :param str|unicode python_home: Set python executable directory - PYTHONHOME/virtualenv. + :param str python_home: Set python executable directory - PYTHONHOME/virtualenv. - :param str|unicode search_path: Add directory (or an .egg or a glob) to the Python search path. + :param str search_path: Add directory (or an .egg or a glob) to the Python search path. .. note:: This can be specified up to 64 times. - :param str|unicode python_binary: Set python program name. + :param str python_binary: Set python program name. - :param str|unicode tracebacker_path: Enable the uWSGI Python tracebacker. + :param str tracebacker_path: Enable the uWSGI Python tracebacker. http://uwsgi-docs.readthedocs.io/en/latest/Tracebacker.html - :param str|unicode plugin_dir: Directory to search for plugin. + :param str plugin_dir: Directory to search for plugin. :param bool enable_threads: Enable threads in the embedded languages. This will allow to spawn threads in your app. @@ -111,7 +111,7 @@ def set_app_args(self, *args): def set_wsgi_params(self, module=None, callable_name=None, env_strategy=None): """Set wsgi related parameters. - :param str|unicode module: + :param str module: * load .wsgi file as the Python application * load a WSGI module as the application. @@ -121,9 +121,9 @@ def set_wsgi_params(self, module=None, callable_name=None, env_strategy=None): * mypackage.my_wsgi_module -- read from `application` attr of mypackage/my_wsgi_module.py * mypackage.my_wsgi_module:my_app -- read from `my_app` attr of mypackage/my_wsgi_module.py - :param str|unicode callable_name: Set WSGI callable name. Default: application. + :param str callable_name: Set WSGI callable name. Default: application. - :param str|unicode env_strategy: Strategy for allocating/deallocating + :param str env_strategy: Strategy for allocating/deallocating the WSGI env, can be: * ``cheat`` - preallocates the env dictionary on uWSGI startup and clears it @@ -149,7 +149,7 @@ def set_wsgi_params(self, module=None, callable_name=None, env_strategy=None): def eval_wsgi_entrypoint(self, code): """Evaluates Python code as WSGI entry point. - :param str|unicode code: + :param str code: """ self._set('eval', code) @@ -162,7 +162,7 @@ def set_autoreload_params(self, scan_interval=None, ignore_modules=None): .. warning:: Use only in development. - :param list|st|unicode ignore_modules: Ignore the specified module during auto-reload scan. + :param list|str ignore_modules: Ignore the specified module during auto-reload scan. """ self._set('py-auto-reload', scan_interval) @@ -175,8 +175,8 @@ def register_module_alias(self, alias, module_path, after_init=False): http://uwsgi-docs.readthedocs.io/en/latest/PythonModuleAlias.html - :param str|unicode alias: - :param str|unicode module_path: + :param str alias: + :param str module_path: :param bool after_init: add a python module alias after uwsgi module initialization """ command = 'post-pymodule-alias' if after_init else 'pymodule-alias' @@ -187,7 +187,7 @@ def register_module_alias(self, alias, module_path, after_init=False): def import_module(self, modules, shared=False, into_spooler=False): """Imports a python module. - :param list|str|unicode modules: + :param list|str modules: :param bool shared: If shared import is done once in master process. Otherwise import a python module in all of the processes. @@ -212,7 +212,7 @@ def import_module(self, modules, shared=False, into_spooler=False): def run_module(self, module): """Runs a Python script in the uWSGI environment. - :param str|unicode module: + :param str module: """ self._set('pyrun', module) diff --git a/uwsgiconf/options/queue.py b/uwsgiconf/options/queue.py index 7f3122f..3de60e1 100644 --- a/uwsgiconf/options/queue.py +++ b/uwsgiconf/options/queue.py @@ -19,7 +19,7 @@ def enable(self, size, block_size=None, store=None, store_sync_interval=None): :param int block_size: Block size in bytes. Default: 8 KiB. - :param str|unicode store: Persist the queue into file. + :param str store: Persist the queue into file. :param int store_sync_interval: Store sync interval in master cycles (usually seconds). diff --git a/uwsgiconf/options/routing.py b/uwsgiconf/options/routing.py index 266a806..9c760de 100644 --- a/uwsgiconf/options/routing.py +++ b/uwsgiconf/options/routing.py @@ -167,7 +167,7 @@ def __init__(self, action, subject=None, stage=stages.REQUEST): * String values are automatically transformed into ``subjects.path_info``. * If ``None`` action is performed always w/o subject check. - :param str|unicode stage: Stage on which the action needs to be performed. + :param str stage: Stage on which the action needs to be performed. See ``.stages``. """ @@ -291,7 +291,7 @@ def register_route(self, route_rules, label=None): :param RouteRule|list[RouteRule] route_rules: - :param str|unicode label: Label to mark the given set of rules. + :param str label: Label to mark the given set of rules. This can be used in conjunction with ``do_goto`` rule action. * http://uwsgi.readthedocs.io/en/latest/InternalRouting.html#goto @@ -319,7 +319,7 @@ def set_error_page(self, status, html_fpath): :param int status: HTTP status code. - :param str|unicode html_fpath: HTML page file path. + :param str html_fpath: HTML page file path. """ statuses = [403, 404, 500] @@ -345,7 +345,7 @@ def set_error_pages(self, codes_map=None, common_prefix=None): If not set, filename containing status code is presumed: 400.html, 500.html, etc. - :param str|unicode common_prefix: Common path (prefix) for all files. + :param str common_prefix: Common path (prefix) for all files. """ statuses = [403, 404, 500] @@ -367,9 +367,9 @@ def set_geoip_params(self, db_country=None, db_city=None): * http://uwsgi.readthedocs.io/en/latest/GeoIP.html - :param str|unicode db_country: Country database file path. + :param str db_country: Country database file path. - :param str|unicode db_city: City database file path. Example: ``GeoLiteCity.dat``. + :param str db_city: City database file path. Example: ``GeoLiteCity.dat``. """ self._set('geoip-country', db_country, plugin='geoip') @@ -380,9 +380,9 @@ def set_geoip_params(self, db_country=None, db_city=None): def header_add(self, name, value): """Automatically add HTTP headers to response. - :param str|unicode name: + :param str name: - :param str|unicode value: + :param str value: """ self._set('add-header', f'{name}: {value}', multi=True) @@ -392,7 +392,7 @@ def header_add(self, name, value): def header_remove(self, value): """Automatically remove specified HTTP header from the response. - :param str|unicode value: + :param str value: """ self._set('del-header', value, multi=True) @@ -403,9 +403,9 @@ def header_collect(self, name, target_var, pull=False): """Store the specified response header in a request var (optionally removing it from the response). - :param str|unicode name: + :param str name: - :param str|unicode target_var: + :param str target_var: :param bool pull: Whether to remove header from response. diff --git a/uwsgiconf/options/routing_actions.py b/uwsgiconf/options/routing_actions.py index 0c64187..f1d0703 100644 --- a/uwsgiconf/options/routing_actions.py +++ b/uwsgiconf/options/routing_actions.py @@ -131,7 +131,7 @@ class ActionLog(RouteAction): def __init__(self, message): """ - :param str|unicode|None message: Message to add into log. + :param str|None message: Message to add into log. If ``None`` logging will be disabled for this request. """ @@ -157,7 +157,7 @@ class ActionAddVarLog(RouteAction): def __init__(self, name, val): """ - :param str|unicode name: Variable name. + :param str name: Variable name. :param val: Variable value. """ @@ -171,7 +171,7 @@ class ActionDoGoto(RouteAction): def __init__(self, where): """ - :param str|unicode|int where: Rule number of label to go to. + :param str|int where: Rule number of label to go to. """ super(ActionDoGoto, self).__init__(where) @@ -183,7 +183,7 @@ class ActionAddVarCgi(RouteAction): def __init__(self, name, val): """ - :param str|unicode name: Variable name. + :param str name: Variable name. :param val: Variable value. """ @@ -197,7 +197,7 @@ class ActionHeaderAdd(RouteAction): def __init__(self, name, val): """ - :param str|unicode name: Header name. + :param str name: Header name. :param val: Header value. """ @@ -213,7 +213,7 @@ class ActionHeaderRemove(RouteAction): def __init__(self, name): """ - :param str|unicode name: Header name. + :param str name: Header name. """ super(ActionHeaderRemove, self).__init__(name) @@ -278,7 +278,7 @@ class ActionRedirect(RouteAction): def __init__(self, url, permanent=False): """ - :param str| unicode url: URL to redirect to. + :param str url: URL to redirect to. :param bool permanent: If ``True`` use 301, otherwise 302. """ if permanent: @@ -299,7 +299,7 @@ class ActionRewrite(RouteAction): def __init__(self, rule, do_continue=False): """ - :param str|unicode rule: A rewrite rule. + :param str rule: A rewrite rule. :param bool do_continue: Stop request processing and continue to the selected request handler. @@ -322,9 +322,9 @@ class ActionRouteUwsgi(RouteAction): def __init__(self, external_address='', modifier='', app=''): """ - :param str|unicode external_address: External uWSGI server address (host:port). + :param str external_address: External uWSGI server address (host:port). :param Modifier modifier: Set request modifier. - :param str|unicode app: Set ``UWSGI_APPID``. + :param str app: Set ``UWSGI_APPID``. """ super(ActionRouteUwsgi, self).__init__(external_address, modifier, modifier.submod, app) @@ -338,9 +338,9 @@ class ActionRouteExternal(RouteAction): def __init__(self, address, host_header=None): """ - :param str|unicode address: External HTTP address (host:port) + :param str address: External HTTP address (host:port) - :param str|unicode host_header: HOST header value. + :param str host_header: HOST header value. """ super(ActionRouteExternal, self).__init__(address, host_header) @@ -355,9 +355,9 @@ class ActionAlarm(RouteAction): def __init__(self, name, message): """ - :param str|unicode name: Alarm name + :param str name: Alarm name - :param str|unicode message: Message to pass into alarm. + :param str message: Message to pass into alarm. """ super(ActionAlarm, self).__init__(name, message) @@ -370,7 +370,7 @@ class ActionServeStatic(RouteAction): def __init__(self, fpath): """ - :param str|unicode fpath: Static file path. + :param str fpath: Static file path. """ super(ActionServeStatic, self).__init__(fpath) @@ -384,11 +384,11 @@ class ActionAuthBasic(RouteAction): def __init__(self, realm, user=None, password=None, do_next=False): """ - :param str|unicode realm: + :param str realm: - :param str|unicode user: + :param str user: - :param str|unicode password: Password or htpasswd-like file. + :param str password: Password or htpasswd-like file. :param bool do_next: Allow next rule. """ @@ -420,22 +420,22 @@ def __init__( do_next=False): """ - :param str|unicode realm: + :param str realm: - :param str|unicode address: LDAP server URI + :param str address: LDAP server URI - :param str|unicode base_dn: Base DN used when searching for users. + :param str base_dn: Base DN used when searching for users. - :param str|unicode bind_dn: DN used for binding. + :param str bind_dn: DN used for binding. Required if the LDAP server does not allow anonymous searches. - :param str|unicode bind_password: Password for the ``bind_dn`` user. + :param str bind_password: Password for the ``bind_dn`` user. - :param str|unicode filter: Filter used when searching for users. Default: ``(objectClass=*)`` + :param str filter: Filter used when searching for users. Default: ``(objectClass=*)`` - :param str|unicode login_attr: LDAP attribute that holds user login. Default: ``uid``. + :param str login_attr: LDAP attribute that holds user login. Default: ``uid``. - :param str|unicode log_level: Log level. + :param str log_level: Log level. Supported values: * 0 - don't log any binds @@ -482,7 +482,7 @@ class ActionDirChange(RouteAction): def __init__(self, dir): """ - :param str|unicode dir: Directory to change into. + :param str dir: Directory to change into. """ super(ActionDirChange, self).__init__(dir) @@ -501,7 +501,7 @@ class ActionSetVarUwsgiAppid(RouteAction): def __init__(self, app): """ - :param str|unicode app: Application ID. + :param str app: Application ID. """ super(ActionSetVarUwsgiAppid, self).__init__(app) @@ -513,7 +513,7 @@ class ActionSetVarRemoteUser(RouteAction): def __init__(self, user): """ - :param str|unicode user: Username. + :param str user: Username. """ super(ActionSetVarRemoteUser, self).__init__(user) @@ -525,7 +525,7 @@ class ActionSetVarUwsgiHome(RouteAction): def __init__(self, dir): """ - :param str|unicode dir: Directory to make a new home. + :param str dir: Directory to make a new home. """ super(ActionSetVarUwsgiHome, self).__init__(dir) @@ -543,7 +543,7 @@ class ActionSetVarUwsgiScheme(RouteAction): def __init__(self, value): """ - :param str|unicode value: + :param str value: """ super(ActionSetVarUwsgiScheme, self).__init__(value) @@ -555,7 +555,7 @@ class ActionSetVarScriptName(RouteAction): def __init__(self, name): """ - :param str|unicode name: Script name + :param str name: Script name """ super(ActionSetVarScriptName, self).__init__(name) @@ -567,7 +567,7 @@ class ActionSetVarRequestMethod(RouteAction): def __init__(self, name): """ - :param str|unicode name: Method name. + :param str name: Method name. """ super(ActionSetVarRequestMethod, self).__init__(name) @@ -579,7 +579,7 @@ class ActionSetVarRequestUri(RouteAction): def __init__(self, value): """ - :param str|unicode value: URI + :param str value: URI """ super(ActionSetVarRequestUri, self).__init__(value) @@ -591,7 +591,7 @@ class ActionSetVarRemoteAddr(RouteAction): def __init__(self, value): """ - :param str|unicode value: Address. + :param str value: Address. """ super(ActionSetVarRemoteAddr, self).__init__(value) @@ -603,7 +603,7 @@ class ActionSetVarPathInfo(RouteAction): def __init__(self, value): """ - :param str|unicode value: New info. + :param str value: New info. """ super(ActionSetVarPathInfo, self).__init__(value) @@ -615,7 +615,7 @@ class ActionSetVarDocumentRoot(RouteAction): def __init__(self, value): """ - :param str|unicode value: + :param str value: """ super(ActionSetVarDocumentRoot, self).__init__(value) @@ -627,7 +627,7 @@ class ActionSetUwsgiProcessName(RouteAction): def __init__(self, name): """ - :param str|unicode name: New process name. + :param str name: New process name. """ super(ActionSetUwsgiProcessName, self).__init__(name) @@ -657,6 +657,6 @@ class ActionSetScriptFile(RouteAction): def __init__(self, fpath): """ - :param str|unicode fpath: File path. + :param str fpath: File path. """ super(ActionSetScriptFile, self).__init__(fpath) diff --git a/uwsgiconf/options/routing_modifiers.py b/uwsgiconf/options/routing_modifiers.py index d7d6022..839d891 100644 --- a/uwsgiconf/options/routing_modifiers.py +++ b/uwsgiconf/options/routing_modifiers.py @@ -19,7 +19,7 @@ def __init__(self, submod=None): def _get_code_str(cls, src): """ :param src: - :rtype: str|unicode + :rtype: str """ return str(src) if src is not None else '' @@ -30,7 +30,7 @@ def __str__(self): def submod(self): """Modifier 2 value. - :rtype: str|unicode + :rtype: str """ return self._get_code_str(self._submod) diff --git a/uwsgiconf/options/routing_routers.py b/uwsgiconf/options/routing_routers.py index 6a54285..87e9847 100644 --- a/uwsgiconf/options/routing_routers.py +++ b/uwsgiconf/options/routing_routers.py @@ -16,7 +16,7 @@ def _set_aliased(self, *args, **kwargs): def __init__(self, on=None): """ - :param SocketShared|str|unicode on: Activates the router on the given address. + :param SocketShared|str on: Activates the router on the given address. """ self._make_section_like() @@ -60,9 +60,9 @@ def 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 zerg_server: Attach the router to a zerg server. - :param str|unicode fallback_node: Fallback to the specified node in case of error. + :param str fallback_node: Fallback to the specified node in case of error. :param int concurrent_events: Set the maximum number of concurrent events router can manage. @@ -73,7 +73,7 @@ def set_basic_params( This means that when there are no nodes subscribed, only your local app (if any) will respond. When all of the nodes go down, the router will return in cheap mode. - :param str|unicode stats_server: Router stats server address to run at. + :param str stats_server: Router stats server address to run at. """ self._set_aliased('workers', workers) @@ -124,7 +124,7 @@ class ForwarderPath(Forwarder): def __init__(self, sockets_dir): """ - :param str|unicode sockets_dir: UNIX sockets directory. + :param str sockets_dir: UNIX sockets directory. Allows %s to denote key (domain). """ @@ -151,9 +151,9 @@ class ForwarderCode(Forwarder): def __init__(self, script, func, modifier=None): """ - :param str|unicode script: Script (module for Python) name to get function from. + :param str script: Script (module for Python) name to get function from. - :param str|unicode func: Function name. + :param str func: Function name. :param Modifier modifier: Routing modifier. @@ -172,7 +172,7 @@ class ForwarderCache(Forwarder): def __init__(self, cache_name=None): """ - :param str|unicode cache_name: Cache name to use. + :param str cache_name: Cache name to use. """ super(ForwarderCache, self).__init__(cache_name) @@ -184,7 +184,7 @@ class ForwarderSocket(Forwarder): def __init__(self, socket): """ - :param str|unicode socket: Socket filepath. + :param str socket: Socket filepath. """ super(ForwarderSocket, self).__init__(socket) @@ -203,7 +203,7 @@ class ForwarderSubscriptionServer(Forwarder): def __init__(self, address): """ - :param str|unicode address: Address (including port) to run the subscription server on. + :param str address: Address (including port) to run the subscription server on. """ super(ForwarderSubscriptionServer, self).__init__(address) @@ -224,9 +224,9 @@ class forwarders(object): def __init__(self, on=None, forward_to=None): """Activates the router on the given address. - :param SocketShared|str|unicode on: Activates the router on the given address. + :param SocketShared|str on: Activates the router on the given address. - :param Forwarder|str|unicode|list[str|unicode] forward_to: Where to forward requests. + :param Forwarder|str|list[str] forward_to: Where to forward requests. Expects a forwarder instance or one or more node names. """ @@ -248,9 +248,9 @@ def 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 zerg_server: Attach the router to a zerg server. - :param str|unicode fallback_node: Fallback to the specified node in case of error. + :param str fallback_node: Fallback to the specified node in case of error. :param int concurrent_events: Set the maximum number of concurrent events router can manage. @@ -261,7 +261,7 @@ def set_basic_params( This means that when there are no nodes subscribed, only your local app (if any) will respond. When all of the nodes go down, the router will return in cheap mode. - :param str|unicode stats_server: Router stats server address to run at. + :param str stats_server: Router stats server address to run at. :param bool quiet: Do not report failed connections to instances. @@ -323,9 +323,9 @@ def 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 zerg_server: Attach the router to a zerg server. - :param str|unicode fallback_node: Fallback to the specified node in case of error. + :param str fallback_node: Fallback to the specified node in case of error. :param int concurrent_events: Set the maximum number of concurrent events router can manage. @@ -336,7 +336,7 @@ def set_basic_params( This means that when there are no nodes subscribed, only your local app (if any) will respond. When all of the nodes go down, the router will return in cheap mode. - :param str|unicode stats_server: Router stats server address to run at. + :param str stats_server: Router stats server address to run at. :param bool quiet: Do not report failed connections to instances. @@ -348,7 +348,7 @@ def set_basic_params( .. note:: See http11 socket type for an alternative. - :param str|unicode|list[str|unicode] resubscribe_addresses: Forward subscriptions + :param str|list[str] resubscribe_addresses: Forward subscriptions to the specified subscription server. @@ -436,9 +436,9 @@ def set_manage_params( def set_owner_params(self, uid=None, gid=None): """Drop http router privileges to specified user and group. - :param str|unicode|int uid: Set uid to the specified username or uid. + :param str|int uid: Set uid to the specified username or uid. - :param str|unicode|int gid: Set gid to the specified groupname or gid. + :param str|int gid: Set gid to the specified groupname or gid. """ self._set_aliased('uid', uid) @@ -470,13 +470,13 @@ def __init__( export_cert_var=None): """Binds https router to run on the given address. - :param SocketShared|str|unicode on: Activates the router on the given address. + :param SocketShared|str on: Activates the router on the given address. - :param str|unicode cert: Certificate file. + :param str cert: Certificate file. - :param str|unicode key: Private key file. + :param str key: Private key file. - :param str|unicode ciphers: Ciphers [alias] string. + :param str ciphers: Ciphers [alias] string. Example: * DEFAULT @@ -485,12 +485,12 @@ def __init__( * https://www.openssl.org/docs/man1.1.0/apps/ciphers.html - :param str|unicode client_ca: Client CA file for client-based auth. + :param str client_ca: Client CA file for client-based auth. .. note: You can prepend ! (exclamation mark) to make client certificate authentication mandatory. - :param str|unicode session_context: Session context identifying string. Can be set to static shared value + :param str session_context: Session context identifying string. Can be set to static shared value to avoid session rejection. Default: a value built from the HTTP server address. @@ -526,16 +526,16 @@ class RouterSsl(_RouterWithForwarders): def __init__(self, on, cert, key, forward_to=None, ciphers=None, client_ca=None, session_context=None, use_sni=None): """Activates the router on the given address. - :param SocketShared|str|unicode on: Activates the router on the given address. + :param SocketShared|str on: Activates the router on the given address. - :param str|unicode cert: Certificate file. + :param str cert: Certificate file. - :param str|unicode key: Private key file. + :param str key: Private key file. - :param Forwarder|str|unicode|list[str|unicode] forward_to: Where to forward requests. + :param Forwarder|str|list[str] forward_to: Where to forward requests. Expects a forwarder instance or one or more node names. - :param str|unicode ciphers: Ciphers [alias] string. + :param str ciphers: Ciphers [alias] string. Example: * DEFAULT @@ -544,9 +544,9 @@ def __init__(self, on, cert, key, forward_to=None, ciphers=None, client_ca=None, * https://www.openssl.org/docs/man1.1.0/apps/ciphers.html - :param str|unicode client_ca: Client CA file for client-based auth. + :param str client_ca: Client CA file for client-based auth. - :param str|unicode session_context: Session context identifying string. Can be set to static shared value + :param str session_context: Session context identifying string. Can be set to static shared value to avoid session rejection. Default: a value built from the HTTP server address. @@ -603,9 +603,9 @@ def 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 zerg_server: Attach the router to a zerg server. - :param str|unicode fallback_node: Fallback to the specified node in case of error. + :param str fallback_node: Fallback to the specified node in case of error. :param int concurrent_events: Set the maximum number of concurrent events router can manage. @@ -616,7 +616,7 @@ def set_basic_params( This means that when there are no nodes subscribed, only your local app (if any) will respond. When all of the nodes go down, the router will return in cheap mode. - :param str|unicode stats_server: Router stats server address to run at. + :param str stats_server: Router stats server address to run at. :param bool quiet: Do not report failed connections to instances. @@ -624,9 +624,9 @@ def set_basic_params( :param bool fallback_nokey: Move to fallback node even if a subscription key is not found. - :param str|unicode subscription_key: Skip uwsgi parsing and directly set a key. + :param str subscription_key: Skip uwsgi parsing and directly set a key. - :param str|unicode emperor_command_socket: Set the emperor command socket that will receive spawn commands. + :param str emperor_command_socket: Set the emperor command socket that will receive spawn commands. See `.empire.set_emperor_command_params()`. @@ -651,9 +651,9 @@ def set_resubscription_params(self, addresses=None, bind_to=None): * http://uwsgi.readthedocs.io/en/latest/Changelog-2.0.1.html#resubscriptions - :param str|unicode|list[str|unicode] addresses: Forward subscriptions to the specified subscription server. + :param str|list[str] addresses: Forward subscriptions to the specified subscription server. - :param str|unicode|list[str|unicode] bind_to: Bind to the specified address when re-subscribing. + :param str|list[str] bind_to: Bind to the specified address when re-subscribing. """ self._set_aliased('resubscribe', addresses, multi=True) @@ -692,7 +692,7 @@ def set_postbuffering_params(self, size=None, store_dir=None): :param int size: The size (in bytes) of the request body after which the body will be stored to disk (as a temporary file) instead of memory. - :param str|unicode store_dir: Put buffered files to the specified directory. Default: TMPDIR, /tmp/ + :param str store_dir: Put buffered files to the specified directory. Default: TMPDIR, /tmp/ """ self._set_aliased('post-buffering', size) @@ -703,9 +703,9 @@ def set_postbuffering_params(self, size=None, store_dir=None): 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|int uid: Set uid to the specified username or uid. - :param str|unicode|int gid: Set gid to the specified groupname or gid. + :param str|int gid: Set gid to the specified groupname or gid. """ self._set_aliased('uid', uid) @@ -765,7 +765,7 @@ class RouterForkPty(_RouterCommon): def __init__(self, on=None, undeferred=False): """Binds router to run on the given address. - :param SocketShared|str|unicode on: Activates the router on the given address. + :param SocketShared|str on: Activates the router on the given address. :param bool undeferred: Run router in undeferred mode. @@ -786,9 +786,9 @@ def 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 zerg_server: Attach the router to a zerg server. - :param str|unicode fallback_node: Fallback to the specified node in case of error. + :param str fallback_node: Fallback to the specified node in case of error. :param int concurrent_events: Set the maximum number of concurrent events router can manage. @@ -799,9 +799,9 @@ def set_basic_params( This means that when there are no nodes subscribed, only your local app (if any) will respond. When all of the nodes go down, the router will return in cheap mode. - :param str|unicode stats_server: Router stats server address to run at. + :param str stats_server: Router stats server address to run at. - :param str|unicode run_command: Run the specified command + :param str run_command: Run the specified command on every connection. Default: /bin/sh. """ @@ -860,13 +860,13 @@ class RouterTunTap(RouterBase): def __init__(self, on=None, device=None, stats_server=None, gateway=None): """Passing params will create a router device. - :param str|unicode on: Socket file. + :param str on: Socket file. - :param str|unicode device: Device name. + :param str device: Device name. - :param str|unicode stats_server: Router stats server address to run at. + :param str stats_server: Router stats server address to run at. - :param str|unicode gateway: Gateway address. + :param str gateway: Gateway address. """ super(RouterTunTap, self).__init__() @@ -884,9 +884,9 @@ def __init__(self, on=None, device=None, stats_server=None, gateway=None): 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 use_credentials: Enable check of SCM_CREDENTIALS for tuntap client/server. - :param str|unicode stats_server: Router stats server address to run at. + :param str stats_server: Router stats server address to run at. """ self._set_aliased('use-credentials', use_credentials) @@ -897,11 +897,11 @@ def set_basic_params(self, use_credentials=None, stats_server=None): def register_route(self, src, dst, gateway): """Adds a routing rule to the tuntap router. - :param str|unicode src: Source/mask. + :param str src: Source/mask. - :param str|unicode dst: Destination/mask. + :param str dst: Destination/mask. - :param str|unicode gateway: Gateway address. + :param str gateway: Gateway address. """ self._set_aliased('router-route', ' '.join((src, dst, gateway)), multi=True) @@ -913,11 +913,11 @@ def device_connect(self, socket, device_name): To be used in a vassal. - :param str|unicode socket: Router socket. + :param str socket: Router socket. Example: `/run/tuntap_router.socket`. - :param str|unicode device_name: Device. + :param str device_name: Device. Example: `uwsgi0`. @@ -931,23 +931,23 @@ def device_add_rule(self, direction, action, src, dst, target=None): To be used in a vassal. - :param str|unicode direction: Direction: + :param str direction: Direction: * in * out. - :param str|unicode action: Action: + :param str action: Action: * allow * deny * route * gateway. - :param str|unicode src: Source/mask. + :param str src: Source/mask. - :param str|unicode dst: Destination/mask. + :param str dst: Destination/mask. - :param str|unicode target: Depends on action. + :param str target: Depends on action. * Route / Gateway: Accept addr:port @@ -967,19 +967,19 @@ def add_firewall_rule(self, direction, action, src=None, dst=None): 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: + :param str direction: Direction: * in * out - :param str|unicode action: Action: + :param str action: Action: * allow * deny - :param str|unicode src: Source/mask. + :param str src: Source/mask. - :param str|unicode dst: Destination/mask + :param str dst: Destination/mask """ value = [action] diff --git a/uwsgiconf/options/routing_subjects.py b/uwsgiconf/options/routing_subjects.py index 0553a53..d562c1e 100644 --- a/uwsgiconf/options/routing_subjects.py +++ b/uwsgiconf/options/routing_subjects.py @@ -16,7 +16,7 @@ class SubjectCustom(ParametrizedValue): def __init__(self, subject, negate=False): """ - :param Var|str|unicode subject: Handwritten subject or a Var heir representing it. + :param Var|str subject: Handwritten subject or a Var heir representing it. :param bool negate: Use to negate subject for rule. .. note:: You can also use tilde (~) instead of this argument for nagation. diff --git a/uwsgiconf/options/spooler.py b/uwsgiconf/options/spooler.py index 6131b92..3075ba6 100644 --- a/uwsgiconf/options/spooler.py +++ b/uwsgiconf/options/spooler.py @@ -31,7 +31,7 @@ def set_basic_params( cheap=None, base_dir=None): """ - :param str|unicode|list touch_reload: reload spoolers if the specified file is modified/touched + :param str|list touch_reload: reload spoolers if the specified file is modified/touched :param bool quiet: Do not log spooler related messages. @@ -44,7 +44,7 @@ def set_basic_params( :param int harakiri: Set harakiri timeout for spooler tasks. - :param str|unicode change_dir: chdir() to specified directory before each spooler task. + :param str change_dir: chdir() to specified directory before each spooler task. :param int poll_interval: Spooler poll frequency in seconds. Default: 30. @@ -76,7 +76,7 @@ def set_basic_params( def add(self, work_dir, external=False): """Run a spooler on the specified directory. - :param str|unicode|list[str|unicode] work_dir: Spooler working directory path or it's name if + :param str|list[str] work_dir: Spooler working directory path or it's name if `base_dir` argument of `spooler.set_basic_params()` is set. .. note:: Placeholders can be used to build paths, e.g.: {project_runtime_dir}/spool/ diff --git a/uwsgiconf/options/statics.py b/uwsgiconf/options/statics.py index ffae842..95bef5a 100644 --- a/uwsgiconf/options/statics.py +++ b/uwsgiconf/options/statics.py @@ -52,23 +52,23 @@ def set_basic_params( self, static_dir=None, index_file=None, mime_file=None, skip_ext=None, transfer_mode=None): """ - :param str|unicode|list[str|unicode] static_dir: Check for static files in the specified directory. + :param str|list[str] static_dir: Check for static files in the specified directory. .. note:: Use ``DIR_DOCUMENT_ROOT`` constant to serve files under ``DOCUMENT_ROOT``. - :param str|unicode|list[str|unicode] index_file: Search for specified file if a directory is requested. + :param str|list[str] index_file: Search for specified file if a directory is requested. Example: ``index.html`` - :param str|unicode|list[str|unicode] mime_file: Set mime types file path to extend uWSGI builtin list. + :param str|list[str] mime_file: Set mime types file path to extend uWSGI builtin list. Default: ``/etc/mime.types`` or ``/etc/apache2/mime.types``. - :param str|unicode|list[str|unicode] skip_ext: Skip specified extension from static file checks. + :param str|list[str] skip_ext: Skip specified extension from static file checks. Example: add ``.php`` to not serve it as static. - :param str|unicode transfer_mode: Set static file serving (transfer) mode. + :param str transfer_mode: Set static file serving (transfer) mode. See ``.transfer_modes``. @@ -94,9 +94,9 @@ def register_static_map(self, mountpoint, target, retain_resource_path=False, sa * http://uwsgi.readthedocs.io/en/latest/StaticFiles.html#mode-3-using-static-file-mount-points - :param str|unicode mountpoint: + :param str mountpoint: - :param str|unicode target: + :param str target: :param bool retain_resource_path: Append the requested resource to the docroot. @@ -129,11 +129,11 @@ def register_static_map(self, mountpoint, target, retain_resource_path=False, sa def add_expiration_rule(self, criterion, value, timeout, use_mod_time=False): """Adds statics expiration rule based on a criterion. - :param str|unicode criterion: Criterion (subject) to base expiration on. + :param str criterion: Criterion (subject) to base expiration on. See ``.expiration_criteria``. - :param str|unicode|list[str|unicode] value: Value to test criteria upon. + :param str|list[str] value: Value to test criteria upon. .. note:: Usually a regular expression. @@ -172,7 +172,7 @@ def set_paths_caching_params(self, timeout=None, cache_name=None): :param int timeout: Amount of seconds to put resolved paths in the uWSGI cache. - :param str|unicode cache_name: Cache name to use for static paths. + :param str cache_name: Cache name to use for static paths. """ self._set('static-cache-paths', timeout) diff --git a/uwsgiconf/options/subscriptions.py b/uwsgiconf/options/subscriptions.py index 3cc521f..1971795 100644 --- a/uwsgiconf/options/subscriptions.py +++ b/uwsgiconf/options/subscriptions.py @@ -34,7 +34,7 @@ def set_server_params( tolerance=None, tolerance_inactive=None, key_dot_split=None): """Sets subscription server related params. - :param str|unicode client_notify_address: Set the notification socket for subscriptions. + :param str 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 will bind and the subscription server will send acknowledgements to. @@ -70,21 +70,21 @@ def set_server_verification_params( These are for secured subscriptions. - :param str|unicode digest_algo: Digest algorithm. Example: SHA1 + :param str digest_algo: Digest algorithm. Example: SHA1 .. note:: Also requires ``dir_cert`` to be set. - :param str|unicode dir_cert: Certificate directory. + :param str dir_cert: Certificate directory. .. note:: Also requires ``digest_algo`` to be set. :param int tolerance: Maximum tolerance (in seconds) of clock skew for secured subscription system. Default: 24h. - :param str|unicode|int|list[str|unicode|int] no_check_uid: Skip signature check for the specified uids + :param str|int|list[str|int] no_check_uid: Skip signature check for the specified uids when using unix sockets credentials. - :param str|unicode|list[str|unicode] dir_credentials: Directories to search for subscriptions + :param str|list[str] dir_credentials: Directories to search for subscriptions key credentials. :param bool pass_unix_credentials: Enable management of SCM_CREDENTIALS in subscriptions UNIX sockets. @@ -128,22 +128,22 @@ def subscribe( sni_cert=None, sni_key=None, sni_client_ca=None): """Registers a subscription intent. - :param str|unicode server: Subscription server address (UDP or UNIX socket). + :param str 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>'). + :param str key: Key to subscribe. Generally the domain name (+ optional '/< mountpoint>'). Examples: * mydomain.it/foo * mydomain.it/foo/bar (requires ``mountpoints_depth=2``) * mydomain.it * ubuntu64.local:9090 - :param str|unicode|int address: Address to subscribe (the value for the key) + :param str|int address: Address to subscribe (the value for the key) or zero-based internal socket number (integer). - :param str|unicode address: Vassal node address. + :param str address: Vassal node address. :param int balancing_weight: Load balancing value. Default: 1. @@ -158,21 +158,21 @@ def subscribe( Examples: * SHA1:idlessh001 - :param str|unicode check_file: If this file exists the subscription packet is sent, + :param str check_file: If this file exists the subscription packet is sent, otherwise it is skipped. - :param str|unicode protocol: the protocol to use, by default it is ``uwsgi``. + :param str protocol: the protocol to use, by default it is ``uwsgi``. See ``.networking.socket_types``. .. note:: Since 2.1 - :param str|unicode sni_cert: Certificate file to use for SNI proxy management. + :param str sni_cert: Certificate file to use for SNI proxy management. * http://uwsgi.readthedocs.io/en/latest/SNI.html#subscription-system-and-sni - :param str|unicode sni_key: sni_key Key file to use for SNI proxy management. + :param str sni_key: sni_key Key file to use for SNI proxy management. * http://uwsgi.readthedocs.io/en/latest/SNI.html#subscription-system-and-sni - :param str|unicode sni_client_ca: Ca file to use for SNI proxy management. + :param str sni_client_ca: Ca file to use for SNI proxy management. * http://uwsgi.readthedocs.io/en/latest/SNI.html#subscription-system-and-sni """ diff --git a/uwsgiconf/options/workers.py b/uwsgiconf/options/workers.py index 57c7d6d..a8087c7 100644 --- a/uwsgiconf/options/workers.py +++ b/uwsgiconf/options/workers.py @@ -8,7 +8,7 @@ class MuleFarm(object): def __init__(self, name, mule_numbers): """ - :param str|unicode name: Farm alias. + :param str name: Farm alias. :param int|list[int] mule_numbers: Total mules on farm count, or a list of mule numbers. @@ -106,7 +106,7 @@ def set_basic_params( def run_command_as_worker(self, command, after_post_fork_hook=False): """Run the specified command as worker. - :param str|unicode command: + :param str command: :param bool after_post_fork_hook: Whether to run it after `post_fork` hook. @@ -368,13 +368,13 @@ def set_zerg_server_params(self, socket, clients_socket_pool=None): * http://uwsgi-docs.readthedocs.io/en/latest/Zerg.html - :param str|unicode socket: Unix socket to bind server to. + :param str socket: Unix socket to bind server to. Examples: * unix socket - ``/var/run/mutalisk`` * Linux abstract namespace - ``@nydus`` - :param str|unicode|list[str|unicode] clients_socket_pool: This enables Zerg Pools. + :param str|list[str] clients_socket_pool: This enables Zerg Pools. .. note:: Expects master process. @@ -394,7 +394,7 @@ def set_zerg_server_params(self, socket, clients_socket_pool=None): 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 str|list[str] server_sockets: Attaches zerg to a zerg server. :param bool use_fallback_socket: Fallback to normal sockets if the zerg server is not available diff --git a/uwsgiconf/presets/empire.py b/uwsgiconf/presets/empire.py index f652b97..1cd5ab4 100644 --- a/uwsgiconf/presets/empire.py +++ b/uwsgiconf/presets/empire.py @@ -20,11 +20,11 @@ def __init__( zerg_count=None, vassal_overload_sos_interval=None, vassal_queue_items_sos=None, section_emperor=None, section_zerg=None): """ - :param str|unicode zerg_socket: Unix socket to bind server to. + :param str zerg_socket: Unix socket to bind server to. :param int zerg_die_on_idle: A number of seconds after which an idle zerg will be destroyed. - :param str|unicode|list[str|unicode] vassals_home: Set vassals home. + :param str|list[str] vassals_home: Set vassals home. :param int zerg_count: Maximum number of zergs to spawn. diff --git a/uwsgiconf/presets/nice.py b/uwsgiconf/presets/nice.py index 07e61a3..65ccade 100644 --- a/uwsgiconf/presets/nice.py +++ b/uwsgiconf/presets/nice.py @@ -11,7 +11,7 @@ def __init__( **kwargs): """ - :param str|unicode name: Section name. + :param str name: Section name. :param str|list touch_reload: Reload uWSGI if the specified file or directory is modified/touched. @@ -22,14 +22,14 @@ def __init__( :param int mules: Number of mules to spawn. - :param str|unicode owner: Set process owner user and group. + :param str owner: Set process owner user and group. - :param str|unicode log_into: Filepath or UDP address to send logs into. + :param str log_into: Filepath or UDP address to send logs into. :param bool log_dedicated: If ``True`` all logging will be handled with a separate thread in master process. - :param str|unicode process_prefix: Add prefix to process names. + :param str process_prefix: Add prefix to process names. :param bool ignore_write_errors: If ``True`` no annoying SIGPIPE/write/writev errors will be logged, and no related exceptions will be raised. @@ -158,7 +158,7 @@ def configure_maintenance_mode(self, trigger, response): def configure_owner(self, owner='www-data'): """Shortcut to set process owner data. - :param str|unicode owner: Sets user and group. Default: ``www-data``. + :param str owner: Sets user and group. Default: ``www-data``. """ if owner is not None: @@ -223,17 +223,17 @@ def __init__( embedded_plugins=True, require_app=True, threads=True, **kwargs): """ - :param str|unicode name: Section name. + :param str name: Section name. :param dict params_python: See Python plugin basic params. - :param str|unicode wsgi_module: WSGI application module path or filepath. + :param str wsgi_module: WSGI application module path or filepath. Example: mypackage.my_wsgi_module -- read from `application` attr of mypackage/my_wsgi_module.py mypackage.my_wsgi_module:my_app -- read from `my_app` attr of mypackage/my_wsgi_module.py - :param str|unicode|callable wsgi_callable: WSGI application callable name. Default: application. + :param str|callable wsgi_callable: WSGI application callable name. Default: application. :param bool|None embedded_plugins: This indicates whether plugins were embedded into uWSGI, which is the case if you have uWSGI from PyPI. diff --git a/uwsgiconf/runtime/alarms.py b/uwsgiconf/runtime/alarms.py index 2794ea9..fec8140 100644 --- a/uwsgiconf/runtime/alarms.py +++ b/uwsgiconf/runtime/alarms.py @@ -4,9 +4,9 @@ issue_alarm = uwsgi.alarm """Issues the given alarm with the given message. -:param str|unicode name: +:param str name: -:param str|unicode message: Message to pass to alarm. +:param str message: Message to pass to alarm. :rtype: None """ diff --git a/uwsgiconf/runtime/asynced.py b/uwsgiconf/runtime/asynced.py index 33a5412..e4aca51 100644 --- a/uwsgiconf/runtime/asynced.py +++ b/uwsgiconf/runtime/asynced.py @@ -6,7 +6,7 @@ * http://uwsgi.readthedocs.io/en/latest/Async.html -:param str|unicode socket: +:param str socket: :rtype: int """ @@ -33,7 +33,7 @@ get_loop_name = uwsgi.loop """Returns current event loop name or None if loop is not set. -:rtype: st|unicode|None +:rtype: str|None """ wait_for_fd_read = uwsgi.wait_fd_read diff --git a/uwsgiconf/runtime/caching.py b/uwsgiconf/runtime/caching.py index 996986c..5ad8c0e 100644 --- a/uwsgiconf/runtime/caching.py +++ b/uwsgiconf/runtime/caching.py @@ -13,7 +13,7 @@ class Cache(object): def __init__(self, name=None, timeout=None): """ - :param str|unicode name: Cache name with optional address (if @-syntax is used). + :param str name: Cache name with optional address (if @-syntax is used). :param int timeout: Expire timeout (seconds). Default: 300 (5 minutes). Use 0 to not to set a timeout (not to expire). @@ -27,7 +27,7 @@ def __init__(self, name=None, timeout=None): def __contains__(self, key): """Checks whether there is a value in the cache associated with the given key. - :param str|unicode key: The cache key to check. + :param str key: The cache key to check. :rtype: bool """ @@ -50,7 +50,7 @@ def clear(self): def get(self, key, default=None, as_int=False, setter=None): """Gets a value from the cache. - :param str|unicode key: The cache key to get value for. + :param str key: The cache key to get value for. :param default: Value to return if none found in cache. @@ -60,7 +60,7 @@ def get(self, key, default=None, as_int=False, setter=None): value if not already cached. Required to accept a key and return a value that will be cached. - :rtype: str|unicode|int + :rtype: str|int """ if as_int: @@ -87,9 +87,9 @@ def get(self, key, default=None, as_int=False, setter=None): def set(self, key, value, timeout=None): """Sets the specified key value. - :param str|unicode key: + :param str key: - :param str|unicode value: + :param str value: :param int timeout: 0 to not to expire. Object default is used if not set. @@ -105,7 +105,7 @@ def set(self, key, value, timeout=None): def delete(self, key): """Deletes the given cached key from the cache. - :param str|unicode key: The cache key to delete. + :param str key: The cache key to delete. :rtype: None """ @@ -116,7 +116,7 @@ def delete(self, key): def incr(self, key, delta=1): """Increments the specified key value by the specified value. - :param str|unicode key: + :param str key: :param int delta: @@ -127,7 +127,7 @@ def incr(self, key, delta=1): def decr(self, key, delta=1): """Decrements the specified key value by the specified value. - :param str|unicode key: + :param str key: :param int delta: @@ -138,7 +138,7 @@ def decr(self, key, delta=1): def mul(self, key, value=2): """Multiplies the specified key value by the specified value. - :param str|unicode key: + :param str key: :param int value: @@ -149,7 +149,7 @@ def mul(self, key, value=2): def div(self, key, value=2): """Divides the specified key value by the specified value. - :param str|unicode key: + :param str key: :param int value: diff --git a/uwsgiconf/runtime/control.py b/uwsgiconf/runtime/control.py index 2a52637..bacc55a 100644 --- a/uwsgiconf/runtime/control.py +++ b/uwsgiconf/runtime/control.py @@ -25,7 +25,7 @@ set_process_name = uwsgi.setprocname """Sets current process name. -:param str|unicode name: +:param str name: :rtype: bool """ diff --git a/uwsgiconf/runtime/logging.py b/uwsgiconf/runtime/logging.py index cad3685..9c1234c 100644 --- a/uwsgiconf/runtime/logging.py +++ b/uwsgiconf/runtime/logging.py @@ -4,9 +4,9 @@ variable_set = uwsgi.set_logvar """Sets log variable. -:param str|unicode name: +:param str name: -:param str|unicode value: +:param str value: :rtype: None """ @@ -18,7 +18,7 @@ .. warning:: Bytes are returned for Python 3. -:param str|unicode name: +:param str name: :rtype: bytes|str """ @@ -26,7 +26,7 @@ log_message = uwsgi.log """Logs a message. -:param str|unicode message: +:param str message: :rtype: bool """ @@ -35,4 +35,4 @@ """Returns current log size. :rtype: long -""" \ No newline at end of file +""" diff --git a/uwsgiconf/runtime/monitoring.py b/uwsgiconf/runtime/monitoring.py index 398662e..e723e9c 100644 --- a/uwsgiconf/runtime/monitoring.py +++ b/uwsgiconf/runtime/monitoring.py @@ -5,9 +5,9 @@ def register_file_monitor(filename, target=None): """Maps a specific file/directory modification event to a signal. - :param str|unicode filename: File or a directory to watch for its modification. + :param str filename: File or a directory to watch for its modification. - :param int|Signal|str|unicode target: Existing signal to raise + :param int|Signal|str target: Existing signal to raise or Signal Target to register signal implicitly. Available targets: @@ -34,7 +34,7 @@ class Metric(object): def __init__(self, name): """ - :param str|unicode name: Metric name. + :param str name: Metric name. """ self.name = name @@ -52,7 +52,7 @@ def set(self, value, mode=None): :param int|long value: New value. - :param str|unicode mode: Update mode. + :param str mode: Update mode. * None - Unconditional update. * max - Sets metric value if it is greater that the current one. diff --git a/uwsgiconf/runtime/mules.py b/uwsgiconf/runtime/mules.py index e92830d..a910eae 100644 --- a/uwsgiconf/runtime/mules.py +++ b/uwsgiconf/runtime/mules.py @@ -129,7 +129,7 @@ def get_message(cls, signals=True, farms=False, buffer_size=65536, timeout=-1): :param int timeout: Seconds. - :rtype: str|unicode + :rtype: str :raises ValueError: If not in a mule. """ @@ -138,7 +138,7 @@ def get_message(cls, signals=True, farms=False, buffer_size=65536, timeout=-1): def send(self, message): """Sends a message to a mule(s)/farm. - :param str|unicode message: + :param str message: :rtype: bool @@ -154,7 +154,7 @@ class Farm(object): def __init__(self, name, mules=None): """ - :param str|unicode name: Mule farm name. + :param str name: Mule farm name. :param list[int] mules: Attached mules. """ @@ -204,7 +204,7 @@ def is_mine(self): """Returns flag indicating whether current mule belongs to this farm. - :param str|unicode name: Farm name. + :param str name: Farm name. :rtype: bool """ @@ -218,7 +218,7 @@ def get_message(cls): .. warning:: Bytes are returned for Python 3. - :rtype: str|unicode|None + :rtype: str|None :raises ValueError: If not in a mule """ @@ -227,7 +227,7 @@ def get_message(cls): def send(self, message): """Sends a message to the given farm. - :param str|unicode message: + :param str message: """ return uwsgi.farm_msg(self.name, message) diff --git a/uwsgiconf/runtime/request.py b/uwsgiconf/runtime/request.py index 791141a..19e2ec0 100644 --- a/uwsgiconf/runtime/request.py +++ b/uwsgiconf/runtime/request.py @@ -55,9 +55,9 @@ def add_var(self, name, value): Can be used for better integration with the internal routing subsystem. - :param str|unicode name: + :param str name: - :param str|unicode value: + :param str value: :rtype: bool diff --git a/uwsgiconf/runtime/rpc.py b/uwsgiconf/runtime/rpc.py index 3943517..477af36 100644 --- a/uwsgiconf/runtime/rpc.py +++ b/uwsgiconf/runtime/rpc.py @@ -18,7 +18,7 @@ def expose_me(arg1, arg2=15): make_rpc_call('expose_me', ['value1']) - :param str|unicode name: RPC function name to associate + :param str name: RPC function name to associate with decorated function. :rtype: callable @@ -39,13 +39,13 @@ def wrapper(func): def make_rpc_call(func_name, args=None, remote=None): """Performs an RPC function call (local or remote) with the given arguments. - :param str|unicode func_name: RPC function name to call. + :param str func_name: RPC function name to call. :param Iterable args: Function arguments. .. warning:: Strings are expected. - :param str|unicode remote: + :param str remote: :rtype: bytes|str diff --git a/uwsgiconf/runtime/scheduling.py b/uwsgiconf/runtime/scheduling.py index f97b705..28c6da3 100644 --- a/uwsgiconf/runtime/scheduling.py +++ b/uwsgiconf/runtime/scheduling.py @@ -19,7 +19,7 @@ def repeat(): :param int period: The interval (seconds) at which to raise the signal. - :param int|Signal|str|unicode target: Existing signal to raise + :param int|Signal|str target: Existing signal to raise or Signal Target to register signal implicitly. Available targets: @@ -57,7 +57,7 @@ def repeat(): :param int repeat: How many times to send signal. Will stop after ther number is reached. Default: None - infinitely. - :param int|Signal|str|unicode target: Existing signal to raise + :param int|Signal|str target: Existing signal to raise or Signal Target to register signal implicitly. Available targets: @@ -92,7 +92,7 @@ def repeat(): :param int period: The interval (milliseconds) at which the signal is raised. - :param int|Signal|str|unicode target: Existing signal to raise + :param int|Signal|str target: Existing signal to raise or Signal Target to register signal implicitly. Available targets: @@ -135,19 +135,19 @@ def repeat(): Keep in mind, that your actual function will be wrapped into another one, which will check whether it is time to call your function. - :param int|str|unicode weekday: Day of a the week number. Defaults to `each`. + :param int|str weekday: Day of a the week number. Defaults to `each`. 0 - Sunday 1 - Monday 2 - Tuesday 3 - Wednesday 4 - Thursday 5 - Friday 6 - Saturday - :param int|str|unicode month: Month number 1-12. Defaults to `each`. + :param int|str month: Month number 1-12. Defaults to `each`. - :param int|str|unicode day: Day of the month number 1-31. Defaults to `each`. + :param int|str day: Day of the month number 1-31. Defaults to `each`. - :param int|str|unicode hour: Hour 0-23. Defaults to `each`. + :param int|str hour: Hour 0-23. Defaults to `each`. - :param int|str|unicode minute: Minute 0-59. Defaults to `each`. + :param int|str minute: Minute 0-59. Defaults to `each`. - :param int|Signal|str|unicode target: Existing signal to raise + :param int|Signal|str target: Existing signal to raise or Signal Target to register signal implicitly. Available targets: diff --git a/uwsgiconf/runtime/signals.py b/uwsgiconf/runtime/signals.py index 8cb2953..6df4cfa 100644 --- a/uwsgiconf/runtime/signals.py +++ b/uwsgiconf/runtime/signals.py @@ -96,7 +96,7 @@ def register_handler(self, target=None): def somefunc(): pass - :param str|unicode target: Where this signal will be delivered to. Default: ``worker``. + :param str 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 @@ -133,7 +133,7 @@ def send(self, remote=None): When you send a signal, it is copied into the master's queue. The master will then check the signal table and dispatch the messages. - :param str|unicode|None remote: Remote address. + :param str|None remote: Remote address. :rtype: None diff --git a/uwsgiconf/sysinit.py b/uwsgiconf/sysinit.py index 54086a7..87e47dd 100644 --- a/uwsgiconf/sysinit.py +++ b/uwsgiconf/sysinit.py @@ -30,7 +30,7 @@ def get_tpl_systemd(conf): * journalctl -fu my.service :param Section conf: Section object. - :rtype: str|unicode + :rtype: str """ tpl = ''' @@ -80,7 +80,7 @@ def get_tpl_upstart(conf): """ :param Section conf: Section object. - :rtype: str|unicode + :rtype: str """ tpl = ''' @@ -123,12 +123,12 @@ def get_tpl_upstart(conf): 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 str 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|unicode runner: Runner command to execute conf_path. Defaults to ``uwsgiconf`` runner. - :param str|unicode project_name: Project name to override. - :rtype: str|unicode + :param str conf_path: File path to a configuration file or a command producing such a configuration. + :param str runner: Runner command to execute conf_path. Defaults to ``uwsgiconf`` runner. + :param str project_name: Project name to override. + :rtype: str """ runner = runner or f'{Finder.uwsgiconf()} run' diff --git a/uwsgiconf/utils.py b/uwsgiconf/utils.py index 8bccb74..bb371c2 100644 --- a/uwsgiconf/utils.py +++ b/uwsgiconf/utils.py @@ -97,7 +97,7 @@ def spawn_uwsgi(self, only=None): If only one configuration found current process (uwsgiconf) is replaced with a new one (uWSGI), otherwise a number of new detached processes is spawned. - :param str|unicode only: Configuration alias to run from the module. + :param str only: Configuration alias to run from the module. If not set uWSGI will be spawned for every configuration found in the module. :rtype: list @@ -141,7 +141,7 @@ def configurations(self): def load(cls, fpath): """Loads a module and returns its object. - :param str|unicode fpath: + :param str fpath: :rtype: module """ module_name = os.path.splitext(os.path.basename(fpath))[0] @@ -215,9 +215,9 @@ def __init__( :param list list_keys: Keys expecting lists. - :param str|unicode items_separator: String to use as items (chunks) separator. + :param str items_separator: String to use as items (chunks) separator. - :rtype: str|unicode + :rtype: str """ self.locals_dict = dict(locals_dict) self.keys = keys or sorted(filter_locals(locals_dict).keys()) @@ -249,10 +249,10 @@ def __str__(self): def get_output(cmd, args): """Runs a command and returns its output (stdout + stderr). - :param str|unicode cmd: - :param str|unicode|list[str|unicode] args: + :param str cmd: + :param str|list[str] args: - :rtype: str|unicode + :rtype: str """ from subprocess import Popen, STDOUT, PIPE @@ -273,7 +273,7 @@ class Finder(object): def uwsgiconf(cls): """Finds uwsgiconf executable location. - :rtype: str|unicode + :rtype: str """ return get_output('which', ['uwsgiconf']).strip() @@ -281,7 +281,7 @@ def uwsgiconf(cls): def python(cls): """Finds Python executable location. - :rtype: str|unicode + :rtype: str """ return sys.executable @@ -291,7 +291,7 @@ class Fifo(object): def __init__(self, fifo_filepath): """ - :param str|unicode fifo_filepath: Path to uWSGI Master FIFO file. + :param str fifo_filepath: Path to uWSGI Master FIFO file. """ self.fifo = fifo_filepath @@ -365,9 +365,9 @@ def __init__(self, binary_path=None): def get_output(self, command_args): """Runs a command and returns its output (stdout + stderr). - :param str|unicode|list[str|unicode] command_args: + :param str|list[str] command_args: - :rtype: str|unicode + :rtype: str """ return get_output(self.binary_uwsgi, command_args) @@ -385,7 +385,7 @@ def get_env_path(cls): """Returns PATH environment variable updated to run uwsgiconf in (e.g. for virtualenv). - :rtype: str|unicode + :rtype: str """ return os.path.dirname(Finder.python()) + os.pathsep + os.environ['PATH'] @@ -395,7 +395,7 @@ def prepare_env(cls): This adds some virtualenv friendliness so that we try use uwsgi from it. - :rtype: str|unicode + :rtype: str """ os.environ['PATH'] = cls.get_env_path() return os.path.basename(Finder.python()) @@ -417,7 +417,7 @@ def spawn(self, config, replace=False, filepath=None, embedded=False): :param Configuration config: Configuration object to spawn uWSGI with. - :param str|unicode filepath: Override configuration file path. + :param str filepath: Override configuration file path. :param bool replace: Whether a new process should replace current one. @@ -465,7 +465,7 @@ def parse_command_plugins_output(out): """Parses ``plugin-list`` command output from uWSGI and returns object containing lists of embedded plugin names. - :param str|unicode out: + :param str out: :rtype EmbeddedPlugins: diff --git a/uwsgiconf/uwsgi_stub.py b/uwsgiconf/uwsgi_stub.py index 9d68901..31f31af 100644 --- a/uwsgiconf/uwsgi_stub.py +++ b/uwsgiconf/uwsgi_stub.py @@ -154,7 +154,7 @@ def add_file_monitor(signal, filename): :param int signal: Signal to raise. - :param str|unicode filename: File or a directory to watch for its modification. + :param str filename: File or a directory to watch for its modification. :rtype: None @@ -209,9 +209,9 @@ def add_var(name, value): Can be used for better integration with the internal routing subsystem. - :param str|unicode name: + :param str name: - :param str|unicode value: + :param str value: :rtype: bool @@ -222,9 +222,9 @@ def add_var(name, value): def alarm(name, message): """Issues the given alarm with the given message. - :param str|unicode name: + :param str name: - :param str|unicode message: Message to pass to alarm. + :param str message: Message to pass to alarm. :rtype: None """ @@ -235,7 +235,7 @@ def async_connect(socket): * http://uwsgi.readthedocs.io/en/latest/Async.html - :param str|unicode socket: + :param str socket: :rtype: int """ @@ -255,7 +255,7 @@ def async_sleep(seconds): def cache_clear(cache): """Clears cache with the given name. - :param str|unicode cache: Cache name with optional address (if @-syntax is used). + :param str cache: Cache name with optional address (if @-syntax is used). :rtype: None """ @@ -266,13 +266,13 @@ def cache_dec(key, value=1, expires=None, cache=None): * http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.9.html#math-for-cache - :param str|unicode key: + :param str key: :param int value: :param int expires: Expire timeout (seconds). - :param str|unicode cache: Cache name with optional address (if @-syntax is used). + :param str cache: Cache name with optional address (if @-syntax is used). :rtype: bool """ @@ -282,9 +282,9 @@ def cache_dec(key, value=1, expires=None, cache=None): def cache_del(key, cache=None): """Deletes the given cached key from the cache. - :param str|unicode key: The cache key to delete. + :param str key: The cache key to delete. - :param str|unicode cache: Cache name with optional address (if @-syntax is used). + :param str cache: Cache name with optional address (if @-syntax is used). :rtype: None """ @@ -296,13 +296,13 @@ def cache_div(key, value=2, expires=None, cache=None): * http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.9.html#math-for-cache - :param str|unicode key: + :param str key: :param int value: :param int expires: Expire timeout (seconds). - :param str|unicode cache: Cache name with optional address (if @-syntax is used). + :param str cache: Cache name with optional address (if @-syntax is used). :rtype: bool """ @@ -312,9 +312,9 @@ def cache_div(key, value=2, expires=None, cache=None): def cache_exists(key, cache=None): """Checks whether there is a value in the cache associated with the given key. - :param str|unicode key: The cache key to check. + :param str key: The cache key to check. - :param str|unicode cache: Cache name with optional address (if @-syntax is used). + :param str cache: Cache name with optional address (if @-syntax is used). :rtype: bool """ @@ -326,9 +326,9 @@ def cache_get(key, cache=None): .. warning:: Bytes are returned for Python 3. - :param str|unicode key: The cache key to get value for. + :param str key: The cache key to get value for. - :param str|unicode cache: Cache name with optional address (if @-syntax is used). + :param str cache: Cache name with optional address (if @-syntax is used). :rtype: bytes|str|None """ @@ -339,13 +339,13 @@ def cache_inc(key, value=1, expires=None, cache=None): * http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.9.html#math-for-cache - :param str|unicode key: + :param str key: :param int value: :param int expires: Expire timeout (seconds). - :param str|unicode cache: Cache name with optional address (if @-syntax is used). + :param str cache: Cache name with optional address (if @-syntax is used). :rtype: bool """ @@ -355,7 +355,7 @@ def cache_inc(key, value=1, expires=None, cache=None): def cache_keys(cache=None): """Returns a list of keys available in cache. - :param str|unicode cache: Cache name with optional address (if @-syntax is used). + :param str cache: Cache name with optional address (if @-syntax is used). :rtype: list @@ -369,13 +369,13 @@ def cache_mul(key, value=2, expires=None, cache=None): * http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.9.html#math-for-cache - :param str|unicode key: + :param str key: :param int value: :param int expires: Expire timeout (seconds). - :param str|unicode cache: Cache name with optional address (if @-syntax is used). + :param str cache: Cache name with optional address (if @-syntax is used). :rtype: bool """ @@ -387,9 +387,9 @@ def cache_num(key, cache=None): * http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.9.html#math-for-cache - :param str|unicode key: The cache key to get value for. + :param str key: The cache key to get value for. - :param str|unicode cache: Cache name with optional address (if @-syntax is used). + :param str cache: Cache name with optional address (if @-syntax is used). :rtype: int|long|None """ @@ -398,13 +398,13 @@ def cache_num(key, cache=None): def cache_set(key, value, expires=None, cache=None): """Sets the specified key value. - :param str|unicode key: + :param str key: - :param str|unicode value: + :param str value: :param int expires: Expire timeout (seconds). - :param str|unicode cache: Cache name with optional address (if @-syntax is used). + :param str cache: Cache name with optional address (if @-syntax is used). :rtype: bool """ @@ -414,13 +414,13 @@ def cache_set(key, value, expires=None, cache=None): def cache_update(key, value, expires=None, cache=None): """Updates the specified key value. - :param str|unicode key: + :param str key: :param int value: :param int expires: Expire timeout (seconds). - :param str|unicode cache: Cache name with optional address (if @-syntax is used). + :param str cache: Cache name with optional address (if @-syntax is used). :rtype: bool """ @@ -432,7 +432,7 @@ def call(func_name, *args): .. warning:: Bytes are returned for Python 3. - :param str|unicode func_name: Function name to call + :param str func_name: Function name to call with optional address (if @-syntax is used). :param list[str|bytes] args: @@ -491,7 +491,7 @@ def close(fd): def connect(socket, timeout=0): """Connects to the socket. - :param str|unicode socket: Socket name. + :param str socket: Socket name. :param int timeout: Timeout (seconds). @@ -520,7 +520,7 @@ def embedded_data(symbol_name): .. warning:: Bytes are returned for Python 3. - :param str|unicode symbol_name: The symbol name to extract. + :param str symbol_name: The symbol name to extract. :rtype: bytes|str @@ -533,7 +533,7 @@ def extract(fname): .. warning:: Bytes are returned for Python 3. - :param str|unicode fname: + :param str fname: :rtype: bytes|str """ @@ -555,9 +555,9 @@ def farm_get_msg(): def farm_msg(farm, message): """Sends a message to the given farm. - :param str|unicode farm: Farm name to send message to. + :param str farm: Farm name to send message to. - :param str|unicode message: + :param str message: :rtype: None """ @@ -570,7 +570,7 @@ def get_logvar(name): .. warning:: Bytes are returned for Python 3. - :param str|unicode name: + :param str name: :rtype: bytes|str """ @@ -600,7 +600,7 @@ def in_farm(name): """Returns flag indicating whether you are (mule) belong to the given farm. - :param str|unicode name: Farm name. + :param str name: Farm name. :rtype: bool """ @@ -667,7 +667,7 @@ def lock(lock_num=0): def log(message): """Logs a message. - :param str|unicode message: + :param str message: :rtype: bool """ @@ -692,7 +692,7 @@ def logsize(): def loop(): """Returns current event loop name or None if loop is not set. - :rtype: st|unicode|None + :rtype: str|None """ @@ -715,7 +715,7 @@ def mem(): def metric_dec(key, value=1): """Decrements the specified metric key value by the specified value. - :param str|unicode key: + :param str key: :param int value: @@ -727,7 +727,7 @@ def metric_dec(key, value=1): def metric_div(key, value=1): """Divides the specified metric key value by the specified value. - :param str|unicode key: + :param str key: :param int value: @@ -739,7 +739,7 @@ def metric_div(key, value=1): def metric_get(key): """Returns metric value by key. - :param str|unicode key: + :param str key: :rtype: int|long """ @@ -748,7 +748,7 @@ def metric_get(key): def metric_inc(key, value=1): """Increments the specified metric key value by the specified value. - :param str|unicode key: + :param str key: :param int value: @@ -760,7 +760,7 @@ def metric_inc(key, value=1): def metric_mul(key, value=1): """Multiplies the specified metric key value by the specified value. - :param str|unicode key: + :param str key: :param int value: @@ -772,7 +772,7 @@ def metric_mul(key, value=1): def metric_set(key, value): """Sets metric value. - :param str|unicode key: + :param str key: :param int|long value: @@ -784,7 +784,7 @@ def metric_set(key, value): def metric_set_max(key, value): """Sets metric value if it is greater that the current one. - :param str|unicode key: + :param str key: :param int|long value: @@ -796,7 +796,7 @@ def metric_set_max(key, value): def metric_set_min(key, value): """Sets metric value if it is less that the current one. - :param str|unicode key: + :param str key: :param int|long value: @@ -845,7 +845,7 @@ def mule_id(): def mule_msg(message, mule_farm=None): """Sends a message to a mule(s)/farm. - :param str|unicode message: + :param str message: :param mule_farm: Mule ID, or farm name. @@ -874,7 +874,7 @@ def parsefile(fpath): Currently implemented only Spooler file parsing. - :param str|unicode fpath: + :param str fpath: :rtype: None """ @@ -914,7 +914,7 @@ def register_rpc(name, func): * http://uwsgi.readthedocs.io/en/latest/RPC.html - :param str|unicode name: + :param str name: :param callable func: @@ -930,7 +930,7 @@ def register_signal(number, target, func): :param int number: Signal number. - :param str|unicode target: + :param str target: * ``workers`` - run the signal handler on all the workers * ``workerN`` - run the signal handler only on worker N @@ -990,9 +990,9 @@ def rpc(address, func_name, *args): .. warning:: Bytes are returned for Python 3. - :param str|unicode address: + :param str address: - :param str|unicode func_name: Function name to call. + :param str func_name: Function name to call. :param list[str|bytes] args: @@ -1028,7 +1028,7 @@ def send(fd_or_data, data=None): def sendfile(fd_or_name, chunk_size=0, start_pos=0, filesize=0): """Runs a sendfile. - :param int|str|unicode fd_or_name: File path or descriptor number. + :param int|str fd_or_name: File path or descriptor number. :param int chunk_size: Not used. @@ -1079,9 +1079,9 @@ def send_to_spooler(message=None, **kwargs): def set_logvar(name, value): """Sets log variable. - :param str|unicode name: + :param str name: - :param str|unicode value: + :param str value: :rtype: None """ @@ -1108,7 +1108,7 @@ def set_user_harakiri(timeout=0): def set_warning_message(message): """Sets a warning. This will be reported by pingers. - :param str|unicode message: + :param str message: :rtype: bool """ @@ -1118,7 +1118,7 @@ def set_warning_message(message): def setprocname(name): """Sets current process name. - :param str|unicode name: + :param str name: :rtype: bool """ @@ -1130,7 +1130,7 @@ def signal(num, remote=''): :param num: Signal number. - :param str|unicode remote: Remote address. + :param str remote: Remote address. :rtype: None @@ -1171,7 +1171,7 @@ def signal_wait(num=None): :param int num: - :rtype: str|unicode + :rtype: str :raises SystemError: If something went wrong. """ @@ -1291,11 +1291,11 @@ def wait_fd_write(fd, timeout=None): def websocket_handshake(security_key=None, origin=None, proto=None): """Waits for websocket handshake. - :param str|unicode security_key: Websocket security key to use. + :param str security_key: Websocket security key to use. - :param str|unicode origin: Override ``Sec-WebSocket-Origin``. + :param str origin: Override ``Sec-WebSocket-Origin``. - :param str|unicode proto: Override ``Sec-WebSocket-Protocol``. + :param str proto: Override ``Sec-WebSocket-Protocol``. :rtype: None @@ -1375,7 +1375,7 @@ def i_am_the_lord(legion_name): * http://uwsgi.readthedocs.io/en/latest/Legion.html#legion-api - :param str|unicode legion_name: + :param str legion_name: :rtype: bool """ @@ -1387,7 +1387,7 @@ def lord_scroll(legion_name): * http://uwsgi.readthedocs.io/en/latest/Legion.html#lord-scroll-coming-soon - :param str|unicode legion_name: + :param str legion_name: :rtype: bool """ @@ -1397,7 +1397,7 @@ def lord_scroll(legion_name): def scrolls(legion_name): """Returns a list of Legion scrolls defined on cluster. - :param str|unicode legion_name: + :param str legion_name: :rtype: list """