本文整理匯總了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