From d9e3e2436b0792bef28ca10ce63d59aabd7e86da Mon Sep 17 00:00:00 2001 From: JSCHILL1 Date: Thu, 13 Aug 2009 08:18:49 -0500 Subject: [PATCH] Remove unused attributes from parent elements --- package.sh | 2 +- release-notes.html | 15 +++- scour.py | 83 ++++++++++++++----- testscour.py | 29 +++++-- .../move-common-attributes-to-grandparent.svg | 10 +++ .../remove-unused-attributes-on-parent.svg | 8 ++ unittests/scour-lengths.svg | 2 +- 7 files changed, 121 insertions(+), 28 deletions(-) create mode 100644 unittests/move-common-attributes-to-grandparent.svg create mode 100644 unittests/remove-unused-attributes-on-parent.svg diff --git a/package.sh b/package.sh index 1e374e6..ee0d0c6 100755 --- a/package.sh +++ b/package.sh @@ -1,5 +1,5 @@ #!/bin/bash -SCOURVER="0.19" +SCOURVER="0.20" cd .. zip scour/tarballs/scour-$SCOURVER.zip scour/scour.py scour/svg_regex.py scour/LICENSE scour/NOTICE scour/README.txt scour/release-notes.html cd scour diff --git a/release-notes.html b/release-notes.html index 6ecb28d..0b22608 100644 --- a/release-notes.html +++ b/release-notes.html @@ -9,14 +9,27 @@

Copyright 2009, Jeff Schiller

+
+
+

Version 0.20

+
+

Aug ??th, 2009

+ +
+

Version 0.19

-

Aug 9th, 2009

+

Aug 13th, 2009

diff --git a/scour.py b/scour.py index 091249d..74d351a 100755 --- a/scour.py +++ b/scour.py @@ -32,19 +32,9 @@ # Even more ideas here: http://esw.w3.org/topic/SvgTidy # * 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: -# -# -# -# -# -# in this case, fill="blue" should be removed # Next Up: -# + analyze all children of a group, if they have common inheritable attributes, then move them to the group -# - crunch *opacity, offset, svg:x,y, stroke-miterlimit, stroke-width numbers (remove trailing zeros, reduce prec, integerize) -# - analyze a group and its children, if a group's attribute is not being used by any children -# (or descendants?) then remove it +# + remove unused attributes in parent elements # - add an option to remove ids if they match the Inkscape-style of IDs # - investigate point-reducing algorithms # - parse transform attribute @@ -52,7 +42,6 @@ # - option to remove metadata # - prevent elements from being stripped if they are referenced in a