boxes_proxy (Inkscape): Fix issue with --id cli arguments

tripping up on newer inkex versions if there are any object selected
while executing a plugiuting a plugin
This commit is contained in:
Florian Festi 2023-02-10 22:06:32 +01:00
parent fa1bbf3052
commit 201e0ae5d8
1 changed files with 5 additions and 5 deletions

View File

@ -25,12 +25,11 @@ class boxesPyWrapper(inkex.GenerateExtension):
args = sys.argv[1:] args = sys.argv[1:]
for arg in args: for arg in args:
key=arg.split("=")[0] key=arg.split("=")[0]
if key == "--id":
continue
if len(arg.split("=")) == 2: if len(arg.split("=")) == 2:
value=arg.split("=")[1] value=arg.split("=")[1]
try: pars.add_argument(key, default=key)
pars.add_argument(key, default=key)
except:
pass #ignore duplicate id arg
def generate(self): def generate(self):
f, box_file = tempfile.mkstemp(".svg", "boxes.py-inkscape") f, box_file = tempfile.mkstemp(".svg", "boxes.py-inkscape")
@ -38,7 +37,8 @@ class boxesPyWrapper(inkex.GenerateExtension):
cmd = "boxes" #boxes.exe in this local dir (or if present in %PATH%), or boxes from $PATH in linux cmd = "boxes" #boxes.exe in this local dir (or if present in %PATH%), or boxes from $PATH in linux
for arg in vars(self.options): for arg in vars(self.options):
if arg in ( if arg in (
"output", "ids", "selected_nodes", "input_file", "tab"): "output", "id", "ids", "selected_nodes",
"input_file", "tab"):
continue continue
#fix behaviour of "original" arg which does not correctly gets #fix behaviour of "original" arg which does not correctly gets
# interpreted if set to false # interpreted if set to false