projects
/
jinja2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fc214cc
)
[svn] small `__repr__` tweaks
author
Armin Ronacher
<armin.ronacher@active-4.com>
Mon, 12 Mar 2007 16:32:18 +0000
(17:32 +0100)
committer
Armin Ronacher
<armin.ronacher@active-4.com>
Mon, 12 Mar 2007 16:32:18 +0000
(17:32 +0100)
--HG--
branch : trunk
jinja/datastructure.py
patch
|
blob
|
history
diff --git
a/jinja/datastructure.py
b/jinja/datastructure.py
index 9ba9e9a39406e1cde333162b3d7cc236483661ec..3b13ae060b62477abb385ed8f3619c9607f957d1 100644
(file)
--- a/
jinja/datastructure.py
+++ b/
jinja/datastructure.py
@@
-139,6
+139,8
@@
class Context(object):
result = {}
for layer in self._stack[1:]:
for key, value in layer.iteritems():
+ if key.startswith('::'):
+ continue
result[key] = value
return result
@@
-238,6
+240,15
@@
class LoopContext(object):
'to define them with the "recursive" '
'modifier.')
+ def __repr__(self):
+ if self._stack:
+ return '<LoopContext %d/%d%s>' % (
+ self.index,
+ self.length,
+ self.loop_function is not None and ' recursive' or ''
+ )
+ return '<LoopContext (empty)>'
+
class CycleContext(object):
"""