当前位置: 首页>>代码示例>>Python>>正文


Python TCompactProtocol.TCompactProtocol方法代码示例

本文整理汇总了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) 
开发者ID:jaegertracing,项目名称:jaeger-client-python,代码行数:22,代码来源:test_thrift.py

示例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) 
开发者ID:CyberTKR,项目名称:CyberTK-Self,代码行数:11,代码来源:Talk.py

示例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 
开发者ID:CyberTKR,项目名称:CyberTK-Self,代码行数:14,代码来源:channel.py

示例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() 
开发者ID:CyberTKR,项目名称:CyberTK-Self,代码行数:14,代码来源:Poll.py

示例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 
开发者ID:arifistifik,项目名称:dpk,代码行数:13,代码来源:session.py

示例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 
开发者ID:arifistifik,项目名称:dpk,代码行数:13,代码来源:session.py

示例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 
开发者ID:arifistifik,项目名称:dpk,代码行数:13,代码来源:session.py

示例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 
开发者ID:arifistifik,项目名称:dpk,代码行数:13,代码来源:session.py

示例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 
开发者ID:arifistifik,项目名称:dpk,代码行数:13,代码来源:session.py

示例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) 
开发者ID:merkremont,项目名称:LineVodka,代码行数:10,代码来源:LineApi.py

示例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 
开发者ID:crash-override404,项目名称:linepy-modified,代码行数:13,代码来源:session.py

示例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 
开发者ID:crash-override404,项目名称:linepy-modified,代码行数:12,代码来源:session.py

示例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 
开发者ID:crash-override404,项目名称:linepy-modified,代码行数:13,代码来源:session.py

示例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 
开发者ID:crash-override404,项目名称:linepy-modified,代码行数:13,代码来源:session.py

示例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 
开发者ID:crash-override404,项目名称:linepy-modified,代码行数:13,代码来源:session.py


注:本文中的thrift.protocol.TCompactProtocol.TCompactProtocol方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。