Difference between revisions of "Updating your Extension for 1.0"

From Inkscape Wiki
Jump to navigation Jump to search
(Start page with instructions for extension updating)
 
(move documentation)
Tags: Replaced Visual edit
 
(33 intermediate revisions by 7 users not shown)
Line 1: Line 1:
This is a preliminary and incomplete list of actions to take for updating Python extensions for Inkscape 1.0:
This was a preliminary and incomplete list of actions to take for updating Python extensions for Inkscape 1.0. It has been moved to the [https://inkscape.gitlab.io/extensions/documentation/authors/update1.0.html extensions repository documentation].
 
[[Category:Extensions]]
== Updating *.inx files ==
 
=== Remove dependency listings ===
 
Remove the dependency listings for the following modules:
 
* bezmisc.py
* coloreffect.py
* cspsubdiv.py
* cubicsuperpath.py
* ffgeom.py
* inkex.py (removal not strictly required)
* pathmodifier.py
* simplepath.py
* simplestyle.py
* simpletransform.py
* more?
 
This change is backwards compatible (as long as the user has a fully functioning Inkscape installation).
 
== Updating *.py files ==
 
=== Collecting the options of the extension ===
 
#. Instead of <code>inkex.Effect.OptionParser.add_option</code>, your extension should now use <code>inkex.Effect.arg_parser.add_argument</code>.
#. The 'type' option now works with variables instead of strings. Use <code>int</code> instead of <code>"int"</code> (same for float,...).
#. The 'inkbool' type is now <code>inkex.inkbool</code>.
#. <code>action="store"</code> can be removed.
 
These changes are not backwards compatible. The old options will still work, but are deprecated and should no longer be used when you develop your extension for Inkscape 1.0 or higher.
 
=== Replace specific functions ===
 
# <code>pathmodifier</code> is now <code>TODO (see https://gitlab.com/inkscape/extensions/issues/24)</code>.
 
=== Test run your extension ===
 
Many functions, when run, will still work, but they will give you a deprecation warning, with instructions what to replace them by.
 
E.g. <code>inkex.Effect.selected</code> is replaced by <code>inkex.Effect.svg.selected</code> - however, most replacements do not follow this naming scheme translation.
 
=== Python 3 / Python 2 compatibility ===
 
Test your extension with both Python 2 and Python 3. With the updated extensions, Inkscape does no longer require Python 2, so some users will probably be using Python 3, and may no longer have Python 2 installed on their system. See [[Extension_Interpreters]] for how to set the Python version for your extension.

Latest revision as of 19:02, 3 March 2022

This was a preliminary and incomplete list of actions to take for updating Python extensions for Inkscape 1.0. It has been moved to the extensions repository documentation.