From 87300e19c3b20beb2d1112c12b2a51ac56d4c577 Mon Sep 17 00:00:00 2001 From: Aldo Mendoza Date: Wed, 4 Dec 2024 20:01:01 -0800 Subject: [PATCH] Add STATION_CALLSIGN field to ADIF output --- not1mm/lib/plugin_common.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/not1mm/lib/plugin_common.py b/not1mm/lib/plugin_common.py index f72a4c1..34e64c3 100644 --- a/not1mm/lib/plugin_common.py +++ b/not1mm/lib/plugin_common.py @@ -21,10 +21,11 @@ def gen_adif(self, cabrillo_name: str, contest_id=""): """ now = datetime.datetime.now() date_time = now.strftime("%Y-%m-%d_%H-%M-%S") + station_callsign = self.station.get('Call', '').upper() filename = ( str(Path.home()) + "/" - + f"{self.station.get('Call', '').upper()}_{cabrillo_name}_{date_time}.adi" + + f"{station_callsign}_{cabrillo_name}_{date_time}.adi" ) log = self.database.fetch_all_contacts_asc() try: @@ -71,6 +72,15 @@ def gen_adif(self, cabrillo_name: str, contest_id=""): except TypeError: ... + try: + print( + f"{station_callsign}", + end="\r\n", + file=file_descriptor, + ) + except TypeError: + ... + try: print( f"{hiscall.upper()}",