andrej@1872: # pylint: disable=undefined-variable andrej@1872: andrej@1881: from __future__ import absolute_import andrej@1869: from svgui.pyjs.jsonrpc.jsonrpc import JSONRPCServiceBase laurent@371: andrej@1736: laurent@371: class JSONRPCService(JSONRPCServiceBase): laurent@371: laurent@371: def serve(self): laurent@371: return self.process(request.body.read()) laurent@371: andrej@1740: def __call__(self, func): andrej@1742: self.methods[func.__name__] = func laurent@371: return func