pax_global_header 0000666 0000000 0000000 00000000064 13141502477 0014516 g ustar 00root root 0000000 0000000 52 comment=e36cd4832a4f8337bef6ca0125bc063da4de3f93
scour-0.36/ 0000775 0000000 0000000 00000000000 13141502477 0012601 5 ustar 00root root 0000000 0000000 scour-0.36/.gitignore 0000664 0000000 0000000 00000000064 13141502477 0014571 0 ustar 00root root 0000000 0000000 *.py[cod]
*.sublime-workspace
build
dist
*.egg-info
scour-0.36/.travis.yml 0000664 0000000 0000000 00000000440 13141502477 0014710 0 ustar 00root root 0000000 0000000 sudo: false
language: python
python:
- pypy
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
install:
- pip install tox-travis codecov
script:
- tox
matrix:
fast_finish: true
include:
- python: 3.5
env:
- TOXENV=flake8
after_success:
- coverage combine && codecov scour-0.36/CONTRIBUTING.md 0000664 0000000 0000000 00000004176 13141502477 0015042 0 ustar 00root root 0000000 0000000 # Contributing
Contributions to Scour are welcome, feel free to create a pull request!
In order to be able to merge your PR as fast as possible please try to stick to the following guidelines.
> _**TL;DR** (if you now what you're doing) Always run [`make check`](https://github.com/scour-project/scour/blob/master/Makefile) before creating a PR to check for common problems._
## Code Style
The Scour project tries to follow the coding conventions described in [PEP 8 - The Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/). While there are some inconsistencies in existing code (e.g. with respect to naming conventions and the usage of globals), new code should always abide by the standard.
To quickly check for common mistakes you can use [`flake8`](https://pypi.python.org/pypi/flake8). Our [Makefile](https://github.com/scour-project/scour/blob/master/Makefile) has a convenience target with the correct options:
```Makefile
make flake8
```
## Unit Tests
In order to check functionality of Scour and prevent any regressions in existing code a number of tests exist which use the [`unittest`](https://docs.python.org/library/unittest.html) unit testing framework which ships with Python. You can quickly run the tests by using the [Makefile](https://github.com/scour-project/scour/blob/master/Makefile) convenience target:
```Makefile
make test
```
These tests are run automatically on all PRs using [TravisCI](https://travis-ci.org/scour-project/scour) and have to pass at all times! When you add new functionality you should always include suitable tests with your PR (see [`testscour.py`](https://github.com/scour-project/scour/blob/master/testscour.py)).
### Coverage
To ensure that all possible code conditions are covered by a test you can use [`coverage`](https://pypi.python.org/pypi/coverage). The [Makefile](https://github.com/scour-project/scour/blob/master/Makefile) convenience target automatically creates an HTML report in `htmlcov/index.html`:
```Makefile
make coverage
```
These reports are also created automatically by our TravisCI builds and are accessible via [Codecov](https://codecov.io/gh/scour-project/scour) scour-0.36/HISTORY.md 0000664 0000000 0000000 00000052146 13141502477 0014274 0 ustar 00root root 0000000 0000000 # Release Notes for Scour
## Version 0.36 (2017-08-06)
* Fix embedding of raster images which was broken in most cases and did not work at all in Python 3. ([#120](https://github.com/scour-project/scour/issues/62))
* Some minor fixes for statistics output.
* Greatly improve the algorithm to reduce numeric precision.
* Precision was not properly reduced for some numbers.
* Only use reduced precision if it results in a shorter string representation, otherwise preserve full precision in output (e.g. use "123" instead of "1e2" when precision is set to 1).
* Reduce precision of lengths in `viewBox` ([#127](https://github.com/scour-project/scour/issues/127))
* Add option `--set-c-precision` which allows to set a reduced numeric precision for control points. Control points determine how a path is bent in between two nodes and are less sensitive to a reduced precision than the position coordinates of the nodes themselves. This option can be used to save a few additional bytes without affecting visual appearance negatively.
* Fix: Unnecessary whitespace was not stripped from elliptical paths. ([#89](https://github.com/scour-project/scour/issues/89))
* Improve and fix functionality to collapse straight paths segments. ([#146](https://github.com/scour-project/scour/issues/146))
* Collapse subpaths of moveto `m` and lineto `l`commands if they have the same direction (before we only collapsed horizontal/vertical `h`/`v` lineto commands).
* Attempt to collapse lineto `l` commands into a preceding moveto `m` command (these are then called "implicit lineto commands")
* Do not collapse straight path segments in paths that have intermediate markers. ([#145](https://github.com/scour-project/scour/issues/145))
* Preserve empty path segments if they have `stroke-linecap` set to `round` or `square`. They render no visible line but a tiny dot or square.
## Version 0.35 (2016-09-14)
* Drop official support for Python 2.6. (While it will probably continue to work for a while compatibility is not guaranteed anymore. If you continue to use Scour with Python 2.6 and should find/fix any compatibility issues pull requests are welcome, though.)
* Fix: Unused IDs were not shortended when `--shorten-ids` was used. ([#19](https://github.com/scour-project/scour/issues/62))
* Fix: Most elements were still removed from `` when `--keep-unreferenced-defs` was used. ([#62](https://github.com/scour-project/scour/issues/62))
* Improve escaping of single/double quotes ('/") in attributes. ([#64](https://github.com/scour-project/scour/issues/64))
* Print usage information if no input file was specified (and no data is available from `stdin`). ([#65](https://github.com/scour-project/scour/issues/65))
* Redirect informational output to `stderr` when SVG is output to `stdout`. ([#67](https://github.com/scour-project/scour/issues/67))
* Allow elements to be found via `Document.getElementById()` in the minidom document returned by scourXmlFile(). ([#68](https://github.com/scour-project/scour/issues/68))
* Improve code to remove default attribute values and add a lot of new default values. ([#70](https://github.com/scour-project/scour/issues/70))
* Fix: Only attempt to group elements that the content model allows to be children of a `` when `--create-groups` is specified. ([#98](https://github.com/scour-project/scour/issues/98))
* Fix: Update list of SVG presentation attributes allowing more styles to be converted to attributes and remove two entries (`line-height` and `visibility`) that were actually invalid. ([#99](https://github.com/scour-project/scour/issues/99))
* Add three options that work analoguous to `--remove-metadata` (removes `` elements) ([#102](https://github.com/scour-project/scour/issues/102))
* `--remove-titles` (removes `` elements)
* `--remove-descriptions` (removes `` elements)
* `--remove-descriptive-elements` (removes all of the descriptive elements, i.e. ``, `` and ``)
* Fix removal rules for the `overflow` attribute. ([#104](https://github.com/scour-project/scour/issues/104))
* Improvement: Automatically order all attributes ([#105](https://github.com/scour-project/scour/issues/105)), as well as `style` declarations ([#107](https://github.com/scour-project/scour/issues/107)) allowing for a constant output across multiple runs of Scour. Before order could change arbitrarily.
* Improve path scouring. ([#108](https://github.com/scour-project/scour/issues/108)) Notably Scour performs all caculations with enhanced precision now, guaranteeing maximum accuracy when optimizing path data. Numerical precision is reduced as a last step of the optimization according to the `--precision` option.
* Fix replacement of removed duplicate gradients if the `fill`/`stroke` properties contained a fallback. ([#109](https://github.com/scour-project/scour/issues/109))
* Fix conversion of cubic Bézier "curveto" commands into "shorthand/smooth curveto" commands. ([#110](https://github.com/scour-project/scour/issues/110))
* Fix some issues due to removal of properties without considering inheritance rules. ([#111](https://github.com/scour-project/scour/issues/111))
## Version 0.34 (2016-07-25)
* Add a function to sanitize an arbitrary Python object containing options for Scour as attributes (usage: `Scour.sanitizeOptions(options)`). This simplifies usage of the Scour module by other scripts while avoiding any compatibility issues that might arise when options are added/removed/renamed in Scour. ([#44](https://github.com/scour-project/scour/issues/44))
* Input/output file can now be specified as positional arguments (e.g. `scour input.svg output.svg`). ([#46](https://github.com/scour-project/scour/issues/46))
* Improve `--help` output by intuitively arranging options in groups. ([#46](https://github.com/scour-project/scour/issues/46))
* Add option `--error-on-flowtext` to raise an exception whenever a non-standard `` element is found (which is only supported in Inkscape). If this option is not specified a warning will be shown. ([#53](https://github.com/scour-project/scour/issues/53))
* Automate tests with continouous integration via Travis. ([#52](https://github.com/scour-project/scour/issues/52))
## Version 0.33 (2016-01-29)
* Add support for removal of editor data of Sketch. ([#37](https://github.com/scour-project/scour/issues/37))
* Add option `--verbose` (or `-v`) to show detailed statistics after running Scour. By default only a single line containing the most important information is output now.
## Version 0.32 (2015-12-10)
* Add functionality to remove unused XML namespace declarations from the `