stations.txt: SERIAL [position], the position read by the app for the weather

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-17 08:51:48 +01:00
1 parent 6454ffef0f
commit 088484c376
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -43,7 +43,7 @@ from sqlalchemy import create_engine, text
from sqlalchemy.engine import URL
UTC = timezone.utc
STATIONS = Path(__file__).resolve().parent / "stations.txt" # the tracked stations, one per line
STATIONS = Path(__file__).resolve().parent / "stations.txt" # the tracked stations, one per line: "SERIAL [position]"
NEW_STATION_DAYS = 30 # without --from, a station with no pumped displacements: the last 30 days
DB_NAMES = ["AIMSIGHT_DATABASE_USER", "AIMSIGHT_DATABASE_PSWD", "AIMSIGHT_DATABASE_TURL", "AIMSIGHT_DATABASE_NAME"]
TYPES = {"images": "OPTICAL_SHIFT-IRON", "images_diff": "OPTICAL_SHIFT-DIFF"} # folder -> measurement type
@@ -361,7 +361,7 @@ def main():
tomorrow = datetime.now(UTC).date() + timedelta(days=1)
start = datetime.strptime(a.start, "%Y-%m-%d").date() if a.start else None
end = min(datetime.strptime(a.end, "%Y-%m-%d").date(), tomorrow) if a.end else tomorrow # no day to come
stations = a.stations or STATIONS.read_text().split()
stations = a.stations or list(dict.fromkeys(l.split()[0] for l in STATIONS.read_text().splitlines() if l.strip()))
missing = [n for n in DB_NAMES if not os.environ.get(n)]
if missing: