From e80f1dfdb54a7c30fa93b07934ae8c5e4960c226 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 19 Feb 2024 13:54:43 +0800 Subject: [PATCH] bugfix --- ahserver/baseProcessor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ahserver/baseProcessor.py b/ahserver/baseProcessor.py index 3093789..0d714ab 100755 --- a/ahserver/baseProcessor.py +++ b/ahserver/baseProcessor.py @@ -173,6 +173,7 @@ class PythonScriptProcessor(BaseProcessor): async def loadScript(self, path): data = '' + print(f'loadScript(), {path=}, {data=}') async with aiofiles.open(path,'r', encoding='utf-8') as f: data = await f.read() print(f'loadScript(), {path=}, {data=}') @@ -186,7 +187,9 @@ class PythonScriptProcessor(BaseProcessor): await self.set_run_env(request, params=params) lenv = self.run_ns del lenv['request'] - txt = await self.loadScript(self.real_path) + filename = self.url2file(request.path) + print(f'ScriptProcessor():{filename=}, {self.real_path=}') + txt = await self.loadScript(filename) # print(self.real_path, "#########", txt) exec(txt,lenv,lenv) func = lenv['myfunc']