From: Armin Ronacher Date: Mon, 12 Mar 2007 16:32:18 +0000 (+0100) Subject: [svn] small `__repr__` tweaks X-Git-Tag: 2.0rc1~448 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=422934c893b54ee67dacf8219045050f2f9cc790;p=jinja2.git [svn] small `__repr__` tweaks --HG-- branch : trunk --- diff --git a/jinja/datastructure.py b/jinja/datastructure.py index 9ba9e9a..3b13ae0 100644 --- 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 '' % ( + self.index, + self.length, + self.loop_function is not None and ' recursive' or '' + ) + return '' + class CycleContext(object): """