aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Mehrdad Afshari <mmx@google.com>2018-01-02 14:40:00 -0800
committerGravatar Mehrdad Afshari <mmx@google.com>2018-01-02 14:40:00 -0800
commit87cd994b0477e98c976e7b321b3c1f52666ab5e0 (patch)
tree8590a82e599e0c763f32f835ef2bbb129871e75b /examples
parent63392f682e21543099926251b642cdcd0be2a17f (diff)
Upgrade yapf to 0.20.0
Upgrade yapf version to 0.20.0 and reformat Python files.
Diffstat (limited to 'examples')
-rw-r--r--examples/python/interceptors/headers/header_manipulator_client_interceptor.py12
-rw-r--r--examples/python/multiplex/multiplex_client.py10
-rw-r--r--examples/python/multiplex/multiplex_server.py4
-rw-r--r--examples/python/multiplex/run_codegen.py18
-rw-r--r--examples/python/route_guide/route_guide_client.py9
-rw-r--r--examples/python/route_guide/route_guide_server.py4
-rw-r--r--examples/python/route_guide/run_codegen.py9
7 files changed, 43 insertions, 23 deletions
diff --git a/examples/python/interceptors/headers/header_manipulator_client_interceptor.py b/examples/python/interceptors/headers/header_manipulator_client_interceptor.py
index ac7c605144..89b1bef05f 100644
--- a/examples/python/interceptors/headers/header_manipulator_client_interceptor.py
+++ b/examples/python/interceptors/headers/header_manipulator_client_interceptor.py
@@ -20,9 +20,10 @@ import generic_client_interceptor
class _ClientCallDetails(
- collections.namedtuple('_ClientCallDetails',
- ('method', 'timeout', 'metadata',
- 'credentials')), grpc.ClientCallDetails):
+ collections.namedtuple(
+ '_ClientCallDetails',
+ ('method', 'timeout', 'metadata', 'credentials')),
+ grpc.ClientCallDetails):
pass
@@ -33,7 +34,10 @@ def header_adder_interceptor(header, value):
metadata = []
if client_call_details.metadata is not None:
metadata = list(client_call_details.metadata)
- metadata.append((header, value,))
+ metadata.append((
+ header,
+ value,
+ ))
client_call_details = _ClientCallDetails(
client_call_details.method, client_call_details.timeout, metadata,
client_call_details.credentials)
diff --git a/examples/python/multiplex/multiplex_client.py b/examples/python/multiplex/multiplex_client.py
index 49713f35b7..9baa10247d 100644
--- a/examples/python/multiplex/multiplex_client.py
+++ b/examples/python/multiplex/multiplex_client.py
@@ -46,9 +46,9 @@ def guide_get_one_feature(route_guide_stub, point):
def guide_get_feature(route_guide_stub):
- guide_get_one_feature(
- route_guide_stub,
- route_guide_pb2.Point(latitude=409146138, longitude=-746188906))
+ guide_get_one_feature(route_guide_stub,
+ route_guide_pb2.Point(
+ latitude=409146138, longitude=-746188906))
guide_get_one_feature(route_guide_stub,
route_guide_pb2.Point(latitude=0, longitude=0))
@@ -101,8 +101,8 @@ def generate_messages():
def guide_route_chat(route_guide_stub):
responses = route_guide_stub.RouteChat(generate_messages())
for response in responses:
- print("Received message %s at %s" %
- (response.message, response.location))
+ print("Received message %s at %s" % (response.message,
+ response.location))
def run():
diff --git a/examples/python/multiplex/multiplex_server.py b/examples/python/multiplex/multiplex_server.py
index e2ff671f97..70dec3c939 100644
--- a/examples/python/multiplex/multiplex_server.py
+++ b/examples/python/multiplex/multiplex_server.py
@@ -124,8 +124,8 @@ def serve():
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
helloworld_pb2_grpc.add_GreeterServicer_to_server(_GreeterServicer(),
server)
- route_guide_pb2_grpc.add_RouteGuideServicer_to_server(_RouteGuideServicer(),
- server)
+ route_guide_pb2_grpc.add_RouteGuideServicer_to_server(
+ _RouteGuideServicer(), server)
server.add_insecure_port('[::]:50051')
server.start()
try:
diff --git a/examples/python/multiplex/run_codegen.py b/examples/python/multiplex/run_codegen.py
index d960c3cf16..be8915fe20 100644
--- a/examples/python/multiplex/run_codegen.py
+++ b/examples/python/multiplex/run_codegen.py
@@ -15,7 +15,17 @@
from grpc_tools import protoc
-protoc.main(('', '-I../../protos', '--python_out=.', '--grpc_python_out=.',
- '../../protos/helloworld.proto',))
-protoc.main(('', '-I../../protos', '--python_out=.', '--grpc_python_out=.',
- '../../protos/route_guide.proto',))
+protoc.main((
+ '',
+ '-I../../protos',
+ '--python_out=.',
+ '--grpc_python_out=.',
+ '../../protos/helloworld.proto',
+))
+protoc.main((
+ '',
+ '-I../../protos',
+ '--python_out=.',
+ '--grpc_python_out=.',
+ '../../protos/route_guide.proto',
+))
diff --git a/examples/python/route_guide/route_guide_client.py b/examples/python/route_guide/route_guide_client.py
index c9d0e96ad6..f2d4317ef1 100644
--- a/examples/python/route_guide/route_guide_client.py
+++ b/examples/python/route_guide/route_guide_client.py
@@ -43,8 +43,9 @@ def guide_get_one_feature(stub, point):
def guide_get_feature(stub):
- guide_get_one_feature(
- stub, route_guide_pb2.Point(latitude=409146138, longitude=-746188906))
+ guide_get_one_feature(stub,
+ route_guide_pb2.Point(
+ latitude=409146138, longitude=-746188906))
guide_get_one_feature(stub, route_guide_pb2.Point(latitude=0, longitude=0))
@@ -94,8 +95,8 @@ def generate_messages():
def guide_route_chat(stub):
responses = stub.RouteChat(generate_messages())
for response in responses:
- print("Received message %s at %s" %
- (response.message, response.location))
+ print("Received message %s at %s" % (response.message,
+ response.location))
def run():
diff --git a/examples/python/route_guide/route_guide_server.py b/examples/python/route_guide/route_guide_server.py
index 46f3322a39..f10008fdec 100644
--- a/examples/python/route_guide/route_guide_server.py
+++ b/examples/python/route_guide/route_guide_server.py
@@ -113,8 +113,8 @@ class RouteGuideServicer(route_guide_pb2_grpc.RouteGuideServicer):
def serve():
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
- route_guide_pb2_grpc.add_RouteGuideServicer_to_server(RouteGuideServicer(),
- server)
+ route_guide_pb2_grpc.add_RouteGuideServicer_to_server(
+ RouteGuideServicer(), server)
server.add_insecure_port('[::]:50051')
server.start()
try:
diff --git a/examples/python/route_guide/run_codegen.py b/examples/python/route_guide/run_codegen.py
index 1ec7fcd51f..8df562d349 100644
--- a/examples/python/route_guide/run_codegen.py
+++ b/examples/python/route_guide/run_codegen.py
@@ -15,5 +15,10 @@
from grpc_tools import protoc
-protoc.main(('', '-I../../protos', '--python_out=.', '--grpc_python_out=.',
- '../../protos/route_guide.proto',))
+protoc.main((
+ '',
+ '-I../../protos',
+ '--python_out=.',
+ '--grpc_python_out=.',
+ '../../protos/route_guide.proto',
+))