mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -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
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue