fix: argument position

This commit is contained in:
2026-04-16 16:56:07 +08:00
parent 3545355317
commit c517c39959

View File

@@ -65,14 +65,20 @@ class Error(Enum):
INVALID_PARAMS = -32602
INTERNAL_ERROR = -32603
def __init__(self):
super().__init__()
self.data = None
def message(self) -> str:
return self.name.capitalize().replace('_', ' ')
def response(self):
data = dict()
data['code'] = self.value
data['message'] = self.message()
return data
result = dict()
result['code'] = self.value
result['message'] = self.message()
if self.data is not None:
result['data'] = self.data
return result
class History(logging.Handler):
def __init__(self):
@@ -159,5 +165,5 @@ def remove(method: str) -> Callable[..., Any]:
return handlers.pop(method)
def run(options: Options):
thread = Thread(target=lambda: trio.run(backend), daemon=True, args=(options,))
thread = Thread(target=lambda: trio.run(backend, options), daemon=True)
thread.start()