(self, environment, parent, name, blocks)
| 155 | _fast_resolve_mode = False |
| 156 | |
| 157 | def __init__(self, environment, parent, name, blocks): |
| 158 | self.parent = parent |
| 159 | self.vars = {} |
| 160 | self.environment = environment |
| 161 | self.eval_ctx = EvalContext(self.environment, name) |
| 162 | self.exported_vars = set() |
| 163 | self.name = name |
| 164 | |
| 165 | # create the initial mapping of blocks. Whenever template inheritance |
| 166 | # takes place the runtime will update this mapping with the new blocks |
| 167 | # from the template. |
| 168 | self.blocks = dict((k, [v]) for k, v in iteritems(blocks)) |
| 169 | |
| 170 | # In case we detect the fast resolve mode we can set up an alias |
| 171 | # here that bypasses the legacy code logic. |
| 172 | if self._fast_resolve_mode: |
| 173 | self.resolve_or_missing = MethodType(resolve_or_missing, self) |
| 174 | |
| 175 | def super(self, name, current): |
| 176 | """Render a parent block.""" |
nothing calls this directly
no test coverage detected