not working 2
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
||||
"""Client and server classes corresponding to protobuf-defined services."""
|
||||
import grpc
|
||||
|
||||
import rowers.rowing_workout_metrics_pb2 as rowing__workout__metrics__pb2
|
||||
@@ -12,13 +13,13 @@ class MetricsStub(object):
|
||||
"""Constructor.
|
||||
|
||||
Args:
|
||||
channel: A grpc.Channel.
|
||||
channel: A grpc.Channel.
|
||||
"""
|
||||
self.CalcMetrics = channel.unary_unary(
|
||||
'/rowing_workout_metrics.Metrics/CalcMetrics',
|
||||
request_serializer=rowing__workout__metrics__pb2.WorkoutMetricsRequest.SerializeToString,
|
||||
response_deserializer=rowing__workout__metrics__pb2.WorkoutMetricsResponse.FromString,
|
||||
)
|
||||
'/rowing_workout_metrics.Metrics/CalcMetrics',
|
||||
request_serializer=rowing__workout__metrics__pb2.WorkoutMetricsRequest.SerializeToString,
|
||||
response_deserializer=rowing__workout__metrics__pb2.WorkoutMetricsResponse.FromString,
|
||||
)
|
||||
|
||||
|
||||
class MetricsServicer(object):
|
||||
@@ -26,22 +27,107 @@ class MetricsServicer(object):
|
||||
"""
|
||||
|
||||
def CalcMetrics(self, request, context):
|
||||
# missing associated documentation comment in .proto file
|
||||
pass
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # pragma: no cover
|
||||
context.set_details('Method not implemented!') # pragma: no cover
|
||||
raise NotImplementedError(
|
||||
'Method not implemented!') # pragma: no cover
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
|
||||
def add_MetricsServicer_to_server(servicer, server): # pragma: no cover
|
||||
def add_MetricsServicer_to_server(servicer, server):
|
||||
rpc_method_handlers = {
|
||||
'CalcMetrics': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.CalcMetrics,
|
||||
request_deserializer=rowing__workout__metrics__pb2.WorkoutMetricsRequest.FromString,
|
||||
response_serializer=rowing__workout__metrics__pb2.WorkoutMetricsResponse.SerializeToString,
|
||||
),
|
||||
'CalcMetrics': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.CalcMetrics,
|
||||
request_deserializer=rowing__workout__metrics__pb2.WorkoutMetricsRequest.FromString,
|
||||
response_serializer=rowing__workout__metrics__pb2.WorkoutMetricsResponse.SerializeToString,
|
||||
),
|
||||
}
|
||||
generic_handler = grpc.method_handlers_generic_handler(
|
||||
'rowing_workout_metrics.Metrics', rpc_method_handlers)
|
||||
'rowing_workout_metrics.Metrics', rpc_method_handlers)
|
||||
server.add_generic_rpc_handlers((generic_handler,))
|
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API.
|
||||
class Metrics(object):
|
||||
"""OTW-metrics service definition
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def CalcMetrics(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(request, target, '/rowing_workout_metrics.Metrics/CalcMetrics',
|
||||
rowing__workout__metrics__pb2.WorkoutMetricsRequest.SerializeToString,
|
||||
rowing__workout__metrics__pb2.WorkoutMetricsResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
|
||||
class CPStub(object):
|
||||
"""GetCP service definition
|
||||
"""
|
||||
|
||||
def __init__(self, channel):
|
||||
"""Constructor.
|
||||
|
||||
Args:
|
||||
channel: A grpc.Channel.
|
||||
"""
|
||||
self.GetCP = channel.unary_unary(
|
||||
'/rowing_workout_metrics.CP/GetCP',
|
||||
request_serializer=rowing__workout__metrics__pb2.CPRequest.SerializeToString,
|
||||
response_deserializer=rowing__workout__metrics__pb2.CPResponse.FromString,
|
||||
)
|
||||
|
||||
|
||||
class CPServicer(object):
|
||||
"""GetCP service definition
|
||||
"""
|
||||
|
||||
def GetCP(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
|
||||
def add_CPServicer_to_server(servicer, server):
|
||||
rpc_method_handlers = {
|
||||
'GetCP': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetCP,
|
||||
request_deserializer=rowing__workout__metrics__pb2.CPRequest.FromString,
|
||||
response_serializer=rowing__workout__metrics__pb2.CPResponse.SerializeToString,
|
||||
),
|
||||
}
|
||||
generic_handler = grpc.method_handlers_generic_handler(
|
||||
'rowing_workout_metrics.CP', rpc_method_handlers)
|
||||
server.add_generic_rpc_handlers((generic_handler,))
|
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API.
|
||||
class CP(object):
|
||||
"""GetCP service definition
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def GetCP(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(request, target, '/rowing_workout_metrics.CP/GetCP',
|
||||
rowing__workout__metrics__pb2.CPRequest.SerializeToString,
|
||||
rowing__workout__metrics__pb2.CPResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
Reference in New Issue
Block a user