aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-01-25 19:26:28 +0000
committerMichael Williamson <mike@zwobble.org>2015-01-25 19:26:28 +0000
commite608ba59caaabeb42a411a0009c75c17e0bbc6df (patch)
tree52ae5db36b7d842916b47deb5d074c42e83a7831 /mammoth
parent9305c48086f4c92b1c1f0096a8e1f947ece46d9d (diff)
Remove Python version switching and use consistent attribute order
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/html_generation.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/mammoth/html_generation.py b/mammoth/html_generation.py
index f31b2d3..13b0fc6 100644
--- a/mammoth/html_generation.py
+++ b/mammoth/html_generation.py
@@ -1,7 +1,6 @@
from __future__ import unicode_literals
import cgi
-import sys
class HtmlGenerator(object):
@@ -72,8 +71,8 @@ def _generate_attribute_string(attributes):
return ""
else:
return "".join(
- ' {0}="{1}"'.format(key, _escape_html(value))
- for key, value in _iteritems(attributes)
+ ' {0}="{1}"'.format(key, _escape_html(attributes[key]))
+ for key in sorted(attributes)
)
@@ -107,11 +106,3 @@ def _is_element_match(generated_element, path_element):
def _generate_class_attribute(path_element):
return " ".join(path_element.class_names)
-
-
-if sys.version_info[0] == 2:
- _iteritems = lambda x: x.iteritems()
-
-else:
- _iteritems = lambda x: x.items()
-