Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
badw-it
DHParser
Commits
4d29105b
Commit
4d29105b
authored
Jun 16, 2017
by
Eckhart Arnold
Browse files
toolkit.py - slight changes
parent
625ad39d
Changes
1
Hide whitespace changes
Inline
Side-by-side
DHParser/toolkit.py
View file @
4d29105b
...
...
@@ -238,7 +238,7 @@ def md5(*txt):
def
smart_list
(
arg
):
"""Returns the argument a
s list
, depending on its type and content.
"""Returns the argument a
n iterable
, depending on its type and content.
If the argument is a string, it will be interpreted as a list of
comma separated values, trying ';', ',', ' ' as possible delimiters
...
...
@@ -270,10 +270,10 @@ def smart_list(arg):
if
len
(
lst
)
>
1
:
return
(
s
.
strip
()
for
s
in
lst
)
return
(
s
.
strip
()
for
s
in
arg
.
strip
().
split
(
' '
))
elif
isinstance
(
arg
,
collections
.
abc
.
Sequence
):
# python 3.6: collections.abc.Collection
return
arg
#
elif isinstance(arg, collections.abc.Sequence): # python 3.6: collections.abc.Collection
#
return arg
elif
isinstance
(
arg
,
collections
.
abc
.
Iterable
):
return
list
(
arg
)
return
arg
else
:
return
[
arg
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment