Skip to content

Commit

Permalink
Update src/pyramid/settings.py
Browse files Browse the repository at this point in the history
Co-authored-by: Steve Piercy <web@stevepiercy.com>
  • Loading branch information
raverat and stevepiercy committed Jun 4, 2020
1 parent 13b3034 commit 8862ede
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ unreleased
Features
--------

- The ``aslist`` method now handles non-string object when flattening.
See https://github.com/Pylons/pyramid/pull/3594

- It is now possible to pass multiple values to the ``header`` predicate
for route and view configuration.
See https://github.com/Pylons/pyramid/pull/3576
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,5 @@ Contributors
- Andrea Borghi, 2019/11/11

- Sergey Maranchuk, 2020/04/18

- Thibault Ravera, 2020/06/03
7 changes: 4 additions & 3 deletions src/pyramid/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ def aslist_cronly(value):


def aslist(value, flatten=True):
""" Return a list. Separating the input based on newlines
and, if flatten=True (the default), also split on spaces within
each line when value is a string."""
""" Return a list, separating the input based on newlines.
Also if ``flatten`` is ``True`` (the default), and if the line
is a string, then the line will be split on spaces.
"""
values = aslist_cronly(value)
if not flatten:
return values
Expand Down

0 comments on commit 8862ede

Please sign in to comment.