| """Trusted source launcher for Music 3 evidence operations.""" |
|
|
| from __future__ import annotations |
|
|
| import argparse |
| from pathlib import Path |
| import runpy |
| import sys |
|
|
|
|
| def main(argv: list[str] | None = None) -> int: |
| parser = argparse.ArgumentParser(add_help=False) |
| parser.add_argument("--project-root", required=True) |
| parser.add_argument("--diffusers-root", required=True) |
| parser.add_argument("arguments", nargs=argparse.REMAINDER) |
| args = parser.parse_args(argv) |
| arguments = list(args.arguments) |
| if arguments and arguments[0] == "--": |
| arguments.pop(0) |
| project_root = Path(args.project_root).expanduser().absolute() |
| diffusers_root = Path(args.diffusers_root).expanduser().absolute() |
| namespace = runpy.run_path( |
| project_root / "src" / "music3lab" / "bootstrap.py" |
| ) |
| return int( |
| namespace["bootstrap_main"]( |
| project_root=project_root, |
| diffusers_root=diffusers_root, |
| argv=arguments, |
| ) |
| ) |
|
|
|
|
| if __name__ == "__main__": |
| raise SystemExit(main()) |
|
|