Update
This commit is contained in:
@@ -53,7 +53,7 @@ class JSONRPC:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.methods = {}
|
self.methods = {}
|
||||||
|
|
||||||
def method(self, name: str):
|
def method(self, name: str, handler = None, fields = None):
|
||||||
"""Декоратор метода
|
"""Декоратор метода
|
||||||
"""
|
"""
|
||||||
assert len(name) > 0, 'Не указано имя метода'
|
assert len(name) > 0, 'Не указано имя метода'
|
||||||
@@ -64,12 +64,12 @@ class JSONRPC:
|
|||||||
# ))
|
# ))
|
||||||
# funcname = func.__name__
|
# funcname = func.__name__
|
||||||
# modulename = func.__module__
|
# modulename = func.__module__
|
||||||
def wrap(function, handler = None, fields = None):
|
def wrap(function):
|
||||||
# print(func)
|
# print(func)
|
||||||
method = Method(
|
method = Method(
|
||||||
function = function,
|
function = function,
|
||||||
handler = None,
|
handler = handler,
|
||||||
fields = None
|
fields = fields
|
||||||
)
|
)
|
||||||
self.methods[name] = method
|
self.methods[name] = method
|
||||||
return function
|
return function
|
||||||
|
|||||||
Reference in New Issue
Block a user