summaryrefslogtreecommitdiff
path: root/urwid
diff options
context:
space:
mode:
authorIan Ward <ian@excess.org>2015-01-04 09:23:21 -0500
committerIan Ward <ian@excess.org>2015-01-04 09:23:21 -0500
commita02060ceeb5da89099c280a6a35030f4da2073f1 (patch)
tree7b2c73cdb0b6b4ffeb462952bbae8d566f1f6ace /urwid
parent5cc77824e2dec3284825e0b4e9870e6171ed98ab (diff)
parentd4dde8aeae644f6205cc65ff777ecd34cb27dc41 (diff)
downloadurwid-a02060ceeb5da89099c280a6a35030f4da2073f1.tar.gz
Merge pull request #91 from rndusr/master
Add equality operators to AttrSpec
Diffstat (limited to 'urwid')
-rwxr-xr-xurwid/display_common.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/urwid/display_common.py b/urwid/display_common.py
index c3b9c5d..9a5646f 100755
--- a/urwid/display_common.py
+++ b/urwid/display_common.py
@@ -646,6 +646,13 @@ class AttrSpec(object):
else:
return vals + _COLOR_VALUES_256[self.background_number]
+ def __eq__(self, other):
+ return isinstance(other, AttrSpec) and self._value == other._value
+
+ def __ne__(self, other):
+ return not self == other
+
+ __hash__ = object.__hash__
class RealTerminal(object):