mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Merge pull request #408 from adam111316/feature/ChangePy2Iteritems
Change py2 iteritems to py2/3 compatible statements using six library
This commit is contained in:
commit
9a9e78deb8
6 changed files with 12 additions and 6 deletions
|
@ -35,6 +35,7 @@
|
|||
* Change py2 exception clauses to py2/3 compatible clauses
|
||||
* Change py2 print statements to py2/3 compatible functions
|
||||
* Change py2 octal literals into the new py2/3 syntax
|
||||
* Change py2 iteritems to py2/3 compatible statements using six library
|
||||
* Change Kodi notifier to use requests as opposed to urllib
|
||||
* Change to consolidate scene exceptions and name cache code
|
||||
* Change check_url function to use requests instead of httplib library
|
||||
|
|
|
@ -21,6 +21,7 @@ import re
|
|||
import sickbeard
|
||||
from sickbeard import logger
|
||||
from sickbeard.clients.generic import GenericClient
|
||||
from six import iteritems
|
||||
import urllib
|
||||
|
||||
|
||||
|
@ -36,7 +37,7 @@ class uTorrentAPI(GenericClient):
|
|||
return super(uTorrentAPI, self)._request(
|
||||
method=method,
|
||||
params='token={0:s}&{1:s}'.format(self.auth, '&'.join(
|
||||
['%s' % urllib.urlencode(dict([[key, str(value)]])) for key, value in params.iteritems()])) if any(params) else params,
|
||||
['%s' % urllib.urlencode(dict([[key, str(value)]])) for key, value in iteritems(params)])) if any(params) else params,
|
||||
files=files)
|
||||
|
||||
def _get_auth(self):
|
||||
|
|
|
@ -32,6 +32,7 @@ from sickbeard import logger
|
|||
from sickbeard import encodingKludge as ek
|
||||
from sickbeard.exceptions import ex
|
||||
from sickbeard.show_name_helpers import allPossibleShowNames
|
||||
from six import iteritems
|
||||
|
||||
from lib.tmdb_api.tmdb_api import TMDB
|
||||
|
||||
|
@ -338,7 +339,7 @@ class GenericMetadata():
|
|||
def create_season_posters(self, show_obj):
|
||||
if self.season_posters and show_obj:
|
||||
result = []
|
||||
for season, episodes in show_obj.episodes.iteritems(): # @UnusedVariable
|
||||
for season, episodes in iteritems(show_obj.episodes): # @UnusedVariable
|
||||
if not self._has_season_poster(show_obj, season):
|
||||
logger.log(u"Metadata provider " + self.name + " creating season posters for " + show_obj.name,
|
||||
logger.DEBUG)
|
||||
|
@ -349,7 +350,7 @@ class GenericMetadata():
|
|||
def create_season_banners(self, show_obj):
|
||||
if self.season_banners and show_obj:
|
||||
result = []
|
||||
for season, episodes in show_obj.episodes.iteritems(): # @UnusedVariable
|
||||
for season, episodes in iteritems(show_obj.episodes): # @UnusedVariable
|
||||
if not self._has_season_banner(show_obj, season):
|
||||
logger.log(u"Metadata provider " + self.name + " creating season banners for " + show_obj.name,
|
||||
logger.DEBUG)
|
||||
|
|
|
@ -30,6 +30,7 @@ from sickbeard import encodingKludge as ek
|
|||
from sickbeard.exceptions import ex
|
||||
|
||||
import xml.etree.cElementTree as etree
|
||||
from six import iteritems
|
||||
|
||||
|
||||
class MediaBrowserMetadata(generic.GenericMetadata):
|
||||
|
@ -536,7 +537,7 @@ class MediaBrowserMetadata(generic.GenericMetadata):
|
|||
persons_dict['Writer'] += [x.strip() for x in myEp['writer'].split('|') if x]
|
||||
|
||||
# fill in Persons section with collected directors, guest starts and writers
|
||||
for person_type, names in persons_dict.iteritems():
|
||||
for person_type, names in iteritems(persons_dict):
|
||||
# remove doubles
|
||||
names = list(set(names))
|
||||
for cur_name in names:
|
||||
|
|
|
@ -26,6 +26,7 @@ from os.path import basename, join, isfile
|
|||
import os
|
||||
import re
|
||||
import datetime
|
||||
from six import iteritems
|
||||
|
||||
# regex to parse time (12/24 hour format)
|
||||
time_regex = re.compile(r'(\d{1,2})(([:.](\d{2,2}))? ?([PA][. ]? ?M)|[:.](\d{2,2}))\b', flags=re.IGNORECASE)
|
||||
|
@ -170,7 +171,7 @@ def update_network_dict():
|
|||
|
||||
# list of sql commands to update the network_timezones table
|
||||
cl = []
|
||||
for cur_d, cur_t in d.iteritems():
|
||||
for cur_d, cur_t in iteritems(d):
|
||||
h_k = old_d.has_key(cur_d)
|
||||
if h_k and cur_t != old_d[cur_d]:
|
||||
# update old record
|
||||
|
|
|
@ -28,6 +28,7 @@ import traceback
|
|||
|
||||
from mimetypes import MimeTypes
|
||||
from Cheetah.Template import Template
|
||||
from six import iteritems
|
||||
|
||||
import sickbeard
|
||||
from sickbeard import config, sab, clients, history, notifiers, processTV, ui, logger, helpers, exceptions, classes, \
|
||||
|
@ -1219,7 +1220,7 @@ class Home(MainHandler):
|
|||
return 'No scene exceptions'
|
||||
|
||||
out = []
|
||||
for season, names in iter(sorted(exceptionsList.iteritems())):
|
||||
for season, names in iter(sorted(iteritems(exceptionsList))):
|
||||
if season == -1:
|
||||
season = '*'
|
||||
out.append('S' + str(season) + ': ' + ', '.join(names))
|
||||
|
|
Loading…
Reference in a new issue