32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
"""Run the src-layout application from a checkout without installing packages."""
|
|
|
|
import runpy
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
def main():
|
|
"""Expose existing module CLIs while leaving their arguments unchanged."""
|
|
source_directory = Path(__file__).resolve().parent / "src"
|
|
sys.path.insert(0, str(source_directory))
|
|
|
|
commands = {
|
|
"usac": "opportunity_intelligence.collectors.usac",
|
|
"lrs": "opportunity_intelligence.collectors.lrs",
|
|
"qualify": "opportunity_intelligence.qualification.lrs",
|
|
"practical": "opportunity_intelligence.qualification.practical",
|
|
}
|
|
if len(sys.argv) < 2 or sys.argv[1] in ("-h", "--help"):
|
|
print("Usage: python w1.py {usac,lrs,qualify,practical} [options]")
|
|
print("Use a command followed by --help for its existing options.")
|
|
return
|
|
|
|
command = sys.argv.pop(1)
|
|
if command not in commands:
|
|
raise SystemExit(f"Unknown command {command!r}; choose usac, lrs, qualify or practical.")
|
|
runpy.run_module(commands[command], run_name="__main__")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|