Skip to content
Myr

[svn] small `__repr__` tweaks

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 fc214cc · 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
137 unmodified lines
138 """Convert the context into a dict. This skips the globals."""139 result = {}140 for layer in self._stack[1:]:141 for key, value in layer.iteritems():142 if key.startswith('::'):143 continue144 result[key] = value145 return result146147 def __getitem__(self, name):
91 unmodified lines
239 raise TemplateRuntimeError('In order to make loops callable you have '240 'to define them with the "recursive" '241 'modifier.')242243 def __repr__(self):244 if self._stack:245 return '<LoopContext %d/%d%s>' % (246 self.index,247 self.length,248 self.loop_function is not None and ' recursive' or ''249 )250 return '<LoopContext (empty)>'251252253class CycleContext(object):254 """255 Helper class used for cycling.256 """
86 unmodified lines