Compare commits
2 Commits
56123cf1bf
...
f67393174b
Author | SHA1 | Date | |
---|---|---|---|
|
f67393174b | ||
|
a88b3f90fe |
@ -2,6 +2,7 @@
|
|||||||
import inspect
|
import inspect
|
||||||
from appPublic.dictObject import DictObject
|
from appPublic.dictObject import DictObject
|
||||||
from appPublic.registerfunction import RegisterFunction
|
from appPublic.registerfunction import RegisterFunction
|
||||||
|
from appPublic.log import info, debug, warning, error, exception, critical
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
from aiohttp.web_response import Response, StreamResponse
|
from aiohttp.web_response import Response, StreamResponse
|
||||||
from .baseProcessor import BaseProcessor
|
from .baseProcessor import BaseProcessor
|
||||||
@ -28,11 +29,14 @@ class FunctionProcessor(BaseProcessor):
|
|||||||
ns = DictObject(**self.run_ns)
|
ns = DictObject(**self.run_ns)
|
||||||
rf = RegisterFunction()
|
rf = RegisterFunction()
|
||||||
f = rf.get(rfname)
|
f = rf.get(rfname)
|
||||||
|
if f is None:
|
||||||
|
error(f'{rfname=} is not registered')
|
||||||
|
return None
|
||||||
self.run_ns['request'] = request
|
self.run_ns['request'] = request
|
||||||
globals().update(self.run_ns)
|
globals().update(self.run_ns)
|
||||||
if inspect.iscoroutinefunction(f):
|
if inspect.iscoroutinefunction(f):
|
||||||
return await f(*args, **self.run_ns)
|
return await f(*args, **self.run_ns)
|
||||||
return f(*args)
|
return f(*args, **self.run_ns)
|
||||||
|
|
||||||
async def datahandle(self,request):
|
async def datahandle(self,request):
|
||||||
x = await self.path_call(request, self.path)
|
x = await self.path_call(request, self.path)
|
||||||
|
Loading…
Reference in New Issue
Block a user