summaryrefslogtreecommitdiff
path: root/lib/commands.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-08-16 22:50:34 -0400
committerLex Neva <github.com@lexneva.name>2018-08-16 22:50:34 -0400
commit19bb8a5a6dbe4244a590147187949d0555eb9fbc (patch)
tree84aec45e6c1236754fedbe58e5464cccabc7c2c8 /lib/commands.py
parent751173080bbc87158619cd98d75c9854ce2d8d01 (diff)
new extension to add layer commands
Diffstat (limited to 'lib/commands.py')
-rw-r--r--lib/commands.py6
1 files changed, 3 insertions, 3 deletions
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: