Commit graph

  • 5360db86d9 Fix the last instance of "list(dict.keys())" Eduard Braun 2018-02-17 15:59:18 +01:00
  • 2f0b3ea362 Rewrite redundant codepatterns introduced by py2 -> py3 conversion Niels Thykier 2018-02-17 07:44:49 +00:00
  • cb093e9171 Update docstring of findReferencedElements Eduard Braun 2018-02-17 14:27:19 +01:00
  • c54a7239e7 Simplify the "ids" structure returned by findReferencedElements Niels Thykier 2018-02-17 10:02:16 +00:00
  • b916a189e9 Avoid recomputing findReferencedElements in removeUnusedDefs Niels Thykier 2018-02-17 10:14:49 +00:00
  • 633b381d87 findReferencedElements: Handle referencingProps separately Niels Thykier 2018-02-17 10:59:13 +00:00
  • 258c782c8c Simplify the "ids" structure returned by findReferencedElements Niels Thykier 2018-02-17 10:02:16 +00:00
  • 35fa0843a9 Avoid recomputing findReferencedElements in removeUnusedDefs Niels Thykier 2018-02-17 10:14:49 +00:00
  • 8543368a6e findReferencedElements: Handle referencingProps separately Niels Thykier 2018-02-17 10:59:13 +00:00
  • 7249ae8b0a user clearer variable names for indent type and indent depth Eduard Braun 2018-02-17 11:59:35 +01:00
  • 843706be39 Catch specific exception rather than anything Niels Thykier 2018-02-17 09:15:45 +00:00
  • f3d8936b5e Rename "I" to "line_prefix" to avoid flake8 E741 Niels Thykier 2018-02-17 09:10:55 +00:00
  • 1bf5723694 Catch specific exception rather than anything Niels Thykier 2018-02-17 09:15:45 +00:00
  • 57a6da7774 Rename "I" to "line_prefix" to avoid flake8 E741 Niels Thykier 2018-02-17 09:10:55 +00:00
  • 0244da3fd1 Rewrite redundant codepatterns introduced by py2 -> py3 conversion Niels Thykier 2018-02-17 07:44:49 +00:00
  • b20a0698cc tests: Add unit tests for preservation of quotes in CSS styles Michael Witten 2017-08-27 02:16:31 +00:00
  • 0a146b7fef tests: Add unit tests for the escaping of quote characters in attribute values Michael Witten 2017-08-24 23:42:31 +00:00
  • 7e14cd352f scour.py: Escape quote characters in attribute values, as necessary and minimally Michael Witten 2017-08-24 21:40:44 +00:00
  • 908fe9df34 tests: Add unit tests for preservation of quotes in CSS styles Michael Witten 2017-08-27 02:16:31 +00:00
  • 7739f058c3 tests: Add unit tests for the escaping of quote characters in attribute values Michael Witten 2017-08-24 23:42:31 +00:00
  • 89acc4c95b scour.py: Escape quote characters in attribute values, as necessary and minimally Michael Witten 2017-08-24 21:40:44 +00:00
  • f14784b01f scour.py: handle id' and xml:id' in the same code that handles other attributes Michael Witten 2017-08-24 18:41:04 +00:00
  • fef2786c5e scour.py: minor rearrangement for the sake of clarity Michael Witten 2017-08-24 18:41:04 +00:00
  • 616190600a Merge 942762b5cd into 695a91e447 Michael Witten 2017-08-26 16:45:09 +00:00
  • 695a91e447 scour.py: Satisfy the identing rules of PEP8 Michael Witten 2017-08-25 04:56:47 +00:00
  • 7ee5f9774d scour.py: Use named constants rather than literal integers for `nodeType' Michael Witten 2017-08-24 20:52:07 +00:00
  • 942762b5cd scour.py: minor rearrangement for the sake of clarity Michael Witten 2017-08-24 18:41:04 +00:00
  • fdbf890ba8 scour.py: Satisfy the identing rules of PEP8 Michael Witten 2017-08-25 04:56:47 +00:00
  • 77aadca98a scour.py: Use named constants rather than literal integers for `nodeType' Michael Witten 2017-08-24 20:52:07 +00:00
  • 790409024f Merge b3fe88ca58 into e36cd4832a Michael Witten 2017-08-25 05:04:52 +00:00
  • b3fe88ca58 tests: Add unit tests for the escaping of quote characters in attribute values Michael Witten 2017-08-24 23:42:31 +00:00
  • b007d75d1c scour.py: Escape quote characters in attribute values, as necessary and minimally Michael Witten 2017-08-24 21:40:44 +00:00
  • 95b1df843f scour.py: handle id' and xml:id' in the same code for other attributes Michael Witten 2017-08-24 19:17:25 +00:00
  • 377a339263 scour.py: minor rearrangement for clarity and efficiency Michael Witten 2017-08-24 18:41:04 +00:00
  • da770cefc3 scour.py: Satisfy the identing rules of PEP8 Michael Witten 2017-08-25 04:56:47 +00:00
  • 0df46a6cbc scour.py: Use named constants rather than literal integers for `nodeType' Michael Witten 2017-08-24 20:52:07 +00:00
  • 6734d1ea58 README.md: clean up Michael Witten 2017-08-24 18:03:41 +00:00
  • e36cd4832a Scour v0.36 v0.36 Eduard Braun 2017-08-06 04:55:59 +02:00
  • 49f3664f82 make flake8 happier Eduard Braun 2017-08-06 04:55:43 +02:00
  • 53d87ed35a make flake8 happy Eduard Braun 2017-08-06 04:47:33 +02:00
  • c089448bb5 Update project description and use in both, README.md and setup.py Eduard Braun 2017-08-06 04:38:33 +02:00
  • e0bfad272b Update README.md Eduard Braun 2017-08-06 04:13:23 +02:00
  • 992b6850c6 Update HISTORY.md Eduard Braun 2017-08-06 03:52:20 +02:00
  • bbc3e648e4 Merge f3c25fd27a into cc592c8e8a Eduard Braun 2017-05-18 20:38:46 +00:00
  • cc592c8e8a Improve and fix behaviour when collapsing straight paths segments (#146) Eduard Braun 2017-05-18 00:53:25 +02:00
  • df3a3ccc5b Minor change to actually cover the case where a line segment doe not point into the same direction. Also increases coverage by explicitly optimizing a lineto command (instead of only "implicit lineto", i.e. effectively moveto, commands) Eduard Braun 2017-05-18 00:38:16 +02:00
  • 44cd072e37 Fix invalid string comparison (luckily Python 2.7 did not intern those strings making the tests fail) Eduard Braun 2017-05-18 00:22:29 +02:00
  • 9712b71b86 Add unittests for collapsing of straight path segments Eduard Braun 2017-05-17 22:07:04 +02:00
  • 8d7220c222 Unittests: Complete set of tests checking the removal of empty line segments if round / square linecaps are present (or not) Eduard Braun 2017-05-17 21:01:51 +02:00
  • 2fc73a2684 minor code cleanup: range(0, end) -> range(end) Eduard Braun 2017-05-17 19:54:29 +02:00
  • fe5cd14585 linecaps and markers can also be specified in style attributes, so check them, too Eduard Braun 2017-05-17 19:52:57 +02:00
  • d8b6a027b8 Adjust unittests for previous commit Eduard Braun 2017-05-17 03:46:56 +02:00
  • 17edba7551 Fix collapsing of lineto into moveto (l into m) commands. Eduard Braun 2017-05-17 03:46:35 +02:00
  • f1827735a7 Adjust a unittest (latest optimizations already paid off ;-) ) Eduard Braun 2017-05-17 02:51:10 +02:00
  • f0865ed96f Fix collapsing of straight "m" path segments: Not only the slope but also the direction needs to be the same! Eduard Braun 2017-05-17 00:56:09 +02:00
  • 566c9cb6a2 Fix collapsing of straight "m" path segments: The first pair must never be modified. Eduard Braun 2017-05-17 00:45:16 +02:00
  • 20f043a17b Use the set precision to determine wether two straight lineto (m,l) segments have the same direction and can be collapsed Eduard Braun 2017-05-17 00:13:11 +02:00
  • d4efcaa983 Optimize/simplify code for last commit and fix a longstanding indexing bug when collapsing subpaths (the first command of a path and all of its parameters were never optimized and as many paths consist only of one moveto command with many parameters the functionality might have been broken in many cases) Eduard Braun 2017-05-16 22:59:50 +02:00
  • 3c3f60f4c0 Also collapse multiple straight lineto (m,l) segments that run in the same direction, just as we do for h,v Eduard Braun 2017-05-16 21:55:44 +02:00
  • 05c2dde477 Also preserve empty path segments if stroke-linecap is square Eduard Braun 2017-05-16 19:44:09 +02:00
  • b7bfb3250a Do not combine straight line segments running in the same direction if the path has intermediate markers. Eduard Braun 2017-05-16 19:32:11 +02:00
  • 75bacbc8e6 Python 3.6 invalid escape sequence deprecation fix (#144) Ville Skyttä 2017-05-09 23:07:06 +03:00
  • ac3c776283 revert... we'd need at least two, so nothing gained Eduard Braun 2017-05-09 22:04:14 +02:00
  • b35e179416 Use string literal instead of escaping backslashes Eduard Braun 2017-05-09 22:02:13 +02:00
  • 62b16c11d8 Spelling fixes Ville Skyttä 2017-05-09 12:21:25 +03:00
  • 9121f5e112 Python 3.6 invalid escape sequence deprecation fixes Ville Skyttä 2017-05-09 12:23:07 +03:00
  • 74588ec378 Spelling fixes Ville Skyttä 2017-05-09 12:21:25 +03:00
  • 5bfffc2ca8 Hardcode printing of "flowtext" warning to stderr Third-party applications obviously can not handle additional output on stdout nor can they be expected to do any weird stdout/sterr redirection as we do via options.stdout We probably shouldn't print anything in scourString() to start with unless we offer an option to disable all non-SVG output for third-party libraries to use. Eduard Braun 2017-04-30 04:13:44 +02:00
  • 79005a3591 Merge d9c273a72c into 98e3040645 Eduard Braun 2017-03-26 17:05:47 +00:00
  • 98e3040645 Add unittest for --set-c-precision (7cb0d36d72) Eduard Braun 2017-02-25 19:33:03 +01:00
  • 51c1e6af23 Improve options handling for precision options - prevent '--set-precision=0' by requiring >=1 - warn user if '--set-c-precision' > '--set-precision' instead of silently ignoring the value - some code cleanup Eduard Braun 2017-02-25 18:55:02 +01:00
  • c2a65a772e Some code refactoring Eduard Braun 2017-02-25 18:07:03 +01:00
  • 12237e01c8 Refactor logic to detect control points from 7cb0d36d72 and also include control points of quadratic Bézier curve commands ("q") Eduard Braun 2017-02-25 17:59:44 +01:00
  • 090884a70f Don't force whitespace for elliptical paths (fixes #89) This was only required in an early draft of the SVG spec (an error that was corrected later, see [1,2]) Eduard Braun 2017-02-24 03:04:15 +01:00
  • 2ebe9741b2 Rename a variable plus some editing of comments Eduard Braun 2017-02-24 02:55:44 +01:00
  • a37c98ffe1 Add unittest for --set-c-precision (7cb0d36d72) Eduard Braun 2017-02-25 19:33:03 +01:00
  • 25cfcd9a58 Improve options handling for precision options - prevent '--set-precision=0' by requiring >=1 - warn user if '--set-c-precision' > '--set-precision' instead of silently ignoring the value - some code cleanup Eduard Braun 2017-02-25 18:55:02 +01:00
  • 3213b267fb Some code refactoring Eduard Braun 2017-02-25 18:07:03 +01:00
  • 91e38b2db1 Refactor logic to detect control points from 7cb0d36d72 and also include control points of quadratic Bézier curve commands ("q") Eduard Braun 2017-02-25 17:59:44 +01:00
  • d853548c57 Don't force whitespace for elliptical paths (fixes #89) This was only required in an early draft of the SVG spec (an error that was corrected later, see [1,2]) Eduard Braun 2017-02-24 03:04:15 +01:00
  • 7dcdc2b00b Rename a variable plus some editing of comments Eduard Braun 2017-02-24 02:55:44 +01:00
  • a7e7b4c21d Cleanup options. Also omit short option strings of advanced options for now (if we offer them again in future, they should be chosen very carefully as should the options for which we offer them) Eduard Braun 2017-02-23 23:39:27 +01:00
  • 7cb0d36d72 Improve precision options for smaller output size (#131) pborunda 2017-02-23 14:00:32 -07:00
  • ffeb76c894 Unittests: remove temporary file 'testscour_temp.svg' after running tests Eduard Braun 2017-02-22 22:13:04 +01:00
  • f7d6406d38 Work around https://github.com/travis-ci/travis-ci/issues/3080 as pypy throws if 'ping' can't be executed Eduard Braun 2017-02-22 22:07:17 +01:00
  • de5aa60b0d split out --keep-int-precision and "round near zero" pborunda 2017-02-22 07:56:13 -07:00
  • 3bcff5e9c4 Merge remote-tracking branch 'refs/remotes/scour-project/master' pborunda 2017-02-20 10:47:26 -07:00
  • 0f6d9be4e2 Add sudo: false to .travis.yml for faster execution of jobs Eduard Braun 2017-02-19 18:06:57 +01:00
  • 3b41d3a547 Add Python 3.6 to tests and simplify .travis.yml by using 'tox-travis' Eduard Braun 2017-02-19 18:04:36 +01:00
  • 0ffefcd8bb Unittests for --enable-viewboxing Eduard Braun 2017-02-19 15:39:53 +01:00
  • 01cb120d71 Reduce precision of lengths in viewBox This fixes #127. Also simplify splitting of viewBox lengths and avoiding a "FutureWarning: split() requires a non-empty pattern match" at the same time Eduard Braun 2017-02-19 15:22:50 +01:00
  • 7521c5c283 Unittests for --enable-viewboxing Eduard Braun 2017-02-19 15:39:53 +01:00
  • 512bcc1737 Reduce precision of lengths in viewBox This fixes #127. Also simplify splitting of viewBox lengths and avoiding a "FutureWarning: split() requires a non-empty pattern match" at the same time Eduard Braun 2017-02-19 15:22:50 +01:00
  • 3e4c8d793f Typo in unittest svg file Eduard Braun 2017-02-19 15:19:53 +01:00
  • f5a61eeeb3 Even better fix for 8f87118725 (previous solution still did not work for numbers like 123.4 with precision < 3) Eduard Braun 2017-02-19 00:39:36 +01:00
  • 4d84194621 Even better fix for 8f87118725 (previous solution still did not work for numbers like 123.4 with precision < 3) Eduard Braun 2017-02-19 00:39:36 +01:00
  • 7c2e035644 Merge pull request #133 from Ede123/precision Eduard Braun 2017-02-18 19:45:51 +01:00
  • a69efb3a55 Add unittests for b00b374e64 and 8f87118725 Eduard Braun 2017-02-18 19:36:19 +01:00
  • 8f87118725 Only use number representation with reduced precision if it is shorter than the initial representation. Before it could happen that "123" was replaced with "1e3" if precision was set to 1 which is obviously not desirable. Eduard Braun 2017-02-18 19:01:26 +01:00
  • b00b374e64 Fix generation of non-scientific number representation. Before numbers often were already in scientific notation due to the str() implementation of Decimal leading to strange optimization results. Eduard Braun 2017-02-18 18:06:09 +01:00