Merge pull request #37 from Eitot/sketch

Sketch support
This commit is contained in:
Tobias Oberstein 2016-01-15 10:44:32 +01:00
commit dccb80314c
2 changed files with 7 additions and 5 deletions

View file

@ -52,13 +52,13 @@ scour -i input.svg -o output.svgz --enable-viewboxing --enable-id-stripping \
--enable-comment-stripping --shorten-ids --indent=none --enable-comment-stripping --shorten-ids --indent=none
``` ```
## Licence ## License
[Apache License 2.0](https://github.com/codedread/scour/blob/master/LICENSE) [Apache License 2.0](https://github.com/codedread/scour/blob/master/LICENSE)
## Development ## Development
Scour was originally developed by Jeff "codedread" Schiller and Louis Simard. Development is [now maintained](https://github.com/codedread/scour/issues/11) by Tobias "oberstet" Oberstein. Scour was originally developed by Jeff "codedread" Schiller and Louis Simard. Development is [now maintained](https://github.com/codedread/scour/issues/11) by Tobias "oberstet" Oberstein.
Scour was started as a vehicle for to learn Python. In addition, the goal was to reduce the amount of time spent in cleaning up files that are found on sites such as [openclipart.org](https://openclipart.org). Scour was started as a vehicle for learning Python. In addition, the goal was to reduce the amount of time spent on cleaning up files that are found on sites such as [openclipart.org](https://openclipart.org).
Ideas were pulled from three places: Ideas were pulled from three places:
* the original author's head * the original author's head

View file

@ -95,13 +95,15 @@ NS = {'SVG': 'http://www.w3.org/2000/svg',
'ADOBE_FLOWS': 'http://ns.adobe.com/Flows/1.0/', 'ADOBE_FLOWS': 'http://ns.adobe.com/Flows/1.0/',
'ADOBE_IMAGE_REPLACEMENT': 'http://ns.adobe.com/ImageReplacement/1.0/', 'ADOBE_IMAGE_REPLACEMENT': 'http://ns.adobe.com/ImageReplacement/1.0/',
'ADOBE_CUSTOM': 'http://ns.adobe.com/GenericCustomNamespace/1.0/', 'ADOBE_CUSTOM': 'http://ns.adobe.com/GenericCustomNamespace/1.0/',
'ADOBE_XPATH': 'http://ns.adobe.com/XPath/1.0/' 'ADOBE_XPATH': 'http://ns.adobe.com/XPath/1.0/',
'SKETCH': 'http://www.bohemiancoding.com/sketch/ns'
} }
unwanted_ns = [ NS['SODIPODI'], NS['INKSCAPE'], NS['ADOBE_ILLUSTRATOR'], unwanted_ns = [ NS['SODIPODI'], NS['INKSCAPE'], NS['ADOBE_ILLUSTRATOR'],
NS['ADOBE_GRAPHS'], NS['ADOBE_SVG_VIEWER'], NS['ADOBE_VARIABLES'], NS['ADOBE_GRAPHS'], NS['ADOBE_SVG_VIEWER'], NS['ADOBE_VARIABLES'],
NS['ADOBE_SFW'], NS['ADOBE_EXTENSIBILITY'], NS['ADOBE_FLOWS'], NS['ADOBE_SFW'], NS['ADOBE_EXTENSIBILITY'], NS['ADOBE_FLOWS'],
NS['ADOBE_IMAGE_REPLACEMENT'], NS['ADOBE_CUSTOM'], NS['ADOBE_XPATH'] ] NS['ADOBE_IMAGE_REPLACEMENT'], NS['ADOBE_CUSTOM'],
NS['ADOBE_XPATH'], NS['SKETCH'] ]
svgAttributes = [ svgAttributes = [
'clip-rule', 'clip-rule',
@ -3150,7 +3152,7 @@ _options_parser.add_option("--keep-unreferenced-defs",
help="won't remove elements within the defs container that are unreferenced") help="won't remove elements within the defs container that are unreferenced")
_options_parser.add_option("--keep-editor-data", _options_parser.add_option("--keep-editor-data",
action="store_true", dest="keep_editor_data", default=False, action="store_true", dest="keep_editor_data", default=False,
help="won't remove Inkscape, Sodipodi or Adobe Illustrator elements and attributes") help="won't remove Inkscape, Sodipodi, Adobe Illustrator or Sketch elements and attributes")
_options_parser.add_option("--remove-metadata", _options_parser.add_option("--remove-metadata",
action="store_true", dest="remove_metadata", default=False, action="store_true", dest="remove_metadata", default=False,
help="remove <metadata> elements (which may contain license metadata etc.)") help="remove <metadata> elements (which may contain license metadata etc.)")