Don't print empty table

This commit is contained in:
Matthias 2020-07-14 16:42:47 +02:00
parent 62c55b1863
commit 0228b63418

View File

@ -113,6 +113,7 @@ def start_list_data(args: Dict[str, Any]) -> None:
for pair, timeframe in sorted(paircombs, key=lambda x: (x[0], timeframe_to_minutes(x[1]))): for pair, timeframe in sorted(paircombs, key=lambda x: (x[0], timeframe_to_minutes(x[1]))):
groupedpair[pair].append(timeframe) groupedpair[pair].append(timeframe)
if groupedpair:
print(tabulate([(pair, ', '.join(timeframes)) for pair, timeframes in groupedpair.items()], print(tabulate([(pair, ', '.join(timeframes)) for pair, timeframes in groupedpair.items()],
headers=("Pair", "Timeframe"), headers=("Pair", "Timeframe"),
tablefmt='psql', stralign='right')) tablefmt='psql', stralign='right'))