diff --git a/.gitignore b/.gitignore index f0728d0b3..55c210775 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,7 @@ build/ locales/ /inx/ messages.po +/DEBUG +.pydevproject +.project + diff --git a/inkstitch.py b/inkstitch.py index 2e21d964a..b466a5089 100644 --- a/inkstitch.py +++ b/inkstitch.py @@ -1,14 +1,28 @@ +import os import sys import traceback from argparse import ArgumentParser -from lib.utils import save_stderr, restore_stderr + from lib import extensions +from lib.utils import save_stderr, restore_stderr parser = ArgumentParser() parser.add_argument("--extension") my_args, remaining_args = parser.parse_known_args() +if os.path.exists(os.path.join(os.path.dirname(os.path.realpath(__file__)), "DEBUG")): + # How to debug Ink/Stitch: + # + # 1. Install LiClipse (liclipse.com) -- no need to install Eclipse first + # 2. Start debug server as described here: http://www.pydev.org/manual_adv_remote_debugger.html + # * follow the "Note:" to enable the debug server menu item + # 3. Create a file named "DEBUG" next to inkstitch.py in your git clone. + # 4. Run any extension and PyDev will start debugging. + + import pydevd + pydevd.settrace() + extension_name = my_args.extension # example: foo_bar_baz -> FooBarBaz diff --git a/lib/stitch_plan/ties.py b/lib/stitch_plan/ties.py index 1d759c0e9..5acf16e66 100644 --- a/lib/stitch_plan/ties.py +++ b/lib/stitch_plan/ties.py @@ -5,7 +5,7 @@ from ..svg import PIXELS_PER_MM def add_tie(stitches, tie_path): - if len(tie_path) < 2 or stitches[0].no_ties: + if len(tie_path) < 2 or tie_path[0].no_ties: # It's from a manual stitch block, so don't add tie stitches. The user # will add them if they want them. return