summaryrefslogtreecommitdiff
path: root/lib/stitch_plan/generate_stitch_plan.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-07-27 07:28:20 +0200
committerGitHub <noreply@github.com>2025-07-27 07:28:20 +0200
commit731ac2868e30dbccf5771abf79564d8bab1156c2 (patch)
tree29f3de6e7694b8ce1cac19756e4f143fd29e8bcd /lib/stitch_plan/generate_stitch_plan.py
parent4dd03c18acbec4c44943c224ea9b66e262e9fd76 (diff)
rename pyembroidery to pystitch (#3889)
... and remove it as a submodule (use pip to install)
Diffstat (limited to 'lib/stitch_plan/generate_stitch_plan.py')
-rw-r--r--lib/stitch_plan/generate_stitch_plan.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/stitch_plan/generate_stitch_plan.py b/lib/stitch_plan/generate_stitch_plan.py
index cdd66d9e..c9faff4f 100644
--- a/lib/stitch_plan/generate_stitch_plan.py
+++ b/lib/stitch_plan/generate_stitch_plan.py
@@ -9,7 +9,7 @@ from html import escape
import inkex
-import pyembroidery
+import pystitch
from ..i18n import _
from ..svg import PIXELS_PER_MM, render_stitch_plan
@@ -20,23 +20,23 @@ from .stitch_plan import StitchPlan
def generate_stitch_plan(embroidery_file, import_commands="symbols"): # noqa: C901
validate_file_path(embroidery_file)
- pattern = pyembroidery.read(embroidery_file)
+ pattern = pystitch.read(embroidery_file)
stitch_plan = StitchPlan()
color_block = None
for raw_stitches, thread in pattern.get_as_colorblocks():
color_block = stitch_plan.new_color_block(thread)
for x, y, command in raw_stitches:
- if command == pyembroidery.STITCH:
+ if command == pystitch.STITCH:
color_block.add_stitch(Stitch(x * PIXELS_PER_MM / 10.0, y * PIXELS_PER_MM / 10.0))
if len(color_block) > 0:
- if import_commands == "none" and command in [pyembroidery.TRIM, pyembroidery.STOP]:
+ if import_commands == "none" and command in [pystitch.TRIM, pystitch.STOP]:
# Importing commands is not wanted:
# start a new color block without inserting the command
color_block = stitch_plan.new_color_block(thread)
- elif command == pyembroidery.TRIM:
+ elif command == pystitch.TRIM:
color_block.add_stitch(trim=True)
- elif command == pyembroidery.STOP:
+ elif command == pystitch.STOP:
color_block.add_stitch(stop=True)
color_block = stitch_plan.new_color_block(thread)