root/cgi-bin/web/WEB-INF/cgi/trac.fcgi @ 1:736443ca372d

Revision 1:736443ca372d, 1.6 KB (checked in by Caoyuan Deng <dcaoyuan@…>, 8 months ago)

Reconstructed project

  • Property exe set to *
Line 
1#!/usr/bin/python2.4
2# -*- coding: utf-8 -*-
3#
4# Copyright (C) 2003-2009 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
18try:
19    import os
20    import pkg_resources
21    if 'TRAC_ENV' not in os.environ and \
22       'TRAC_ENV_PARENT_DIR' not in os.environ:
23        os.environ['TRAC_ENV'] = '/data/trac/projects/blogtrader'
24    if 'PYTHON_EGG_CACHE' not in os.environ:
25        if 'TRAC_ENV' in os.environ:
26            egg_cache = os.path.join(os.environ['TRAC_ENV'], '.egg-cache')
27        elif 'TRAC_ENV_PARENT_DIR' in os.environ:
28            egg_cache = os.path.join(os.environ['TRAC_ENV_PARENT_DIR'],
29                                     '.egg-cache')
30        pkg_resources.set_extraction_path(egg_cache)
31    from trac.web import fcgi_frontend
32    fcgi_frontend.run()
33except SystemExit:
34    raise
35except Exception, e:
36    print 'Content-Type: text/plain\r\n\r\n',
37    print 'Oops...'
38    print
39    print 'Trac detected an internal error:'
40    print
41    print e
42    print
43    import traceback
44    import StringIO
45    tb = StringIO.StringIO()
46    traceback.print_exc(file=tb)
47    print tb.getvalue()
Note: See TracBrowser for help on using the browser.