#
# Copyright (C) 2014 Martin Owens
#
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Merges styles into class based styles and removes.
"""
import inkex
import sys
if attr:
"""Removes any elements that aren't the same using a weighted threshold"""
"""Returns an iter for each added element who's style matches this style"""
if self == c:
yield (c, el)
"""Not equals, prefer to overload 'in' but that doesn't seem possible"""
return False
return True
nodes = []
return node
# Reorder to make the style element FIRST
return ret
help="Name of selected element's common class")
threshold = 1
if not common:
raise KeyError("There are no common styles between these elements.")
if __name__ == '__main__':
e = MergeStyles()
e.affect()