feat: Ability to call any custom Squirrel function
This commit is contained in:
10
src/pyg2o/functions/pyg2o.py
Normal file
10
src/pyg2o/functions/pyg2o.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
from ..server import PythonWebsocketServer
|
||||||
|
|
||||||
|
async def call_squirrel_function(function_name: str, *args):
|
||||||
|
|
||||||
|
arg_list = ', '.join(args)
|
||||||
|
data = f'return {function_name}({arg_list})'
|
||||||
|
|
||||||
|
server = await PythonWebsocketServer.get_server()
|
||||||
|
result = await server.make_request(data)
|
||||||
|
return result
|
||||||
Reference in New Issue
Block a user