Skip to content

Commit

Permalink
Support two means of initializing Simple Inkscape Scripting
Browse files Browse the repository at this point in the history
An extension class can either derive from `SimpleInkscapeScripting`
and invoke `super.effect()` from its `effect` method or derive from an
arbitrary `inkex` extension type and invoke
`SimpleInkscapeScripting(self).effect()` from its `effect` method.
  • Loading branch information
spakin committed Dec 6, 2024
1 parent 5b0d7d5 commit 9b20fba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion simpinkscr/simple_inkscape_scripting.py
Original file line number Diff line number Diff line change
Expand Up @@ -3634,12 +3634,14 @@ def to_list(e):
class SimpleInkscapeScripting(inkex.EffectExtension):
'Help the user create Inkscape objects with a simple API.'

def __init__(self):
def __init__(self, obj=None):
super().__init__()
self.options.user_args = []
self.options.encoding = ''
self.options.py_source = None
self.options.program = None
if obj is not None:
self.svg = obj.svg

def filename_arg(self, name):
"""Existing file to read or option used in script arguments"""
Expand Down

0 comments on commit 9b20fba

Please sign in to comment.