MCPcopy Create free account
hub / github.com/webpy/webpy / __init__

Method __init__

web/template.py:1149–1162  ·  view source on GitHub ↗
(self, loc, *a, **kw)

Source from the content-addressed store, hash-verified

1147 super = Render
1148
1149 def __init__(self, loc, *a, **kw):
1150 GAE_Render.super.__init__(self, loc, *a, **kw)
1151
1152 import types
1153
1154 if isinstance(loc, types.ModuleType):
1155 self.mod = loc
1156 else:
1157 name = loc.rstrip("/").replace("/", ".")
1158 self.mod = __import__(name, None, None, ["x"])
1159
1160 self.mod.__dict__.update(kw.get("builtins", TEMPLATE_BUILTINS))
1161 self.mod.__dict__.update(Template.globals)
1162 self.mod.__dict__.update(kw.get("globals", {}))
1163
1164 def _load_template(self, name):
1165 t = getattr(self.mod, name)

Callers

nothing calls this directly

Calls 3

__init__Method · 0.45
updateMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected