From 17ca883c7cc4bbf62137a83cf7728a4e32c92029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 22 May 2017 03:10:34 +0200 Subject: [PATCH] features: add vm.features.items() function Make it behave more like a dict. --- qubesadmin/features.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qubesadmin/features.py b/qubesadmin/features.py index 0eeef74..54d6437 100644 --- a/qubesadmin/features.py +++ b/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):