Holds evaluation time information. Custom attributes can be attached to it in extensions.
| 74 | |
| 75 | |
| 76 | class EvalContext(object): |
| 77 | """Holds evaluation time information. Custom attributes can be attached |
| 78 | to it in extensions. |
| 79 | """ |
| 80 | |
| 81 | def __init__(self, environment, template_name=None): |
| 82 | self.environment = environment |
| 83 | if callable(environment.autoescape): |
| 84 | self.autoescape = environment.autoescape(template_name) |
| 85 | else: |
| 86 | self.autoescape = environment.autoescape |
| 87 | self.volatile = False |
| 88 | |
| 89 | def save(self): |
| 90 | return self.__dict__.copy() |
| 91 | |
| 92 | def revert(self, old): |
| 93 | self.__dict__.clear() |
| 94 | self.__dict__.update(old) |
| 95 | |
| 96 | |
| 97 | def get_eval_context(node, ctx): |
no outgoing calls
no test coverage detected
searching dependent graphs…