|
|
@ -16,16 +16,34 @@ def crayonlog(colour,event):
|
|
|
|
crayonstring = str(crayonno) + " " + crayonrend
|
|
|
|
crayonstring = str(crayonno) + " " + crayonrend
|
|
|
|
return crayonstring
|
|
|
|
return crayonstring
|
|
|
|
|
|
|
|
|
|
|
|
def loggen():
|
|
|
|
def loggen(month=False):
|
|
|
|
if not os.path.isdir("build/log"):
|
|
|
|
if month:
|
|
|
|
os.mkdir("build/log")
|
|
|
|
if not os.path.isdir("build/log/month"):
|
|
|
|
if os.path.exists("build/log/index.html"):
|
|
|
|
os.mkdir("build/log/month")
|
|
|
|
os.remove("build/log/index.html")
|
|
|
|
if os.path.exists("build/log/month/index.html"):
|
|
|
|
thefile = "build/log/index.html"
|
|
|
|
os.remove("build/log/month/index.html")
|
|
|
|
|
|
|
|
thefile = "build/log/month/index.html"
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
if not os.path.isdir("build/log"):
|
|
|
|
|
|
|
|
os.mkdir("build/log")
|
|
|
|
|
|
|
|
if os.path.exists("build/log/index.html"):
|
|
|
|
|
|
|
|
os.remove("build/log/index.html")
|
|
|
|
|
|
|
|
thefile = "build/log/index.html"
|
|
|
|
skel.headerwrite(thefile,"log")
|
|
|
|
skel.headerwrite(thefile,"log")
|
|
|
|
content = open(thefile,"a")
|
|
|
|
content = open(thefile,"a")
|
|
|
|
content.write("<h1>log</h1>\n")
|
|
|
|
content.write("<h1>log</h1>\n")
|
|
|
|
thelog = log.log[::-1]
|
|
|
|
if month:
|
|
|
|
|
|
|
|
content.write("<p><a href=\"/log\">Show all</a></p>\n")
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
content.write("<p><a href=\"/log/month\">Show current month only</a></p>\n")
|
|
|
|
|
|
|
|
if month:
|
|
|
|
|
|
|
|
thelog = []
|
|
|
|
|
|
|
|
for event in log.log:
|
|
|
|
|
|
|
|
if event["date"].month == datetime.datetime.now().month and event["date"].year == datetime.datetime.now().year:
|
|
|
|
|
|
|
|
thelog.append(event)
|
|
|
|
|
|
|
|
thelog = thelog[::-1]
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
thelog = log.log[::-1]
|
|
|
|
for event in thelog:
|
|
|
|
for event in thelog:
|
|
|
|
if event["event"] != "portfolio":
|
|
|
|
if event["event"] != "portfolio":
|
|
|
|
content.write("<p><code>" + event["date"].strftime("%Y-%m-%d") + "</code> <a href=\"" + event["url"] + "\">[" + event["event"] + "]</a>: ")
|
|
|
|
content.write("<p><code>" + event["date"].strftime("%Y-%m-%d") + "</code> <a href=\"" + event["url"] + "\">[" + event["event"] + "]</a>: ")
|
|
|
@ -125,5 +143,9 @@ def loggen():
|
|
|
|
content.close()
|
|
|
|
content.close()
|
|
|
|
skel.footerwrite(thefile)
|
|
|
|
skel.footerwrite(thefile)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def logall():
|
|
|
|
|
|
|
|
loggen(False)
|
|
|
|
|
|
|
|
loggen(True)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
if __name__ == "__main__":
|
|
|
|
loggen()
|
|
|
|
logall()
|
|
|
|