summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
diff options
context:
space:
mode:
authorShane Wang <shane.wang@intel.com>2012-03-16 13:40:41 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-20 15:21:33 +0000
commit9ecdbc377c6ab6848afb0a378c5804918951f6b7 (patch)
tree6a399868e8e832298e94bd8a03eaf0b7728b7950 /bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
parentdab638e150fb2af56f54f0752383965b016f4960 (diff)
downloadpoky-9ecdbc377c6ab6848afb0a378c5804918951f6b7.tar.gz
Hob: change the code style to enumerate a list in a for-loop
We use the more common style to enumerate a list in a for-loop (http://docs.python.org/library/functions.html#enumerate), that is: try to use for item in mylist, and try to use for i, item in enumerate(list) rather than for i in range(len(mylist)) (From Poky rev: 33c21bc60bd1542f81d33c328f116dec424728cd) (Bitbake rev: 9b168239a5d9693573438eb6514938b81de85af3) Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/recipeselectionpage.py')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/recipeselectionpage.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
index db873b611a..6dd7c1e473 100755
--- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -127,16 +127,16 @@ class RecipeSelectionPage (HobPage):
127 self.ins = HobNotebook() 127 self.ins = HobNotebook()
128 self.tables = [] # we need modify table when the dialog is shown 128 self.tables = [] # we need modify table when the dialog is shown
129 # append the tabs in order 129 # append the tabs in order
130 for i in range(len(self.pages)): 130 for page in self.pages:
131 columns = self.pages[i]['columns'] 131 columns = page['columns']
132 tab = HobViewTable(columns) 132 tab = HobViewTable(columns)
133 filter = self.pages[i]['filter'] 133 filter = page['filter']
134 tab.set_model(self.recipe_model.tree_model(filter)) 134 tab.set_model(self.recipe_model.tree_model(filter))
135 tab.connect("toggled", self.table_toggled_cb) 135 tab.connect("toggled", self.table_toggled_cb)
136 if self.pages[i]['name'] == "Included": 136 if page['name'] == "Included":
137 tab.connect("row-activated", self.tree_row_activated_cb) 137 tab.connect("row-activated", self.tree_row_activated_cb)
138 138
139 label = gtk.Label(self.pages[i]['name']) 139 label = gtk.Label(page['name'])
140 self.ins.append_page(tab, label) 140 self.ins.append_page(tab, label)
141 self.tables.append(tab) 141 self.tables.append(tab)
142 142