Merge master into the Windows port

Three of the four collisions were the same one: master moved the directory
rule into paths.py while this branch was adding a Windows case to the copy in
config.py and the second copy in ggml.py. The case moves to paths.py with the
rest of it, and the directories test moves to tests/test_paths.py where master
put its neighbours.

The fourth is MeetingRecorder, which now starts a process per capture device.
Windows keeps its two lines there: no console window for either process, and
a stop that terminates rather than sending a signal the platform does not have.
This commit is contained in:
2026-08-16 10:14:37 +03:00
26 changed files with 1691 additions and 220 deletions
+14 -11
View File
@@ -46,21 +46,17 @@ import urllib.request
import zipfile
import hub
import paths
from i18n import t
HOST = "127.0.0.1"
# The path api.py asks for, so its URL and the server's line up.
INFERENCE_PATH = "/v1/audio/transcriptions"
def _data_dir():
if sys.platform == "win32":
return pathlib.Path(os.environ.get("LOCALAPPDATA")
or os.path.expanduser("~/AppData/Local")) / "Dikte"
return pathlib.Path(os.environ.get("XDG_DATA_HOME")
or os.path.expanduser("~/.local/share")) / "dikte"
DATA_DIR = _data_dir()
# Not worked out here: a Mac keeps its data under ~/Library, and a copy of the
# rule that did not know that put several gigabytes of models somewhere no Mac
# user looks and uninstall.sh never deleted from.
DATA_DIR = paths.DATA_DIR
BIN_DIR = DATA_DIR / "bin"
MODELS_DIR = DATA_DIR / "models"
@@ -358,10 +354,17 @@ def install_program(program, tag="", on_progress=None, should_stop=None,
if item:
break
if item is None:
# Nothing to download and nothing to install for you: whisper.cpp
# publishes no macOS binary, and Homebrew's whisper-cpp is configured
# with WHISPER_BUILD_SERVER=OFF, so it is whisper-cli that lands and not
# the server Dikte talks to. Building it is a cmake line, and the
# binary is picked up from the PATH or from the box above, the same way
# a distribution's own build is on Linux.
if sys.platform == "darwin" and program is WHISPER:
raise LocalError(t(
"whisper.cpp publishes no macOS build. Install it with: "
"brew install whisper-cpp"
"whisper.cpp has no macOS build, and Homebrew's leaves out the "
"server. Build whisper-server yourself and give its path here, "
"or transcribe in the cloud. See the README."
))
raise LocalError(t("{repo} {tag} has no build for this machine.",
repo=program.repo, tag=tag))