import datetime,os,re import log,skel def levelsgen(): if not os.path.isdir("build/levels"): os.mkdir("build/levels") if os.path.exists("build/levels/index.html"): os.remove("build/levels/index.html") thefile = "build/levels/index.html" skel.headerwrite(thefile,"levels") content = open(thefile,"a") content.write("

levels

\n") dates = [] for event in log.log: try: for card in event["received"]: dates.append(event["date"]) except: pass try: for card in event["lost"]: dates.remove(dates[-1]) except: pass content.write("\n\n\n\n\n\n\n\n\n
" + dates[0].strftime("%Y-%m-%d") + "
\n") try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[100].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[200].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[300].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[400].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[500].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[600].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[700].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[800].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[1000].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[1200].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[1400].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[1600].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[1800].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[2000].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[2200].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[2400].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[2700].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[3000].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[3300].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[3600].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[3900].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[5200].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[4500].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[4800].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[5100].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[5400].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[5700].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[6000].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[6300].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[6600].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[6900].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[7200].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[7500].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[7800].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[8100].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[8400].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[8700].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[9000].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[9300].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[9600].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[9900].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[10200].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[10500].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[10800].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[11100].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[11400].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[11700].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[12000].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[12300].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[12600].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[12900].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[13200].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[13500].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[13800].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[14100].strftime("%Y-%m-%d") + "
\n") except: pass try: content.write("\n\n\n\n\n\n\n\n\n
" + dates[14400].strftime("%Y-%m-%d") + "
\n") except: pass content.close() skel.footerwrite(thefile) if __name__ == "__main__": levelsgen()