You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 lines
499 B

class PacketGroup:
def __init__(self, data, p = False, s = False):
self.count = data.get("count", 0)
if p:
self.type = "perNode"
setattr(self, "portnum", data["_id"].get("portnum", 0))
setattr(self, "from", data["_id"].get("from", 0))
elif s:
self.type = "perSumNode"
setattr(self, "from", data.get("_id", 0))
else:
self.type = "perPortNum"
setattr(self, "portnum", data["_id"])