예제 #1
0
파일: renderer.py 프로젝트: pztrn/wetchy
 def init_renderer(self):
     """
     Initialize renderer with settings, provided by user.
     """
     self.engine = tenjin.Engine(path = [os.path.join(common.SETTINGS["themes"]["templates_path"], common.SETTINGS["themes"]["template_name"])], escapefunc="cgi.escape", tostrfunc="str")
     # Force cache storage to memory, to keep clean templates directory.
     tenjin.Engine.cache = tenjin.MemoryCacheStorage()
     tenjin.set_template_encoding("utf-8")
예제 #2
0
파일: renderer.py 프로젝트: pztrn/wetchy
 def emergency_init_renderer(self):
     """
     Initialize renderer with emergency settings.
     """
     common.TEMP_SETTINGS["RENDERER_IN_EMERGENCY"] = True
     self.engine = tenjin.Engine(path = [os.path.join(common.SETTINGS["WETCHY_PATH"], "public", "themes", "default")], escapefunc="cgi.escape", tostrfunc="str")
     # Force cache storage to memory, to keep clean templates directory.
     tenjin.Engine.cache = tenjin.MemoryCacheStorage()
     tenjin.set_template_encoding("utf-8")