From 4a815167421a4226fad09c09d2283ff0db0adc27 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 31 Jan 2024 17:08:29 +0800 Subject: [PATCH] bugfix --- ahserver/baseProcessor.py | 19 +++++++++++-------- ahserver/processorResource.py | 4 +++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ahserver/baseProcessor.py b/ahserver/baseProcessor.py index 1d2a882..bad9cc0 100755 --- a/ahserver/baseProcessor.py +++ b/ahserver/baseProcessor.py @@ -150,20 +150,23 @@ class TemplateProcessor(BaseProcessor): else: self.headers['Content-Type'] = 'text/html; utf-8' -class JSUIProcessor(TemplateProcessor): +class BricksUIProcessor(TemplateProcessor): @classmethod def isMe(self,name): - return name=='jsui' + return name=='bui' async def datahandle(self, request): params = await self.resource.y_env['request2ns']() - if params.get('_jsui',None): - super().datahandle(request) + await super().datahandle(request) + print(f'{self.content=}') + if params.get('_webbricks_',None): + return else: - content0 = await self.resource.path_call(request,'/header.tmpl') - content1 = await self.resource.path_call(request,self.path) - content2 = await self.resource.path_call(request,'/footer.tmpl') - self.content = '%s%s%s' % (content0,content1,content2) + txt = self.content + entire_url = self.run_ns.get('entire_url') + content0 = await self.resource.path_call(request,entire_url('/header.tmpl')) + content2 = await self.resource.path_call(request,entire_url('/footer.tmpl')) + self.content = '%s%s%s' % (content0, txt, content2) class PythonScriptProcessor(BaseProcessor): @classmethod diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index 1c0e6d3..bf942cf 100755 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -39,7 +39,9 @@ from appPublic.timecost import TimeCost from appPublic.timeUtils import timestampstr from appPublic.app_logger import AppLogger -from .baseProcessor import getProcessor +from .baseProcessor import getProcessor, BricksUIProcessor, TemplateProcessor +from .baseProcessor import PythonScriptProcessor, MarkdownProcessor + from .xlsxdsProcessor import XLSXDataSourceProcessor from .websocketProcessor import WebsocketProcessor, XtermProcessor from .sqldsProcessor import SQLDataSourceProcessor