inkscapeMadeEasy icon indicating copy to clipboard operation
inkscapeMadeEasy copied to clipboard

Suggestion: optional textext dependency

Open denilsonsa opened this issue 1 year ago • 1 comments

In these lines: https://github.com/fsmMLK/inkscapeMadeEasy/blob/master/latest/inkscapeMadeEasy_Draw.py#L25-L49

The code unconditionally loads the textext Python module.

However, not all extensions need LaTeX (e.g. your inkscapeSpirograph, but the textext extension is still being required. Even your "Dimensions" extension has a checkbox "Use LaTeX", which makes me believe that dependency is optional.


How to implement this suggestion? You can try something like this (untested):

try:
  import textext
except ImportError:
  warn("The 'textext' inkscape extension was not found. If you get errors, please install it.")
  textext = None

Alternatively, I see textext is being called only two times in the codebase. Those calls could be prefixed by a check if textext is None, and only at that moment throw an error/warning with a helpful error message.

denilsonsa avatar Nov 09 '23 11:11 denilsonsa

I will take a look at your suggestion

fsmMLK avatar Jun 21 '24 19:06 fsmMLK