MCPcopy Create free account
hub / github.com/nodejs/node / BlockReference

Class BlockReference

tools/inspector_protocol/jinja2/runtime.py:324–348  ·  view source on GitHub ↗

One block on a template reference.

Source from the content-addressed store, hash-verified

322
323
324class BlockReference(object):
325 """One block on a template reference."""
326
327 def __init__(self, name, context, stack, depth):
328 self.name = name
329 self._context = context
330 self._stack = stack
331 self._depth = depth
332
333 @property
334 def super(self):
335 """Super the block."""
336 if self._depth + 1 >= len(self._stack):
337 return self._context.environment. \
338 undefined('there is no parent block called %r.' %
339 self.name, name='super')
340 return BlockReference(self.name, self._context, self._stack,
341 self._depth + 1)
342
343 @internalcode
344 def __call__(self):
345 rv = concat(self._stack[self._depth](self._context))
346 if self._context.eval_ctx.autoescape:
347 rv = Markup(rv)
348 return rv
349
350
351class LoopContextBase(object):

Callers 3

__getitem__Method · 0.70
superMethod · 0.70
superMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected