This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/fablabchemnitz_cleangroups.py
2020-08-12 22:47:42 +02:00

16 lines
378 B
Python

#!/usr/bin/env python3
import inkex
class CleanGroups(inkex.Effect):
def __init__(self):
inkex.Effect.__init__(self)
def effect(self):
groups = self.document.xpath('//svg:g',namespaces=inkex.NSS)
for group in groups:
if len(group.getchildren()) == 0:
group.getparent().remove(group)
CleanGroups().run()