fix flake8

This commit is contained in:
Stefano Ariestasia 2022-02-06 03:16:56 +00:00
parent 131b2d68d8
commit 4cf514e293

View File

@ -442,7 +442,8 @@ class Telegram(RPCHandler):
r['num_entries'] = len(r['filled_entry_orders']) r['num_entries'] = len(r['filled_entry_orders'])
r['sell_reason'] = r.get('sell_reason', "") r['sell_reason'] = r.get('sell_reason', "")
lines = [ lines = [
"*Trade ID:* `{trade_id}`" + ("` (since {open_date_hum})`" if r['is_open'] else ""), "*Trade ID:* `{trade_id}`" +
("` (since {open_date_hum})`" if r['is_open'] else ""),
"*Current Pair:* {pair}", "*Current Pair:* {pair}",
"*Amount:* `{amount} ({stake_amount} {base_currency})`", "*Amount:* `{amount} ({stake_amount} {base_currency})`",
"*Buy Tag:* `{buy_tag}`" if r['buy_tag'] else "", "*Buy Tag:* `{buy_tag}`" if r['buy_tag'] else "",
@ -481,10 +482,9 @@ class Telegram(RPCHandler):
else: else:
lines.append("*Open Order:* `{open_order}`") lines.append("*Open Order:* `{open_order}`")
if len(r['filled_entry_orders']) > 1:
lines_detail = self._prepare_buy_details( lines_detail = self._prepare_buy_details(
r['filled_entry_orders'], r['base_currency']) r['filled_entry_orders'], r['base_currency'])
lines.extend(lines_detail) lines.extend((lines_detail if (len(r['filled_entry_orders']) > 1) else ""))
# Filter empty lines using list-comprehension # Filter empty lines using list-comprehension
messages.append("\n".join([line for line in lines if line]).format(**r)) messages.append("\n".join([line for line in lines if line]).format(**r))