Remove six: iteritems

This commit is contained in:
Odd Stråbø 2024-06-11 03:14:07 +00:00
parent 0e80c7cbcc
commit a00a1951cb
7 changed files with 11 additions and 15 deletions

View file

@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
##################################################################################################
from six import iteritems
from kodi_six import xbmcgui
from ..helper import translate, LazyLogger, kodi_version
@ -34,7 +33,7 @@ class LoginManual(xbmcgui.WindowXMLDialog):
def set_args(self, **kwargs):
# connect_manager, user_image, servers
for key, value in iteritems(kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
def is_logged_in(self):

View file

@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
##################################################################################################
from six import iteritems
from kodi_six import xbmc, xbmcgui
from ..helper import translate
@ -44,7 +43,7 @@ class ServerConnect(xbmcgui.WindowXMLDialog):
def set_args(self, **kwargs):
# connect_manager, user_image, servers
for key, value in iteritems(kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
def is_server_selected(self):

View file

@ -5,7 +5,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
import re
from six import iteritems
from kodi_six import xbmcgui
from ..helper import translate
@ -41,7 +40,7 @@ class ServerManual(xbmcgui.WindowXMLDialog):
def set_args(self, **kwargs):
# connect_manager, user_image, servers, jellyfin_connect
for key, value in iteritems(kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
def is_connected(self):

View file

@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
##################################################################################################
from six import iteritems
from kodi_six import xbmcgui
from ..helper import LazyLogger
@ -36,7 +35,7 @@ class UsersConnect(xbmcgui.WindowXMLDialog):
def set_args(self, **kwargs):
# connect_manager, user_image, servers
for key, value in iteritems(kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
def is_user_selected(self):

View file

@ -7,7 +7,6 @@ import json
import sys
import os
from six import iteritems
from six.moves.urllib.parse import parse_qsl, urlencode
from kodi_six import xbmc, xbmcvfs, xbmcgui, xbmcplugin, xbmcaddon
@ -1073,7 +1072,7 @@ def create_listitem(item):
li.setProperty("dbid", str(item["episodeid"]))
li.setProperty("fanart_image", item["art"].get("tvshow.fanart", ""))
for key, value in iteritems(item["streamdetails"]):
for key, value in item["streamdetails"].items():
for stream in value:
li.addStreamInfo(key, stream)

View file

@ -12,7 +12,7 @@ import unicodedata
from uuid import uuid4
from dateutil import tz, parser
from six import text_type, string_types, iteritems, ensure_text, ensure_binary
from six import text_type, string_types, ensure_text, ensure_binary
from six.moves.urllib.parse import quote_plus
from kodi_six import xbmc, xbmcaddon, xbmcgui, xbmcvfs
@ -103,11 +103,12 @@ def create_id():
def find(dict, item):
# FIXME: dead code
"""Find value in dictionary."""
if item in dict:
return dict[item]
for key, value in sorted(iteritems(dict), key=lambda kv: (kv[1], kv[0])):
for key, value in sorted(dict.items(), key=lambda kv: (kv[1], kv[0])):
if re.match(key, item, re.I):
return dict[key]

View file

@ -6,7 +6,7 @@ from __future__ import division, absolute_import, print_function, unicode_litera
import json
import os
from six import iteritems, ensure_text
from six import ensure_text
from ..helper import LazyLogger, get_filesystem_encoding
@ -54,7 +54,7 @@ class Objects(object):
mapping = self.objects[mapping_name]
for key, value in iteritems(mapping):
for key, value in mapping.items():
self.mapped_item[key] = None
params = value.split(",")
@ -151,7 +151,7 @@ class Objects(object):
result = False
for key, value in iteritems(filters):
for key, value in filters.items():
inverse = False