inkstitch/lib/extensions/input.py

24 wiersze
790 B
Python
Czysty Zwykły widok Historia

2021-03-12 04:17:19 +00:00
# Authors: see git history
#
# Copyright (c) 2010 Authors
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
from lxml import etree
from inkex import errormsg
from ..i18n import _
2021-10-09 16:25:29 +00:00
from ..stitch_plan import generate_stitch_plan
2018-04-29 02:29:49 +00:00
class Input(object):
def run(self, args):
2018-04-29 02:29:49 +00:00
embroidery_file = args[0]
if args[0].endswith(('edr', 'col', 'inf')):
msg = _("Ink/Stitch cannot import color formats directly. But you can open the embroidery file and apply the color with "
"Extensions > Ink/Stitch > Thread Color Management > Apply Threadlist")
errormsg(msg)
exit(0)
2021-10-09 16:25:29 +00:00
stitch_plan = generate_stitch_plan(embroidery_file)
print(etree.tostring(stitch_plan).decode('utf-8'))