mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
fix some warnings on startup
This commit is contained in:
parent
e3c9502b46
commit
a61f3bbc48
2 changed files with 12 additions and 6 deletions
|
@ -20,11 +20,12 @@ def _build_info_path() -> str:
|
||||||
|
|
||||||
def _get_build_info() -> Dict[str, str]:
|
def _get_build_info() -> Dict[str, str]:
|
||||||
info = {}
|
info = {}
|
||||||
for line in open(_build_info_path()).readlines():
|
with open(_build_info_path()) as file:
|
||||||
elems = line.split()
|
for line in file.readlines():
|
||||||
if len(elems) == 2:
|
elems = line.split()
|
||||||
k, v = elems
|
if len(elems) == 2:
|
||||||
info[k] = v
|
k, v = elems
|
||||||
|
info[k] = v
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,12 @@ class MediaServer(threading.Thread):
|
||||||
logging.getLogger("waitress").setLevel(logging.ERROR)
|
logging.getLogger("waitress").setLevel(logging.ERROR)
|
||||||
|
|
||||||
desired_port = int(os.getenv("ANKI_API_PORT", "0"))
|
desired_port = int(os.getenv("ANKI_API_PORT", "0"))
|
||||||
self.server = create_server(app, host="127.0.0.1", port=desired_port)
|
self.server = create_server(
|
||||||
|
app,
|
||||||
|
host="127.0.0.1",
|
||||||
|
port=desired_port,
|
||||||
|
clear_untrusted_proxy_headers=True,
|
||||||
|
)
|
||||||
if devMode:
|
if devMode:
|
||||||
print(
|
print(
|
||||||
"Serving on http://%s:%s"
|
"Serving on http://%s:%s"
|
||||||
|
|
Loading…
Reference in a new issue