inkex.elements._utils module#
Useful utilities specifically for elements (that aren’t base classes)
New in version 1.1: Most of the methods in this module were moved from inkex.utils.
- inkex.elements._utils.registerNS(prefix, url)[source]#
Register the given prefix as a namespace url.
- inkex.elements._utils.addNS(tag, ns=None, namespaces=NSS)[source]#
Add a known namespace to a name for use with lxml
- inkex.elements._utils.removeNS(name, reverse_namespaces=SSN, default='svg')[source]#
The reverse of addNS, finds any namespace and returns tuple (ns, tag)
- inkex.elements._utils.splitNS(name, namespaces=NSS)[source]#
Like removeNS, but returns a url instead of a prefix
- inkex.elements._utils.natural_sort_key(key, _nsre=re.compile('([0-9]+)'))[source]#
Helper for a natural sort, see https://stackoverflow.com/a/16090640/3298143