kopia lustrzana https://github.com/inkstitch/inkstitch
fixes
rodzic
d332e36d16
commit
b5fbc23f74
14
inkstitch.py
14
inkstitch.py
|
@ -5,15 +5,11 @@ from inkstitch.utils import save_stderr, restore_stderr
|
||||||
from inkstitch import extensions
|
from inkstitch import extensions
|
||||||
|
|
||||||
|
|
||||||
def get_extension():
|
parser = ArgumentParser()
|
||||||
parser = ArgumentParser()
|
parser.add_argument("--extension")
|
||||||
parser.add_argument("--extension")
|
my_args, remaining_args = parser.parse_known_args()
|
||||||
args, extras = parser.parse_known_args()
|
|
||||||
|
|
||||||
return args.extension
|
extension_name = my_args.extension
|
||||||
|
|
||||||
|
|
||||||
extension_name = get_extension()
|
|
||||||
extension_class = getattr(extensions, extension_name.capitalize())
|
extension_class = getattr(extensions, extension_name.capitalize())
|
||||||
extension = extension_class()
|
extension = extension_class()
|
||||||
|
|
||||||
|
@ -21,7 +17,7 @@ exception = None
|
||||||
|
|
||||||
save_stderr()
|
save_stderr()
|
||||||
try:
|
try:
|
||||||
extension.affect()
|
extension.affect(args=remaining_args)
|
||||||
except (SystemExit, KeyboardInterrupt):
|
except (SystemExit, KeyboardInterrupt):
|
||||||
raise
|
raise
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from embroider import Embroider
|
from embroider import Embroider
|
||||||
from palettes import Palettes
|
from palettes import Palettes
|
||||||
from params import Params
|
from params import Params
|
||||||
from print import Print
|
from print_pdf import Print
|
||||||
from simulate import Simulate
|
from simulate import Simulate
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# -*- coding: UTF-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
|
@ -630,7 +632,7 @@ class SettingsFrame(wx.Frame):
|
||||||
self.Layout()
|
self.Layout()
|
||||||
# end wxGlade
|
# end wxGlade
|
||||||
|
|
||||||
class EmbroiderParams(InkstitchExtension):
|
class Params(InkstitchExtension):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.cancelled = False
|
self.cancelled = False
|
||||||
InkstitchExtension.__init__(self, *args, **kwargs)
|
InkstitchExtension.__init__(self, *args, **kwargs)
|
||||||
|
|
|
@ -106,7 +106,7 @@ class PrintPreviewServer(Thread):
|
||||||
if getattr(sys, 'frozen', False):
|
if getattr(sys, 'frozen', False):
|
||||||
self.resources_path = os.path.join(sys._MEIPASS, 'print', 'resources')
|
self.resources_path = os.path.join(sys._MEIPASS, 'print', 'resources')
|
||||||
else:
|
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):
|
def __setup_app(self):
|
||||||
self.__set_resources_path()
|
self.__set_resources_path()
|
||||||
|
@ -283,7 +283,7 @@ class Print(InkstitchExtension):
|
||||||
if getattr( sys, 'frozen', False ) :
|
if getattr( sys, 'frozen', False ) :
|
||||||
template_dir = os.path.join(sys._MEIPASS, "print", "templates")
|
template_dir = os.path.join(sys._MEIPASS, "print", "templates")
|
||||||
else:
|
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(
|
env = Environment(
|
||||||
loader = FileSystemLoader(template_dir),
|
loader = FileSystemLoader(template_dir),
|
|
@ -1,3 +1,5 @@
|
||||||
|
import wx
|
||||||
|
|
||||||
from .base import InkstitchExtension
|
from .base import InkstitchExtension
|
||||||
from ..simulator import EmbroiderySimulator
|
from ..simulator import EmbroiderySimulator
|
||||||
from ..stitch_plan import patches_to_stitch_plan
|
from ..stitch_plan import patches_to_stitch_plan
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
|
import sys
|
||||||
import numpy
|
import numpy
|
||||||
import wx
|
import wx
|
||||||
import colorsys
|
import colorsys
|
||||||
from itertools import izip
|
from itertools import izip
|
||||||
|
|
||||||
from .base import InkstitchExtension
|
from . import PIXELS_PER_MM
|
||||||
from .. import PIXELS_PER_MM
|
from .svg import color_block_to_point_lists
|
||||||
from ..svg import color_block_to_point_lists
|
|
||||||
|
|
||||||
|
|
||||||
class EmbroiderySimulator(wx.Frame):
|
class EmbroiderySimulator(wx.Frame):
|
||||||
|
|
Ładowanie…
Reference in New Issue