py3: replace xrange() with range()

xrange() has been removed in Python 3.

Partial-Implements: blueprint porting-python3
Change-Id: Icdb86b98eb396e9d58fe737f8229218a15805aa9
This commit is contained in:
Victor Stinner 2015-08-19 16:34:31 -07:00
parent be746bca4e
commit b46b67eb2b
2 changed files with 3 additions and 3 deletions

View File

@ -157,8 +157,8 @@ class ConfigureLibs(workflows.Step):
def contribute(self, data, context):
chosen_libs = json.loads(data.get("lib_ids", '[]'))
for k in xrange(len(chosen_libs)):
context["lib_" + str(k)] = chosen_libs[k]
for index, library in enumerate(chosen_libs):
context["lib_%s" % index] = library
return context

View File

@ -85,7 +85,7 @@ class NavigationAccordionRegion(baseregion.BaseRegion):
if not get_selected_func:
self._click_item(text, loc_craft_func)
else:
for _ in xrange(self.MAX_MENU_ITEM_CLICK_TRIES):
for _ in range(self.MAX_MENU_ITEM_CLICK_TRIES):
selected_item = get_selected_func()
if selected_item and text == selected_item.text:
break