1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-16 02:53:33 +02:00

Removed iteritems and itervalues, which are redundant

This commit is contained in:
2020-04-21 18:20:08 +02:00
parent 9e076e0af4
commit 3234e4de27
82 changed files with 382 additions and 457 deletions

View File

@@ -37,7 +37,6 @@ from ebook_converter.ebooks.lrf.pylrs.pylrs import (
RuledLine, Span, Sub, Sup, TextBlock
)
from ebook_converter.ptempfile import PersistentTemporaryFile
from ebook_converter.polyglot.builtins import itervalues
from ebook_converter.polyglot.urllib import unquote
from PIL import Image as PILImage
@@ -1774,7 +1773,7 @@ class HTMLConverter(object):
self.book.renderLrs(path) if lrs else self.book.renderLrf(path)
def cleanup(self):
for _file in chain(itervalues(self.scaled_images), itervalues(self.rotated_images)):
for _file in chain(self.scaled_images.values(), self.rotated_images.values()):
_file.__del__()

View File

@@ -9,7 +9,6 @@ import codecs
import os
from .pylrfopt import tagListOptimizer
from ebook_converter.polyglot.builtins import iteritems
PYLRF_VERSION = "1.0"
@@ -525,7 +524,7 @@ class LrfObject(object):
# belongs somewhere, so here it is.
#
composites = {}
for name, value in iteritems(tagDict):
for name, value in tagDict.items():
if name == 'rubyAlignAndAdjust':
continue
if name in {

View File

@@ -51,7 +51,7 @@ DEFAULT_GENREADING = "fs" # default is yes to both lrf and lrs
from ebook_converter import __appname__, __version__
from ebook_converter import entity_to_unicode
from ebook_converter.polyglot.builtins import iteritems, native_string_type
from ebook_converter.polyglot.builtins import native_string_type
class LrsError(Exception):
@@ -1835,7 +1835,7 @@ class Span(LrsSimpleChar1, LrsContainer):
oldTextStyle = self.findCurrentTextStyle()
# set the attributes we want changed
for (name, value) in tuple(iteritems(self.attrs)):
for name, value in tuple(self.attrs.items()):
if name in oldTextStyle.attrs and oldTextStyle.attrs[name] == self.attrs[name]:
self.attrs.pop(name)
else: