summaryrefslogtreecommitdiff
path: root/lib/stitch_plan
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2019-08-03 23:14:36 -0400
committerLex Neva <github.com@lexneva.name>2019-08-10 22:14:47 -0400
commit363e05209780149f53fba1f749240f706cc01cec (patch)
treea155e0723b31d7a62bea5d17646a50a5b33a524e /lib/stitch_plan
parent077f7ea72ba38790bf030d3181c44787fef953b6 (diff)
input: read STOP commands too
Diffstat (limited to 'lib/stitch_plan')
-rw-r--r--lib/stitch_plan/stitch_plan.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/stitch_plan/stitch_plan.py b/lib/stitch_plan/stitch_plan.py
index b621ef07..c62ebe98 100644
--- a/lib/stitch_plan/stitch_plan.py
+++ b/lib/stitch_plan/stitch_plan.py
@@ -210,6 +210,20 @@ class ColorBlock(object):
else:
return False
+ @property
+ def trim_after(self):
+ # If there's a STOP, it will be at the end. We still want to return
+ # True.
+ for stitch in reversed(self.stitches):
+ if stitch.stop or stitch.jump:
+ continue
+ elif stitch.trim:
+ return True
+ else:
+ break
+
+ return False
+
def filter_duplicate_stitches(self):
if not self.stitches:
return