summaryrefslogtreecommitdiff
path: root/lib/commands.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2019-08-06 04:42:48 +0200
committerLex Neva <lexelby@users.noreply.github.com>2019-08-05 22:42:48 -0400
commit077f7ea72ba38790bf030d3181c44787fef953b6 (patch)
tree1cd8bf2896d587735c98eee06589f4c88bee3aa9 /lib/commands.py
parentcdb8d1d0d4a6dba9a1eb146167b1aef01de0e9d6 (diff)
add Troubleshoot extension (#465)
adds an extension to help you understand what's wrong with an object and how to fix it, e.g. "invalid" fill shapes
Diffstat (limited to 'lib/commands.py')
-rw-r--r--lib/commands.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/commands.py b/lib/commands.py
index c735185f..908c6e53 100644
--- a/lib/commands.py
+++ b/lib/commands.py
@@ -371,3 +371,22 @@ def add_commands(element, commands):
pos = get_command_pos(element, i, len(commands))
symbol = add_symbol(document, group, command, pos)
add_connector(document, symbol, element)
+
+
+def add_layer_commands(layer, commands):
+ document = get_document(layer)
+ correction_transform = get_correction_transform(layer)
+
+ for command in commands:
+ ensure_symbol(document, command)
+ inkex.etree.SubElement(layer, SVG_USE_TAG,
+ {
+ "id": generate_unique_id(document, "use"),
+ INKSCAPE_LABEL: _("Ink/Stitch Command") + ": %s" % get_command_description(command),
+ XLINK_HREF: "#inkstitch_%s" % command,
+ "height": "100%",
+ "width": "100%",
+ "x": "0",
+ "y": "-10",
+ "transform": correction_transform
+ })