| 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) |