コード例 #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")