Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
Make accepting transports in Python work correctly. (#2156)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesneeringer authored Jul 18, 2018
1 parent 3430baf commit 085018f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 25 deletions.
11 changes: 6 additions & 5 deletions src/main/resources/com/google/api/codegen/py/main.snip
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,12 @@
'credentials; these are mutually exclusive.'
)
self.transport = transport
self.transport = {@api.grpcTransportImportName}.{@api.grpcTransportClassName}(
address=self.SERVICE_ADDRESS,
channel=channel,
credentials=credentials,
)
else:
self.transport = {@api.grpcTransportImportName}.{@api.grpcTransportClassName}(
address=self.SERVICE_ADDRESS,
channel=channel,
credentials=credentials,
)

# Client information initialization.
if client_info is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1184,11 +1184,12 @@ class LibraryServiceClient(object):
'credentials; these are mutually exclusive.'
)
self.transport = transport
self.transport = library_service_grpc_transport.LibraryServiceGrpcTransport(
address=self.SERVICE_ADDRESS,
channel=channel,
credentials=credentials,
)
else:
self.transport = library_service_grpc_transport.LibraryServiceGrpcTransport(
address=self.SERVICE_ADDRESS,
channel=channel,
credentials=credentials,
)

if client_info is None:
client_info = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -937,11 +937,12 @@ class DecrementerServiceClient(object):
'credentials; these are mutually exclusive.'
)
self.transport = transport
self.transport = decrementer_service_grpc_transport.DecrementerServiceGrpcTransport(
address=self.SERVICE_ADDRESS,
channel=channel,
credentials=credentials,
)
else:
self.transport = decrementer_service_grpc_transport.DecrementerServiceGrpcTransport(
address=self.SERVICE_ADDRESS,
channel=channel,
credentials=credentials,
)

if client_info is None:
client_info = (
Expand Down Expand Up @@ -1149,11 +1150,12 @@ class IncrementerServiceClient(object):
'credentials; these are mutually exclusive.'
)
self.transport = transport
self.transport = incrementer_service_grpc_transport.IncrementerServiceGrpcTransport(
address=self.SERVICE_ADDRESS,
channel=channel,
credentials=credentials,
)
else:
self.transport = incrementer_service_grpc_transport.IncrementerServiceGrpcTransport(
address=self.SERVICE_ADDRESS,
channel=channel,
credentials=credentials,
)

if client_info is None:
client_info = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -886,11 +886,12 @@ class NoTemplatesAPIServiceClient(object):
'credentials; these are mutually exclusive.'
)
self.transport = transport
self.transport = no_templates_api_service_grpc_transport.NoTemplatesApiServiceGrpcTransport(
address=self.SERVICE_ADDRESS,
channel=channel,
credentials=credentials,
)
else:
self.transport = no_templates_api_service_grpc_transport.NoTemplatesApiServiceGrpcTransport(
address=self.SERVICE_ADDRESS,
channel=channel,
credentials=credentials,
)

if client_info is None:
client_info = (
Expand Down

0 comments on commit 085018f

Please sign in to comment.