29 lines
		
	
	
		
			908 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			908 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| '''
 | |
| Created on 20.12.2010
 | |
| 
 | |
| @author: morozov
 | |
| '''
 | |
| import os, sys, cgitb, datetime
 | |
| from wsgiref.util import application_uri
 | |
| 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.allDays()
 | |
|     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])
 |