Merge remote-tracking branch 'origin/for_webui' into for_webui
This commit is contained in:
commit
a1da98d29c
21 files changed
+46
-28
No files matched your search
+1
-1
@@ -5,7 +5,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"setup-python": "install.bat",
|
||||
"build-python": "pyinstaller -F src-python/test.py --distpath src-tauri/bin --clean -n test-x86_64-pc-windows-msvc",
|
||||
"build-python": "pyinstaller -F src-python/webui_mainloop.py --add-data ./fonts;fonts/ --add-data ./batch;batch/ --add-data .venv/Lib/site-packages/zeroconf;zeroconf/ --add-data .venv/Lib/site-packages/openvr;openvr/ --distpath src-tauri/bin --exclude-module pandas --exclude-module matplotlib --exclude-module PyQt5 --clean -n test-x86_64-pc-windows-msvc",
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -222,35 +222,53 @@ def main():
|
||||
received_data = json.loads(received_data)
|
||||
|
||||
if received_data is True:
|
||||
endpoint = received_data.get("endpoint", None)
|
||||
data = received_data.get("data", None)
|
||||
|
||||
match endpoint.split("/")[1]:
|
||||
case "config":
|
||||
response_data, status = handleConfigRequest(endpoint, data)
|
||||
case "controller":
|
||||
response_data, status = handleControllerRequest(endpoint, data)
|
||||
case _:
|
||||
pass
|
||||
|
||||
response = {
|
||||
"status": status,
|
||||
"endpoint": endpoint,
|
||||
"data": response_data,
|
||||
response_data = {
|
||||
"status": "ok",
|
||||
"id": received_data["id"],
|
||||
"data": received_data["data"],
|
||||
}
|
||||
|
||||
response = json.dumps(response)
|
||||
response = json.dumps(response_data)
|
||||
time.sleep(2)
|
||||
print(response, flush=True)
|
||||
|
||||
# endpoint = received_data.get("endpoint", None)
|
||||
# data = received_data.get("data", None)
|
||||
|
||||
# match endpoint.split("/")[1]:
|
||||
# case "config":
|
||||
# response_data, status = handleConfigRequest(endpoint, data)
|
||||
# case "controller":
|
||||
# response_data, status = handleControllerRequest(endpoint, data)
|
||||
# case _:
|
||||
# pass
|
||||
|
||||
# response = {
|
||||
# "status": status,
|
||||
# "endpoint": endpoint,
|
||||
# "data": response_data,
|
||||
# }
|
||||
|
||||
# response = json.dumps(response)
|
||||
# time.sleep(2)
|
||||
# print(response, flush=True)
|
||||
|
||||
if __name__ == "__main__":
|
||||
endpoint = "/controller/list_mic_host"
|
||||
data = None
|
||||
response_data, status = handleControllerRequest(endpoint, data)
|
||||
response = {
|
||||
"status": status,
|
||||
"endpoint": endpoint,
|
||||
"data": response_data,
|
||||
}
|
||||
response = json.dumps(response)
|
||||
print(response, flush=True)
|
||||
# endpoint = "/controller/list_mic_host"
|
||||
# data = None
|
||||
# response_data, status = handleControllerRequest(endpoint, data)
|
||||
# response = {
|
||||
# "status": status,
|
||||
# "endpoint": endpoint,
|
||||
# "data": response_data,
|
||||
# }
|
||||
# response = json.dumps(response)
|
||||
# print(response, flush=True)
|
||||
|
||||
try:
|
||||
print(json.dumps({"init_key_from_py": "Initialization from Python."}), flush=True)
|
||||
while True:
|
||||
main()
|
||||
except Exception:
|
||||
import traceback
|
||||
with open('error.log', 'a') as f:
|
||||
traceback.print_exc(file=f)
|
||||
Reference in new issue
Block a user