From 1700dbe546532adc0db1e78f51ab89da340cf2b8 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 19 Feb 2024 12:52:50 +0800 Subject: [PATCH] bugfix --- ahserver/baseProcessor.py | 1 - ahserver/processorResource.py | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ahserver/baseProcessor.py b/ahserver/baseProcessor.py index 137362d..c5acf45 100755 --- a/ahserver/baseProcessor.py +++ b/ahserver/baseProcessor.py @@ -137,7 +137,6 @@ class TemplateProcessor(BaseProcessor): n_path = self.resource.url2path(url) ns = self.run_ns te = self.run_ns['tmpl_engine'] - print(f'TemplateProcessor:path_call():{url=}, {path=}, {n_path=}, {self.path=}') # return await te.render(url,**ns) return await te.render(path,**ns) diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index 988b0e8..e3e65e4 100755 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -193,7 +193,7 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): self._prepath = '/' + self._prepath self._preurl = f'{self._scheme}://{self._host}:{self._port}{self._prepath}' - print(f'{request.path=}, {self._preurl=}') + # print(f'{request.path=}, {self._preurl=}') async def _handle(self,request:Request) -> StreamResponse: @@ -410,12 +410,12 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): return url if url.startswith('/'): u = f'{self._preurl}{url}' - print(f'entireUrl(), {u=}, {url=}, {self._preurl=}') + # print(f'entireUrl(), {u=}, {url=}, {self._preurl=}') return u path = request.path p = self.relatedurl(path,url) u = f'{self._preurl}{p}' - print(f'entireUrl(), {u=}, {url=}, {self._preurl=}') + # print(f'entireUrl(), {u=}, {url=}, {self._preurl=}') return u def url2path(self, url): @@ -425,12 +425,11 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): async def path_call(self, request, path, params={}): url = self.entireUrl(request, path) - print(f'{path=}, after entireUrl(), {url=}') + # print(f'{path=}, after entireUrl(), {url=}') path = self.url2path(url) fpath = self.url2file(path) processor = self.url2processor(request, path, fpath) - print(f'path_call(), {path=}, {url=}, {fpath=}, {processor=}, {self._prepath}') + # print(f'path_call(), {path=}, {url=}, {fpath=}, {processor=}, {self._prepath}') new_request = request.clone(rel_url=path) - # new_request.path = path return await processor.be_call(new_request, params=params)