[Kimchi-devel] [RFC PATCH V2 22/31] Make render_cheetah_file() plugin-aware

Lucio Correia luciojhc at linux.vnet.ibm.com
Mon Jun 22 22:59:36 UTC 2015


The key ui_dir must come from either Paths or PluginPaths,
depending on who is calling render_cheetah_file(), otherwise
wrong paths would be used. This patch fixes that.

Signed-off-by: Lucio Correia <luciojhc at linux.vnet.ibm.com>
Signed-off-by: Gustavo Y. Ribeiro <gyr at linux.vnet.ibm.com>
---
 src/wok/template.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/wok/template.py b/src/wok/template.py
index e192ca4..323bf55 100644
--- a/src/wok/template.py
+++ b/src/wok/template.py
@@ -86,12 +86,13 @@ def render_cheetah_file(resource, data):
     paths = cherrypy.request.app.root.paths
     filename = paths.get_template_path(resource)
     try:
-        params = {'data': data}
+        params = {}
         lang = validate_language(get_lang())
         gettext_conf = {'domain': cherrypy.request.app.root.domain,
                         'localedir': paths.mo_dir,
                         'lang': [lang]}
         params['lang'] = gettext_conf
+        params['data'] = {'ui_dir': paths.ui_dir}
         return Template(file=filename, searchList=params).respond()
     except OSError, e:
         if e.errno == errno.ENOENT:
-- 
1.7.1




More information about the Kimchi-devel mailing list