maybe I shouldo nly use buffered writes?
This commit is contained in:
parent
01a93657ea
commit
7c27203744
3 changed files with 6 additions and 6 deletions
4
anime.py
4
anime.py
|
@ -2,7 +2,6 @@
|
||||||
from htmlgen import *
|
from htmlgen import *
|
||||||
import sys
|
import sys
|
||||||
import storage
|
import storage
|
||||||
print("Content-type: text/html\r\n\r\n")
|
|
||||||
html=htmlgen.HTMLgen(pagelayout.getLayoutXML().decode('utf-8'),"Home Page")
|
html=htmlgen.HTMLgen(pagelayout.getLayoutXML().decode('utf-8'),"Home Page")
|
||||||
count=storage.count("articles")
|
count=storage.count("articles")
|
||||||
for i in range(count):
|
for i in range(count):
|
||||||
|
@ -13,7 +12,8 @@ for i in range(count):
|
||||||
except:
|
except:
|
||||||
html.addArticle(**storage.get("articles",i), aid=i)
|
html.addArticle(**storage.get("articles",i), aid=i)
|
||||||
|
|
||||||
print("<!DOCTYPE html>")
|
sys.stdout.buffer.write("Content-type: text/html\r\n\r\n".encode('utf8'))
|
||||||
|
sys.stdout.buffer.write("<!DOCTYPE html>".encode('utf8'))
|
||||||
sys.stdout.buffer.write(html.renderSite().encode('utf8'))
|
sys.stdout.buffer.write(html.renderSite().encode('utf8'))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
#print(html.renderSite())
|
#print(html.renderSite())
|
||||||
|
|
|
@ -9,7 +9,6 @@ import base64
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from captcha.image import ImageCaptcha
|
from captcha.image import ImageCaptcha
|
||||||
import time, string
|
import time, string
|
||||||
print("Content-type: text/html\r\n\r\n")
|
|
||||||
form=cgi.FieldStorage()
|
form=cgi.FieldStorage()
|
||||||
aid=int(form["aid"].value)
|
aid=int(form["aid"].value)
|
||||||
try:
|
try:
|
||||||
|
@ -46,7 +45,8 @@ count=storage.count("comments-%i"%aid)
|
||||||
for i in range(count):
|
for i in range(count):
|
||||||
html.addArticle(aid=aid,**(storage.get("comments-%i"%aid,i)))
|
html.addArticle(aid=aid,**(storage.get("comments-%i"%aid,i)))
|
||||||
|
|
||||||
print("<!DOCTYPE html>")
|
sys.stdout.buffer.write("Content-type: text/html\r\n\r\n".encode('utf8'))
|
||||||
|
sys.stdout.buffer.write("<!DOCTYPE html>".encode('utf8'))
|
||||||
sys.stdout.buffer.write(html.renderSite(True).encode('utf8'))
|
sys.stdout.buffer.write(html.renderSite(True).encode('utf8'))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
#print(html.renderSite(True))
|
#print(html.renderSite(True))
|
||||||
|
|
4
index.py
4
index.py
|
@ -2,7 +2,6 @@
|
||||||
from htmlgen import *
|
from htmlgen import *
|
||||||
import sys
|
import sys
|
||||||
import storage
|
import storage
|
||||||
print("Content-type: text/html\r\n\r\n")
|
|
||||||
html=htmlgen.HTMLgen(pagelayout.getLayoutXML().decode('utf-8'),"Home Page")
|
html=htmlgen.HTMLgen(pagelayout.getLayoutXML().decode('utf-8'),"Home Page")
|
||||||
count=storage.count("articles")
|
count=storage.count("articles")
|
||||||
for i in range(count):
|
for i in range(count):
|
||||||
|
@ -13,7 +12,8 @@ for i in range(count):
|
||||||
except:
|
except:
|
||||||
html.addArticle(aid=i, **storage.get("articles",i))
|
html.addArticle(aid=i, **storage.get("articles",i))
|
||||||
|
|
||||||
print("<!DOCTYPE html>")
|
sys.stdout.buffer.write("Content-type: text/html\r\n\r\n".encode('utf8'))
|
||||||
|
sys.stdout.buffer.write("<!DOCTYPE html>".encode('utf8'))
|
||||||
sys.stdout.buffer.write(html.renderSite().encode('utf8'))
|
sys.stdout.buffer.write(html.renderSite().encode('utf8'))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
#print(html.renderSite())
|
#print(html.renderSite())
|
||||||
|
|
Loading…
Reference in a new issue