summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2018-10-23 18:08:46 -0600
committerGitHub <noreply@github.com>2018-10-23 18:08:46 -0600
commitd9525968a2462270ed5ef0f2ec1742c8ae325079 (patch)
tree24d0aa04d2a392a64f206e6d5abba2a185b4118c
parent3e6704e5c0382ba6b338649bb656dbc7d76508fc (diff)
fix manual stitch and add debugging support (#339)
* add debugging support using pydev * fix: don't add tie stitches for manual stitch * fix style
-rw-r--r--.gitignore4
-rw-r--r--inkstitch.py16
-rw-r--r--lib/stitch_plan/ties.py2
3 files changed, 20 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index f0728d0b..55c21077 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 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
diff --git a/lib/stitch_plan/ties.py b/lib/stitch_plan/ties.py
index 1d759c0e..5acf16e6 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