pull/163/head
Lex Neva 2018-04-28 22:14:23 -04:00
rodzic d332e36d16
commit b5fbc23f74
6 zmienionych plików z 16 dodań i 16 usunięć

Wyświetl plik

@ -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:

Wyświetl plik

@ -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

Wyświetl plik

@ -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)

Wyświetl plik

@ -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),

Wyświetl plik

@ -1,3 +1,5 @@
import wx
from .base import InkstitchExtension
from ..simulator import EmbroiderySimulator
from ..stitch_plan import patches_to_stitch_plan

Wyświetl plik

@ -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):