Files
UmbraTrans/umbratrans_web/__main__.py
umbra audio dda079f605 commit audio ingest: apply 0008+0009 migrations, wire Postgres adapter to commit path
- Apply migration 0008_audio_source_import (additive schema for source import)
- Apply migration 0009_translation_import_runs (ledger table for import runs)
- Wire PostgresAudioImportStore into HTTP commit path with org from node credential
- Commit path uses PG store with org from node, no payload org
- Bundle hash 21ce5687… remains frozen until v2; no authority transferred
2026-10-19 04:35:07 -07:00

41 lines
1.2 KiB
Python

# Copyright 2026 Umbra Tools (umbratools.com)
# SPDX-License-Identifier: Apache-2.0
"""Module entry point: ``python -m umbratrans_web <command>``.
``bootstrap-admin`` is the hidden-prompt operator command and is also installed
as the ``umbratrans-bootstrap-admin`` console script. ``serve`` runs the
development API on the loopback interface.
"""
from __future__ import annotations
import sys
from collections.abc import Sequence
from .cli import bootstrap_admin, import_audio, serve
COMMANDS = {
"bootstrap-admin": bootstrap_admin,
"import-audio": import_audio,
"serve": serve,
}
def main(argv: Sequence[str] | None = None) -> int:
args = list(argv) if argv is not None else sys.argv[1:]
if not args or args[0] in {"-h", "--help"}:
print("usage: python -m umbratrans_web {" + ",".join(sorted(COMMANDS)) + "}", file=sys.stderr)
print("See each command's --help output. No command accepts a password argument.", file=sys.stderr)
return 0
command, rest = args[0], args[1:]
handler = COMMANDS.get(command)
if handler is None:
print(f"unknown command: {command}", file=sys.stderr)
return 2
return handler(rest)
if __name__ == "__main__":
raise SystemExit(main())