From 285d73e5a6bcd0dbc8a7353f704585eff3fdc9a8 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 25 Sep 2016 15:44:07 +0200 Subject: [PATCH] Fix statistics out put for "Number of comments removed" --- scour/scour.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scour/scour.py b/scour/scour.py index 00d8c7b..7a93fb8 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -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):