diff --git a/ahserver/baseProcessor.py b/ahserver/baseProcessor.py index 5e6a060..6f2458d 100644 --- a/ahserver/baseProcessor.py +++ b/ahserver/baseProcessor.py @@ -9,6 +9,7 @@ from aiohttp.web_response import Response, StreamResponse from appPublic.jsonConfig import getConfig from appPublic.dictObject import DictObject from appPublic.folderUtils import listFile +from appPublic.argsConvert import ArgsConvert from appPublic.log import info, debug, warning, error, critical, exception from .utils import unicode_escape @@ -165,6 +166,22 @@ class TemplateProcessor(BaseProcessor): else: self.headers['Content-Type'] = 'text/html; utf-8' +class BricksAppProcessor(TemplateProcessor): + @classmethod + def isMe(self,name): + return name=='app' + + async def datahandle(self, request): + params = await self.resource.y_env['request2ns']() + await super().datahandle(request) + if params.get('_webbricks_',None): + return + txt = self.content + entire_url = self.run_ns.get('entire_url') + content0 = await self.resource.path_call(request,entire_url('/bricks/bricksapp.tmpl')) + ac = ArgsConvert("${", "}$" + self.content = ac.convert(content0, {'appdic':txt}) + class BricksUIProcessor(TemplateProcessor): @classmethod def isMe(self,name):