MCPcopy Create free account
hub / github.com/SolSaviour/INFO1112-Materials / code

Method code

Week 6/server.py:3961–3973  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 4

translateMethod · 0.95
touniFunction · 0.85
deprFunction · 0.85
StplParserClass · 0.85

Tested by

no test coverage detected