本文整理汇总了Python中thrift.protocol.TCompactProtocol.TCompactProtocol方法的典型用法代码示例。如果您正苦于以下问题:Python TCompactProtocol.TCompactProtocol方法的具体用法?Python TCompactProtocol.TCompactProtocol怎么用?Python TCompactProtocol.TCompactProtocol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thrift.protocol.TCompactProtocol
的用法示例。
在下文中一共展示了TCompactProtocol.TCompactProtocol方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _marshall_span
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def _marshall_span(span):
class TestTrans(TMemoryBuffer):
def now_reading(self):
"""
Thrift TMemoryBuffer is not read-able AND write-able,
it's one or the other (really? yes.). This will convert
us from write-able to read-able.
"""
self._buffer = BytesIO(self.getvalue())
batch = thrift.make_jaeger_batch(
spans=[span], process=ttypes.Process(serviceName='x', tags={}))
# write and read them to test encoding
args = Agent.emitBatch_args(batch)
t = TestTrans()
prot = TCompactProtocol(t)
args.write(prot)
t.now_reading()
args.read(prot)
示例2: __init__
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def __init__(self):
self.transport = THttpClient.THttpClient('https://gd2.line.naver.jp:443'+self.auth_query_path)
self.transport.setCustomHeaders({
"User-Agent" : self.UA,
"X-Line-Application" : self.LA,
})
self.transport.open()
self.protocol = TCompactProtocol.TCompactProtocol(self.transport);
self.client = LineService.Client(self.protocol)
示例3: __init__
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def __init__(self, authToken):
self.authToken = authToken
self.transport = THttpClient.THttpClient('https://gd2.line.naver.jp:443'+self.http_query_path)
self.transport.setCustomHeaders({ "User-Agent" : self.UA,
"X-Line-Application" : self.LA,
"X-Line-Access": self.authToken
})
self.transport.open()
self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
self.client = LineService.Client(self.protocol)
self.mid = self.client.getProfile().mid
self.transport.path = self.channel_query_path
示例4: __init__
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def __init__(self, authToken):
self.transport = THttpClient.THttpClient('https://gd2.line.naver.jp:443'+ self.http_query_path)
self.transport.setCustomHeaders({
"User-Agent" : self.UA,
"X-Line-Application" : self.LA,
"X-Line-Access": authToken
});
self.protocol = TCompactProtocol.TCompactProtocol(self.transport);
self.client = LineService.Client(self.protocol)
self.rev = self.client.getLastOpRevision()
self.transport.path = self.polling_path
self.transport.open()
示例5: Auth
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def Auth(self, isopen=True):
self.transport = THttpClient.THttpClient(self.host)
self.transport.setCustomHeaders(self.headers)
self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
self._auth = AuthService.Client(self.protocol)
if isopen:
self.transport.open()
return self._auth
示例6: Talk
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def Talk(self, isopen=True):
self.transport = THttpClient.THttpClient(self.host)
self.transport.setCustomHeaders(self.headers)
self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
self._talk = TalkService.Client(self.protocol)
if isopen:
self.transport.open()
return self._talk
示例7: Channel
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def Channel(self, isopen=True):
self.transport = THttpClient.THttpClient(self.host)
self.transport.setCustomHeaders(self.headers)
self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
self._channel = ChannelService.Client(self.protocol)
if isopen:
self.transport.open()
return self._channel
示例8: Call
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def Call(self, isopen=True):
self.transport = THttpClient.THttpClient(self.host)
self.transport.setCustomHeaders(self.headers)
self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
self._call = CallService.Client(self.protocol)
if isopen:
self.transport.open()
return self._call
示例9: Square
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def Square(self, isopen=True):
self.transport = THttpClient.THttpClient(self.host)
self.transport.setCustomHeaders(self.headers)
self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
self._square = SquareService.Client(self.protocol)
if isopen:
self.transport.open()
return self._square
示例10: _transportOpen
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def _transportOpen(self, host, path=None):
if path is not None:
self._thriftTransport = LineTransport(host + path)
else:
self._thriftTransport = LineTransport(host)
self._thriftProtocol = TCompactProtocol.TCompactProtocol(
self._thriftTransport)
self._client = TalkService.Client(self._thriftProtocol)
示例11: Auth
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def Auth(self, isopen=True):
self.transport = THttpClient(self.host, customThrift=self.customThrift)
self.transport.setCustomHeaders(self.headers)
self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
self._auth = AuthService.Client(self.protocol)
if isopen:
self.transport.open()
return self._auth
示例12: Talk
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def Talk(self, isopen=True):
self.transport = THttpClient(self.host, customThrift=self.customThrift)
self.transport.setCustomHeaders(self.headers)
self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
self._talk = TalkService.Client(self.protocol)
if isopen:
self.transport.open()
return self._talk
示例13: Channel
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def Channel(self, isopen=True):
self.transport = THttpClient(self.host, customThrift=self.customThrift)
self.transport.setCustomHeaders(self.headers)
self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
self._channel = ChannelService.Client(self.protocol)
if isopen:
self.transport.open()
return self._channel
示例14: Call
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def Call(self, isopen=True):
self.transport = THttpClient(self.host, customThrift=self.customThrift)
self.transport.setCustomHeaders(self.headers)
self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
self._call = CallService.Client(self.protocol)
if isopen:
self.transport.open()
return self._call
示例15: Square
# 需要导入模块: from thrift.protocol import TCompactProtocol [as 别名]
# 或者: from thrift.protocol.TCompactProtocol import TCompactProtocol [as 别名]
def Square(self, isopen=True):
self.transport = THttpClient(self.host, customThrift=self.customThrift)
self.transport.setCustomHeaders(self.headers)
self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
self._square = SquareService.Client(self.protocol)
if isopen:
self.transport.open()
return self._square