mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-14 01:02:55 -07:00
Use six.iteritems helper
* Standardizes dict.iteritems between Python 2 and Python 3
This commit is contained in:
parent
d4e5809a29
commit
abf63d6bbe
3 changed files with 11 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue