quebs: make Label() and storage.Pool() objects hashable
这个提交包含在:
父节点
59426b2dbc
当前提交
f324d30d4e
@ -110,6 +110,9 @@ class Label(object):
|
||||
return self.name == other.name
|
||||
return NotImplemented
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self.name)
|
||||
|
||||
@builtins.property
|
||||
def icon_path(self):
|
||||
'''Icon path
|
||||
|
@ -519,6 +519,9 @@ class Pool(object):
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self.name)
|
||||
|
||||
def __xml__(self):
|
||||
config = _sanitize_config(self.config)
|
||||
return lxml.etree.Element('pool', **config)
|
||||
|
正在加载...
在新工单中引用
屏蔽一个用户