You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
899 B

'''
Created on 29.11.2010
@author: morozov
'''
import os, sys, cgitb
serverdir = os.path.dirname(__file__)
sys.path.append(serverdir + os.sep + 'include')
import functions
import database
import webInterface
cgitb.enable()
config = functions.readConfig()
def application(environ, start_response):
db = database.dbOperations(dbname = config.mysql_database, user = config.mysql_user, password = config.mysql_password, host = config.mysql_server, port = int(config.mysql_port))
pageParts = webInterface.pageParts(environ, db)
output = pageParts.header()
output += pageParts.journalForDay()
output += pageParts.addRecord()
output += pageParts.footer()
db.close()
status = '200 OK'
response_headers = [('Content-type', 'text/html'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return([output])