Starting on version 0.10, minor comment cleanup
This commit is contained in:
parent
9f38caabaa
commit
12ba6000ea
4 changed files with 13 additions and 39 deletions
23
README.txt
23
README.txt
|
|
@ -1,23 +0,0 @@
|
||||||
Scour
|
|
||||||
=====
|
|
||||||
|
|
||||||
Scour is a Python module that takes an input SVG and outputs a cleaner,
|
|
||||||
more concise SVG file. The goal is that authors will use this script after
|
|
||||||
editing the file in a GUI editor such as Inkscape or Adobe Illustrator.
|
|
||||||
|
|
||||||
Scour was started as a vehicle for me to learn Python. In addition, the goal
|
|
||||||
is to reduce the amount of time I spend in cleaning up files I find on sites
|
|
||||||
such as openclipart.org
|
|
||||||
|
|
||||||
Ideas are pulled from three places:
|
|
||||||
|
|
||||||
- my head
|
|
||||||
- Sam Ruby's SVG Tidy script: http://intertwingly.net/code/svgtidy/svgtidy.rb
|
|
||||||
- Inkscape's proposal for a 'cleaned SVG': http://wiki.inkscape.org/wiki/index.php/Save_Cleaned_SVG
|
|
||||||
|
|
||||||
Regards,
|
|
||||||
|
|
||||||
Jeff Schiller
|
|
||||||
2009-04-06
|
|
||||||
codedread@gmail.com
|
|
||||||
http://blog.codedread.com/
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
SCOURVER="0.09"
|
SCOURVER="0.10"
|
||||||
tar cvf scour-$SCOURVER.tar scour.py LICENSE NOTICE README.txt
|
tar cvf scour-$SCOURVER.tar scour.py LICENSE NOTICE README.txt release-notes.html
|
||||||
gzip scour-$SCOURVER.tar
|
gzip scour-$SCOURVER.tar
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,13 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<h1>Scour Release Notes</h1>
|
||||||
|
|
||||||
|
<p>Copyright 2009, Jeff Schiller</p>
|
||||||
|
|
||||||
<section id="0.09">
|
<section id="0.09">
|
||||||
<header>
|
<header>
|
||||||
<h3><a href="#0.09">Version 0.09</a></h3>
|
<h2><a href="#0.09">Version 0.09</a></h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -22,7 +26,7 @@
|
||||||
|
|
||||||
<section id="0.08">
|
<section id="0.08">
|
||||||
<header>
|
<header>
|
||||||
<h3><a href="#0.08">Version 0.08</a></h3>
|
<h2><a href="#0.08">Version 0.08</a></h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -35,7 +39,7 @@
|
||||||
|
|
||||||
<section id="0.07">
|
<section id="0.07">
|
||||||
<header>
|
<header>
|
||||||
<h3><a href="#0.07">Version 0.07</a></h3>
|
<h2><a href="#0.07">Version 0.07</a></h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -48,7 +52,7 @@
|
||||||
|
|
||||||
<section id="0.06">
|
<section id="0.06">
|
||||||
<header>
|
<header>
|
||||||
<h3><a href="#0.06">Version 0.06</a></h3>
|
<h2><a href="#0.06">Version 0.06</a></h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -60,7 +64,7 @@
|
||||||
|
|
||||||
<section id="0.05">
|
<section id="0.05">
|
||||||
<header>
|
<header>
|
||||||
<h3><a href="#0.05">Version 0.05 and earlier</a></h3>
|
<h2><a href="#0.05">Version 0.05 and earlier</a></h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
||||||
11
scour.py
11
scour.py
|
|
@ -1,7 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
# Scour
|
# Scour
|
||||||
# Version 0.09
|
|
||||||
#
|
#
|
||||||
# Copyright 2009 Jeff Schiller
|
# Copyright 2009 Jeff Schiller
|
||||||
#
|
#
|
||||||
|
|
@ -47,11 +46,6 @@
|
||||||
# * Put id attributes first in the serialization (or make the d attribute last)
|
# * Put id attributes first in the serialization (or make the d attribute last)
|
||||||
|
|
||||||
# Next Up:
|
# Next Up:
|
||||||
# + fix bug when removing stroke styles
|
|
||||||
# + Remove gradients that are only referenced by one other gradient
|
|
||||||
# + added option to prevent group collapsing
|
|
||||||
# + prevent groups with title/desc children from being collapsed
|
|
||||||
# + remove stroke=none attribute
|
|
||||||
# - Remove unnecessary units of precision on attributes
|
# - Remove unnecessary units of precision on attributes
|
||||||
# - Remove unnecessary units of precision on path coordinates
|
# - Remove unnecessary units of precision on path coordinates
|
||||||
# - Convert all colors to #RRGGBB format
|
# - Convert all colors to #RRGGBB format
|
||||||
|
|
@ -82,7 +76,7 @@ import os.path
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
APP = 'scour'
|
APP = 'scour'
|
||||||
VER = '0.09'
|
VER = '0.10'
|
||||||
COPYRIGHT = 'Copyright Jeff Schiller, 2009'
|
COPYRIGHT = 'Copyright Jeff Schiller, 2009'
|
||||||
|
|
||||||
NS = { 'SVG': 'http://www.w3.org/2000/svg',
|
NS = { 'SVG': 'http://www.w3.org/2000/svg',
|
||||||
|
|
@ -895,6 +889,5 @@ if __name__ == '__main__':
|
||||||
print " Number of raster images embedded inline:", numRastersEmbedded
|
print " Number of raster images embedded inline:", numRastersEmbedded
|
||||||
oldsize = os.path.getsize(input.name)
|
oldsize = os.path.getsize(input.name)
|
||||||
newsize = os.path.getsize(output.name)
|
newsize = os.path.getsize(output.name)
|
||||||
#sizediff = (min(oldsize, newsize) / max(oldsize, newsize)) * 100;
|
t sizediff = (newsize / oldsize);
|
||||||
sizediff = (newsize / oldsize);
|
|
||||||
print " Original file size:", oldsize, "bytes; new file size:", newsize, "bytes (" + str(sizediff)[:5] + "x)"
|
print " Original file size:", oldsize, "bytes; new file size:", newsize, "bytes (" + str(sizediff)[:5] + "x)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue