예제 #1
0
 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)
예제 #2
0
 def __init__(self):
     self.cache = TemplateCache()
예제 #3
0
class CachedLoader(object):
    def __init__(self):
        self.cache = TemplateCache()
    def load(self, path):
        return self.cache.getTemplate(path)