From d9525968a2462270ed5ef0f2ec1742c8ae325079 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 23 Oct 2018 18:08:46 -0600 Subject: fix manual stitch and add debugging support (#339) * add debugging support using pydev * fix: don't add tie stitches for manual stitch * fix style --- inkstitch.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'inkstitch.py') diff --git a/inkstitch.py b/inkstitch.py index 2e21d964..b466a508 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 -- cgit v1.2.3