當前位置: 首頁>>代碼示例>>Python>>正文


Python TType.I16屬性代碼示例

本文整理匯總了Python中thrift.Thrift.TType.I16屬性的典型用法代碼示例。如果您正苦於以下問題:Python TType.I16屬性的具體用法?Python TType.I16怎麽用?Python TType.I16使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在thrift.Thrift.TType的用法示例。


在下文中一共展示了TType.I16屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: write

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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('NodeCapabilities')
        if self.protocol_minor_version is not None:
            oprot.writeFieldBegin('protocol_minor_version', TType.I16, 1)
            oprot.writeI16(self.protocol_minor_version)
            oprot.writeFieldEnd()
        if self.flood_reduction is not None:
            oprot.writeFieldBegin('flood_reduction', TType.BOOL, 2)
            oprot.writeBool(self.flood_reduction)
            oprot.writeFieldEnd()
        if self.hierarchy_indications is not None:
            oprot.writeFieldBegin('hierarchy_indications', TType.I32, 3)
            oprot.writeI32(self.hierarchy_indications)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
開發者ID:brunorijsman,項目名稱:rift-python,代碼行數:21,代碼來源:ttypes.py

示例2: write

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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('TIEHeader')
        if self.tieid is not None:
            oprot.writeFieldBegin('tieid', TType.STRUCT, 2)
            self.tieid.write(oprot)
            oprot.writeFieldEnd()
        if self.seq_nr is not None:
            oprot.writeFieldBegin('seq_nr', TType.I16, 3)
            oprot.writeI16(self.seq_nr)
            oprot.writeFieldEnd()
        if self.origination_time is not None:
            oprot.writeFieldBegin('origination_time', TType.STRUCT, 10)
            self.origination_time.write(oprot)
            oprot.writeFieldEnd()
        if self.origination_lifetime is not None:
            oprot.writeFieldBegin('origination_lifetime', TType.I32, 12)
            oprot.writeI32(self.origination_lifetime)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
開發者ID:brunorijsman,項目名稱:rift-python,代碼行數:25,代碼來源:ttypes.py

示例3: write

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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('DatumMapRecord')
    if self.data is not None:
      oprot.writeFieldBegin('data', TType.MAP, 1)
      oprot.writeMapBegin(TType.I16, TType.STRUCT, len(self.data))
      for kiter46,viter47 in self.data.items():
        oprot.writeI16(kiter46)
        viter47.write(oprot)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.keyIdMap is not None:
      oprot.writeFieldBegin('keyIdMap', TType.MAP, 2)
      oprot.writeMapBegin(TType.I16, TType.STRING, len(self.keyIdMap))
      for kiter48,viter49 in self.keyIdMap.items():
        oprot.writeI16(kiter48)
        oprot.writeString(viter49)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-python,代碼行數:25,代碼來源:ttypes.py

示例4: read

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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 == 0:
                if ftype == TType.I16:
                    self.success = iprot.readI16()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
開發者ID:snower,項目名稱:forsun,代碼行數:20,代碼來源:Forsun.py

示例5: read

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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.I16:
                    self.code = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.message = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
開發者ID:snower,項目名稱:forsun,代碼行數:25,代碼來源:ttypes.py

示例6: read

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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.I16:
                    self.padded = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I16:
                    self.logical = iprot.readI16()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
開發者ID:omnisci,項目名稱:pymapd,代碼行數:25,代碼來源:ttypes.py

示例7: write

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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('Endpoint')
        if self.ipv4 is not None:
            oprot.writeFieldBegin('ipv4', TType.I32, 1)
            oprot.writeI32(self.ipv4)
            oprot.writeFieldEnd()
        if self.port is not None:
            oprot.writeFieldBegin('port', TType.I16, 2)
            oprot.writeI16(self.port)
            oprot.writeFieldEnd()
        if self.service_name is not None:
            oprot.writeFieldBegin('service_name', TType.STRING, 3)
            oprot.writeString(self.service_name.encode('utf-8') if sys.version_info[0] == 2 else self.service_name)
            oprot.writeFieldEnd()
        if self.ipv6 is not None:
            oprot.writeFieldBegin('ipv6', TType.STRING, 4)
            oprot.writeBinary(self.ipv6)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
開發者ID:open-telemetry,項目名稱:opentelemetry-python,代碼行數:25,代碼來源:ttypes.py

示例8: write

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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('Endpoint')
    if self.ipv4 is not None:
      oprot.writeFieldBegin('ipv4', TType.I32, 1)
      oprot.writeI32(self.ipv4)
      oprot.writeFieldEnd()
    if self.port is not None:
      oprot.writeFieldBegin('port', TType.I16, 2)
      oprot.writeI16(self.port)
      oprot.writeFieldEnd()
    if self.service_name is not None:
      oprot.writeFieldBegin('service_name', TType.STRING, 3)
      oprot.writeString(self.service_name)
      oprot.writeFieldEnd()
    if self.ipv6 is not None:
      oprot.writeFieldBegin('ipv6', TType.STRING, 4)
      oprot.writeString(self.ipv6)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
開發者ID:jaegertracing,項目名稱:jaeger-client-python,代碼行數:25,代碼來源:ttypes.py

示例9: read

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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.I16:
          self.maxTracesPerSecond = iprot.readI16()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd() 
開發者ID:jaegertracing,項目名稱:jaeger-client-python,代碼行數:20,代碼來源:ttypes.py

示例10: read

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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.I16:
                    self.protocol_minor_version = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.flood_reduction = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.hierarchy_indications = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
開發者ID:brunorijsman,項目名稱:rift-python,代碼行數:30,代碼來源:ttypes.py

示例11: write

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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('ping_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.I16, 0)
            oprot.writeI16(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
開發者ID:snower,項目名稱:forsun,代碼行數:13,代碼來源:Forsun.py

示例12: write

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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('TSlotSize')
        if self.padded is not None:
            oprot.writeFieldBegin('padded', TType.I16, 1)
            oprot.writeI16(self.padded)
            oprot.writeFieldEnd()
        if self.logical is not None:
            oprot.writeFieldBegin('logical', TType.I16, 2)
            oprot.writeI16(self.logical)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
開發者ID:omnisci,項目名稱:pymapd,代碼行數:17,代碼來源:ttypes.py

示例13: read

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [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.I32:
                    self.ipv4 = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I16:
                    self.port = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.service_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.ipv6 = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
開發者ID:open-telemetry,項目名稱:opentelemetry-python,代碼行數:35,代碼來源:ttypes.py

示例14: field_type_to_str

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [as 別名]
def field_type_to_str(ftype):
        if ftype == TType.STOP:
            return 'stop'
        elif ftype == TType.VOID:
            return 'void'
        elif ftype == TType.BOOL:
            return 'bool'
        elif ftype == TType.BYTE:
            return 'byte'
        elif ftype == TType.I08:
            return 'i08'
        elif ftype == TType.DOUBLE:
            return 'double'
        elif ftype == TType.I16:
            return 'i16'
        elif ftype == TType.I32:
            return 'i32'
        elif ftype == TType.I64:
            return 'i64'
        elif ftype == TType.STRING:
            return 'string'
        elif ftype == TType.UTF7:
            return 'utf7'
        elif ftype == TType.STRUCT:
            return 'struct'
        elif ftype == TType.MAP:
            return 'map'
        elif ftype == TType.SET:
            return 'set'
        elif ftype == TType.LIST:
            return 'list'
        elif ftype == TType.UTF8:
            return 'utf8'
        elif ftype == TType.UTF16:
            return 'utf16'
        else:
            raise ValueError('Unknown type: %s' % ftype) 
開發者ID:pinterest,項目名稱:thrift-tools,代碼行數:39,代碼來源:thrift_struct.py

示例15: _fix_map

# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import I16 [as 別名]
def _fix_map(element_type):
    # For a map of key -> value type, ``element_type`` will be,
    # (TType.I16, None, TType.STRUCT, [RecMapBasic, None], False), None, )
    # which is just a normal struct definition.
    #
    # For a map of key -> list / set, ``element_type`` will be,
    # (TType.I16, None, TType.LIST, (TType.STRUCT, [RecMapList, None], False), False)
    # and we need to process the 3rd element as a list.
    #
    # For a map of key -> map, ``element_type`` will be,
    # (TType.I16, None, TType.MAP, (TType.I16, None, TType.STRUCT,
    #  [RecMapMap, None], False), False)
    # and need to process 3rd element as a map.

    # Is the map key a struct?
    if element_type[0] == TType.STRUCT:
        element_type[1][1] = element_type[1][0].thrift_spec
    elif element_type[0] in (TType.LIST, TType.SET):
        _fix_list_or_set(element_type[1])
    elif element_type[0] == TType.MAP:
        _fix_map(element_type[1])

    # Is the map value a struct?
    if element_type[2] == TType.STRUCT:
        element_type[3][1] = element_type[3][0].thrift_spec
    elif element_type[2] in (TType.LIST, TType.SET):
        _fix_list_or_set(element_type[3])
    elif element_type[2] == TType.MAP:
        _fix_map(element_type[3]) 
開發者ID:stya535,項目名稱:SOLO,代碼行數:31,代碼來源:TRecursive.py


注:本文中的thrift.Thrift.TType.I16屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。