Use tuple for sqlite arguments - breaks on older versions of storm
[build-farm.git] / web / build.cgi
1 #!/usr/bin/python
2 # This CGI script presents the results of the build_farm build
3
4 # Copyright (C) Jelmer Vernooij <jelmer@samba.org>     2010
5 #
6 #   This program is free software; you can redistribute it and/or modify
7 #   it under the terms of the GNU General Public License as published by
8 #   the Free Software Foundation; either version 3 of the License, or
9 #   (at your option) any later version.
10 #
11 #   This program is distributed in the hope that it will be useful,
12 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #   GNU General Public License for more details.
15 #
16 #   You should have received a copy of the GNU General Public License
17 #   along with this program; if not, write to the Free Software
18 #   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 import os
21 import sys
22 sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
23
24 import wsgiref.handlers
25 import resource
26
27 resource.setrlimit(resource.RLIMIT_RSS, (300000, 300000))
28 resource.setrlimit(resource.RLIMIT_DATA, (300000, 300000))
29 resource.setrlimit(resource.RLIMIT_CPU, (60, 60))
30
31 handler = wsgiref.handlers.CGIHandler()
32 CGI_DEBUG = False
33
34 if CGI_DEBUG:
35     import cgitb
36     cgitb.enable()
37     handler.log_exception = cgitb.handler
38
39 from buildfarm import BuildFarm
40 from buildfarm.web import BuildFarmApp
41 buildfarm = BuildFarm()
42 buildApp = BuildFarmApp(buildfarm)
43 handler.run(buildApp)