features: add vm.features.items() function
Make it behave more like a dict.
This commit is contained in:
parent
c826378579
commit
17ca883c7c
@ -60,6 +60,11 @@ class Features(object):
|
|||||||
|
|
||||||
keys = __iter__
|
keys = __iter__
|
||||||
|
|
||||||
|
def items(self):
|
||||||
|
'''Return iterable of pairs (feature, value)'''
|
||||||
|
for key in self:
|
||||||
|
yield key, self[key]
|
||||||
|
|
||||||
_NO_DEFAULT = object()
|
_NO_DEFAULT = object()
|
||||||
|
|
||||||
def check_with_template(self, feature, default=_NO_DEFAULT):
|
def check_with_template(self, feature, default=_NO_DEFAULT):
|
||||||
|
Loading…
Reference in New Issue
Block a user