StreamHandler.py 文件源码

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

项目:packet_analysis 作者: tanjiti 项目源码 文件源码
def __parse_data(self, proto_parse_class, data, file_hd):
        """

        Args:
            proto_parse_class:
            data:
            file_hd:

        Returns:

        """

        proto_parse_ob = proto_parse_class(data)
        data_yield = proto_parse_ob.parse_data(sep="\x00")
        for d in data_yield:
            if d:
                if file_hd:
                    file_hd.write("%r%s" % (d, os.linesep))
                if self.std_output_enable:
                    if not isinstance(d, dict):
                        d = d.toDict()
                    print json.dumps(d, indent=4)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号