2016-06-14 16:07:17 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
from htmlgen import *
|
2016-07-31 09:57:35 +00:00
|
|
|
import sys
|
2016-06-14 16:07:17 +00:00
|
|
|
import storage
|
|
|
|
print("Content-type: text/html\r\n\r\n")
|
|
|
|
html=htmlgen.HTMLgen(pagelayout.getLayoutXML().decode('utf-8'),"Home Page")
|
|
|
|
count=storage.count("articles")
|
|
|
|
for i in range(count):
|
|
|
|
try:
|
|
|
|
article=storage.get("articles",i)
|
|
|
|
if "anime" in article["tags"]:
|
|
|
|
html.addArticle(**article)
|
|
|
|
except:
|
|
|
|
html.addArticle(**storage.get("articles",i), aid=i)
|
|
|
|
|
|
|
|
print("<!DOCTYPE html>")
|
2016-07-31 09:57:35 +00:00
|
|
|
sys.stdout.buffer.write(html.renderSite().encode('utf8'))
|
2016-07-31 10:01:06 +00:00
|
|
|
sys.stdout.flush()
|
2016-07-31 09:57:35 +00:00
|
|
|
#print(html.renderSite())
|