-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improved structure and readability of main.py #196
improved structure and readability of main.py #196
Conversation
1.Removed unnecessary import statements (import sys, import shutil, import getpass). 2.Encapsulated the code inside the BotCore class to provide better organization and encapsulation. 3.Replaced hardcoded configuration values with variables (self.server_url, self.port, self.name, etc.). 4.Utilized the os.path module for path-related operations instead of manually concatenating strings. 5.Updated the logging statements to use the logger instance. 6.Refactored the message_info method to handle exceptions and return a dictionary with all fields set to prevent None values. 7.Updated the methods method to return a dictionary of method references. 8.Added docstrings to functions and methods. 9.Fixed the indentation of the code to conform to Python style guidelines. 10.Replaced the print statements with logger statements for consistent logging. 11.Modified the load_plugins_from_folder method to handle different sources of plugin names (from configuration file or directory) and log errors appropriately. 12.Updated the load_plugins method to load plugins from the specified folders. 13.Refactored the run_plugins method to use the loaded plugins and pass the necessary arguments to the plugin's run method. 14.Renamed command_parser method to core_commands_parse for clarity. 15.Removed unused methods and variables (self.sp_command, self.core_plugins, pull). 16.Added missing exception handling in the quit method. 17.Cleaned up the code formatting and removed unnecessary comments.
|
||
""" | ||
ONGOING REQUIREMENT/S | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AnastasiosZyngiridis Why did you remove this section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Abdur-rahmaanJ Sorry for the mistake. As they where ONGOING REQUIREMENT/S i didn't touch them and forgot to put them back in after i was done editing the rest of the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AnastasiosZyngiridis Just add them back, thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put code back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l
1.Removed unnecessary import statements (import sys, import shutil, import getpass).
2.Encapsulated the code inside the BotCore class to provide better organization and encapsulation.
3.Replaced hardcoded configuration values with variables (self.server_url, self.port, self.name, etc.).
4.Utilized the os.path module for path-related operations instead of manually concatenating strings.
5.Updated the logging statements to use the logger instance.
6.Refactored the message_info method to handle exceptions and return a dictionary with all fields set to prevent None values.
7.Updated the methods method to return a dictionary of method references.
8.Added docstrings to functions and methods.
9.Fixed the indentation of the code to conform to Python style guidelines.
10.Replaced the print statements with logger statements for consistent logging.
11.Modified the load_plugins_from_folder method to handle different sources of plugin names (from configuration file or directory) and log errors appropriately.
12.Updated the load_plugins method to load plugins from the specified folders.
13.Refactored the run_plugins method to use the loaded plugins and pass the necessary arguments to the plugin's run method.
14.Renamed command_parser method to core_commands_parse for clarity.
15.Removed unused methods and variables (self.sp_command, self.core_plugins, pull).
16.Added missing exception handling in the quit method.
17.Cleaned up the code formatting and removed unnecessary comments.
Description
How Has This Been Tested?
Additional context
Add any other context or screenshots about the pull request here.
Checklist
README.md
Code of Conduct
By submitting this issue, you agree to follow our Code of Conduct