From 809f5160aa6792b7fab6b962cb6e63845f112c6f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 2 Dec 2020 04:42:53 +0800 Subject: [PATCH] add params_kw env var --- ahserver/baseProcessor.py | 3 +++ ahserver/processorResource.py | 1 + 2 files changed, 4 insertions(+) diff --git a/ahserver/baseProcessor.py b/ahserver/baseProcessor.py index 3684724..2af0f1c 100644 --- a/ahserver/baseProcessor.py +++ b/ahserver/baseProcessor.py @@ -96,6 +96,9 @@ class TemplateProcessor(BaseProcessor): async def datahandle(self,request): path = request.path + request2ns = self.run_ns.get('request2ns') + if request2ns: + self.run_ns['params_kw'] = await request2ns() ns = self.run_ns te = self.run_ns['tmpl_engine'] self.content = te.render(path,**ns) diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index bf1edf0..823bb09 100644 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -45,6 +45,7 @@ def i18nDICT(request): i18n = getI18N() lang = getHeaderLang(request) l = c.langMapping.get(lang,lang) + print('i18nDict():lang=',lang,',l=',l,',dict=',,i18n.getLangDict(l)) return json.dumps(i18n.getLangDict(l)).encode(c.website.coding)