1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-21 21:51:32 +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
+3 -4
View File
@@ -3,7 +3,6 @@ import re
from lxml.etree import XPath as X
from ebook_converter.utils.filenames import ascii_text
from ebook_converter.polyglot.builtins import iteritems
__license__ = 'GPL v3'
@@ -29,7 +28,7 @@ TRANSITIONAL_NAMES = {
STRICT_NAMES = {
k:v.replace('http://schemas.openxmlformats.org/officeDocument/2006', 'http://purl.oclc.org/ooxml/officeDocument')
for k, v in iteritems(TRANSITIONAL_NAMES)
for k, v in TRANSITIONAL_NAMES.items()
}
TRANSITIONAL_NAMESPACES = {
@@ -69,7 +68,7 @@ STRICT_NAMESPACES = {
'http://schemas.openxmlformats.org/officeDocument/2006', 'http://purl.oclc.org/ooxml/officeDocument').replace(
'http://schemas.openxmlformats.org/wordprocessingml/2006', 'http://purl.oclc.org/ooxml/wordprocessingml').replace(
'http://schemas.openxmlformats.org/drawingml/2006', 'http://purl.oclc.org/ooxml/drawingml')
for k, v in iteritems(TRANSITIONAL_NAMESPACES)
for k, v in TRANSITIONAL_NAMESPACES.items()
}
# }}}
@@ -135,7 +134,7 @@ class DOCXNamespace(object):
return self.XPath('|'.join('descendant::%s' % a for a in args))(elem)
def makeelement(self, root, tag, append=True, **attrs):
ans = root.makeelement(self.expand(tag), **{self.expand(k, sep='_'):v for k, v in iteritems(attrs)})
ans = root.makeelement(self.expand(tag), **{self.expand(k, sep='_'):v for k, v in attrs.items()})
if append:
root.append(ans)
return ans