- added `getattribute` and `getitem` filter.
-- added support for the `pp` library.
+- added support for the `pretty` library.
Version 1.1
Pretty print a variable. Useful for debugging.
With Jinja 1.2 onwards you can pass it a parameter. If this parameter
- is truthy the output will be more verbose (this requires `pp`)
+ is truthy the output will be more verbose (this requires `pretty`)
"""
def wrapped(env, context, value):
return pformat(value, verbose=verbose)
def pformat(obj, verbose=False):
"""
- Prettyprint an object. Either use the `pp` library or the
+ Prettyprint an object. Either use the `pretty` library or the
builtin `pprint`.
"""
try:
- from pp import pp
- return pp(obj, verbose=verbose)
+ from pretty import pretty
+ return pretty(obj, verbose=verbose)
except ImportError:
from pprint import pformat
return pformat(obj)