Browse Source

buy: highlight items with no bids in red

raylu 9 hours ago
parent
commit
b1f0e3b07b
1 changed files with 5 additions and 1 deletions
  1. 5 1
      buy.py

+ 5 - 1
buy.py

@@ -40,7 +40,11 @@ def main() -> None:
 	print('mat   want  bids  have   buy  savings')
 	for m in materials:
 		buy = max(m.amount - m.bids - m.have, 0)
-		print(f'{m.ticker:4} {m.amount:>5} {m.bids:>5} {m.have:>5} {buy:>5} {m.savings:8.0f}')
+		if m.bids == 0 and buy > 0:
+			bids = f'\033[91m{m.bids:5}\033[0m'
+		else:
+			bids = str(m.bids).rjust(5)
+		print(f'{m.ticker:4} {m.amount:>5} {bids} {m.have:>5} {buy:>5} {m.savings:8.0f}')
 
 	# deposits of current bids
 	orders.sort(key=lambda order: order['Limit'] * order['Amount'], reverse=True)