From 1b31806423c8fec4040fed6d1009db016860b763 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 1 May 2018 20:37:51 -0400 Subject: rename inkstitch/ to lib/ You can't have a module and a package named the same thing. PyInstaller wants to import the main script as if it were a module, and this doesn't work unless there's no directory of the same name with a __init__.py in it. --- lib/extensions/simulate.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/extensions/simulate.py (limited to 'lib/extensions/simulate.py') diff --git a/lib/extensions/simulate.py b/lib/extensions/simulate.py new file mode 100644 index 00000000..75bc62c7 --- /dev/null +++ b/lib/extensions/simulate.py @@ -0,0 +1,27 @@ +import wx + +from .base import InkstitchExtension +from ..simulator import EmbroiderySimulator +from ..stitch_plan import patches_to_stitch_plan + + +class Simulate(InkstitchExtension): + def __init__(self): + InkstitchExtension.__init__(self) + self.OptionParser.add_option("-P", "--path", + action="store", type="string", + dest="path", default=".", + help="Directory in which to store output file") + + def effect(self): + if not self.get_elements(): + return + + patches = self.elements_to_patches(self.elements) + stitch_plan = patches_to_stitch_plan(patches) + app = wx.App() + frame = EmbroiderySimulator(None, -1, _("Embroidery Simulation"), wx.DefaultPosition, size=(1000, 1000), stitch_plan=stitch_plan) + app.SetTopWindow(frame) + frame.Show() + wx.CallAfter(frame.go) + app.MainLoop() -- cgit v1.2.3 From 05daffb7e01db55879eb24f3c00532324a5d41af Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 1 May 2018 21:21:07 -0400 Subject: refactor everything out of lib/__init__.py --- lib/extensions/simulate.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/extensions/simulate.py') diff --git a/lib/extensions/simulate.py b/lib/extensions/simulate.py index 75bc62c7..0c372d4d 100644 --- a/lib/extensions/simulate.py +++ b/lib/extensions/simulate.py @@ -1,6 +1,7 @@ import wx from .base import InkstitchExtension +from ..i18n import _ from ..simulator import EmbroiderySimulator from ..stitch_plan import patches_to_stitch_plan -- cgit v1.2.3