Home | History | Annotate | Download | only in tko
      1 from autotest_lib.frontend.tko import rpc_interface
      2 from autotest_lib.frontend.tko import csv_encoder
      3 from autotest_lib.frontend.afe import rpc_handler
      4 
      5 rpc_handler_obj = rpc_handler.RpcHandler((rpc_interface,),
      6                                          document_module=rpc_interface)
      7 
      8 def handle_rpc(request):
      9     return rpc_handler_obj.handle_rpc_request(request)
     10 
     11 
     12 def handle_jsonp_rpc(request):
     13     return rpc_handler_obj.handle_jsonp_rpc_request(request)
     14 
     15 
     16 def 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 
     24 def rpc_documentation(request):
     25     return rpc_handler_obj.get_rpc_documentation()
     26 
     27 
     28 def handle_plot(request):
     29     raise DeprecationWarning()
     30