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


Python TType.MAP属性代码示例

本文整理汇总了Python中thrift.Thrift.TType.MAP属性的典型用法代码示例。如果您正苦于以下问题:Python TType.MAP属性的具体用法?Python TType.MAP怎么用?Python TType.MAP使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在thrift.Thrift.TType的用法示例。


在下文中一共展示了TType.MAP属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.MAP:
                    self.keyvalues = {}
                    (_ktype54, _vtype55, _size53) = iprot.readMapBegin()
                    for _i57 in range(_size53):
                        _key58 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val59 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.keyvalues[_key58] = _val59
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
开发者ID:brunorijsman,项目名称:rift-python,代码行数:26,代码来源:ttypes.py

示例2: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.MAP:
                    self.credentials = {}
                    (_ktype71, _vtype72, _size70) = iprot.readMapBegin()
                    for _i74 in range(_size70):
                        _key75 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val76 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.credentials[_key75] = _val76
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
开发者ID:apache,项目名称:cassandra-dtest,代码行数:26,代码来源:ttypes.py

示例3: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.MAP:
          self.credentials = {}
          (_ktype64, _vtype65, _size63 ) = iprot.readMapBegin() 
          for _i67 in range(_size63):
            _key68 = iprot.readString();
            _val69 = iprot.readString();
            self.credentials[_key68] = _val69
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd() 
开发者ID:apache,项目名称:cassandra-dtest,代码行数:26,代码来源:ttypes.py

示例4: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TableSplit')
    if self.startKey is not None:
      oprot.writeFieldBegin('startKey', TType.MAP, 1)
      oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.startKey))
      for kiter187,viter188 in self.startKey.items():
        oprot.writeString(kiter187)
        viter188.write(oprot)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.stopKey is not None:
      oprot.writeFieldBegin('stopKey', TType.MAP, 2)
      oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.stopKey))
      for kiter189,viter190 in self.stopKey.items():
        oprot.writeString(kiter189)
        viter190.write(oprot)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
开发者ID:XiaoMi,项目名称:galaxy-sdk-python,代码行数:25,代码来源:ttypes.py

示例5: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.MAP:
          self.item = {}
          (_ktype208, _vtype209, _size207 ) = iprot.readMapBegin()
          for _i211 in xrange(_size207):
            _key212 = iprot.readString();
            _val213 = Datum()
            _val213.read(iprot)
            self.item[_key212] = _val213
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd() 
开发者ID:XiaoMi,项目名称:galaxy-sdk-python,代码行数:27,代码来源:ttypes.py

示例6: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.MAP:
          self.keyIdMap = {}
          (_ktype1, _vtype2, _size0 ) = iprot.readMapBegin()
          for _i4 in xrange(_size0):
            _key5 = iprot.readI16();
            _val6 = iprot.readString();
            self.keyIdMap[_key5] = _val6
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd() 
开发者ID:XiaoMi,项目名称:galaxy-sdk-python,代码行数:26,代码来源:ttypes.py

示例7: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('RCBasicMeta')
    if self.keys is not None:
      oprot.writeFieldBegin('keys', TType.LIST, 1)
      oprot.writeListBegin(TType.STRING, len(self.keys))
      for iter22 in self.keys:
        oprot.writeString(iter22)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.types is not None:
      oprot.writeFieldBegin('types', TType.MAP, 2)
      oprot.writeMapBegin(TType.STRING, TType.I32, len(self.types))
      for kiter23,viter24 in self.types.items():
        oprot.writeString(kiter23)
        oprot.writeI32(viter24)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
开发者ID:XiaoMi,项目名称:galaxy-sdk-python,代码行数:24,代码来源:ttypes.py

示例8: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getUserIdentities_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.MAP, 0)
      oprot.writeMapBegin(TType.I32, TType.STRING, len(self.success))
      for kiter626,viter627 in self.success.items():
        oprot.writeI32(kiter626)
        oprot.writeString(viter627)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.e is not None:
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
      self.e.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:21,代码来源:ChannelApplicationProvidedService.py

示例9: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 2:
                if ftype == TType.MAP:
                    self.parameterMap = {}
                    (_ktype375, _vtype376, _size374) = iprot.readMapBegin()
                    for _i378 in range(_size374):
                        _key379 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val380 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.parameterMap[_key379] = _val380
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
开发者ID:soppeng29,项目名称:simpleSB,代码行数:26,代码来源:AccountSupervisorService.py

示例10: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('getNewlyReleasedBuddyIds_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.MAP, 0)
            oprot.writeMapBegin(TType.STRING, TType.I64, len(self.success))
            for kiter561, viter562 in self.success.items():
                oprot.writeString(kiter561.encode('utf-8') if sys.version_info[0] == 2 else kiter561)
                oprot.writeI64(viter562)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
开发者ID:soppeng29,项目名称:simpleSB,代码行数:21,代码来源:BuddyService.py

示例11: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 2:
                if ftype == TType.MAP:
                    self.parameterMap = {}
                    (_ktype1279, _vtype1280, _size1278) = iprot.readMapBegin()
                    for _i1282 in range(_size1278):
                        _key1283 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val1284 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.parameterMap[_key1283] = _val1284
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
开发者ID:crash-override404,项目名称:linepy-modified,代码行数:26,代码来源:AccountSupervisorService.py

示例12: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('PrefixTIEElement')
        if self.prefixes is not None:
            oprot.writeFieldBegin('prefixes', TType.MAP, 1)
            oprot.writeMapBegin(TType.STRUCT, TType.STRUCT, len(self.prefixes))
            for kiter51, viter52 in self.prefixes.items():
                kiter51.write(oprot)
                viter52.write(oprot)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
开发者ID:brunorijsman,项目名称:rift-python,代码行数:17,代码来源:ttypes.py

示例13: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('AuthenticationRequest')
        if self.credentials is not None:
            oprot.writeFieldBegin('credentials', TType.MAP, 1)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.credentials))
            for kiter77, viter78 in self.credentials.items():
                oprot.writeString(kiter77.encode('utf-8') if sys.version_info[0] == 2 else kiter77)
                oprot.writeString(viter78.encode('utf-8') if sys.version_info[0] == 2 else viter78)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
开发者ID:apache,项目名称:cassandra-dtest,代码行数:17,代码来源:ttypes.py

示例14: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import MAP [as 别名]
def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('ColumnDef')
    if self.name is not None:
      oprot.writeFieldBegin('name', TType.STRING, 1)
      oprot.writeString(self.name)
      oprot.writeFieldEnd()
    if self.validation_class is not None:
      oprot.writeFieldBegin('validation_class', TType.STRING, 2)
      oprot.writeString(self.validation_class)
      oprot.writeFieldEnd()
    if self.index_type is not None:
      oprot.writeFieldBegin('index_type', TType.I32, 3)
      oprot.writeI32(self.index_type)
      oprot.writeFieldEnd()
    if self.index_name is not None:
      oprot.writeFieldBegin('index_name', TType.STRING, 4)
      oprot.writeString(self.index_name)
      oprot.writeFieldEnd()
    if self.index_options is not None:
      oprot.writeFieldBegin('index_options', TType.MAP, 5)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.index_options))
      for kiter79,viter80 in list(self.index_options.items()):
        oprot.writeString(kiter79)
        oprot.writeString(viter80)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
开发者ID:apache,项目名称:cassandra-dtest,代码行数:33,代码来源:ttypes.py


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