diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2020-04-28 12:34:05 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-28 18:34:05 +0200 |
| commit | cb2b4e3522cb7f426ba5ad3e68deb9e6ccc581ec (patch) | |
| tree | 2a2f38823c3c9f0b5439ce2aa7c9040299109292 /lib/extensions | |
| parent | eb526927e16954390d06929535d6f5c3766b5f6c (diff) | |
electron simulator (#531)
Diffstat (limited to 'lib/extensions')
| -rw-r--r-- | lib/extensions/__init__.py | 6 | ||||
| -rw-r--r-- | lib/extensions/simulator.py | 17 |
2 files changed, 20 insertions, 3 deletions
diff --git a/lib/extensions/__init__.py b/lib/extensions/__init__.py index 6f9ef5c4..3c67700b 100644 --- a/lib/extensions/__init__.py +++ b/lib/extensions/__init__.py @@ -16,7 +16,7 @@ from output import Output from params import Params from print_pdf import Print from remove_embroidery_settings import RemoveEmbroiderySettings -from simulate import Simulate +from simulator import Simulator from stitch_plan_preview import StitchPlanPreview from zip import Zip @@ -25,7 +25,6 @@ __all__ = extensions = [Embroider, Install, Params, Print, - Simulate, Input, Output, Zip, @@ -40,4 +39,5 @@ __all__ = extensions = [Embroider, Troubleshoot, RemoveEmbroiderySettings, BreakApart, - ImportThreadlist] + ImportThreadlist, + Simulator] diff --git a/lib/extensions/simulator.py b/lib/extensions/simulator.py new file mode 100644 index 00000000..1c0627ba --- /dev/null +++ b/lib/extensions/simulator.py @@ -0,0 +1,17 @@ +from ..api import APIServer +from ..gui import open_url + +from .base import InkstitchExtension + + +class Simulator(InkstitchExtension): + def __init__(self): + InkstitchExtension.__init__(self) + + def effect(self): + api_server = APIServer(self) + port = api_server.start_server() + electron = open_url("/simulator?port=%d" % port) + electron.wait() + api_server.stop() + api_server.join() |
