Skip to content

Commit

Permalink
Add --disable-remove-default-attributes flag
Browse files Browse the repository at this point in the history
  • Loading branch information
callanmcnamara committed Jan 15, 2016
1 parent fbf4e3e commit 2d427cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scour/scour.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3040,7 +3040,8 @@ def xmlnsUnused(prefix, namespace):
numBytesSavedInLengths = reducePrecision(doc.documentElement)

# remove default values of attributes
numAttrsRemoved += removeDefaultAttributeValues(doc.documentElement, options)
if options.default_attributes:
numAttrsRemoved += removeDefaultAttributeValues(doc.documentElement, options)

# reduce the length of transformation attributes
numBytesSavedInTransforms = optimizeTransforms(doc.documentElement, options)
Expand Down Expand Up @@ -3127,6 +3128,9 @@ def format_usage(self, usage):
_options_parser.add_option("--disable-group-collapsing",
action="store_false", dest="group_collapse", default=True,
help="won't collapse <g> elements")
_options_parser.add_option("--disable-remove-default-attributes",
action="store_false", dest="default_attributes", default=True,
help="won't remove attributes with default values.")
_options_parser.add_option("--create-groups",
action="store_true", dest="group_create", default=False,
help="create <g> elements for runs of elements with identical attributes")
Expand Down

0 comments on commit 2d427cf

Please sign in to comment.