]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: use items and range instead of old APIs
authorEd Bartosh <ed.bartosh@linux.intel.com>
Tue, 10 May 2016 13:13:50 +0000 (16:13 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 1 Jun 2016 14:28:23 +0000 (15:28 +0100)
Used items() and range() APIs instead of iteritems() and
xrange() as latter don't exist in python 3

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/toaster/contrib/tts/config.py
lib/toaster/orm/models.py
lib/toaster/toastergui/tablefilter.py
lib/toaster/toastergui/views.py
lib/toaster/toastergui/widgets.py

index 40d45f3b7a920a2f21e77a9481942ee7a3e0d19e..87b427cc3dffa7a63340a5913f0ac48a6fffaa6f 100644 (file)
@@ -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)
 
index 58dc753aef714b85f34fdb167b5d1bb056e9c1aa..ee01a46250a9bd1096447cb13a9b918a15cb0730 100644 (file)
@@ -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
index 9d15bcff0d2f57ebe7501679c174b8b8cccb4788..65454e140d2d4a0908ee892b9322a97b7ac5c251 100644 (file)
@@ -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
index 22d1a0ce6a47d4d3b7fc190cd18a3b1adf85be48..b256db7b444adb79e1ab167ac00e0fc2f5fd3430 100755 (executable)
@@ -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()
 
 
index 0f972d940e092aefae664fa36df354d8ed1d4fda..19850fbcf49246db04ec487c5b967c6f7da3a970 100644 (file)
@@ -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