Files
spothole/main.py
2025-09-27 10:00:12 +01:00

60 lines
1.6 KiB
Python

# Main script
import signal
from providers.dxcluster import DXCluster
from providers.gma import GMA
from providers.pota import POTA
from providers.sota import SOTA
from providers.wwbota import WWBOTA
from providers.wwff import WWFF
# Shutdown function
def shutdown(sig, frame):
print("Stopping program, this may take a few seconds...")
for p in providers: p.stop()
# Main function
if __name__ == '__main__':
# Shut down gracefully on SIGINT
signal.signal(signal.SIGINT, shutdown)
# Create providers
providers = [
POTA(),
SOTA(),
WWFF(),
WWBOTA(),
GMA(),
# todo HEMA
# todo PNP
# todo RBN
# todo packet?
# todo APRS?
DXCluster("hrd.wa9pie.net", 8000),
# DXCluster("dxc.w3lpl.net", 22)
]
# Set up spot list
spot_list = []
# Set up data providers
for p in providers: p.setup(spot_list=spot_list)
# Start data providers
for p in providers: p.start()
# todo thread to clear spot list of old data
# Todo serve spot API
# Todo spot API arguments e.g. "since" based on received_time of spots, sig only, dx cont, dxcc, de cont, band, mode, filter out qrt, filter pre-qsy
# Todo serve status API
# Todo serve apidocs
# Todo serve website
# TODO NOTES FOR NGINX REVERSE PROXY
# local cache time of 15 sec to avoid over burdening python?
# TODO NOTES FOR FIELD SPOTTER
# Still need to de-dupe spots
# Still need to do QSY checking in FS because we can enable/disable showing them and don't want to re-query the API.
# Filter comments, still do in FS or move that here?