summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-04-28 22:14:23 -0400
committerLex Neva <github.com@lexneva.name>2018-04-29 21:45:56 -0400
commitb5fbc23f746c86cc985711026d6585991c3251f4 (patch)
treeeda2869908e6e2d94dd439da59b4cfa534767e99
parentd332e36d16ff3325427a0f2129af503c6189dcdc (diff)
fixes
-rw-r--r--inkstitch.py14
-rw-r--r--inkstitch/extensions/__init__.py2
-rw-r--r--inkstitch/extensions/params.py4
-rw-r--r--inkstitch/extensions/print_pdf.py (renamed from inkstitch/extensions/print.py)4
-rw-r--r--inkstitch/extensions/simulate.py2
-rw-r--r--inkstitch/simulator.py6
6 files changed, 16 insertions, 16 deletions
diff --git a/inkstitch.py b/inkstitch.py
index bd3f3f48..fe8d6ecb 100644
--- a/inkstitch.py
+++ b/inkstitch.py
@@ -5,15 +5,11 @@ from inkstitch.utils import save_stderr, restore_stderr
from inkstitch import extensions
-def get_extension():
- parser = ArgumentParser()
- parser.add_argument("--extension")
- args, extras = parser.parse_known_args()
+parser = ArgumentParser()
+parser.add_argument("--extension")
+my_args, remaining_args = parser.parse_known_args()
- return args.extension
-
-
-extension_name = get_extension()
+extension_name = my_args.extension
extension_class = getattr(extensions, extension_name.capitalize())
extension = extension_class()
@@ -21,7 +17,7 @@ exception = None
save_stderr()
try:
- extension.affect()
+ extension.affect(args=remaining_args)
except (SystemExit, KeyboardInterrupt):
raise
except Exception:
diff --git a/inkstitch/extensions/__init__.py b/inkstitch/extensions/__init__.py
index 20449866..4c8317d0 100644
--- a/inkstitch/extensions/__init__.py
+++ b/inkstitch/extensions/__init__.py
@@ -1,5 +1,5 @@
from embroider import Embroider
from palettes import Palettes
from params import Params
-from print import Print
+from print_pdf import Print
from simulate import Simulate
diff --git a/inkstitch/extensions/params.py b/inkstitch/extensions/params.py
index a9bff6cc..881dab49 100644
--- a/inkstitch/extensions/params.py
+++ b/inkstitch/extensions/params.py
@@ -1,3 +1,5 @@
+# -*- coding: UTF-8 -*-
+
import os
import sys
import json
@@ -630,7 +632,7 @@ class SettingsFrame(wx.Frame):
self.Layout()
# end wxGlade
-class EmbroiderParams(InkstitchExtension):
+class Params(InkstitchExtension):
def __init__(self, *args, **kwargs):
self.cancelled = False
InkstitchExtension.__init__(self, *args, **kwargs)
diff --git a/inkstitch/extensions/print.py b/inkstitch/extensions/print_pdf.py
index 0241639e..5d462c0f 100644
--- a/inkstitch/extensions/print.py
+++ b/inkstitch/extensions/print_pdf.py
@@ -106,7 +106,7 @@ class PrintPreviewServer(Thread):
if getattr(sys, 'frozen', False):
self.resources_path = os.path.join(sys._MEIPASS, 'print', 'resources')
else:
- self.resources_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'print', 'resources')
+ self.resources_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..', 'print', 'resources'))
def __setup_app(self):
self.__set_resources_path()
@@ -283,7 +283,7 @@ class Print(InkstitchExtension):
if getattr( sys, 'frozen', False ) :
template_dir = os.path.join(sys._MEIPASS, "print", "templates")
else:
- template_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "print", "templates")
+ template_dir = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..", "print", "templates"))
env = Environment(
loader = FileSystemLoader(template_dir),
diff --git a/inkstitch/extensions/simulate.py b/inkstitch/extensions/simulate.py
index 377649c3..75bc62c7 100644
--- a/inkstitch/extensions/simulate.py
+++ b/inkstitch/extensions/simulate.py
@@ -1,3 +1,5 @@
+import wx
+
from .base import InkstitchExtension
from ..simulator import EmbroiderySimulator
from ..stitch_plan import patches_to_stitch_plan
diff --git a/inkstitch/simulator.py b/inkstitch/simulator.py
index dc60e4d8..cc9442ea 100644
--- a/inkstitch/simulator.py
+++ b/inkstitch/simulator.py
@@ -1,11 +1,11 @@
+import sys
import numpy
import wx
import colorsys
from itertools import izip
-from .base import InkstitchExtension
-from .. import PIXELS_PER_MM
-from ..svg import color_block_to_point_lists
+from . import PIXELS_PER_MM
+from .svg import color_block_to_point_lists
class EmbroiderySimulator(wx.Frame):