summaryrefslogtreecommitdiffstats
path: root/layman/overlays/overlay.py
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2010-01-04 05:36:34 +0100
committerSebastian Pipping <sebastian@pipping.org>2010-01-04 05:36:34 +0100
commit836dea135b73c2b0e802888702c6b67c86f2bea4 (patch)
tree2dde4565291ae18112053c66210beb936a9ac2d1 /layman/overlays/overlay.py
parent4cfd62c88c855c90f56db1a60ef2e438b13ca3d6 (diff)
downloadlayman-836dea135b73c2b0e802888702c6b67c86f2bea4.tar.gz
layman-836dea135b73c2b0e802888702c6b67c86f2bea4.tar.bz2
layman-836dea135b73c2b0e802888702c6b67c86f2bea4.zip
Introduce equality and inequality tests
Diffstat (limited to 'layman/overlays/overlay.py')
-rw-r--r--layman/overlays/overlay.py10
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.'''