Explorar o código

features: add vm.features.items() function

Make it behave more like a dict.
Marek Marczykowski-Górecki %!s(int64=7) %!d(string=hai) anos
pai
achega
17ca883c7c
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      qubesadmin/features.py

+ 5 - 0
qubesadmin/features.py

@@ -60,6 +60,11 @@ class Features(object):
 
     keys = __iter__
 
+    def items(self):
+        '''Return iterable of pairs (feature, value)'''
+        for key in self:
+            yield key, self[key]
+
     _NO_DEFAULT = object()
 
     def check_with_template(self, feature, default=_NO_DEFAULT):