Skip to content

Commit

Permalink
Removed unicode.
Browse files Browse the repository at this point in the history
  • Loading branch information
idlesign committed May 1, 2020
1 parent 88f0abf commit fb3d514
Show file tree
Hide file tree
Showing 48 changed files with 534 additions and 534 deletions.
6 changes: 3 additions & 3 deletions uwsgiconf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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``.
Expand All @@ -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.
Expand Down
50 changes: 25 additions & 25 deletions uwsgiconf/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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 ''
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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:
Expand All @@ -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):
Expand All @@ -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
"""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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()
Expand All @@ -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)

Expand All @@ -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:
Expand Down
24 changes: 12 additions & 12 deletions uwsgiconf/contrib/django/uwsgify/toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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)

Expand Down Expand Up @@ -62,17 +62,17 @@ 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')

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')
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
"""
Expand Down
8 changes: 4 additions & 4 deletions uwsgiconf/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions uwsgiconf/options/alarms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions uwsgiconf/options/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit fb3d514

Please sign in to comment.