From afd1bcae17ec69cfe306ef8944159a905fdfa6fd Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 3 Oct 2024 23:00:34 -0700 Subject: [PATCH] enhance --- etc/report_generator.py | 19 +++++++++++++++++-- mesh_bot.py | 2 +- modules/system.py | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/etc/report_generator.py b/etc/report_generator.py index 502623c..8e37571 100644 --- a/etc/report_generator.py +++ b/etc/report_generator.py @@ -73,12 +73,12 @@ def parse_log_file(file_path): log_data['command_counts'][cmd] += 1 log_data['command_timestamps'].append((timestamp.isoformat(), cmd)) - if 'Sending DM:' in line or 'Sending Multi-Chunk DM:' in line: + if 'Sending DM:' in line or 'Sending Multi-Chunk DM:' in line or 'SendingChannel:' in line or 'Sending Multi-Chunk Message:' in line: log_data['message_types']['Outgoing DM'] += 1 log_data['total_messages'] += 1 log_data['message_timestamps'].append((timestamp.isoformat(), 'Outgoing DM')) - if 'Received DM:' in line: + if 'Received DM:' in line or 'Ignoring DM:' in line or 'Ignoring Message:' in line or 'ReceivedChannel:' in line: log_data['message_types']['Incoming DM'] += 1 log_data['total_messages'] += 1 log_data['message_timestamps'].append((timestamp.isoformat(), 'Incoming DM')) @@ -232,6 +232,7 @@ def get_system_info(): def get_wall_of_shame(): # Get the wall of shame + return { 'shame': "N/A", } @@ -265,11 +266,21 @@ def get_database_info(): golfsim_score = pickle.load(f) f.close() + with open('../bbsdb.pkl', 'rb') as f: + bbsdb = pickle.load(f) + f.close() + + with open('../bbsdm.pkl', 'rb') as f: + bbsdm = pickle.load(f) + f.close() + except Exception as e: pass return { 'database': "N/A", + "bbsdb": bbsdb, + "bbsdm": bbsdm, 'lemon_score': lemon_score, 'dopewar_score': dopewar_score, 'blackjack_score': blackjack_score, @@ -739,6 +750,10 @@ def generate_database_html(database_info):

Database Information

${database}

+

BBS Message Database

+

BBSdb: ${bbsdb}

+

BBSdm: ${bbsdm}

+

High Scores

diff --git a/mesh_bot.py b/mesh_bot.py index 6658f8c..69d18d9 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -1058,7 +1058,7 @@ def onReceive(packet, interface): logger.debug(f"System: ignoreDefaultChannel CMD:{message_string} From: {get_name_from_number(message_from_id, 'short', rxNode)}") else: # message is for bot to respond to - logger.info(f"Device:{rxNode} Channel:{channel_number} " + CustomFormatter.green + "Received: " + CustomFormatter.white + f"{message_string} " + CustomFormatter.purple +\ + logger.info(f"Device:{rxNode} Channel:{channel_number} " + CustomFormatter.green + "ReceivedChannel: " + CustomFormatter.white + f"{message_string} " + CustomFormatter.purple +\ "From: " + CustomFormatter.white + f"{get_name_from_number(message_from_id, 'long', rxNode)}") if useDMForResponse: # respond to channel message via direct message diff --git a/modules/system.py b/modules/system.py index 0e9547b..3ea981f 100644 --- a/modules/system.py +++ b/modules/system.py @@ -560,7 +560,7 @@ def send_message(message, ch, nodeid=0, nodeInt=1): else: # message is less than MESSAGE_CHUNK_SIZE characters if nodeid == 0: # Send to channel - logger.info(f"Device:{nodeInt} Channel:{ch} " + CustomFormatter.red + "Sending: " + CustomFormatter.white + message.replace('\n', ' ')) + logger.info(f"Device:{nodeInt} Channel:{ch} " + CustomFormatter.red + "SendingChannel: " + CustomFormatter.white + message.replace('\n', ' ')) if nodeInt == 1: interface1.sendText(text=message, channelIndex=ch) if nodeInt == 2:
GameHigh Score
Lemonade Stand${lemon_score}