Changeset View
Changeset View
Standalone View
Standalone View
swh/core/api/__init__.py
Show First 20 Lines • Show All 323 Lines • ▼ Show 20 Lines | def __add_endpoint(self, meth_name, meth, backend_factory): | ||||
@self.route('/'+meth._endpoint_path, methods=['POST']) | @self.route('/'+meth._endpoint_path, methods=['POST']) | ||||
@functools.wraps(meth) # Copy signature and doc | @functools.wraps(meth) # Copy signature and doc | ||||
def _f(): | def _f(): | ||||
# Call the actual code | # Call the actual code | ||||
obj_meth = getattr(backend_factory(), meth_name) | obj_meth = getattr(backend_factory(), meth_name) | ||||
return encode_data_server(obj_meth(**decode_request(request))) | return encode_data_server(obj_meth(**decode_request(request))) | ||||
SWHServerAPIApp = deprecated( | @deprecated(version='0.0.64', | ||||
version='0.0.64', | reason='Use the RPCServerApp instead') | ||||
reason='Use the RPCServerApp instead')(RPCServerApp) | class SWHServerAPIApp(RPCServerApp): | ||||
pass | |||||
MetaSWHRemoteAPI = deprecated( | |||||
version='0.0.64', | |||||
reason='Use the MetaRPCClient instead')(MetaRPCClient) | @deprecated(version='0.0.64', | ||||
reason='Use the MetaRPCClient instead') | |||||
SWHRemoteAPI = deprecated( | class MetaSWHRemoteAPI(MetaRPCClient): | ||||
version='0.0.64', | pass | ||||
reason='Use the RPCClient instead')(RPCClient) | |||||
@deprecated(version='0.0.64', | |||||
reason='Use the RPCClient instead') | |||||
class SWHRemoteAPI(RPCClient): | |||||
pass |