diff --git a/qt/aqt/mediasrv.py b/qt/aqt/mediasrv.py index f034c0792..43395a97f 100644 --- a/qt/aqt/mediasrv.py +++ b/qt/aqt/mediasrv.py @@ -80,7 +80,7 @@ class MediaServer(threading.Thread): logging.getLogger("waitress").setLevel(logging.ERROR) desired_host = os.getenv("ANKI_API_HOST", "127.0.0.1") - desired_port = int(os.getenv("ANKI_API_PORT", "0")) + desired_port = int(os.getenv("ANKI_API_PORT") or 0) self.server = create_server( app, host=desired_host, diff --git a/run b/run index 27fbda0a0..7f4a5f9ea 100755 --- a/run +++ b/run @@ -4,7 +4,14 @@ set -e export PYTHONWARNINGS=default export PYTHONPYCACHEPREFIX=out/pycache -export ANKIDEV=1 +# define these as blank before calling the script if you want to disable them +export ANKIDEV=${ANKIDEV-1} +export QTWEBENGINE_REMOTE_DEBUGGING=${QTWEBENGINE_REMOTE_DEBUGGING-8080} +# The pages can be accessed by, e.g. surfing to +# http://localhost:40000/_anki/pages/deckconfig.html +# Useful in conjunction with tools/web-watch for auto-rebuilding. +export ANKI_API_PORT=${ANKI_API_PORT-40000} +export ANKI_API_HOST=${ANKI_API_HOST-localhost} ./ninja pylib qt ./out/pyenv/bin/python tools/run.py $* diff --git a/tools/ts-run b/tools/ts-run deleted file mode 100755 index 25bc53c9c..000000000 --- a/tools/ts-run +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -# -# The pages can be accessed by, eg surfing to -# http://localhost:40000/_anki/pages/deckconfig.html - -QTWEBENGINE_REMOTE_DEBUGGING=8080 ANKI_API_PORT=40000 ./run $*