From 24f329d07e4785a7846ae7c6590a670ce6bef62e Mon Sep 17 00:00:00 2001 From: default Date: Thu, 3 Apr 2025 20:45:56 +0000 Subject: [PATCH] Refactor weather plugin structure and update imports - Moved weather plugin files into a new 'plugins' directory for better organization. - Updated import statements in command_handlers.py and message_processing.py to reflect the new file structure. - Adjusted .gitignore to exclude nested .ini files. - Removed obsolete weather plugin files and documentation as part of the restructuring. --- .gitignore | 2 +- command_handlers.py | 2 +- message_processing.py | 4 ++-- plugins/__init__.py | 0 {weather_plugin => plugins/weather_plugin}/README.md | 0 {weather_plugin => plugins/weather_plugin}/__init__.py | 0 {weather_plugin => plugins/weather_plugin}/command_router.py | 0 {weather_plugin => plugins/weather_plugin}/menu.py | 0 .../weather_plugin/weather.ini.example | 0 {weather_plugin => plugins/weather_plugin}/weather.py | 0 10 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 plugins/__init__.py rename {weather_plugin => plugins/weather_plugin}/README.md (100%) rename {weather_plugin => plugins/weather_plugin}/__init__.py (100%) rename {weather_plugin => plugins/weather_plugin}/command_router.py (100%) rename {weather_plugin => plugins/weather_plugin}/menu.py (100%) rename weather_plugin/weater.ini.example => plugins/weather_plugin/weather.ini.example (100%) rename {weather_plugin => plugins/weather_plugin}/weather.py (100%) diff --git a/.gitignore b/.gitignore index d93e110..fcde568 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,5 @@ venv/ .venv .idea config.ini -*/*.ini +*/*/*.ini fortunes.txt diff --git a/command_handlers.py b/command_handlers.py index 682155c..732a4bf 100644 --- a/command_handlers.py +++ b/command_handlers.py @@ -4,7 +4,7 @@ import random import time from meshtastic import BROADCAST_NUM -from weather_plugin.menu import get_weather_menu_text +from plugins.weather_plugin.menu import get_weather_menu_text from db_operations import ( add_bulletin, add_mail, delete_mail, diff --git a/message_processing.py b/message_processing.py index 0d954aa..d4a16b0 100644 --- a/message_processing.py +++ b/message_processing.py @@ -10,10 +10,10 @@ from command_handlers import ( handle_check_bulletin_command, handle_read_bulletin_command, handle_read_channel_command, handle_post_channel_command, handle_list_channels_command, handle_quick_help_command ) -from weather_plugin.command_router import handle_weather_command, handle_weather_steps +from plugins.weather_plugin.command_router import handle_weather_command, handle_weather_steps from db_operations import add_bulletin, add_mail, delete_bulletin, delete_mail, get_db_connection, add_channel from js8call_integration import handle_js8call_command, handle_js8call_steps, handle_group_message_selection -from utils import get_user_state, get_node_short_name, get_node_id_from_num, send_message +from utils import get_node_short_name, get_node_id_from_num, send_message, get_user_state, update_user_state main_menu_handlers = { "q": handle_quick_help_command, diff --git a/plugins/__init__.py b/plugins/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/weather_plugin/README.md b/plugins/weather_plugin/README.md similarity index 100% rename from weather_plugin/README.md rename to plugins/weather_plugin/README.md diff --git a/weather_plugin/__init__.py b/plugins/weather_plugin/__init__.py similarity index 100% rename from weather_plugin/__init__.py rename to plugins/weather_plugin/__init__.py diff --git a/weather_plugin/command_router.py b/plugins/weather_plugin/command_router.py similarity index 100% rename from weather_plugin/command_router.py rename to plugins/weather_plugin/command_router.py diff --git a/weather_plugin/menu.py b/plugins/weather_plugin/menu.py similarity index 100% rename from weather_plugin/menu.py rename to plugins/weather_plugin/menu.py diff --git a/weather_plugin/weater.ini.example b/plugins/weather_plugin/weather.ini.example similarity index 100% rename from weather_plugin/weater.ini.example rename to plugins/weather_plugin/weather.ini.example diff --git a/weather_plugin/weather.py b/plugins/weather_plugin/weather.py similarity index 100% rename from weather_plugin/weather.py rename to plugins/weather_plugin/weather.py