summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-05-10 16:13:50 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 08:24:04 +0100
commit314541f60041adff40be32fdfa3f426133c657ca (patch)
treea59c265b4798d3449e7326f594b14a4465e91fcd
parent96ce54315056ddba15b67d943a3778181b765bce (diff)
downloadpoky-314541f60041adff40be32fdfa3f426133c657ca.tar.gz
poky-314541f60041adff40be32fdfa3f426133c657ca.tar.bz2
poky-314541f60041adff40be32fdfa3f426133c657ca.zip
bitbake: toaster: use items and range instead of old APIs
Used items() and range() APIs instead of iteritems() and xrange() as latter don't exist in python 3 [YOCTO #9584] (Bitbake rev: 372dd3abcb201bd9ac2c3189c5505d3578ce0dd0) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/contrib/tts/config.py2
-rw-r--r--bitbake/lib/toaster/orm/models.py2
-rw-r--r--bitbake/lib/toaster/toastergui/tablefilter.py2
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py2
-rw-r--r--bitbake/lib/toaster/toastergui/widgets.py4
5 files changed, 6 insertions, 6 deletions
diff --git a/bitbake/lib/toaster/contrib/tts/config.py b/bitbake/lib/toaster/contrib/tts/config.py
index 40d45f3b7a..87b427cc3d 100644
--- a/bitbake/lib/toaster/contrib/tts/config.py
+++ b/bitbake/lib/toaster/contrib/tts/config.py
@@ -74,7 +74,7 @@ BACKLOGFILE = os.path.join(os.path.dirname(__file__), "backlog.txt")
# task states
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
- reverse = dict((value, key) for key, value in enums.iteritems())
+ reverse = dict((value, key) for key, value in enums.items())
enums['reverse_mapping'] = reverse
return type('Enum', (), enums)
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 58dc753aef..ee01a46250 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -103,7 +103,7 @@ class GitURLValidator(validators.URLValidator):
def GitURLField(**kwargs):
r = models.URLField(**kwargs)
- for i in xrange(len(r.validators)):
+ for i in range(len(r.validators)):
if isinstance(r.validators[i], validators.URLValidator):
r.validators[i] = GitURLValidator()
return r
diff --git a/bitbake/lib/toaster/toastergui/tablefilter.py b/bitbake/lib/toaster/toastergui/tablefilter.py
index 9d15bcff0d..65454e140d 100644
--- a/bitbake/lib/toaster/toastergui/tablefilter.py
+++ b/bitbake/lib/toaster/toastergui/tablefilter.py
@@ -286,7 +286,7 @@ class TableFilterMap(object):
def to_json(self, queryset):
data = {}
- for filter_name, table_filter in self.__filters.iteritems():
+ for filter_name, table_filter in self.__filters.items():
data[filter_name] = table_filter.to_json()
return data
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 22d1a0ce6a..b256db7b44 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2279,7 +2279,7 @@ if True:
# Strip trailing/leading whitespace from all values
# put into a new dict because POST one is immutable
post_data = dict()
- for key,val in request.POST.iteritems():
+ for key,val in request.POST.items():
post_data[key] = val.strip()
diff --git a/bitbake/lib/toaster/toastergui/widgets.py b/bitbake/lib/toaster/toastergui/widgets.py
index 0f972d940e..19850fbcf4 100644
--- a/bitbake/lib/toaster/toastergui/widgets.py
+++ b/bitbake/lib/toaster/toastergui/widgets.py
@@ -278,12 +278,12 @@ class ToasterTable(TemplateView):
# Make a unique cache name
cache_name = self.__class__.__name__
- for key, val in request.GET.iteritems():
+ for key, val in request.GET.items():
if key == 'nocache':
continue
cache_name = cache_name + str(key) + str(val)
- for key, val in kwargs.iteritems():
+ for key, val in kwargs.items():
cache_name = cache_name + str(key) + str(val)
# No special chars allowed in the cache name apart from dash