Skip to content

Commit abbd27b

Browse files
Rename thigns
1 parent 4c1b402 commit abbd27b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pydgraph/client_slash.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from pydgraph.proto import api_pb2 as api
2222

2323
__author__ = 'Anurag Sharma <[email protected]>'
24-
__maintainer__ = 'Martin Martinez Rivera <martinmr@dgraph.io>'
24+
__maintainer__ = 'Arpan Gupta <arpan@dgraph.io>'
2525
__version__ = VERSION
2626
__status__ = 'development'
2727

@@ -30,22 +30,22 @@ class SlashGraphQLClient(object):
3030
"""Creates a new Client for interacting with the Slash GraphQL.
3131
"""
3232

33-
def __init__(self, SlashEndpoint, APIKey):
34-
if not SlashEndpoint:
33+
def __init__(self, slash_end_point, api_key):
34+
if not slash_end_point:
3535
raise ValueError('No Slash endpoint provided in SlashGraphQLClient constructor')
3636

37-
self._SlashEndpoint = SlashEndpoint
38-
self._APIKey = APIKey
37+
self._slash_end_point = slash_end_point
38+
self._api_key = api_key
3939

4040
def get_stub(self):
4141
"""Returns Dgraph Client stub for the Slash GraphQL endpoint"""
42-
url = self._SlashEndpoint.replace("/graphql", "")
42+
url = self._slash_end_point.replace("/graphql", "")
4343
url = url.replace("https://", "")
4444
url_parts = url.split(".", 1)
45-
HOST = url_parts[0] + ".grpc." + url_parts[1]
45+
host = url_parts[0] + ".grpc." + url_parts[1]
4646
PORT = "443"
4747
creds = grpc.ssl_channel_credentials()
48-
call_credentials = grpc.metadata_call_credentials(lambda context, callback: callback((("authorization", self._APIKey),), None))
48+
call_credentials = grpc.metadata_call_credentials(lambda context, callback: callback((("authorization", self._api_key),), None))
4949
composite_credentials = grpc.composite_channel_credentials(creds, call_credentials)
50-
client_stub = pydgraph.DgraphClientStub('{host}:{port}'.format(host=HOST, port=PORT), composite_credentials, options=(('grpc.enable_http_proxy', 0),))
50+
client_stub = pydgraph.DgraphClientStub('{host}:{port}'.format(host=host, port=PORT), composite_credentials, options=(('grpc.enable_http_proxy', 0),))
5151
return client_stub

0 commit comments

Comments
 (0)