forked from meshfinity/meshfinity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
35 lines (29 loc) · 798 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
import time
import webview
from tsr_web_api import TsrWebApi
def show_after_delay(window):
# Avoid the flash of white background if possible...
time.sleep(0.6)
window.show()
if __name__ == "__main__":
api = TsrWebApi()
window = webview.create_window(
"Meshfinity",
(
"http://localhost:5173"
if os.getenv("MESHFINITY_ENVIRONMENT") == "development"
else "assets/index.html"
),
js_api=api,
min_size=(800, 600),
hidden=True,
)
api.bind_window(window)
webview.start(
show_after_delay,
args=(window),
debug=os.getenv("MESHFINITY_ENVIRONMENT") == "development",
)
api.kill_running_processes()