From 76006dcda7faf01332e4ca47fc1b004121f23273 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Mon, 20 Jan 2025 10:54:51 -0800 Subject: [PATCH] reverse_in_out --- config.template | 1 + modules/checklist.py | 6 +++--- modules/settings.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config.template b/config.template index 507f9ae..b6a872a 100644 --- a/config.template +++ b/config.template @@ -172,6 +172,7 @@ satList = 25544,7530 [checklist] enabled = False checklist_db = data/checklist.db +reverse_in_out = False [qrz] # QRZ Hello to new nodes with message diff --git a/modules/checklist.py b/modules/checklist.py index 382f8f0..3a39482 100644 --- a/modules/checklist.py +++ b/modules/checklist.py @@ -120,7 +120,7 @@ def list_checkin(): timeCheckedIn = time.strftime("%H:%M:%S", time.gmtime(time.time() - time.mktime(time.strptime(row[2] + " " + row[3], "%Y-%m-%d %H:%M:%S")))) checkin_list += "ID: " + row[1] + " checked-In for " + timeCheckedIn if row[5] != "": - checkin_list += " note: " + row[5] + checkin_list += "📝" + row[5] if row != rows[-1]: checkin_list += "\n" # if empty list @@ -140,9 +140,9 @@ def process_checklist_command(nodeID, message, name="none", location="none"): except IndexError: comment = "" # handle checklist commands - if "checkin" in message.lower(): + if ("checkin" in message.lower() and not reverse_in_out) or ("checkout" in message.lower() and reverse_in_out): return checkin(name, current_date, current_time, location, comment) - elif "checkout" in message.lower(): + elif ("checkout" in message.lower() and not reverse_in_out) or ("checkin" in message.lower() and reverse_in_out): return checkout(name, current_date, current_time, location, comment) elif "purgein" in message.lower(): return delete_checkin(nodeID) diff --git a/modules/settings.py b/modules/settings.py index 957010b..e2f2caf 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -272,6 +272,7 @@ try: # checklist checklist_enabled = config['checklist'].getboolean('enabled', False) checklist_db = config['checklist'].get('checklist_db', 'data/checklist.db') + reverse_in_out = config['checklist'].getboolean('reverse_in_out', False) # qrz hello qrz_hello_enabled = config['qrz'].getboolean('enabled', False)