X-Git-Url: https://git.tld-linux.org/?p=tld-ftp-admin.git;a=blobdiff_plain;f=modules%2Fwwwiface.py;fp=modules%2Fwwwiface.py;h=4e65630728bb8481c5b2f2007ea3e741396e7899;hp=bc215ae768cab66fd7d8ec91f29c7cb41c863e2a;hb=51b9814081f743180ffed6c80fd7945acb554ce2;hpb=f7b22268ab563fa906be0653d037f1805e220e5c diff --git a/modules/wwwiface.py b/modules/wwwiface.py index bc215ae..4e65630 100644 --- a/modules/wwwiface.py +++ b/modules/wwwiface.py @@ -1,5 +1,7 @@ # vi: encoding=utf-8 ts=8 sts=4 sw=4 et +from __future__ import print_function + import cgi, Cookie, os menu=[] @@ -14,11 +16,11 @@ def getfile(file): def catfile(file): f=open("../html/" + file + ".html", 'r') - print f.read() + print(f.read()) f.close() def sendhttpheaders(): - print "Content-Type: text/html\n" + print("Content-Type: text/html\n") def getopts(): form = cgi.FieldStorage() @@ -28,7 +30,7 @@ def getopts(): cookies = {} - if os.environ.has_key('HTTP_COOKIE'): + if 'HTTP_COOKIE' in os.environ: c = Cookie.SimpleCookie() c.load(os.environ['HTTP_COOKIE']) for key in c.keys(): @@ -39,21 +41,21 @@ def getopts(): def sendhtml(): catfile('header') - print '') - print '') - print '
' + print('
') for i in content: - print i - print '
' + print(i) + print('
') catfile('footer')