Line | |
---|
1 | #!/usr/bin/python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | # |
---|
4 | # Copyright (C) 2003-2008 Edgewall Software |
---|
5 | # Copyright (C) 2003-2004 Jonas Borgström <jonas@edgewall.com> |
---|
6 | # All rights reserved. |
---|
7 | # |
---|
8 | # This software is licensed as described in the file COPYING, which |
---|
9 | # you should have received as part of this distribution. The terms |
---|
10 | # are also available at http://trac.edgewall.org/wiki/TracLicense. |
---|
11 | # |
---|
12 | # This software consists of voluntary contributions made by many |
---|
13 | # individuals. For the exact contribution history, see the revision |
---|
14 | # history and logs, available at http://trac.edgewall.org/log/. |
---|
15 | # |
---|
16 | # Author: Jonas Borgström <jonas@edgewall.com> |
---|
17 | |
---|
18 | try: |
---|
19 | import os |
---|
20 | import tempfile |
---|
21 | if 'TRAC_ENV' not in os.environ and \ |
---|
22 | 'TRAC_ENV_PARENT_DIR' not in os.environ: |
---|
23 | os.environ['TRAC_ENV'] = '/srv/caca.zoy.org/var/lib/trac-test' |
---|
24 | if 'PYTHON_EGG_CACHE' not in os.environ: |
---|
25 | os.environ['PYTHON_EGG_CACHE'] = tempfile.gettempdir() |
---|
26 | from trac.web import fcgi_frontend |
---|
27 | fcgi_frontend.run() |
---|
28 | except SystemExit: |
---|
29 | raise |
---|
30 | except Exception, e: |
---|
31 | print 'Content-Type: text/plain\r\n\r\n', |
---|
32 | print 'Oops...' |
---|
33 | print |
---|
34 | print 'Trac detected an internal error:' |
---|
35 | print |
---|
36 | print e |
---|
37 | print |
---|
38 | import traceback |
---|
39 | import StringIO |
---|
40 | tb = StringIO.StringIO() |
---|
41 | traceback.print_exc(file=tb) |
---|
42 | print tb.getvalue() |
---|
Note: See
TracBrowser
for help on using the repository browser.