Skip to content
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

🥚ignore_instrument setting (Sourcery refactored) #238

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions findmyorder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@ async def get_order(
msg: str,
):
"""get an order."""
if await self.search(msg):
order = await self.identify_order(msg)
if isinstance(order, dict):
order["timestamp"] = datetime.utcnow().strftime(
"%Y-%m-%dT%H:%M:%SZ")
print(settings.instrument_mapping)
if settings.instrument_mapping:
await self.replace_instrument(order)
if order["instrument"] in settings.ignore_instrument:
""" ignoring instrument"""
return
return order
return None
if not await self.search(msg):
return None
order = await self.identify_order(msg)
if isinstance(order, dict):
order["timestamp"] = datetime.utcnow().strftime(
"%Y-%m-%dT%H:%M:%SZ")
print(settings.instrument_mapping)
if settings.instrument_mapping:
await self.replace_instrument(order)
if order["instrument"] in settings.ignore_instrument:
""" ignoring instrument"""
return
return order
mraniki marked this conversation as resolved.
Show resolved Hide resolved

async def replace_instrument(self, order):
""" replace instrument by an alternative instrument """
Expand Down