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


Python TType.DOUBLE属性代码示例

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


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

示例1: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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('AlertPolicy')
    if self.type is not None:
      oprot.writeFieldBegin('type', TType.I32, 1)
      oprot.writeI32(self.type)
      oprot.writeFieldEnd()
    if self.measurement is not None:
      oprot.writeFieldBegin('measurement', TType.I32, 2)
      oprot.writeI32(self.measurement)
      oprot.writeFieldEnd()
    if self.threshold is not None:
      oprot.writeFieldBegin('threshold', TType.DOUBLE, 3)
      oprot.writeDouble(self.threshold)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
开发者ID:XiaoMi,项目名称:galaxy-sdk-python,代码行数:21,代码来源:ttypes.py

示例2: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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('MetricsSample')
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 1)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.int64_value is not None:
            oprot.writeFieldBegin('int64_value', TType.I64, 2)
            oprot.writeI64(self.int64_value)
            oprot.writeFieldEnd()
        if self.double_value is not None:
            oprot.writeFieldBegin('double_value', TType.DOUBLE, 3)
            oprot.writeDouble(self.double_value)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
开发者ID:lightstep,项目名称:lightstep-tracer-python,代码行数:21,代码来源:ttypes.py

示例3: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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('I18nArgument')
        if self.string_value is not None:
            oprot.writeFieldBegin('string_value', TType.STRING, 1)
            oprot.writeString(self.string_value.encode('utf-8') if sys.version_info[0] == 2 else self.string_value)
            oprot.writeFieldEnd()
        if self.i32_value is not None:
            oprot.writeFieldBegin('i32_value', TType.I32, 2)
            oprot.writeI32(self.i32_value)
            oprot.writeFieldEnd()
        if self.double_value is not None:
            oprot.writeFieldBegin('double_value', TType.DOUBLE, 3)
            oprot.writeDouble(self.double_value)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
开发者ID:CJWorkbench,项目名称:cjworkbench,代码行数:21,代码来源:ttypes.py

示例4: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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.DOUBLE:
          self.samplingRate = iprot.readDouble()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd() 
开发者ID:jaegertracing,项目名称:jaeger-client-python,代码行数:20,代码来源:ttypes.py

示例5: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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('TimeSeriesData')
    if self.tableName is not None:
      oprot.writeFieldBegin('tableName', TType.STRING, 1)
      oprot.writeString(self.tableName)
      oprot.writeFieldEnd()
    if self.metricKey is not None:
      oprot.writeFieldBegin('metricKey', TType.I32, 2)
      oprot.writeI32(self.metricKey)
      oprot.writeFieldEnd()
    if self.metricType is not None:
      oprot.writeFieldBegin('metricType', TType.I32, 3)
      oprot.writeI32(self.metricType)
      oprot.writeFieldEnd()
    if self.data is not None:
      oprot.writeFieldBegin('data', TType.MAP, 4)
      oprot.writeMapBegin(TType.I64, TType.DOUBLE, len(self.data))
      for kiter32,viter33 in self.data.items():
        oprot.writeI64(kiter32)
        oprot.writeDouble(viter33)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
开发者ID:XiaoMi,项目名称:galaxy-sdk-python,代码行数:29,代码来源:ttypes.py

示例6: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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('TimeSeriesData')
    if self.metric is not None:
      oprot.writeFieldBegin('metric', TType.STRING, 1)
      oprot.writeString(self.metric)
      oprot.writeFieldEnd()
    if self.tags is not None:
      oprot.writeFieldBegin('tags', TType.MAP, 2)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.tags))
      for kiter87,viter88 in self.tags.items():
        oprot.writeString(kiter87)
        oprot.writeString(viter88)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.data is not None:
      oprot.writeFieldBegin('data', TType.MAP, 3)
      oprot.writeMapBegin(TType.I64, TType.DOUBLE, len(self.data))
      for kiter89,viter90 in self.data.items():
        oprot.writeI64(kiter89)
        oprot.writeDouble(viter90)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
开发者ID:XiaoMi,项目名称:galaxy-sdk-python,代码行数:29,代码来源:ttypes.py

示例7: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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.I32:
          self.type = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.measurement = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.threshold = iprot.readDouble();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd() 
开发者ID:XiaoMi,项目名称:galaxy-sdk-python,代码行数:30,代码来源:ttypes.py

示例8: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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.STRING:
                    self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.int64_value = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.DOUBLE:
                    self.double_value = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
开发者ID:lightstep,项目名称:lightstep-tracer-python,代码行数:30,代码来源:ttypes.py

