summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster
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 /bitbake/lib/toaster
parent96ce54315056ddba15b67d943a3778181b765bce (diff)
downloadpoky-314541f60041adff40be32fdfa3f426133c657ca.tar.gz
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>
Diffstat (limited to 'bitbake/lib/toaster')
-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")
74# task states 74# task states
75def enum(*sequential, **named): 75def enum(*sequential, **named):
76 enums = dict(zip(sequential, range(len(sequential))), **named) 76 enums = dict(zip(sequential, range(len(sequential))), **named)
77 reverse = dict((value, key) for key, value in enums.iteritems()) 77 reverse = dict((value, key) for key, value in enums.items())
78 enums['reverse_mapping'] = reverse 78 enums['reverse_mapping'] = reverse
79 return type('Enum', (), enums) 79 return type('Enum', (), enums)
80 80
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):
103 103
104def GitURLField(**kwargs): 104def GitURLField(**kwargs):
105 r = models.URLField(**kwargs) 105 r = models.URLField(**kwargs)
106 for i in xrange(len(r.validators)): 106 for i in range(len(r.validators)):
107 if isinstance(r.validators[i], validators.URLValidator): 107 if isinstance(r.validators[i], validators.URLValidator):
108 r.validators[i] = GitURLValidator() 108 r.validators[i] = GitURLValidator()
109 return r 109 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):
286 def to_json(self, queryset): 286 def to_json(self, queryset):
287 data = {} 287 data = {}
288 288
289 for filter_name, table_filter in self.__filters.iteritems(): 289 for filter_name, table_filter in self.__filters.items():
290 data[filter_name] = table_filter.to_json() 290 data[filter_name] = table_filter.to_json()
291 291
292 return data 292 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:
2279 # Strip trailing/leading whitespace from all values 2279 # Strip trailing/leading whitespace from all values
2280 # put into a new dict because POST one is immutable 2280 # put into a new dict because POST one is immutable
2281 post_data = dict() 2281 post_data = dict()
2282 for key,val in request.POST.iteritems(): 2282 for key,val in request.POST.items():
2283 post_data[key] = val.strip() 2283 post_data[key] = val.strip()
2284 2284
2285 2285
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):
278 # Make a unique cache name 278 # Make a unique cache name
279 cache_name = self.__class__.__name__ 279 cache_name = self.__class__.__name__
280 280
281 for key, val in request.GET.iteritems(): 281 for key, val in request.GET.items():
282 if key == 'nocache': 282 if key == 'nocache':
283 continue 283 continue
284 cache_name = cache_name + str(key) + str(val) 284 cache_name = cache_name + str(key) + str(val)
285 285
286 for key, val in kwargs.iteritems(): 286 for key, val in kwargs.items():
287 cache_name = cache_name + str(key) + str(val) 287 cache_name = cache_name + str(key) + str(val)
288 288
289 # No special chars allowed in the cache name apart from dash 289 # No special chars allowed in the cache name apart from dash