summaryrefslogtreecommitdiffstats
path: root/layman/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/overlay.py
parent4cfd62c88c855c90f56db1a60ef2e438b13ca3d6 (diff)
downloadlayman-836dea135b73c2b0e802888702c6b67c86f2bea4.tar.gz
layman-836dea135b73c2b0e802888702c6b67c86f2bea4.tar.bz2
layman-836dea135b73c2b0e802888702c6b67c86f2bea4.zip
Introduce equality and inequality tests
Diffstat (limited to 'layman/overlay.py')
-rw-r--r--layman/overlay.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/layman/overlay.py b/layman/overlay.py
index ae19f28..643e652 100644
--- a/layman/overlay.py
+++ b/layman/overlay.py
@@ -84,6 +84,15 @@ class Overlays:
if os.path.exists(path):
self.read_file(path)
+ def __eq__(self, other):
+ for key in set(self.overlays.keys() + other.overlays.keys()):
+ if self.overlays[key] != other.overlays[key]:
+ return False
+ return True
+
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
def read_file(self, path):
'''Read the overlay definition file.'''