import log def ownedcards(): ownedcards = [] for event in log.log: try: for card in event["received"]: ownedcards.append(card) except: pass return sorted(ownedcards) def cardtext(card): cardtext = "" with open("build/decks/" + card[:-2] + "/type") as thetype: cardtype = thetype.read() if cardtype == "red": cardtext += "🔴" elif cardtype == "orange": cardtext += "🟠" elif cardtype == "yellow": cardtext += "🟡" elif cardtype == "green": cardtext += "🟢" elif cardtype == "blue": cardtext += "🔵" elif cardtype == "purple": cardtext += "🟣" elif cardtype == "brown": cardtext += "🟤" elif cardtype == "gray": cardtext += "⚪" elif cardtype == "special": cardtext += "✨" cardtext += card + "" return cardtext def printcard(card): deck = card[:-2] cardid = card[-2:] return "" def printdeck(deck): deckstring = "\n\n \n \n \n\n\n" test = 1 while test < 21: if test % 5 == 1: deckstring += " \n" deckstring += " \n" if test % 5 == 0: deckstring += " \n" test += 1 deckstring += "\n
" + deck + " [" deckcards = [] for card in ownedcards(): if card[:-2] == deck: deckcards.append(int(card[-2:])) deckcards = sorted(list(dict.fromkeys(deckcards))) deckstring += str(len(deckcards)) + "/20]
9: deckstring += str(test) else: deckstring += "0" + str(test) else: deckstring += "00" deckstring += ".gif\">
\n" return deckstring