diff --git a/generate.py b/generate.py index f27cbbe..c5e2b94 100644 --- a/generate.py +++ b/generate.py @@ -1,13 +1,37 @@ +import sys import download,indexgen,collectinggen,ownedgen,wantedgen,loggen,levelsgen,tradegen,masteredgen,portfoliosgen,searchgen +print("Checking for new decks … ",end="") +sys.stdout.flush() download.getimg() +print("done\nBuilding index page …",end="") +sys.stdout.flush() indexgen.indexgen() +print(" done\nBuilding collecting page …",end="") +sys.stdout.flush() collectinggen.collectingall() +print(" done\nBuilding owned page …",end="") +sys.stdout.flush() ownedgen.ownedall() +print(" done\nBuilding wanted page …",end="") +sys.stdout.flush() wantedgen.wantedgen() +print(" done\nBuilding log page …",end="") +sys.stdout.flush() loggen.loggen() +print(" done\nBuilding levels page …",end="") +sys.stdout.flush() levelsgen.levelsgen() +print(" done\nBuilding trading page …",end="") +sys.stdout.flush() tradegen.tradeall() +print(" done\nBuilding mastered page …",end="") +sys.stdout.flush() masteredgen.masteredall() +print(" done\nBuilding portfolios page …",end="") +sys.stdout.flush() portfoliosgen.portfoliosgen() +print(" done\nBuilding search page …",end="") +sys.stdout.flush() searchgen.searchgen() +print(" done") diff --git a/tradegen.py b/tradegen.py index f5df772..548286f 100644 --- a/tradegen.py +++ b/tradegen.py @@ -16,27 +16,27 @@ def tradegen(colour=False): content = open(thefile,"a") content.write("

available for trade

\n") content.write(tcgcore.filterwrite("trade",colour,True)) - content.write("

") if len(variables.tradestatement) > 0: content.write(variables.tradestatement + " ") content.write("Trade cards here

\n

") + tradelist = [] previouscard = "" for card in tcgcore.ownedcards(): if card[0:4] != "sig_": if card == previouscard: if colour: if tcgcore.cardtype(card) == colour: - content.write(tcgcore.printcard(card)) + tradelist.append(card) else: - content.write(tcgcore.printcard(card)) + tradelist.append(card) else: if not tcgcore.deckmastered(card[:-2]): if not tcgcore.collecting(card[:-2]): if colour: if tcgcore.cardtype(card) == colour: - content.write(tcgcore.printcard(card)) + tradelist.append(card) else: - content.write(tcgcore.printcard(card)) + tradelist.append(card) previouscard = card siglist = [] for card in tcgcore.ownedcards(): @@ -47,10 +47,13 @@ def tradegen(colour=False): if colour: if colour == "sig": for sig in siglist: - content.write(tcgcore.printcard(sig)) + tradelist.append(sig) else: for sig in siglist: - content.write(tcgcore.printcard(sig)) + tradelist.append(sig) + content.write("\n

") + for card in tradelist: + content.write(tcgcore.printcard(card)) content.write("

\n") content.close() skel.footerwrite(thefile) diff --git a/wantedgen.py b/wantedgen.py index a93e133..2f0e26b 100644 --- a/wantedgen.py +++ b/wantedgen.py @@ -33,7 +33,7 @@ def wantedgen(): elif tcgcore.priority(card[:-2]) == "low": lowpriority.append(card) if len(highpriority) > 0: - content.write("

High priority: ") + content.write("

High priority

\n\n

") for card in highpriority: content.write(tcgcore.cardtext(card)) if highpriority.index(card) == len(highpriority) - 1: @@ -42,7 +42,7 @@ def wantedgen(): content.write(", ") content.write("

\n") if len(medpriority) > 0: - content.write("

Medium priority: ") + content.write("

Medium priority

\n\n

") for card in medpriority: content.write(tcgcore.cardtext(card)) if medpriority.index(card) == len(medpriority) - 1: @@ -51,7 +51,7 @@ def wantedgen(): content.write(", ") content.write("

\n") if len(lowpriority) > 0: - content.write("

Low priority: ") + content.write("

Low priority

\n\n

") for card in lowpriority: content.write(tcgcore.cardtext(card)) if lowpriority.index(card) == len(lowpriority) - 1: