ttypes.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:wpw-sdk-python 作者: WPTechInnovation 项目源码 文件源码
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('ServiceDetails')
        if self.serviceId is not None:
            oprot.writeFieldBegin('serviceId', TType.I32, 1)
            oprot.writeI32(self.serviceId)
            oprot.writeFieldEnd()
        if self.serviceDescription is not None:
            oprot.writeFieldBegin('serviceDescription', TType.STRING, 2)
            oprot.writeString(self.serviceDescription.encode('utf-8') if sys.version_info[0] == 2 else self.serviceDescription)
            oprot.writeFieldEnd()
        if self.serviceName is not None:
            oprot.writeFieldBegin('serviceName', TType.STRING, 3)
            oprot.writeString(self.serviceName.encode('utf-8') if sys.version_info[0] == 2 else self.serviceName)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号