Module Expr Str Assign NameStore Str ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If CompareNotIn AttributeLoad NameLoad attr NameLoad body Return Assign NameStore SubscriptLoad NameLoad Index AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad If CompareNotIn AttributeLoad NameLoad attr NameLoad body Return Assign NameStore SubscriptLoad NameLoad Index AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Lambda arguments args defaults AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr For NameStore AttributeLoad AttributeLoad NameLoad attr attr body Expr Call NameLoad NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Str Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Return Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Str Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Str Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Lambda arguments args NameParam NameParam NameParam NameParam defaults Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad For NameStore AttributeLoad AttributeLoad NameLoad attr attr body Expr Call NameLoad NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Lambda arguments args NameParam NameParam NameParam NameParam defaults NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list
N/A N/A Contains metaclasses used to create protocol service and service stub
classes from ServiceDescriptor objects at runtime.

The GeneratedServiceType and GeneratedServiceStubType metaclasses are used to
inject all useful functionality into the classes output by the protocol
compiler at compile-time.
 N/A __author__ petar@google.com (Petar Petrov) GeneratedServiceType N/A type N/A N/A Metaclass for service classes created at runtime from ServiceDescriptors.

  Implementations for all methods described in the Service class are added here
  by this class. We also create properties to allow getting/setting all fields
  in the protocol message.

  The protocol compiler currently uses this metaclass to create protocol service
  classes at runtime. Clients can also manually create their own classes at
  runtime, as in this example:

  mydescriptor = ServiceDescriptor(.....)
  class MyProtoService(service.Service):
    __metaclass__ = GeneratedServiceType
    DESCRIPTOR = mydescriptor
  myservice_instance = MyProtoService()
  ...
   N/A _DESCRIPTOR_KEY DESCRIPTOR __init__ N/A N/A cls name bases dictionary N/A N/A N/A Creates a message service class.

    Args:
      name: Name of the class (ignored, but required by the metaclass
        protocol).
      bases: Base classes of the class being constructed.
      dictionary: The class dictionary of the class being constructed.
        dictionary[_DESCRIPTOR_KEY] must contain a ServiceDescriptor object
        describing this protocol service type.
     N/A N/A N/A GeneratedServiceType _DESCRIPTOR_KEY dictionary N/A N/A N/A descriptor N/A dictionary N/A N/A GeneratedServiceType _DESCRIPTOR_KEY N/A service_builder N/A _ServiceBuilder descriptor N/A N/A N/A service_builder BuildService cls N/A N/A GeneratedServiceStubType N/A GeneratedServiceType N/A N/A Metaclass for service stubs created at runtime from ServiceDescriptors.

  This class has similar responsibilities as GeneratedServiceType, except that
  it creates the service stub classes.
   N/A _DESCRIPTOR_KEY DESCRIPTOR __init__ N/A N/A cls name bases dictionary N/A N/A N/A Creates a message service stub class.

    Args:
      name: Name of the class (ignored, here).
      bases: Base classes of the class being constructed.
      dictionary: The class dictionary of the class being constructed.
        dictionary[_DESCRIPTOR_KEY] must contain a ServiceDescriptor object
        describing this protocol service type.
     N/A N/A N/A N/A super GeneratedServiceStubType cls __init__ name bases dictionary N/A N/A N/A GeneratedServiceStubType _DESCRIPTOR_KEY dictionary N/A N/A N/A descriptor N/A dictionary N/A N/A GeneratedServiceStubType _DESCRIPTOR_KEY N/A service_stub_builder N/A _ServiceStubBuilder descriptor N/A N/A N/A service_stub_builder BuildServiceStub cls N/A N/A _ServiceBuilder N/A object N/A N/A This class constructs a protocol service class using a service descriptor.

  Given a service descriptor, this class constructs a class that represents
  the specified service descriptor. One service builder instance constructs
  exactly one service class. That means all instances of that class share the
  same builder.
   __init__ N/A N/A self service_descriptor N/A N/A N/A Initializes an instance of the service class builder.

    Args:
      service_descriptor: ServiceDescriptor to use when constructing the
        service class.
     N/A N/A self descriptor service_descriptor N/A BuildService N/A N/A self cls N/A N/A N/A Constructs the service class.

    Args:
      cls: The class that will be constructed.
     _WrapCallMethod N/A N/A srvc method_descriptor rpc_controller request callback N/A N/A N/A N/A N/A self _CallMethod srvc method_descriptor rpc_controller request callback N/A N/A N/A self cls cls N/A N/A cls CallMethod _WrapCallMethod N/A N/A cls GetDescriptor N/A staticmethod N/A N/A N/A N/A N/A self descriptor N/A N/A N/A cls GetDescriptor __doc__ Returns the service descriptor. N/A N/A cls GetRequestClass N/A self _GetRequestClass N/A N/A cls GetResponseClass N/A self _GetResponseClass N/A method N/A N/A self descriptor methods N/A N/A N/A setattr cls N/A method name N/A N/A self _GenerateNonImplementedMethod method N/A _CallMethod N/A N/A self srvc method_descriptor rpc_controller request callback N/A N/A N/A Calls the method described by a given method descriptor.

    Args:
      srvc: Instance of the service for which this method is called.
      method_descriptor: Descriptor that represent the method to call.
      rpc_controller: RPC controller to use for this method's execution.
      request: Request protocol message.
      callback: A callback to invoke after the method has completed.
     N/A N/A N/A method_descriptor containing_service N/A self descriptor N/A N/A N/A RuntimeError CallMethod() given method descriptor for wrong service type. N/A method N/A getattr srvc N/A method_descriptor name N/A N/A method rpc_controller request callback N/A _GetRequestClass N/A N/A self method_descriptor N/A N/A N/A Returns the class of the request protocol message.

    Args:
      method_descriptor: Descriptor of the method for which to return the
        request protocol message class.

    Returns:
      A class that represents the input protocol message of the specified
      method.
     N/A N/A N/A method_descriptor containing_service N/A self descriptor N/A N/A N/A RuntimeError GetRequestClass() given method descriptor for wrong service type. N/A N/A N/A method_descriptor input_type _concrete_class N/A _GetResponseClass N/A N/A self method_descriptor N/A N/A N/A Returns the class of the response protocol message.

    Args:
      method_descriptor: Descriptor of the method for which to return the
        response protocol message class.

    Returns:
      A class that represents the output protocol message of the specified
      method.
     N/A N/A N/A method_descriptor containing_service N/A self descriptor N/A N/A N/A RuntimeError GetResponseClass() given method descriptor for wrong service type. N/A N/A N/A method_descriptor output_type _concrete_class N/A _GenerateNonImplementedMethod N/A N/A self method N/A N/A N/A Generates and returns a method that can be set for a service methods.

    Args:
      method: Descriptor of the service method for which a method is to be
        generated.

    Returns:
      A method that can be added to the service class.
     N/A N/A N/A N/A inst rpc_controller request callback N/A N/A N/A self _NonImplementedMethod N/A method name rpc_controller callback N/A _NonImplementedMethod N/A N/A self method_name rpc_controller callback N/A N/A N/A The body of all methods in the generated service class.

    Args:
      method_name: Name of the method being executed.
      rpc_controller: RPC controller used to execute this method.
      callback: A callback which will be invoked when the method finishes.
     N/A N/A N/A rpc_controller SetFailed N/A Method %s not implemented. method_name N/A N/A callback None N/A N/A _ServiceStubBuilder N/A object N/A N/A Constructs a protocol service stub class using a service descriptor.

  Given a service descriptor, this class constructs a suitable stub class.
  A stub is just a type-safe wrapper around an RpcChannel which emulates a
  local implementation of the service.

  One service stub builder instance constructs exactly one class. It means all
  instances of that class share the same service stub builder.
   __init__ N/A N/A self service_descriptor N/A N/A N/A Initializes an instance of the service stub class builder.

    Args:
      service_descriptor: ServiceDescriptor to use when constructing the
        stub class.
     N/A N/A self descriptor service_descriptor N/A BuildServiceStub N/A N/A self cls N/A N/A N/A Constructs the stub class.

    Args:
      cls: The class that will be constructed.
     _ServiceStubInit N/A N/A stub rpc_channel N/A N/A N/A N/A stub rpc_channel rpc_channel N/A N/A N/A self cls cls N/A N/A cls __init__ _ServiceStubInit N/A method N/A N/A self descriptor methods N/A N/A N/A setattr cls N/A method name N/A N/A self _GenerateStubMethod method N/A _GenerateStubMethod N/A N/A self method N/A N/A N/A N/A N/A N/A inst rpc_controller request callback N/A None N/A N/A self _StubMethod inst method rpc_controller request callback N/A _StubMethod N/A N/A self stub method_descriptor rpc_controller request callback N/A N/A N/A The body of all service methods in the generated stub class.

    Args:
      stub: Stub instance.
      method_descriptor: Descriptor of the invoked method.
      rpc_controller: Rpc controller to execute the method.
      request: Request protocol message.
      callback: A callback to execute when the method finishes.
    Returns:
      Response message (in case of blocking call).
     N/A N/A N/A N/A stub rpc_channel CallMethod method_descriptor rpc_controller request N/A N/A method_descriptor output_type _concrete_class callback N/A N/A