Commit 74d4e661 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[common] Fix striginfy method

With Python 3 map is a generator function which is not serializable.

The fix is to make it a list.

Fixes #34
parent 301173b4
Pipeline #20815 passed with stages
in 28 minutes and 7 seconds
...@@ -1539,6 +1539,10 @@ def dot_diagram(prefix, type, names, path, formats): ...@@ -1539,6 +1539,10 @@ def dot_diagram(prefix, type, names, path, formats):
def stringify(value): def stringify(value):
'''Creates a string representation of a baseformat represented as a dict '''Creates a string representation of a baseformat represented as a dict
To avoid overloading the terminal that will print the result of this
function, only the first ten elements of lists are processed with visual cues
that will show that there's more to it.
The input variable ``value`` is modified in-place. The input variable ``value`` is modified in-place.
Parameters: Parameters:
...@@ -1569,7 +1573,7 @@ def stringify(value): ...@@ -1569,7 +1573,7 @@ def stringify(value):
return reduced return reduced
elif (len(value) > 0) and \ elif (len(value) > 0) and \
(isinstance(value[0], list) or isinstance(value[0], dict)): (isinstance(value[0], list) or isinstance(value[0], dict)):
return map(stringify, value) return list(map(stringify, value))
elif isinstance(value, dict): elif isinstance(value, dict):
for name, value2 in value.items(): for name, value2 in value.items():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment