From d502d7418dd71690d5e666c9fdb5ed587c6c6af6 Mon Sep 17 00:00:00 2001 From: Hongyu Chen Date: Wed, 11 Mar 2015 17:43:12 -0700 Subject: [PATCH] Update helloword_pb2.py such that it's in sync with py file generated by run_codegen.sh. PR #993 of grpc/grpc eliminated "assembly" package. We need to update this pb2.py file accordingly. --- python/helloworld/helloworld_pb2.py | 43 ++++++++++++----------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/python/helloworld/helloworld_pb2.py b/python/helloworld/helloworld_pb2.py index d35ebb77c66..965a3991f54 100644 --- a/python/helloworld/helloworld_pb2.py +++ b/python/helloworld/helloworld_pb2.py @@ -103,15 +103,13 @@ _sym_db.RegisterMessage(HelloReply) import abc -from grpc._adapter import fore -from grpc._adapter import rear -from grpc.framework.assembly import implementations -from grpc.framework.assembly import utilities +from grpc.early_adopter import implementations +from grpc.early_adopter import utilities class EarlyAdopterGreeterServicer(object): """""" __metaclass__ = abc.ABCMeta @abc.abstractmethod - def SayHello(self, request): + def SayHello(self, request, context): raise NotImplementedError() class EarlyAdopterGreeterServer(object): """""" @@ -130,29 +128,24 @@ class EarlyAdopterGreeterStub(object): raise NotImplementedError() SayHello.async = None def early_adopter_create_Greeter_server(servicer, port, root_certificates, key_chain_pairs): - method_implementations = { - "SayHello": utilities.unary_unary_inline(servicer.SayHello), - } import helloworld_pb2 - request_deserializers = { - "SayHello": helloworld_pb2.HelloRequest.FromString, - } - response_serializers = { - "SayHello": lambda x: x.SerializeToString(), + import helloworld_pb2 + method_service_descriptions = { + "SayHello": utilities.unary_unary_service_description( + servicer.SayHello, + helloworld_pb2.HelloRequest.FromString, + helloworld_pb2.HelloReply.SerializeToString, + ), } - link = fore.activated_fore_link(port, request_deserializers, response_serializers, root_certificates, key_chain_pairs) - return implementations.assemble_service(method_implementations, link) + return implementations.secure_server(method_service_descriptions, port, root_certificates, key_chain_pairs) def early_adopter_create_Greeter_stub(host, port): - method_implementations = { - "SayHello": utilities.unary_unary_inline(None), - } import helloworld_pb2 - response_deserializers = { - "SayHello": helloworld_pb2.HelloReply.FromString, - } - request_serializers = { - "SayHello": lambda x: x.SerializeToString(), + import helloworld_pb2 + method_invocation_descriptions = { + "SayHello": utilities.unary_unary_invocation_description( + helloworld_pb2.HelloRequest.SerializeToString, + helloworld_pb2.HelloReply.FromString, + ), } - link = rear.activated_rear_link(host, port, request_serializers, response_deserializers) - return implementations.assemble_dynamic_inline_stub(method_implementations, link) + return implementations.insecure_stub(method_invocation_descriptions, host, port) # @@protoc_insertion_point(module_scope)