1from autotest_lib.frontend.tko import rpc_interface 2from autotest_lib.frontend.tko import csv_encoder 3from autotest_lib.frontend.afe import rpc_handler 4 5rpc_handler_obj = rpc_handler.RpcHandler((rpc_interface,), 6 document_module=rpc_interface) 7 8def handle_rpc(request): 9 return rpc_handler_obj.handle_rpc_request(request) 10 11 12def handle_jsonp_rpc(request): 13 return rpc_handler_obj.handle_jsonp_rpc_request(request) 14 15 16def handle_csv(request): 17 request_data = rpc_handler_obj.raw_request_data(request) 18 decoded_request = rpc_handler_obj.decode_request(request_data) 19 result = rpc_handler_obj.dispatch_request(decoded_request)['result'] 20 encoder = csv_encoder.encoder(decoded_request, result) 21 return encoder.encode() 22 23 24def rpc_documentation(request): 25 return rpc_handler_obj.get_rpc_documentation() 26 27 28def handle_plot(request): 29 raise DeprecationWarning() 30