Restore function to show duplicates
This commit is contained in:
parent
6c3f949f84
commit
dcb6597851
1 changed files with 43 additions and 29 deletions
72
new.py
72
new.py
|
@ -839,7 +839,20 @@ def crayonlog(colour,event):
|
||||||
crayonstring = str(crayonno) + " " + crayonrend
|
crayonstring = str(crayonno) + " " + crayonrend
|
||||||
return crayonstring
|
return crayonstring
|
||||||
|
|
||||||
print("Building index page")
|
def showdupes():
|
||||||
|
dupeslist = []
|
||||||
|
previouscard = ""
|
||||||
|
for card in cardlist:
|
||||||
|
try:
|
||||||
|
if card["name"] == previouscard["name"]:
|
||||||
|
dupeslist.append(card["name"])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
previouscard = card
|
||||||
|
return dupeslist
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print("Building index page")
|
||||||
|
|
||||||
def indexgen():
|
def indexgen():
|
||||||
if os.path.exists("build/index.html"):
|
if os.path.exists("build/index.html"):
|
||||||
|
@ -1103,9 +1116,9 @@ def indexgen():
|
||||||
content.close()
|
content.close()
|
||||||
footerwrite(thefile)
|
footerwrite(thefile)
|
||||||
|
|
||||||
indexgen()
|
if __name__ == "__main__":
|
||||||
|
indexgen()
|
||||||
print("Building levels page")
|
print("Building levels page")
|
||||||
|
|
||||||
def levelsgen():
|
def levelsgen():
|
||||||
if not os.path.isdir("build/levels"):
|
if not os.path.isdir("build/levels"):
|
||||||
|
@ -1343,9 +1356,9 @@ def levelsgen():
|
||||||
content.close()
|
content.close()
|
||||||
footerwrite(thefile)
|
footerwrite(thefile)
|
||||||
|
|
||||||
levelsgen()
|
if __name__ == "__main__":
|
||||||
|
levelsgen()
|
||||||
print("Building portfolios page")
|
print("Building portfolios page")
|
||||||
|
|
||||||
def portfoliosgen(colour=False):
|
def portfoliosgen(colour=False):
|
||||||
if not os.path.isdir("build/portfolios"):
|
if not os.path.isdir("build/portfolios"):
|
||||||
|
@ -1381,9 +1394,9 @@ def portfoliosgen(colour=False):
|
||||||
content.close()
|
content.close()
|
||||||
footerwrite(thefile)
|
footerwrite(thefile)
|
||||||
|
|
||||||
portfoliosgen()
|
if __name__ == "__main__":
|
||||||
|
portfoliosgen()
|
||||||
print("Building collecting page")
|
print("Building collecting page")
|
||||||
|
|
||||||
def collectinggen(colour=False):
|
def collectinggen(colour=False):
|
||||||
if not os.path.isdir("build/collecting"):
|
if not os.path.isdir("build/collecting"):
|
||||||
|
@ -1431,9 +1444,9 @@ def collectingall():
|
||||||
for thevalue in values:
|
for thevalue in values:
|
||||||
collectinggen(thevalue)
|
collectinggen(thevalue)
|
||||||
|
|
||||||
collectingall()
|
if __name__ == "__main__":
|
||||||
|
collectingall()
|
||||||
print("Building mass collecting pages")
|
print("Building mass collecting pages")
|
||||||
|
|
||||||
masslist = sorted(list(variables.masscollect.keys()))
|
masslist = sorted(list(variables.masscollect.keys()))
|
||||||
|
|
||||||
|
@ -1490,9 +1503,9 @@ def massall():
|
||||||
massseriesgen(series,massindex)
|
massseriesgen(series,massindex)
|
||||||
massindex += 1
|
massindex += 1
|
||||||
|
|
||||||
massall()
|
if __name__ == "__main__":
|
||||||
|
massall()
|
||||||
print("Building mastered page")
|
print("Building mastered page")
|
||||||
|
|
||||||
def masteredgen(colour=False):
|
def masteredgen(colour=False):
|
||||||
if not os.path.isdir("build/mastered"):
|
if not os.path.isdir("build/mastered"):
|
||||||
|
@ -1524,9 +1537,9 @@ def masteredall():
|
||||||
for thevalue in values:
|
for thevalue in values:
|
||||||
masteredgen(thevalue)
|
masteredgen(thevalue)
|
||||||
|
|
||||||
masteredall()
|
if __name__ == "__main__":
|
||||||
|
masteredall()
|
||||||
print("Building trading page")
|
print("Building trading page")
|
||||||
|
|
||||||
tradelist = []
|
tradelist = []
|
||||||
sigtradelist = []
|
sigtradelist = []
|
||||||
|
@ -1584,9 +1597,9 @@ def tradeall():
|
||||||
tradegen(thevalue)
|
tradegen(thevalue)
|
||||||
tradegen("sig")
|
tradegen("sig")
|
||||||
|
|
||||||
tradeall()
|
if __name__ == "__main__":
|
||||||
|
tradeall()
|
||||||
print("Building wanted page")
|
print("Building wanted page")
|
||||||
|
|
||||||
def wantedgen():
|
def wantedgen():
|
||||||
if not os.path.isdir("build/wanted"):
|
if not os.path.isdir("build/wanted"):
|
||||||
|
@ -1648,9 +1661,9 @@ def wantedgen():
|
||||||
content.close()
|
content.close()
|
||||||
footerwrite(thefile)
|
footerwrite(thefile)
|
||||||
|
|
||||||
wantedgen()
|
if __name__ == "__main__":
|
||||||
|
wantedgen()
|
||||||
print("Building search page")
|
print("Building search page")
|
||||||
|
|
||||||
def searchgen():
|
def searchgen():
|
||||||
if not os.path.isdir("build/search"):
|
if not os.path.isdir("build/search"):
|
||||||
|
@ -1711,9 +1724,9 @@ def searchgen():
|
||||||
content.write("];\n const searchstring = document.getElementById('cardinput').value;\n const searcharray = searchstring.replaceAll(' ','').replaceAll('\\n',',').replaceAll('\\r',',').toLowerCase().split(',');\n const hpwfound = [];\n const mpwfound = [];\n const lpwfound = [];\n const hptfound = [];\n const mptfound = [];\n const lptfound = [];\n for (const element of searcharray) {\n let cardend = element.substring(element.length, element.length - 2);\n if (!(thecards.includes(cardend))) {\n for (const ending of thecards) {\n searcharray.push(element + ending);\n };\n };\n };\n for (const element of searcharray) {\n if (hpw.includes(element)) {\n hpwfound.push(element);\n } else if (mpw.includes(element)) {\n mpwfound.push(element);\n } else if (lpw.includes(element)) {\n lpwfound.push(element);\n } else if (hpt.includes(element)) {\n hptfound.push(element);\n } else if (mpt.includes(element)) {\n mptfound.push(element);\n } else if (lpt.includes(element)) {\n lptfound.push(element);\n };\n };\n if ((hpwfound.length) > 0) {\n document.getElementById('hpwfound').innerHTML = '<span class=\"sorttitle\">Wanted (high priority):</span> <span class=\"searchresults\">' + hpwfound.join(', ') + '</span>';\n } else {\n document.getElementById('hpwfound').innerHTML = '';\n };\n if ((mpwfound.length) > 0) {\n document.getElementById('mpwfound').innerHTML = '<span class=\"sorttitle\">Wanted (medium priority):</span> <span class=\"searchresults\">' + mpwfound.join(', ') + '</span>';\n } else {\n document.getElementById('mpwfound').innerHTML = '';\n };\n if ((lpwfound.length) > 0) {\n document.getElementById('lpwfound').innerHTML = '<span class=\"sorttitle\">Wanted (low priority):</span> <span class=\"searchresults\">' + lpwfound.join(', ') + '</span>';\n } else {\n document.getElementById('lpwfound').innerHTML = '';\n };\n if ((hptfound.length) > 0) {\n document.getElementById('hptfound').innerHTML = '<span class=\"sorttitle\">Will trade out for <a href=\"/wanted\">high priority cards</a> only:</span> <span class=\"searchresults\">' + hptfound.join(', ') + '</span>';\n } else {\n document.getElementById('hptfound').innerHTML = '';\n };\n if ((mptfound.length) > 0) {\n document.getElementById('mptfound').innerHTML = '<span class=\"sorttitle\">Will trade out for <a href=\"/wanted\">high or medium priority cards</a>:</span> <span class=\"searchresults\">' + mptfound.join(', ') + '</span>';\n } else {\n document.getElementById('mptfound').innerHTML = '';\n };\n if ((lptfound.length) > 0) {\n document.getElementById('lptfound').innerHTML = '<span class=\"sorttitle\">Will trade out for <a href=\"/wanted\">any wanted card</a>:</span> <span class=\"searchresults\">' + lptfound.join(', ') + '</span>';\n } else {\n document.getElementById('lptfound').innerHTML = '';\n };\n if ((hpwfound.length) + (mpwfound.length) + (lpwfound.length) + (hptfound.length) + (mptfound.length) + (lptfound.length) == 0) {\n document.getElementById('nothing').innerHTML = 'No results';\n } else {\n document.getElementById('nothing').innerHTML = '';\n }\n }\n</script>\n </main>\n </body>\n</html>")
|
content.write("];\n const searchstring = document.getElementById('cardinput').value;\n const searcharray = searchstring.replaceAll(' ','').replaceAll('\\n',',').replaceAll('\\r',',').toLowerCase().split(',');\n const hpwfound = [];\n const mpwfound = [];\n const lpwfound = [];\n const hptfound = [];\n const mptfound = [];\n const lptfound = [];\n for (const element of searcharray) {\n let cardend = element.substring(element.length, element.length - 2);\n if (!(thecards.includes(cardend))) {\n for (const ending of thecards) {\n searcharray.push(element + ending);\n };\n };\n };\n for (const element of searcharray) {\n if (hpw.includes(element)) {\n hpwfound.push(element);\n } else if (mpw.includes(element)) {\n mpwfound.push(element);\n } else if (lpw.includes(element)) {\n lpwfound.push(element);\n } else if (hpt.includes(element)) {\n hptfound.push(element);\n } else if (mpt.includes(element)) {\n mptfound.push(element);\n } else if (lpt.includes(element)) {\n lptfound.push(element);\n };\n };\n if ((hpwfound.length) > 0) {\n document.getElementById('hpwfound').innerHTML = '<span class=\"sorttitle\">Wanted (high priority):</span> <span class=\"searchresults\">' + hpwfound.join(', ') + '</span>';\n } else {\n document.getElementById('hpwfound').innerHTML = '';\n };\n if ((mpwfound.length) > 0) {\n document.getElementById('mpwfound').innerHTML = '<span class=\"sorttitle\">Wanted (medium priority):</span> <span class=\"searchresults\">' + mpwfound.join(', ') + '</span>';\n } else {\n document.getElementById('mpwfound').innerHTML = '';\n };\n if ((lpwfound.length) > 0) {\n document.getElementById('lpwfound').innerHTML = '<span class=\"sorttitle\">Wanted (low priority):</span> <span class=\"searchresults\">' + lpwfound.join(', ') + '</span>';\n } else {\n document.getElementById('lpwfound').innerHTML = '';\n };\n if ((hptfound.length) > 0) {\n document.getElementById('hptfound').innerHTML = '<span class=\"sorttitle\">Will trade out for <a href=\"/wanted\">high priority cards</a> only:</span> <span class=\"searchresults\">' + hptfound.join(', ') + '</span>';\n } else {\n document.getElementById('hptfound').innerHTML = '';\n };\n if ((mptfound.length) > 0) {\n document.getElementById('mptfound').innerHTML = '<span class=\"sorttitle\">Will trade out for <a href=\"/wanted\">high or medium priority cards</a>:</span> <span class=\"searchresults\">' + mptfound.join(', ') + '</span>';\n } else {\n document.getElementById('mptfound').innerHTML = '';\n };\n if ((lptfound.length) > 0) {\n document.getElementById('lptfound').innerHTML = '<span class=\"sorttitle\">Will trade out for <a href=\"/wanted\">any wanted card</a>:</span> <span class=\"searchresults\">' + lptfound.join(', ') + '</span>';\n } else {\n document.getElementById('lptfound').innerHTML = '';\n };\n if ((hpwfound.length) + (mpwfound.length) + (lpwfound.length) + (hptfound.length) + (mptfound.length) + (lptfound.length) == 0) {\n document.getElementById('nothing').innerHTML = 'No results';\n } else {\n document.getElementById('nothing').innerHTML = '';\n }\n }\n</script>\n </main>\n </body>\n</html>")
|
||||||
content.close()
|
content.close()
|
||||||
|
|
||||||
searchgen()
|
if __name__ == "__main__":
|
||||||
|
searchgen()
|
||||||
print("Building log page")
|
print("Building log page")
|
||||||
|
|
||||||
def loggen(month=False):
|
def loggen(month=False):
|
||||||
if month:
|
if month:
|
||||||
|
@ -1846,4 +1859,5 @@ def logall():
|
||||||
loggen(False)
|
loggen(False)
|
||||||
loggen(True)
|
loggen(True)
|
||||||
|
|
||||||
logall()
|
if __name__ == "__main__":
|
||||||
|
logall()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue