inkex.utils module

Basic common utility functions for calculated things

exception inkex.utils.AbortExtension(message='')[source]

Bases: Exception

Raised to print a message to the user without backtrace


write the error message out to the user


ArgParser function to turn a boolean string into a python boolean

exception inkex.utils.DependencyError[source]

Bases: NotImplementedError

Raised when we need an external python module that isn’t available


Intended for end-user-visible error messages.

(Currently just writes to stderr with an appended newline, but could do something better in future: e.g. could add markup to distinguish error messages from status messages or debugging output.)

Note that this should always be combined with translation:

import inkex … inkex.errormsg(_(“This extension requires two selected paths.”))