(self)
| 3959 | |
| 3960 | @cached_property |
| 3961 | def code(self): |
| 3962 | source = self.source |
| 3963 | if not source: |
| 3964 | with open(self.filename, 'rb') as f: |
| 3965 | source = f.read() |
| 3966 | try: |
| 3967 | source, encoding = touni(source), 'utf8' |
| 3968 | except UnicodeError: |
| 3969 | raise depr(0, 11, 'Unsupported template encodings.', 'Use utf-8 for templates.') |
| 3970 | parser = StplParser(source, encoding=encoding, syntax=self.syntax) |
| 3971 | code = parser.translate() |
| 3972 | self.encoding = parser.encoding |
| 3973 | return code |
| 3974 | |
| 3975 | def _rebase(self, _env, _name=None, **kwargs): |
| 3976 | _env['_rebase'] = (_name, kwargs) |
nothing calls this directly
no test coverage detected