DANGDOCAO commited on
Commit
bf1dd33
·
verified ·
1 Parent(s): 85af144
Files changed (1) hide show
  1. HVU_QA/main.py +0 -31
HVU_QA/main.py DELETED
@@ -1,31 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import os
4
- import threading
5
- import webbrowser
6
-
7
- from backend import create_app
8
-
9
- app = create_app()
10
-
11
-
12
- def _as_bool(value: str | None, default: bool) -> bool:
13
- if value is None:
14
- return default
15
- return value.strip().lower() not in {"0", "false", "no", "off"}
16
-
17
-
18
- def _open_browser_later(host: str, port: int) -> None:
19
- if not _as_bool(os.getenv("HVU_OPEN_BROWSER"), True):
20
- return
21
- target_host = "127.0.0.1" if host in {"0.0.0.0", "::"} else host
22
- url = f"http://{target_host}:{port}"
23
- threading.Timer(1.2, lambda: webbrowser.open(url)).start()
24
-
25
-
26
- if __name__ == "__main__":
27
- host = os.getenv("HVU_HOST", "127.0.0.1")
28
- port = int(os.getenv("HVU_PORT", "5000"))
29
- debug = _as_bool(os.getenv("HVU_DEBUG"), False)
30
- _open_browser_later(host, port)
31
- app.run(host=host, port=port, debug=debug, use_reloader=False)