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/simulator.py | |
| parent | eb526927e16954390d06929535d6f5c3766b5f6c (diff) | |
electron simulator (#531)
Diffstat (limited to 'lib/extensions/simulator.py')
| -rw-r--r-- | lib/extensions/simulator.py | 17 |
1 files changed, 17 insertions, 0 deletions
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() |
