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.
|
|
|
|
|
2021-03-04 17:40:53 +00:00
|
|
|
from lxml import etree
|
|
|
|
|
2022-06-24 15:11:52 +00:00
|
|
|
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):
|
2021-03-04 17:40:53 +00:00
|
|
|
def run(self, args):
|
2018-04-29 02:29:49 +00:00
|
|
|
embroidery_file = args[0]
|
2022-06-24 15:11:52 +00:00
|
|
|
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'))
|