record.py 文件源码

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

项目:bitpay-brick 作者: javgh 项目源码 文件源码
def __init__(self, record_type=None, record_name=None, data=None):
        self._message_begin = self._message_end = False
        self._type = self._name = self._data = ''
        if not (record_type is None and record_name is None):
            self.type = record_type if record_type is not None else 'unknown'
            if record_name is not None:
                self.name = record_name
            if data is not None:
                self.data = data
        elif data is not None:
            if isinstance(data, (bytearray, str)):
                data = io.BytesIO(data)
            if isinstance(data, io.IOBase):
                self._read(data)
            else:
                raise TypeError("invalid data argument type")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号