diff --git a/crunch.sh b/crunch.sh
index 5ad1219..480b188 100755
--- a/crunch.sh
+++ b/crunch.sh
@@ -3,5 +3,5 @@ mkdir $1
for FILE in `ls fulltests`
do
echo Doing $FILE:
- ./scour.py -i fulltests/$FILE -o $1/$FILE 2>> $1/report.txt
+ python ./scour.py -i fulltests/$FILE -o $1/$FILE 2>> $1/report.txt
done
diff --git a/release-notes.html b/release-notes.html
index a492c10..5c545f1 100644
--- a/release-notes.html
+++ b/release-notes.html
@@ -16,6 +16,8 @@
TBD
- Fix Bug 482215 by using os.linesep to end lines
+ - Fix unittests to run properly in Windows
+ - Removed default scaling of image to 100%/100% and creating a viewBox. Added --enable-viewboxing option to explicitly turn that on
diff --git a/scour.py b/scour.py
index 6bf14fa..6996f5a 100755
--- a/scour.py
+++ b/scour.py
@@ -63,8 +63,15 @@ except ImportError:
from fixedpoint import *
Decimal = FixedPoint
+# Import Psyco if available
+try:
+ import psyco
+ psyco.full()
+except ImportError:
+ pass
+
APP = 'scour'
-VER = '0.22'
+VER = '0.23'
COPYRIGHT = 'Copyright Jeff Schiller, 2009'
NS = { 'SVG': 'http://www.w3.org/2000/svg',
@@ -2266,7 +2273,8 @@ def scourString(in_string, options=None):
embedRasters(elem, options)
# properly size the SVG document (ideally width/height should be 100% with a viewBox)
- properlySizeDoc(doc.documentElement)
+ if options.viewboxing:
+ properlySizeDoc(doc.documentElement)
# output the document as a pretty string with a single space for indent
# NOTE: removed pretty printing because of this problem:
@@ -2340,6 +2348,9 @@ _options_parser.add_option("--keep-editor-data",
_options_parser.add_option("--strip-xml-prolog",
action="store_true", dest="strip_xml_prolog", default=False,
help="won't output the prolog")
+_options_parser.add_option("--enable-viewboxing",
+ action="store_true", dest="viewboxing", default=False,
+ help="changes document width/height to 100%/100% and creates viewbox coordinates")
# GZ: this is confusing, most people will be thinking in terms of
# decimal places, which is not what decimal precision is doing
diff --git a/testscour.py b/testscour.py
index 0347ab1..39c4dfc 100755
--- a/testscour.py
+++ b/testscour.py
@@ -47,6 +47,7 @@ class ScourOptions:
keep_editor_data = False
strip_xml_prolog = False
indent_type = "space"
+ viewboxing = False
class NoInkscapeElements(unittest.TestCase):
def runTest(self):
@@ -829,7 +830,6 @@ class RemoveDefaultGradFYValue(unittest.TestCase):
class CDATAInXml(unittest.TestCase):
def runTest(self):
lines = scour.scourString(open('unittests/cdata.svg').read()).splitlines()
- print lines[4]
self.assertEquals( lines[3],
" alert('pb&j');",
'CDATA did not come out correctly')