Commit graph

43 commits

Author SHA1 Message Date
Eduard Braun
4eade69201 Open input file in binary mode an let XML parser deal with encoding.
Fixes #26
2015-12-08 23:38:06 +01:00
Jeff Schiller
1a6ff29c14 Merge pull request #24 from Ede123/unittests
Import unittests from old repository
2015-12-08 08:23:30 -08:00
Eduard Braun
32e7e5517f Unittests: Account for b979fe19e5 (fix one test and add two more)
- Unused XML namespace declarations *are supposed* to be removed
- XML namespace declarations that are used as prefix for elements/attributes *must not* be removed
2015-12-07 00:33:08 +01:00
Eduard Braun
ab1aa0e2f8 Fix a bug with "points" attribute of "polyline/polygon" starting with a negative number.
In this case "len(nums) = 0" and "nums[len(nums)-1]" triggered an "IndexError: list index out of range"
2015-12-06 23:47:56 +01:00
Eduard Braun
f0c69b827e Unittests: Sync options with current Scour
(fixes yet two other errors when running tests)
2015-12-06 23:07:06 +01:00
Eduard Braun
2293e1bd4a Fix regex for list of points splitting: Expect at least one whitespace character or comma between coords.
The previous regex would have allowed zero length matches and therefore could have split the string after every character - luckily this was not (yet) correctly implemented in Python. Since Python 3.5 a warning is raised informing of this problem. Future versions will correctly split also at zero length matches.

See also note on https://docs.python.org/3/library/re.html#re.split
2015-12-06 22:53:03 +01:00
Eduard Braun
c54c5e5d7e Unittests: Fix warnings
- Replace deprecated assertion-aliases
- Make sure opened files are properly closed after usage
2015-12-06 22:13:21 +01:00
Eduard Braun
320bdda6e9 Unittests: Run python-modernize 2015-12-06 21:20:05 +01:00
Eduard Braun
391ff77659 Unittests: Fix import paths 2015-12-06 20:10:12 +01:00
Eduard Braun
3b7e8a0091 Restore unittests from history 2015-12-06 19:59:06 +01:00
Tobias Oberstein
ebccae8cad Merge pull request #17 from Ede123/compat_fix
Compatibility fix for Python 2.6
2015-11-26 22:56:48 +01:00
Eduard Braun
6254548582 Compatibility fix for Python 2.6
(NamedNodeList seems not to have had the iterkeys method back then)
2015-11-21 23:29:59 +01:00
Tobias Oberstein
46a2ada361 Merge pull request #14 from Ede123/namespaces
Remove unused XML namespace declarations
2015-11-17 23:18:46 +01:00
Eduard Braun
532f664001 Minor fix in console output (superfluous space) 2015-11-17 23:09:25 +01:00
Eduard Braun
89f4b687f2 Statistics: count also attributes removed from root SVG element 2015-11-17 22:49:50 +01:00
Eduard Braun
67bacc2f23 Remove metadata right away
(i.e. before checking for unused XML namespaces; otherwise the relevant namespaces used for metadata would not yet be unused)
2015-11-17 22:46:50 +01:00
Eduard Braun
b979fe19e5 Remove unused XML namespace declarations 2015-11-17 22:30:23 +01:00
Tobias Oberstein
302f7f7477 use absolute imports 2015-11-16 20:36:12 +01:00
Tobias Oberstein
d3b29a68da fix links; only upload source dist 2015-11-16 18:12:56 +01:00
Tobias Oberstein
ec7385c995 update readme 2015-11-16 18:08:02 +01:00
Tobias Oberstein
e903475289 cleanups; bump version 2015-11-16 18:05:35 +01:00
Tobias Oberstein
27d5cd3881 Merge pull request #13 from Ede123/options
Add some options to optimize pretty-printing
2015-11-16 16:39:58 +01:00
Eduard Braun
7e36be4aaa Add an option to strip the xml:space="preserve" attribute from the root SVG element
This attribute is added by at least one popular vector graphics editor thwarting our efforts to pretty-print the output.
2015-11-15 19:26:39 +01:00
Eduard Braun
e21e362353 Add an option to suppress output of line breaks
(obviously this also disables indentation)
2015-11-15 18:44:17 +01:00
Eduard Braun
18266ca1ec Add an option to set number of spaces (or tabs used for indentation) 2015-11-15 18:14:03 +01:00
Tobias Oberstein
a5b09e3824 add notice of repo move 2015-10-17 17:29:47 +02:00
Tobias Oberstein
03f099a26e Merge pull request #8 from levisaya/master
Python 3 Updates
2015-05-20 19:25:25 +02:00
Andy Levisay
d1c66cc75b Python 3 Updates
Ran python-modernizer, this fixed most of the Python 3
incompatibilities.

Had to manually rework the iteration in svg_regex and svg_transform;
.next doesn't exist in Python 3. Wrapped the builtin next function in a
partial for equivalent functionality.
2015-04-28 15:26:55 -05:00
Tobias Oberstein
85dff51cc9 fix ingoring of additional args when invoked from scons; bump version 2014-08-05 12:47:33 +02:00
Tobias Oberstein
26a360a00c add option to ingore unknown cmd line opts; bump version 2014-07-26 17:20:47 +02:00
Tobias Oberstein
43ee078ee6 Merge pull request #3 from flosse/master
fixed version string
2014-03-10 00:22:47 +01:00
Tobias Oberstein
e01fac82a4 Merge pull request #2 from flosse/keep-unreferenced-defs
added option to keep elements within defs
2014-03-10 00:22:27 +01:00
Tobias Oberstein
e7332f6704 Merge pull request #5 from mdxs/patch-1
Small typo fix in doc string of parseListOfPoints
2014-03-10 00:20:05 +01:00
mdxs
f7165f66a9 Small typo fix in doc string of parseListOfPoints 2014-03-09 23:44:06 +01:00
Markus Kohlhase
9bb929d91e added option to keep elements within defs 2014-01-12 17:10:02 +01:00
Markus Kohlhase
edcaeba905 fixed version string 2014-01-12 16:56:56 +01:00
Tobias Oberstein
c27ca4db8a Merge pull request #1 from flosse/id-prefix
support custom id prefixes
2014-01-10 14:52:15 -08:00
Markus Kohlhase
ae4d9303f1 support custom id prefixes 2014-01-10 23:42:02 +01:00
Tobias Oberstein
3353500845 allow direct calling of module 2013-10-26 17:47:42 +02:00
Tobias Oberstein
8dc6137373 whitespace cleanup 2013-10-26 16:43:39 +02:00
Tobias Oberstein
0e35c9d40f more README, publish 2013-10-22 18:25:37 +02:00
Tobias Oberstein
f89b6bbf6a initial source import (v0.26) and packaging 2013-10-22 16:31:42 +02:00
Tobias Oberstein
f3a7507d82 Initial commit 2013-10-22 07:02:57 -07:00