quebs: make Label() and storage.Pool() objects hashable
This commit is contained in:
parent
59426b2dbc
commit
f324d30d4e
@ -110,6 +110,9 @@ class Label(object):
|
|||||||
return self.name == other.name
|
return self.name == other.name
|
||||||
return NotImplemented
|
return NotImplemented
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
return hash(self.name)
|
||||||
|
|
||||||
@builtins.property
|
@builtins.property
|
||||||
def icon_path(self):
|
def icon_path(self):
|
||||||
'''Icon path
|
'''Icon path
|
||||||
|
@ -519,6 +519,9 @@ class Pool(object):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
return hash(self.name)
|
||||||
|
|
||||||
def __xml__(self):
|
def __xml__(self):
|
||||||
config = _sanitize_config(self.config)
|
config = _sanitize_config(self.config)
|
||||||
return lxml.etree.Element('pool', **config)
|
return lxml.etree.Element('pool', **config)
|
||||||
|
Loading…
Reference in New Issue
Block a user