Skip to content

Imports from head module

This MR allows one to import elements from top inkex module. (follow up to !178 (merged))

Example (from voronoi2svg.py):

# before 
from inkex.elements import Group, Rectangle, PathElement
from inkex.transforms import Vector2d as Point
# after
from inkex import Group, Rectangle, PathElement, Vector2d as Point

To avoid name collision with inkex.base in star imports the inkex.elements.base renamed to inkex.elements.basics. Should be not-so-breaking change as inkex.elements.base is pretty new and likely no one uses it explicitly.

New shortened imports are applied to stock extensions (as they usually serve as (good) example)

Not directly related to this MR:

We have inconsistent naming: inkex.elements.PathElement stands out from others, e.g. Line or Circle. Line can potentially overlap with inkex.paths.Line and we may want to export/rename it as/to LineElement.

Edited by Jonathan Neuhauser

Merge request reports