diff --git a/core/nzbToMediaAutoFork.py b/core/nzbToMediaAutoFork.py index cfb4e60c..ce1949c5 100644 --- a/core/nzbToMediaAutoFork.py +++ b/core/nzbToMediaAutoFork.py @@ -2,6 +2,8 @@ import requests +from six import iteritems + import core from core import logger @@ -89,7 +91,7 @@ def autoFork(section, inputCategory): rem_params.append(param) for param in rem_params: params.pop(param) - for fork in sorted(core.FORKS.iteritems(), reverse=False): + for fork in sorted(iteritems(core.FORKS), reverse=False): if params == fork[1]: detected = True break diff --git a/core/nzbToMediaConfig.py b/core/nzbToMediaConfig.py index 75d8ad19..bb1202ce 100644 --- a/core/nzbToMediaConfig.py +++ b/core/nzbToMediaConfig.py @@ -1,4 +1,6 @@ # coding=utf-8 + +from six import iteritems import os import shutil import copy @@ -150,7 +152,7 @@ class ConfigObj(configobj.ConfigObj, Section): continue def cleanup_values(values, section): - for option, value in values.iteritems(): + for option, value in iteritems(values): if section in ['CouchPotato']: if option == ['outputDirectory']: CFG_NEW['Torrent'][option] = os.path.split(os.path.normpath(value))[0] @@ -227,7 +229,7 @@ class ConfigObj(configobj.ConfigObj, Section): subsection = None if section in list(chain.from_iterable(subsections.values())): subsection = section - section = ''.join([k for k, v in subsections.iteritems() if subsection in v]) + section = ''.join([k for k, v in iteritems(subsections) if subsection in v]) process_section(section, subsection) elif section in subsections.keys(): subsection = subsections[section] diff --git a/core/transcoder/transcoder.py b/core/transcoder/transcoder.py index 9065c78a..730ce77e 100644 --- a/core/transcoder/transcoder.py +++ b/core/transcoder/transcoder.py @@ -1,4 +1,6 @@ # coding=utf-8 + +from six import iteritems import errno import os import platform @@ -128,7 +130,7 @@ def buildCommands(file, newDir, movieName, bitbucket): if ext == core.VEXTENSION and newDir == dir: # we need to change the name to prevent overwriting itself. core.VEXTENSION = '-transcoded' + core.VEXTENSION # adds '-transcoded.ext' else: - img, data = file.iteritems().next() + img, data = iteritems(file).next() name = data['name'] video_details, result = getVideoDetails(data['files'][0], img, bitbucket) inputFile = '-' @@ -774,7 +776,7 @@ def Transcode_directory(dirName): if isinstance(file, str): proc = subprocess.Popen(command, stdout=bitbucket, stderr=bitbucket) else: - img, data = file.iteritems().next() + img, data = iteritems(file).next() proc = subprocess.Popen(command, stdout=bitbucket, stderr=bitbucket, stdin=subprocess.PIPE) for vob in data['files']: procin = zip_out(vob, img, bitbucket)