示例9: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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('Tag')
        if self.key is not None:
            oprot.writeFieldBegin('key', TType.STRING, 1)
            oprot.writeString(self.key.encode('utf-8') if sys.version_info[0] == 2 else self.key)
            oprot.writeFieldEnd()
        if self.vType is not None:
            oprot.writeFieldBegin('vType', TType.I32, 2)
            oprot.writeI32(self.vType)
            oprot.writeFieldEnd()
        if self.vStr is not None:
            oprot.writeFieldBegin('vStr', TType.STRING, 3)
            oprot.writeString(self.vStr.encode('utf-8') if sys.version_info[0] == 2 else self.vStr)
            oprot.writeFieldEnd()
        if self.vDouble is not None:
            oprot.writeFieldBegin('vDouble', TType.DOUBLE, 4)
            oprot.writeDouble(self.vDouble)
            oprot.writeFieldEnd()
        if self.vBool is not None:
            oprot.writeFieldBegin('vBool', TType.BOOL, 5)
            oprot.writeBool(self.vBool)
            oprot.writeFieldEnd()
        if self.vLong is not None:
            oprot.writeFieldBegin('vLong', TType.I64, 6)
            oprot.writeI64(self.vLong)
            oprot.writeFieldEnd()
        if self.vBinary is not None:
            oprot.writeFieldBegin('vBinary', TType.STRING, 7)
            oprot.writeBinary(self.vBinary)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
开发者ID:open-telemetry,项目名称:opentelemetry-python,代码行数:37,代码来源:ttypes.py

示例10: field_type_to_str

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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

示例11: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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.STRING:
                    self.string_value = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I32:
                    self.i32_value = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.DOUBLE:
                    self.double_value = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
开发者ID:CJWorkbench,项目名称:cjworkbench,代码行数:30,代码来源:ttypes.py

示例12: write

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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('ProbabilisticSamplingStrategy')
    if self.samplingRate is not None:
      oprot.writeFieldBegin('samplingRate', TType.DOUBLE, 1)
      oprot.writeDouble(self.samplingRate)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
开发者ID:jaegertracing,项目名称:jaeger-client-python,代码行数:13,代码来源:ttypes.py

示例13: skip

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [as 别名]
def skip(self, ttype):
        if ttype == TType.STOP:
            return
        elif ttype == TType.BOOL:
            self.readBool()
        elif ttype == TType.BYTE:
            self.readByte()
        elif ttype == TType.I16:
            self.readI16()
        elif ttype == TType.I32:
            self.readI32()
        elif ttype == TType.I64:
            self.readI64()
        elif ttype == TType.DOUBLE:
            self.readDouble()
        elif ttype == TType.STRING:
            self.readString()
        elif ttype == TType.STRUCT:
            name = self.readStructBegin()
            while True:
                (name, ttype, id) = self.readFieldBegin()
                if ttype == TType.STOP:
                    break
                self.skip(ttype)
                self.readFieldEnd()
            self.readStructEnd()
        elif ttype == TType.MAP:
            (ktype, vtype, size) = self.readMapBegin()
            for i in range(size):
                self.skip(ktype)
                self.skip(vtype)
            self.readMapEnd()
        elif ttype == TType.SET:
            (etype, size) = self.readSetBegin()
            for i in range(size):
                self.skip(etype)
            self.readSetEnd()
        elif ttype == TType.LIST:
            (etype, size) = self.readListBegin()
            for i in range(size):
                self.skip(etype)
            self.readListEnd()

    # tuple of: ( 'reader method' name, is_container bool, 'writer_method' name ) 
开发者ID:Aditmadzs,项目名称:Protect4,代码行数:46,代码来源:TProtocol.py

示例14: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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.STRING:
                    self.key = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I32:
                    self.vType = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.vStr = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.DOUBLE:
                    self.vDouble = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.BOOL:
                    self.vBool = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.I64:
                    self.vLong = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.STRING:
                    self.vBinary = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
开发者ID:open-telemetry,项目名称:opentelemetry-python,代码行数:50,代码来源:ttypes.py

示例15: read

# 需要导入模块: from thrift.Thrift import TType [as 别名]
# 或者: from thrift.Thrift.TType import DOUBLE [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.STRING:
          self.key = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.vType = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.vStr = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.vDouble = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.BOOL:
          self.vBool = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.vLong = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.vBinary = iprot.readString()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd() 
开发者ID:jaegertracing,项目名称:jaeger-client-python,代码行数:50,代码来源:ttypes.py


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