def represent_data(self, data):
"""
This is very hackish. There is for sure a better way either by using
the add_multi_representer or add_representer, the issue though lies in
the fact that Scapy packets are metaclasses that leads to
yaml.representer.get_classobj_bases to not be able to properly get the
base of class of a Scapy packet.
XXX fully debug this problem
"""
if isinstance(data, Packet):
data = createPacketReport(data)
return SafeRepresenter.represent_data(self, data)
评论列表
文章目录