In jsonrpclib docs, example is register function one by one as this:
def foo():
pass
def bar():
pass
server = SimpleJSONRPCServer(("localhost", 8000))
server.register_multicall_functions()
server.register_function(foo, 'foo')
server.register_function(bar, 'bar')
It can work but not pythonic. Register functions one by one is intricate after all.
Are there some examples to register functions in a class or other pythonic way at one time. Such as:
class Api(object):
def foo():
pass
def bar():
pass
def SomeMagic():
# register all function in Api
server.register_function(Api)
An idea has come to my mind. Most important is dir() built-in function.