Creates a template object from compiled code and the globals. This is used by the loaders and environment to create a template object.
(cls, environment, code, globals, uptodate=None)
| 829 | |
| 830 | @classmethod |
| 831 | def from_code(cls, environment, code, globals, uptodate=None): |
| 832 | """Creates a template object from compiled code and the globals. This |
| 833 | is used by the loaders and environment to create a template object. |
| 834 | """ |
| 835 | namespace = { |
| 836 | 'environment': environment, |
| 837 | '__file__': code.co_filename |
| 838 | } |
| 839 | exec code in namespace |
| 840 | rv = cls._from_namespace(environment, namespace, globals) |
| 841 | rv._uptodate = uptodate |
| 842 | return rv |
| 843 | |
| 844 | @classmethod |
| 845 | def from_module_dict(cls, environment, module_dict, globals): |
no test coverage detected