From 84d0d3aa7c23e0cc31b80b39c4dde4e60d464f29 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 12 Apr 2022 22:06:56 +0100 Subject: [PATCH] Reformat to reduce line length --- handler/ux/irc.py | 11 ++++++++++- handler/ux/notify.py | 42 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/handler/ux/irc.py b/handler/ux/irc.py index b754cab..3ef03c1 100644 --- a/handler/ux/irc.py +++ b/handler/ux/irc.py @@ -88,7 +88,16 @@ class IRCBot(irc.IRCClient): # Check if the command required authentication if obj.authed: if host in self.admins: - obj.run(cmd, spl, length, authed, msgl, self.agora, self.tx, self.ux) + obj.run( + cmd, + spl, + length, + authed, + msgl, + self.agora, + self.tx, + self.ux, + ) else: # Handle authentication here instead of in the command module for security self.msg(channel, "Access denied.") diff --git a/handler/ux/notify.py b/handler/ux/notify.py index 37561a7..2348700 100644 --- a/handler/ux/notify.py +++ b/handler/ux/notify.py @@ -27,23 +27,53 @@ class Notify(util.Base): def notify_new_trade(self, amount, currency): amount_usd = self.money.to_usd(amount, currency) - self.sendmsg(f"Total: {amount_usd}", title="New trade", tags="trades", priority="2") + self.sendmsg( + f"Total: {amount_usd}", + title="New trade", + tags="trades", + priority="2", + ) def notify_complete_trade(self, amount, currency): amount_usd = self.money.to_usd(amount, currency) - self.sendmsg(f"Total: {amount_usd}", title="Trade complete", tags="trades,profit", priority="3") + self.sendmsg( + f"Total: {amount_usd}", + title="Trade complete", + tags="trades,profit", + priority="3", + ) def notify_withdrawal(self, amount_usd): - self.sendmsg(f"Total: {amount_usd}", title="Withdrawal", tags="profit", priority="4") + self.sendmsg( + f"Total: {amount_usd}", + title="Withdrawal", + tags="profit", + priority="4", + ) def notify_need_topup(self, amount_usd_xmr, amount_usd_btc): - self.sendmsg(f"XMR: {amount_usd_xmr} | BTC: {amount_usd_btc}", title="Topup needed", tags="admin", priority="5") + self.sendmsg( + f"XMR: {amount_usd_xmr} | BTC: {amount_usd_btc}", + title="Topup needed", + tags="admin", + priority="5", + ) def notify_tx_lookup_failed(self, currency, amount, reference, code, trade_id=None): - self.sendmsg(f"Unknown TX [{code}]: {amount}{currency} ({reference}) for {trade_id}", title=code, tags="tx", priority="5") + self.sendmsg( + f"Unknown TX [{code}]: {amount}{currency} ({reference}) for {trade_id}", + title=code, + tags="tx", + priority="5", + ) def notify_release_unsuccessful(self, trade_id): - self.sendmsg(f"Release unsuccessful for {trade_id}", title="Unsuccessful release", tags="tx", priority="5") + self.sendmsg( + f"Release unsuccessful for {trade_id}", + title="Unsuccessful release", + tags="tx", + priority="5", + ) def notify_sender_name_mismatch(self, trade_id, platform_username, bank_sender): self.sendmsg(