Skip to content
Snippets Groups Projects
Commit 7d030048 authored by nimrod's avatar nimrod
Browse files

- The pprint filter already exists in Jinja, removing my duplicate.

parent b09c2dba
Branches
No related tags found
No related merge requests found
......@@ -43,7 +43,6 @@ The following Jinja filters were added:
- :code:`from_yaml`: Convert from yaml.
- :code:`to_json`: Convert to json.
- :code:`from_json`: Convert from json.
- :code:`pprint`: Pretty print variable.
- :code:`combine`: Combine 2 dictionaries.
- :code:`to_toml`: Convert to toml.
- :code:`from_toml`: Convert from toml.
......
0.4.1
0.4.2
......@@ -72,25 +72,6 @@ def from_yaml(value):
return safe_load(value)
def pprint(value):
'''
Returns a pretty string representation of the data structure given.
Examples:
>>> pprint(1)
'1'
>>> import six
>>> output = pprint([{'first_name': 'John', 'last_name': 'Doe'}, {'first_name': 'Jane', 'last_name': 'Doe'}]) # noqa: E501
>>> if six.PY3:
... output == "[{'first_name': 'John', 'last_name': 'Doe'},\\n {'first_name': 'Jane', 'last_name': 'Doe'}]"
... elif six.PY2:
... output == "[{u'first_name': u'John', u'last_name': u'Doe'},\\n {u'first_name': u'Jane', u'last_name': u'Doe'}]"
...
True
'''
from pprint import pformat
return pformat(value)
def combine(default, override):
'''
Returns a combined dictionary of the 2 dictionaries given (with the 2nd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment