From 03025e7fc239b3bc95fd7a8389e155d1584c611a Mon Sep 17 00:00:00 2001 From: Roberta Date: Sun, 13 Jun 2021 12:00:36 -0500 Subject: [PATCH] use join in clean animated path And test for empty values. --- scour/scour.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scour/scour.py b/scour/scour.py index aed8b02..ea9d3f9 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -2772,11 +2772,10 @@ def clean_animated_path(element, options, stats): These are ';' delimited path data that must keep the same number of nodes, so the only cleaning is via serializePath """ oldPathStr = element.getAttribute('values') + if oldPathStr=="": + return oldPathStrs = oldPathStr.split(';') - newPathStr = "" - for oldPathStrPart in oldPathStrs: - path = svg_parser.parse(oldPathStrPart) - newPathStr += serializePath(path, options) + " ;\n" + newPathStr = ";".join(map(lambda s:serializePath(svg_parser.parse(s),options),oldPathStrs) element.setAttribute('values', newPathStr) def parseListOfPoints(s):