Skip to content

Commit

Permalink
Use correct grpc stub
Browse files Browse the repository at this point in the history
* use grpc stub

* fix grpc stub import problem

* do not track .idea

* delete .idea

* Update .gitignore
  • Loading branch information
darkdarkfruit authored and RussellLuo committed Nov 14, 2017
1 parent e1ae5a0 commit e7bd735
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ build
*.egg
*.egg-info
.tox
.idea
5 changes: 3 additions & 2 deletions grpc_pytools/pythonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def write_module_header(self):
'# -*- coding: utf-8 -*-\n'
'{import_enum}'
'\nimport grpc'
'\n\n{import_pb2}'.format(
'\n\n{import_pb2}'
'\n{import_pb2}_grpc'.format(
import_enum='\nimport enum' if self.has_enum_types() else '',
import_pb2=import_pb2
)
Expand Down Expand Up @@ -90,7 +91,7 @@ def write_stub_property(self, stub_class_name):
'\n @property\n'
' def stub(self):\n'
' channel = grpc.insecure_channel(self.target)\n'
' return {pb2_name}.{stub_class_name}(channel)\n'.format(
' return {pb2_name}_grpc.{stub_class_name}(channel)\n'.format(
pb2_name=self.pb2_name,
stub_class_name=stub_class_name
)
Expand Down

0 comments on commit e7bd735

Please sign in to comment.