diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2010-01-04 05:36:34 +0100 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2010-01-04 05:36:34 +0100 |
commit | 836dea135b73c2b0e802888702c6b67c86f2bea4 (patch) | |
tree | 2dde4565291ae18112053c66210beb936a9ac2d1 /layman/overlays/overlay.py | |
parent | Make Overlay derive from object so we can use super() in subclasses (diff) | |
download | overlord-836dea135b73c2b0e802888702c6b67c86f2bea4.tar.gz overlord-836dea135b73c2b0e802888702c6b67c86f2bea4.tar.bz2 overlord-836dea135b73c2b0e802888702c6b67c86f2bea4.zip |
Introduce equality and inequality tests
Diffstat (limited to 'layman/overlays/overlay.py')
-rw-r--r-- | layman/overlays/overlay.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py index 8e1abc2..aa20f9d 100644 --- a/layman/overlays/overlay.py +++ b/layman/overlays/overlay.py @@ -147,6 +147,16 @@ class Overlay(object): else: self.homepage = None + def __eq__(self, other): + for i in ('description', 'homepage', 'name', 'owner_email', + 'owner_name', 'priority', 'src', 'status'): + if getattr(self, i) != getattr(other, i): + return False + return True + + def __ne__(self, other): + return not self.__eq__(other) + def set_priority(self, priority): '''Set the priority of this overlay.''' |