-
Notifications
You must be signed in to change notification settings - Fork 1
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
🔧 update default_settings.toml and main.py #384
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,9 @@ def __init__(self, **kwargs): | |
self.name = kwargs.get("name", None) | ||
self.client = None | ||
self.enabled = kwargs.get("enabled", None) | ||
self.library = kwargs.get("library", None) or kwargs.get( | ||
"parser_library", "standard" | ||
) | ||
self.action_identifier = kwargs.get("action_identifier", "BUY SELL") | ||
self.action_identifier = self.action_identifier.lower() | ||
self.stop_loss_identifier = kwargs.get("stop_loss_identifier", None) | ||
|
@@ -64,11 +67,7 @@ async def search(self, message: str) -> bool: | |
""" | ||
if message: | ||
order_identifier = message.split()[0].lower() | ||
# logger.debug("Order identifier: {}", order_identifier) | ||
# logger.debug("Action identifiers: {}", self.action_identifiers) | ||
if order_identifier in self.action_identifier: | ||
|
||
# logger.debug("Order identifier found in {}", order_identifier) | ||
Comment on lines
-67
to
-71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Consider removing commented-out debug statements. The commented-out debug statements can be removed to keep the code clean and maintainable. If these logs are no longer needed, it's better to remove them entirely. |
||
return True | ||
|
||
return False | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,13 +45,15 @@ def __init__( | |
""" | ||
|
||
self.enabled = settings.findmyorder_enabled | ||
self.settings = settings.findmyorder | ||
logger.debug("Settings: {}", self.settings) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 issue (security): Consider the security implications of logging settings. Logging the entire settings object might expose sensitive information. Ensure that no sensitive data is included in the settings or consider logging only non-sensitive parts. |
||
if not self.enabled: | ||
logger.info("Module is disabled. No Client will be created.") | ||
return | ||
self.client_classes = self.get_all_client_classes() | ||
self.clients = [] | ||
# Create a client for each client in settings.findmyorder | ||
for name, client_config in settings.findmyorder.items(): | ||
for name, client_config in self.settings.items(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): Check for potential NoneType in settings. Ensure that |
||
if ( | ||
# Skip empty client configs | ||
client_config is None | ||
|
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.
suggestion: Consider simplifying the library assignment logic.
The current logic for assigning
self.library
can be simplified toself.library = kwargs.get("library") or kwargs.get("parser_library", "standard")
. This makes the code more readable.