projects
/
jinja2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f3f136
)
added pretty print for context
author
Armin Ronacher
<armin.ronacher@active-4.com>
Sun, 21 Oct 2007 21:04:28 +0000
(23:04 +0200)
committer
Armin Ronacher
<armin.ronacher@active-4.com>
Sun, 21 Oct 2007 21:04:28 +0000
(23:04 +0200)
--HG--
branch : trunk
jinja/datastructure.py
patch
|
blob
|
history
diff --git
a/jinja/datastructure.py
b/jinja/datastructure.py
index d265d8d1054fa2672dc57c29227040c24905c548..2408dd05fca0974ae9d03d58ee0596fc850374cf 100644
(file)
--- a/
jinja/datastructure.py
+++ b/
jinja/datastructure.py
@@
-313,6
+313,17
@@
class Context(BaseContext):
"""
return 'Context(%r)' % self.to_dict()
+ def __pretty__(self, p, cycle):
+ p.begin_group(9, 'Context({')
+ for idx, (key, value) in enumerate(self.to_dict().iteritems()):
+ if idx:
+ p.text(',')
+ p.breakable()
+ p.pretty(key)
+ p.text(': ')
+ p.pretty(value)
+ p.end_group(9, '})')
+
class LoopContext(object):
"""