diff --git a/findmyorder/config.py b/findmyorder/config.py index f9041f4b..0ce9e616 100644 --- a/findmyorder/config.py +++ b/findmyorder/config.py @@ -16,14 +16,14 @@ # Load the default settings file settings_files=[ os.path.join(ROOT, "default_settings.toml"), - 'talky_settings.toml', - 'settings.toml', - '.secrets.toml' - ".op.toml", + "talky_settings.toml", + "settings.toml", + ".secrets.toml" ".op.toml", ], # Load the.env file load_dotenv=True, # Set the environments to True environments=True, # Set the default environment - default_env="default",) + default_env="default", +) diff --git a/findmyorder/default_settings.toml b/findmyorder/default_settings.toml index c2a7f5ee..716a9db2 100644 --- a/findmyorder/default_settings.toml +++ b/findmyorder/default_settings.toml @@ -55,7 +55,7 @@ mapping = [ # Instrument to be ignored # when generating an order -ignore_instrument = "US500 USTEC DOGE" +ignore_instrument = "US500 DOGE" ######################################## ### END OF DEFAULT SETTINGS ### diff --git a/findmyorder/main.py b/findmyorder/main.py index 67bed1ad..7c8c5f2f 100644 --- a/findmyorder/main.py +++ b/findmyorder/main.py @@ -4,6 +4,7 @@ """ from datetime import datetime +from loguru import logger from pyparsing import ( Combine, Optional, @@ -65,7 +66,7 @@ async def search(self, my_string: str) -> bool: """ if my_string: string_check = my_string.split()[0].lower() - self.logger.debug("Searching order identifier in {}", string_check) + logger.debug("Searching order identifier in {}", string_check) if string_check in settings.action_identifier.lower(): return True return False @@ -135,11 +136,11 @@ async def identify_order( ) order = order_grammar.parse_string(instring=my_string, parse_all=False) - self.logger.debug("Order parsed {}", order) + logger.debug("Order parsed {}", order) return order.asDict() except Exception as error: - self.logger.error(error) + logger.error(error) return error async def get_order( @@ -158,18 +159,18 @@ async def get_order( """ if not await self.search(msg): - self.logger.debug("No order identified") + logger.debug("No order identified") return None order = await self.identify_order(msg) if isinstance(order, dict): order["timestamp"] = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ") if settings.instrument_mapping: - self.logger.debug("mapping") + logger.debug("mapping") await self.replace_instrument(order) if order["instrument"] in settings.ignore_instrument: - self.logger.debug("Ignoring instrument {}", order["instrument"]) + logger.debug("Ignoring instrument {}", order["instrument"]) return - self.logger.debug("Order identified {}", order) + logger.debug("Order identified {}", order) return order async def replace_instrument(self, order): @@ -188,5 +189,5 @@ async def replace_instrument(self, order): if item["id"] == instrument: order["instrument"] = item["alt"] break - self.logger.debug("Instrument symbol changed", order) + logger.debug("Instrument symbol changed", order) return order