26 lines
672 B
Python
26 lines
672 B
Python
#!/usr/bin/env python3
|
|
"""Launch Orisys AutoCal from the source tree."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parent
|
|
SRC = ROOT / "src"
|
|
SHARED_SRC = ROOT.parents[1] / "shared" / "src"
|
|
for path in (SRC, SHARED_SRC):
|
|
if path.is_dir() and str(path) not in sys.path:
|
|
sys.path.insert(0, str(path))
|
|
|
|
# Resolve config/outputs to this app, and set the app id before any shared
|
|
# import can read it (see orisys_app_shared.paths).
|
|
os.environ.setdefault("ORISYS_APP_ID", "autocal")
|
|
os.chdir(ROOT)
|
|
|
|
from orisys_autocal.main import main
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|