From 5f5c8a431dc4b64801da1930394d02a717abccec Mon Sep 17 00:00:00 2001 From: JSCHILL1 Date: Sun, 9 Aug 2009 15:04:50 -0500 Subject: [PATCH] Fix Bug 411062: typo of 'true'. Modify unit test to cover exercising the code. Update testscour.py for new indent_type option. --- scour.py | 5 +++-- testscour.py | 2 ++ unittests/redundant-svg-namespace.svg | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scour.py b/scour.py index 72b4e85..a43fae9 100755 --- a/scour.py +++ b/scour.py @@ -30,7 +30,8 @@ # * Collapse all group based transformations # Even more ideas here: http://esw.w3.org/topic/SvgTidy -# * analysis of path elements to see if rect can be used instead? +# * analysis of path elements to see if rect can be used instead? (must also need to look +# at rounded corners) # * removal of unused attributes in groups: # # @@ -1866,7 +1867,7 @@ def remapNamespacePrefix(node, oldprefix, newprefix): # clone and add all the child nodes for child in node.childNodes: - newNode.appendChild(child.cloneNode(true)) + newNode.appendChild(child.cloneNode(True)) # replace old node with new node node = parent.replaceChild( newNode, node ) diff --git a/testscour.py b/testscour.py index ec0a22f..7ffc315 100755 --- a/testscour.py +++ b/testscour.py @@ -46,6 +46,7 @@ class ScourOptions: embed_rasters = True keep_editor_data = False strip_xml_prolog = False + indent_type = "space" class NoInkscapeElements(unittest.TestCase): def runTest(self): @@ -754,6 +755,7 @@ class RemoveRedundantSvgNamespacePrefix(unittest.TestCase): self.assertEquals( r.tagName, 'rect', 'Redundant svg: prefix not removed') + class RemoveDefaultGradX1Value(unittest.TestCase): def runTest(self): g = scour.scourXmlFile('unittests/gradient-default-attrs.svg').getElementsByTagNameNS(SVGNS, 'linearGradient')[0] diff --git a/unittests/redundant-svg-namespace.svg b/unittests/redundant-svg-namespace.svg index f3fc7bb..66eb773 100644 --- a/unittests/redundant-svg-namespace.svg +++ b/unittests/redundant-svg-namespace.svg @@ -1,6 +1,8 @@ - + + Test + \ No newline at end of file