14 lines
350 B
Python
14 lines
350 B
Python
import time
|
|
|
|
class MsgContainer:
|
|
def __init__(self, data: bytes, name: str = "default", timestamp=time.time()):
|
|
self.timestamp : float = timestamp
|
|
self.data: bytes = data
|
|
self.name : str = name
|
|
|
|
def __str__(self):
|
|
return f"{self.timestamp}:{self.name}:{self.data}"
|
|
|
|
def __repr__(self):
|
|
return f"{self.timestamp}:{self.name}:{self.data}"
|