summaryrefslogtreecommitdiff
path: root/lib/extensions/input.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2021-03-04 18:40:53 +0100
committerGitHub <noreply@github.com>2021-03-04 18:40:53 +0100
commite84a86d4ac0caf29d6074728376ff0a594243fec (patch)
tree888c79ed0094ba2916a1d329861a85515959913c /lib/extensions/input.py
parentb39575a50191307b3b56eab6455626398eec6397 (diff)
Update for Inkscape 1.0 (#880)
* update for inkscape 1.0 * add about extension * Build improvements for the inkscape1.0 branch (#985) * zip: export real svg not stitch plan * #411 and #726 * Tools for Font Creators (#1018) * ignore very small holes in fills * remove embroider (#1026) * auto_fill: ignore shrink_or_grow if result is empty (#589) * break apart: do not ignore small fills Co-authored-by: Hagen Fritsch <rumpeltux-github@irgendwo.org> Co-authored-by: Lex Neva <github.com@lexneva.name>
Diffstat (limited to 'lib/extensions/input.py')
-rw-r--r--lib/extensions/input.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/extensions/input.py b/lib/extensions/input.py
index 957d355c..c6dcb698 100644
--- a/lib/extensions/input.py
+++ b/lib/extensions/input.py
@@ -1,8 +1,9 @@
import os
-import pyembroidery
-from inkex import etree
import inkex
+from lxml import etree
+
+import pyembroidery
from ..stitch_plan import StitchPlan
from ..svg import PIXELS_PER_MM, render_stitch_plan
@@ -10,7 +11,7 @@ from ..svg.tags import INKSCAPE_LABEL
class Input(object):
- def affect(self, args):
+ def run(self, args):
embroidery_file = args[0]
pattern = pyembroidery.read(embroidery_file)
@@ -47,11 +48,11 @@ class Input(object):
# rename the Stitch Plan layer so that it doesn't get overwritten by Embroider
layer = svg.find(".//*[@id='__inkstitch_stitch_plan__']")
- layer.set(INKSCAPE_LABEL, os.path.basename(embroidery_file.decode("UTF-8")))
+ layer.set(INKSCAPE_LABEL, os.path.basename(embroidery_file))
layer.attrib.pop('id')
# Shift the design so that its origin is at the center of the canvas
# Note: this is NOT the same as centering the design in the canvas!
layer.set('transform', 'translate(%s,%s)' % (extents[0], extents[1]))
- print etree.tostring(svg)
+ print(etree.tostring(svg).decode('utf-8'))