Loading template/filters.py +13 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,19 @@ def to_yaml(value): ''' Converts given data structure to YAML form. Examples: >>> to_yaml([1,2,3]) '[1, 2, 3]\\n' >>> to_yaml({'a': 1, 'b': 2}) '{a: 1, b: 2}\\n' >>> to_yaml({1: {'a': [1,2,3]}}) '1:\\n a: [1, 2, 3]\\n' >>> to_yaml("abc") 'abc\\n...\\n' ''' from yaml import safe_dump return safe_dump(value) Loading tox.ini +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ commands = check-manifest --ignore tox.ini,tests* python setup.py check -m -r -s flake8 . python -m doctest template/filters.py template/__init__.py ./tests.sh [testenv:release] Loading Loading
template/filters.py +13 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,19 @@ def to_yaml(value): ''' Converts given data structure to YAML form. Examples: >>> to_yaml([1,2,3]) '[1, 2, 3]\\n' >>> to_yaml({'a': 1, 'b': 2}) '{a: 1, b: 2}\\n' >>> to_yaml({1: {'a': [1,2,3]}}) '1:\\n a: [1, 2, 3]\\n' >>> to_yaml("abc") 'abc\\n...\\n' ''' from yaml import safe_dump return safe_dump(value) Loading
tox.ini +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ commands = check-manifest --ignore tox.ini,tests* python setup.py check -m -r -s flake8 . python -m doctest template/filters.py template/__init__.py ./tests.sh [testenv:release] Loading