From 19bb8a5a6dbe4244a590147187949d0555eb9fbc Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Thu, 16 Aug 2018 22:50:34 -0400 Subject: new extension to add layer commands --- lib/commands.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/commands.py') diff --git a/lib/commands.py b/lib/commands.py index a9f156e4..cadfa080 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -75,7 +75,7 @@ class Command(BaseCommand): class StandaloneCommand(BaseCommand): def __init__(self, use): self.node = use - self.svg = self.use.getroottree().getroot() + self.svg = self.node.getroottree().getroot() self.parse_command() @@ -113,7 +113,7 @@ def layer_commands(layer, command): for standalone_command in standalone_commands(layer.getroottree().getroot()): if standalone_command.command == command: - if layer in command.iterancestors(): + if layer in standalone_command.node.iterancestors(): commands.append(command) return commands @@ -122,7 +122,7 @@ def standalone_commands(svg): """Find all unconnected command symbols in the SVG.""" xpath = ".//svg:use[starts-with(@xlink:href, '#inkstitch_')]" - symbols = svg.xpath(xpath, namespace=inkex.NSS) + symbols = svg.xpath(xpath, namespaces=inkex.NSS) commands = [] for symbol in symbols: -- cgit v1.2.3