bandsaunter/bandsaunter/__init__.py
The Dust Council 3a253d918f Flash an aircraft's ring red when it is actually heard
The rings travelling out from each aircraft on the live map kept their own
slow rhythm and said only that something was somewhere about.  Now a ring
turns bright red, and thicker, the moment a frame from that aircraft
arrives, held for a few repaints and then cooling back to its own colour
over half a second.  An aeroplane that is flashing is one being heard right
now rather than one that was.

The receiver is read a block at a time, so frames reach the window in
bursts.  Flashing each on arrival would flash every aeroplane at once, once
a block, which says when the block ended rather than when anything was
heard.  So frames are replayed at their own times, late by however late
they have been turning up over the last ten seconds (believed up to three):
the rhythm is the real one, a beat behind.  A listener that does not report
frames one at a time still counts, through each mark's last-heard time.

Four tests: the flash's shape over time, the replay at a lag, a mark
updated without frames, and red pixels actually drawn round a fresh
aircraft and none round a stale one.

Full suite 2901 passed, 4 skipped.  Built as 2026-11-25_01.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:42:32 -07:00

57 lines
2.2 KiB
Python
Executable file

"""bandsaunter -- a signal scanner for RTL-SDR receivers.
Sweeps arbitrary frequency ranges (or US band-plan presets), records what it
finds, and identifies the modulation -- including decoding CW/Morse to text
and transcribing speech.
"""
# Versions are the release date and a revision within that day, so
# 2026-08-21_02 is the second build made on the 21st. The revision is padded
# to two digits so versions sort as text.
VERSION_DATE = "2026-11-25"
VERSION_REVISION = 1
__version__ = f"{VERSION_DATE}_{VERSION_REVISION:02d}"
__all__ = ["__version__", "VERSION_DATE", "VERSION_REVISION",
"pep440_version", "debian_version", "version_notice"]
COPYRIGHT = "Copyright (C) 2026 The Dust Council"
def version_notice(program: str = "bandsaunter") -> str:
"""What ``--version`` prints: the version and the terms it comes under.
The GNU form, and for the GNU reason: the licence tells whoever is running
the program what they are allowed to do with it, and the program is the
only thing in front of them.
"""
return (f"{program} {__version__}\n"
f"{COPYRIGHT}\n"
"License GPLv3+: GNU GPL version 3 or later "
"<https://gnu.org/licenses/gpl.html>\n"
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.")
def pep440_version() -> str:
"""The version as Python packaging tools require it.
PEP 440 allows only digits and dots in the release segment, so the
displayed form cannot be used directly: pip rejects both the dashes and
the underscore. ``2026-08-21_01`` becomes ``2026.8.21.1``, which sorts
the same way and round-trips back to the same date and revision.
"""
year, month, day = VERSION_DATE.split("-")
return f"{int(year)}.{int(month)}.{int(day)}.{VERSION_REVISION}"
def debian_version() -> str:
"""The version as dpkg requires it.
Debian permits alphanumerics and ``. + - : ~`` in an upstream version but
not underscores, so the displayed form cannot be used there either. Dots
keep the zero padding, which makes dpkg's comparison agree with a plain
text sort.
"""
return f"{VERSION_DATE.replace('-', '.')}.{VERSION_REVISION:02d}"