Fix statistics out put for "Number of comments removed"
This commit is contained in:
parent
2fe7152a1e
commit
285d73e5a6
1 changed files with 5 additions and 1 deletions
|
|
@ -2928,13 +2928,17 @@ def removeComments(element):
|
|||
Removes comments from the element and its children.
|
||||
"""
|
||||
global _num_bytes_saved_in_comments
|
||||
num = 0
|
||||
|
||||
if isinstance(element, xml.dom.minidom.Comment):
|
||||
_num_bytes_saved_in_comments += len(element.data)
|
||||
element.parentNode.removeChild(element)
|
||||
num += 1
|
||||
else:
|
||||
for subelement in element.childNodes[:]:
|
||||
removeComments(subelement)
|
||||
num += removeComments(subelement)
|
||||
|
||||
return num
|
||||
|
||||
|
||||
def embedRasters(element, options):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue