Commit fc741dc8 authored by Dan Pascu's avatar Dan Pascu

Added context attribute to status messages

parent 24dfd3a0
...@@ -221,14 +221,15 @@ class PacketLossLabel(QLabel): ...@@ -221,14 +221,15 @@ class PacketLossLabel(QLabel):
class Status(unicode): class Status(unicode):
def __new__(cls, value, color='black'): def __new__(cls, value, color='black', context=None):
instance = super(Status, cls).__new__(cls, value) instance = super(Status, cls).__new__(cls, value)
instance.color = color instance.color = color
instance.context = context
return instance return instance
def __eq__(self, other): def __eq__(self, other):
if isinstance(other, Status): if isinstance(other, Status):
return super(Status, self).__eq__(other) and self.color == other.color return super(Status, self).__eq__(other) and self.color == other.color and self.context == other.context
elif isinstance(other, basestring): elif isinstance(other, basestring):
return super(Status, self).__eq__(other) return super(Status, self).__eq__(other)
return NotImplemented return NotImplemented
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment