Add textareas and progress indicators

master
trémeur 5 days ago
parent c1d73d661f
commit 99ccff47c1

@ -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")

@ -16,27 +16,27 @@ def tradegen(colour=False):
content = open(thefile,"a")
content.write("<h1>available for trade</h1>\n")
content.write(tcgcore.filterwrite("trade",colour,True))
content.write("<p>")
if len(variables.tradestatement) > 0:
content.write(variables.tradestatement + " ")
content.write("Trade cards <a href=\"" + variables.tradepost + "\">here</a></p>\n<p>")
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("<textarea readonly>" + ", ".join(tradelist) + "</textarea>\n<p>")
for card in tradelist:
content.write(tcgcore.printcard(card))
content.write("</p>\n")
content.close()
skel.footerwrite(thefile)

@ -33,7 +33,7 @@ def wantedgen():
elif tcgcore.priority(card[:-2]) == "low":
lowpriority.append(card)
if len(highpriority) > 0:
content.write("<p><b>High priority:</b> ")
content.write("<h2>High priority</h2>\n<textarea readonly>" + ", ".join(highpriority) + "</textarea>\n<p>")
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("</p>\n")
if len(medpriority) > 0:
content.write("<p><b>Medium priority:</b> ")
content.write("<h2>Medium priority</h2>\n<textarea readonly>" + ", ".join(medpriority) + "</textarea>\n<p>")
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("</p>\n")
if len(lowpriority) > 0:
content.write("<p><b>Low priority:</b> ")
content.write("<h2>Low priority</h2>\n<textarea readonly>" + ", ".join(lowpriority) + "</textarea>\n<p>")
for card in lowpriority:
content.write(tcgcore.cardtext(card))
if lowpriority.index(card) == len(lowpriority) - 1:

Loading…
Cancel
Save