def __init__(self, template_path): um = Map([ Rule("/", endpoint="index", methods=("GET", )), Rule("/<int:group_id>/", endpoint="group", methods=("GET", ), defaults={"template_name": "default"}), Rule("/<int:group_id>/<template_name>", endpoint="group", methods=("GET", )) ], strict_slashes=False) self.template_cache = TemplateCache() self.template_root = TemplateRoot(template_path, self.template_cache.getTemplate) VCAppBase.__init__(self, um)
def __init__(self): self.cache = TemplateCache()
class CachedLoader(object): def __init__(self): self.cache = TemplateCache() def load(self, path): return self.cache.getTemplate(path)