From 20fa004893096ef299c0e44b4088c60b4669929b Mon Sep 17 00:00:00 2001 From: break27 Date: Mon, 13 Apr 2026 18:15:21 +0800 Subject: [PATCH] add: 'script' function --- src/common/jsonrpc2/__init__.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/common/jsonrpc2/__init__.py b/src/common/jsonrpc2/__init__.py index 884b140..c89f69e 100644 --- a/src/common/jsonrpc2/__init__.py +++ b/src/common/jsonrpc2/__init__.py @@ -1,16 +1,16 @@ -import os -from common.jsonrpc2.server import * -script = os.path.join(os.path.dirname(os.path.realpath(__file__)), "client.js") -__all__ = [ - "Request", - "Response", - "Error", - "History", - "ConnectionContext", - "define", - "remove", - "script", - "url", - "run", -] \ No newline at end of file +from common.jsonrpc2.server import ( + Request, + Response, + Error, + History, + ConnectionContext, + define, + remove, + url, + run +) + +def script(): + with open(__file__.replace('__init__.py', 'client.js'), 'r') as file: + return file.read()