Compare commits

...

6 commits

Author SHA1 Message Date
TC² 6d7e1f4ad2
Merge pull request #97 from jkeychan/fix-handle-node-stats-type-error
Fix TypeError in handle_stats_steps
2025-01-02 20:16:57 -05:00
TC² cd2c4c9cb5
Merge pull request #100 from jakern/patch-1
Rename example_config.ini for docker build
2025-01-02 20:14:58 -05:00
TC² c0003ec536
Merge pull request #106 from jabez007/merge_config_hostname
merge args.host into system_config['hostname']
2025-01-02 20:09:30 -05:00
Jimmy 7d9de709c3
merge args.host into system_config['hostname'] 2025-01-02 18:46:16 -06:00
Jacob Kern ab228e97f0
Rename example_config.ini for docker build
resolves #80
2024-11-30 18:32:48 -05:00
Jeff Bollinger 03d8aebbe1
Fix TypeError in handle_stats_steps
Fix TypeError in handle_stats_steps for NoneType comparison in node stats command
2024-11-22 15:02:47 -05:00
3 changed files with 4 additions and 4 deletions

View file

@ -135,7 +135,7 @@ def handle_stats_steps(sender_id, message, step, interface):
total_nodes = len(interface.nodes) total_nodes = len(interface.nodes)
else: else:
time_limit = current_time - seconds time_limit = current_time - seconds
total_nodes = sum(1 for node in interface.nodes.values() if node.get('lastHeard', 0) >= time_limit) total_nodes = sum(1 for node in interface.nodes.values() if node.get('lastHeard') is not None and node['lastHeard'] >= time_limit)
total_nodes_summary.append(f"- {period}: {total_nodes}") total_nodes_summary.append(f"- {period}: {total_nodes}")
response = "Total nodes seen:\n" + "\n".join(total_nodes_summary) response = "Total nodes seen:\n" + "\n".join(total_nodes_summary)

View file

@ -76,7 +76,7 @@ def merge_config(system_config:dict[str, Any], args:argparse.Namespace) -> dict[
system_config['port'] = args.port system_config['port'] = args.port
if args.host is not None: if args.host is not None:
system_config['host'] = args.host system_config['hostname'] = args.host
return system_config return system_config

View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
if [ ! -f "/config/config.ini" ]; then if [ ! -f "/config/config.ini" ]; then
cp "/TC2-BBS-mesh/config.ini" "/config/config.ini" cp "/TC2-BBS-mesh/example_config.ini" "/config/config.ini"
fi fi
if [ ! -f "/config/fortunes.txt" ]; then if [ ! -f "/config/fortunes.txt" ]; then
cp "/TC2-BBS-mesh/fortunes.txt" "/config/fortunes.txt" cp "/TC2-BBS-mesh/fortunes.txt" "/config/fortunes.txt"
fi fi