From 196fde44e070274dca17b2c219c790100d8ec691 Mon Sep 17 00:00:00 2001 From: Eugene Schava Date: Mon, 17 May 2021 14:45:54 +0300 Subject: [PATCH] Total row for telegram "/status table" command work around mypy warning --- freqtrade/rpc/telegram.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index 6a12488d1..1e0fad8fd 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -360,13 +360,14 @@ class Telegram(RPCHandler): self._config['stake_currency'], fiat_currency) show_total = fiat_currency != '' - total_sum = 0 + total_sum = 0.0 if show_total: - total_sum = sum( - map(lambda m: float(m[1]) if m else 0.0, - map(lambda trade: re.compile(".*\\((-?\\d*\\.\\d*)\\)").match(trade[-1]), - statlist)) - ) + r = re.compile(".*\\((-?\\d*\\.\\d*)\\)") + for trade in statlist: + m = r.match(trade[-1]) + if m is not None: + total_sum += float(m[1]) + max_trades_per_msg = 50 """ Calculate the number of messages of 50 trades per message