projects
/
tools
/
python-jenkinsapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54d1a70
)
Put dict to use
author
Hugh Brown
<hbrown@amplify.com>
Thu, 10 Oct 2013 22:26:55 +0000
(18:26 -0400)
committer
Hugh Brown
<hbrown@amplify.com>
Thu, 10 Oct 2013 23:29:03 +0000
(19:29 -0400)
jenkinsapi/queue.py
patch
|
blob
|
history
diff --git
a/jenkinsapi/queue.py
b/jenkinsapi/queue.py
index
5c5b506
..
b14ec51
100644
(file)
--- a/
jenkinsapi/queue.py
+++ b/
jenkinsapi/queue.py
@@
-43,10
+43,11
@@
class Queue(JenkinsBase):
return len(self._data['items'])
def __getitem__(self, item_id):
- for id, item in self.iteritems():
- if id == item_id:
- return item
- raise UnknownQueueItem(item_id)
+ self_as_dict = dict(self.iteritems())
+ if item_id in self_as_dict:
+ return self_as_dict[item_id]
+ else:
+ raise UnknownQueueItem(item_id)
def get_queue_items_for_job(self, job_name):
if not job_name: