fix: argument position
This commit is contained in:
@@ -65,14 +65,20 @@ class Error(Enum):
|
|||||||
INVALID_PARAMS = -32602
|
INVALID_PARAMS = -32602
|
||||||
INTERNAL_ERROR = -32603
|
INTERNAL_ERROR = -32603
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.data = None
|
||||||
|
|
||||||
def message(self) -> str:
|
def message(self) -> str:
|
||||||
return self.name.capitalize().replace('_', ' ')
|
return self.name.capitalize().replace('_', ' ')
|
||||||
|
|
||||||
def response(self):
|
def response(self):
|
||||||
data = dict()
|
result = dict()
|
||||||
data['code'] = self.value
|
result['code'] = self.value
|
||||||
data['message'] = self.message()
|
result['message'] = self.message()
|
||||||
return data
|
if self.data is not None:
|
||||||
|
result['data'] = self.data
|
||||||
|
return result
|
||||||
|
|
||||||
class History(logging.Handler):
|
class History(logging.Handler):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -159,5 +165,5 @@ def remove(method: str) -> Callable[..., Any]:
|
|||||||
return handlers.pop(method)
|
return handlers.pop(method)
|
||||||
|
|
||||||
def run(options: Options):
|
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()
|
thread.start()
|
||||||
|
|||||||
Reference in New Issue
Block a user