From c02486efe4cf0c959532f92c6c7de9e37d397444 Mon Sep 17 00:00:00 2001 From: Hugh Brown Date: Thu, 10 Oct 2013 18:29:12 -0400 Subject: [PATCH] Implement methods with dict-like primitives --- jenkinsapi/queue.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jenkinsapi/queue.py b/jenkinsapi/queue.py index b14ec51..e6fda7c 100644 --- a/jenkinsapi/queue.py +++ b/jenkinsapi/queue.py @@ -33,11 +33,19 @@ class Queue(JenkinsBase): for item in self._data['items']: yield item['id'], QueueItem(self.jenkins, **item) + def iterkeys(self): + for item in self._data['items']: + yield item['id'] + + def iterivalues(self): + for item in self._data['items']: + yield QueueItem(self.jenkins, **item) + def keys(self): - return [i[0] for i in self.iteritems()] + return list(self.iterkeys()) def values(self): - return [i[1] for i in self.iteritems()] + return list(self.itervalues()) def __len__(self): return len(self._data['items']) -- 2.7.4