Skip to content
Myr

added pretty print for context

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 5f3f136 · Browse files · 1 file+11 added−0 removed
This commit

State

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

Diff stats

1 file+11 added−0 removed

  • other:+11 added−0 removed

1 file+11 added−0 removed

modified:jinja/datastructure.py+11 added
311 unmodified lines
312 String representation of the context.313 """314 return 'Context(%r)' % self.to_dict()315316 def __pretty__(self, p, cycle):317 p.begin_group(9, 'Context({')318 for idx, (key, value) in enumerate(self.to_dict().iteritems()):319 if idx:320 p.text(',')321 p.breakable()322 p.pretty(key)323 p.text(': ')324 p.pretty(value)325 p.end_group(9, '})')326327328class LoopContext(object):329 """330 Simple class that provides special loop variables.331 Used by `Environment.iterate`.
375 unmodified lines