Show users with pending trades

This commit is contained in:
mez 2025-07-08 20:03:34 +01:00
parent 03c3cedb6b
commit 1929ea9af3

View file

@ -270,7 +270,17 @@ for event in log.log:
logitems = logitems[::-1] logitems = logitems[::-1]
coupons = coupons[::-1] coupons = coupons[::-1]
tradepend = len(list(Counter(tradeout).elements())) - len(list(Counter(tradein).elements())) tradepend = len(tradeout) - len(tradein)
tradediff = tradeout.copy()
halftrades = []
if tradepend > 0:
for trade in tradein:
if trade in tradediff:
tradediff.remove(trade)
tradediff = sorted(list(dict.fromkeys(tradediff)))
for trade in tradediff:
cuttrade = trade[11:]
halftrades.append(cuttrade)
print("Calculating level") print("Calculating level")
@ -1310,7 +1320,7 @@ def indexgen():
content.write("rainbow" + " + " + str(levelcrayons - 56)) content.write("rainbow" + " + " + str(levelcrayons - 56))
content.write("\">(" + rank + ")</span></li>\n") content.write("\">(" + rank + ")</span></li>\n")
if tradepend > 0: if tradepend > 0:
content.write("<li>" + str(tradepend) + " card") content.write("<li title=\"pending: " + ", ".join(halftrades) + "\">" + str(tradepend) + " card")
if tradepend > 1: if tradepend > 1:
content.write("s") content.write("s")
content.write(" held for trades</li>\n") content.write(" held for trades</li>\n")