add webserver
This commit is contained in:
30
chatbug/ui/ui.py
Normal file
30
chatbug/ui/ui.py
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
import webview
|
||||
from threading import Thread
|
||||
|
||||
|
||||
def start_ui(threaded=False):
|
||||
if threaded:
|
||||
_start_threaded()
|
||||
else:
|
||||
_start_normal()
|
||||
|
||||
|
||||
def _start_threaded():
|
||||
t = Thread(target=start_ui, args=[False])
|
||||
t.run()
|
||||
|
||||
def _start_normal():
|
||||
webview.create_window('Geargenerator', 'http://localhost:8080', min_size=(1200, 900), zoomable=True)
|
||||
webview.start()
|
||||
|
||||
def _start_sandboxed():
|
||||
webview.create_window('Geargenerator', 'web_v2/geargenerator.html', min_size=(1200, 900), zoomable=True)
|
||||
webview.start(ssl=True)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
_start_sandboxed()
|
||||
# start_ui(threaded=False)
|
Reference in New Issue
Block a user