This commit is contained in:
yumoqing 2024-11-23 13:31:43 +08:00
parent 71035080b6
commit ebaafec95a

View File

@ -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):