Skip to content
Myr

added pp support to jinja

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent e658b73 · Browse files · 2 files+13 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+13 added−3 removed

  • other:+13 added−3 removed

2 files+13 added−3 removed

modified:jinja/filters.py+1 added-2 removed
11 unmodified lines
12from random import choice13from operator import itemgetter14from urllib import urlencode, quote15from jinja.utils import urlize, escape, reversed, sorted, groupby, \16 get_attribute16 get_attribute, pformat17from jinja.datastructure import TemplateData18from jinja.exceptions import FilterArgumentError, SecurityException1920
406 unmodified lines
427 """428 Pretty print a variable. Useful for debugging.429 """430 def wrapped(env, context, value):431 from pprint import pformat431 return pformat(value)432 return wrapped433434
549 unmodified lines
modified:jinja/utils.py+12 added-1 removed
348 unmodified lines
349 RUNTIME_EXCEPTION_OFFSET = 2350del _test_singleton, _test_gen_bug351352353def pformat(obj):354 """355 Prettyprint an object. Either use the `pp` library or the356 builtin `pprint`.357 """358 try:359 from pp import pp as format360 except ImportError:361 from pprint import pformat as format362 return format(obj)363364365def buffereater(f):366 """367 Used by the python translator to capture output of substreams.368 (macros, filter sections etc)
49 unmodified lines
418 self.__class__.__name__)419420 def __call__(self, env, context):421 """Print a nice representation of the context."""410 from pprint import pformat422 return pformat(context.to_dict())423424 def filters(self, env, context, builtins=True):425 """List the filters."""
214 unmodified lines