Fix statistics out put for "Number of comments removed"

This commit is contained in:
Eduard Braun 2016-09-25 15:44:07 +02:00
parent 2fe7152a1e
commit 285d73e5a6

View file

@ -2928,13 +2928,17 @@ def removeComments(element):
Removes comments from the element and its children. Removes comments from the element and its children.
""" """
global _num_bytes_saved_in_comments global _num_bytes_saved_in_comments
num = 0
if isinstance(element, xml.dom.minidom.Comment): if isinstance(element, xml.dom.minidom.Comment):
_num_bytes_saved_in_comments += len(element.data) _num_bytes_saved_in_comments += len(element.data)
element.parentNode.removeChild(element) element.parentNode.removeChild(element)
num += 1
else: else:
for subelement in element.childNodes[:]: for subelement in element.childNodes[:]:
removeComments(subelement) num += removeComments(subelement)
return num
def embedRasters(element, options): def embedRasters(element, options):