X-Git-Url: http://average.org/gitweb/?a=blobdiff_plain;f=gps303%2Fzmsg.py;h=211011392a296f200cc6cbce99188ceda20c1f44;hb=9d43b364c397f1f50bd8620e487cbc8fc7189f20;hp=56392007f1ff74ecd61cf59b8a95b1b9c2c06c48;hpb=faa0b11a46a7ff8797640433afdb1bfd11bce611;p=loctrkd.git diff --git a/gps303/zmsg.py b/gps303/zmsg.py index 5639200..2110113 100644 --- a/gps303/zmsg.py +++ b/gps303/zmsg.py @@ -58,15 +58,20 @@ class _Zmsg: ), ) + def __eq__(self, other): + return all( + [getattr(self, k) == getattr(other, k) for k, _ in self.KWARGS] + ) + def decode(self, buffer): - raise RuntimeError( - self.__class__.__name__ + "must implement `encode()` method" + raise NotImplementedError( + self.__class__.__name__ + "must implement `decode()` method" ) @property def packed(self): - raise RuntimeError( - self.__class__.__name__ + "must implement `encode()` method" + raise NotImplementedError( + self.__class__.__name__ + "must implement `packed()` property" )