Skip to content

Commit

Permalink
Set an arbitrarily long width for uwsgi YAML line lengths (I highly
Browse files Browse the repository at this point in the history
doubt it can handle line wraps)
  • Loading branch information
natefoo committed Nov 20, 2019
1 parent dff5f13 commit 5f08723
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
*.pyc
__pycache__
4 changes: 2 additions & 2 deletions filter_plugins/uwsgi_yaml.py
Expand Up @@ -52,7 +52,7 @@ def _iter_options(a):
"|to_uwsgi_yaml value must be a dictionary (hash) or list (is type: %s, value: %s)" % (type(a), str(a)))


def to_uwsgi_yaml(a, indent=4, *args, **kwargs):
def to_uwsgi_yaml(a, indent=4, width=9999, *args, **kwargs):
# uWSGI's internal YAML parser is not real YAML - all values are expected to be strings, and lists are created by
# repeating keys
if not isinstance(a, dict):
Expand All @@ -63,7 +63,7 @@ def to_uwsgi_yaml(a, indent=4, *args, **kwargs):
items = []
for k, v in _iter_options(pv):
for d in _iter_values(k, v):
items.append(_strip_quotes(to_nice_yaml(d, indent=indent, *args, **kwargs)))
items.append(_strip_quotes(to_nice_yaml(d, indent=indent, width=width, *args, **kwargs)))
r.append((' ' * indent).join(items))
return (':\n' + ' ' * indent).join(r)

Expand Down

0 comments on commit 5f08723

Please sign in to comment.