Added a way to output stuff if stdout is not utf-8
This commit is contained in:
parent
36a73733c6
commit
cce6bb0b56
3 changed files with 9 additions and 3 deletions
4
anime.py
4
anime.py
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
from htmlgen import *
|
||||
import sys
|
||||
import storage
|
||||
print("Content-type: text/html\r\n\r\n")
|
||||
html=htmlgen.HTMLgen(pagelayout.getLayoutXML().decode('utf-8'),"Home Page")
|
||||
|
@ -13,4 +14,5 @@ for i in range(count):
|
|||
html.addArticle(**storage.get("articles",i), aid=i)
|
||||
|
||||
print("<!DOCTYPE html>")
|
||||
print(html.renderSite())
|
||||
sys.stdout.buffer.write(html.renderSite().encode('utf8'))
|
||||
#print(html.renderSite())
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
from htmlgen import *
|
||||
import traceback
|
||||
import sys
|
||||
import storage
|
||||
import cgi
|
||||
import random
|
||||
|
@ -46,4 +47,5 @@ for i in range(count):
|
|||
html.addArticle(aid=aid,**(storage.get("comments-%i"%aid,i)))
|
||||
|
||||
print("<!DOCTYPE html>")
|
||||
print(html.renderSite(True))
|
||||
sys.stdout.buffer.write(html.renderSite(True).encode('utf8'))
|
||||
#print(html.renderSite(True))
|
||||
|
|
4
index.py
4
index.py
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
from htmlgen import *
|
||||
import sys
|
||||
import storage
|
||||
print("Content-type: text/html\r\n\r\n")
|
||||
html=htmlgen.HTMLgen(pagelayout.getLayoutXML().decode('utf-8'),"Home Page")
|
||||
|
@ -13,4 +14,5 @@ for i in range(count):
|
|||
html.addArticle(aid=i, **storage.get("articles",i))
|
||||
|
||||
print("<!DOCTYPE html>")
|
||||
print(html.renderSite())
|
||||
sys.stdout.buffer.write(html.renderSite().encode('utf8'))
|
||||
#print(html.renderSite())
|
||||
|
|
Loading…
Reference in a new issue