Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit a57b716

Browse files
authored
Merge pull request #130 from vmarkovtsev/master
Refactor aliases
2 parents e661862 + 0c84421 commit a57b716

File tree

1 file changed

+20
-39
lines changed

1 file changed

+20
-39
lines changed

bblfsh/aliases.py

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,27 @@
1-
__all__ = ["DESCRIPTOR", "Node", "ParseResponse", "NativeParseResponse",
2-
"ParseRequest", "NativeParseRequest", "VersionRequest",
3-
"ProtocolServiceStub"]
1+
__all__ = ["DESCRIPTOR", "Node", "Position", "ParseResponse", "NativeParseResponse",
2+
"ParseRequest", "NativeParseRequest", "VersionRequest", "ProtocolServiceStub"]
43

54
import importlib
65

76
from bblfsh.sdkversion import VERSION
87

98
# "in" is a reserved keyword in Python thus can't be used as package name, so
109
# we import by string
11-
12-
DESCRIPTOR = importlib.import_module(
13-
"bblfsh.gopkg.in.bblfsh.sdk.%s.uast.generated_pb2" % VERSION).DESCRIPTOR
14-
15-
Node = importlib.import_module(
16-
"bblfsh.gopkg.in.bblfsh.sdk.%s.uast.generated_pb2" % VERSION).Node
17-
18-
ParseResponse = importlib.import_module(
19-
"bblfsh.gopkg.in.bblfsh.sdk.%s.protocol.generated_pb2" % VERSION).ParseResponse
20-
21-
NativeParseResponse = importlib.import_module(
22-
"bblfsh.gopkg.in.bblfsh.sdk.%s.protocol.generated_pb2" % VERSION
23-
).NativeParseResponse
24-
25-
ParseRequest = importlib.import_module(
26-
"bblfsh.gopkg.in.bblfsh.sdk.%s.protocol.generated_pb2" % VERSION).ParseRequest
27-
28-
NativeParseRequest = importlib.import_module(
29-
"bblfsh.gopkg.in.bblfsh.sdk.%s.protocol.generated_pb2" % VERSION
30-
).NativeParseRequest
31-
32-
VersionRequest = importlib.import_module(
33-
"bblfsh.gopkg.in.bblfsh.sdk.%s.protocol.generated_pb2" % VERSION
34-
).VersionRequest
35-
36-
SupportedLanguagesRequest = importlib.import_module(
37-
"bblfsh.gopkg.in.bblfsh.sdk.%s.protocol.generated_pb2" % VERSION
38-
).SupportedLanguagesRequest
39-
40-
SupportedLanguagesResponse = importlib.import_module(
41-
"bblfsh.gopkg.in.bblfsh.sdk.%s.protocol.generated_pb2" % VERSION
42-
).SupportedLanguagesResponse
43-
44-
ProtocolServiceStub = importlib.import_module(
45-
"bblfsh.gopkg.in.bblfsh.sdk.%s.protocol.generated_pb2_grpc" % VERSION
46-
).ProtocolServiceStub
10+
uast_module = importlib.import_module(
11+
"bblfsh.gopkg.in.bblfsh.sdk.%s.uast.generated_pb2" % VERSION)
12+
protocol_module = importlib.import_module(
13+
"bblfsh.gopkg.in.bblfsh.sdk.%s.protocol.generated_pb2" % VERSION)
14+
protocol_grpc_module = importlib.import_module(
15+
"bblfsh.gopkg.in.bblfsh.sdk.%s.protocol.generated_pb2_grpc" % VERSION)
16+
17+
DESCRIPTOR = uast_module.DESCRIPTOR
18+
Node = uast_module.Node
19+
Position = uast_module.Position
20+
ParseResponse = protocol_module.ParseResponse
21+
NativeParseResponse = protocol_module.NativeParseResponse
22+
ParseRequest = protocol_module.ParseRequest
23+
NativeParseRequest = protocol_module.NativeParseRequest
24+
VersionRequest = protocol_module.VersionRequest
25+
SupportedLanguagesRequest = protocol_module.SupportedLanguagesRequest
26+
SupportedLanguagesResponse = protocol_module.SupportedLanguagesResponse
27+
ProtocolServiceStub = protocol_grpc_module.ProtocolServiceStub

0 commit comments

Comments
 (0)