選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

43 行
1.3 KiB

  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. try:
  18. import os
  19. import tempfile
  20. if 'TRAC_ENV' not in os.environ and \
  21. 'TRAC_ENV_PARENT_DIR' not in os.environ:
  22. os.environ['TRAC_ENV'] = '/srv/caca.zoy.org/var/lib/trac'
  23. if 'PYTHON_EGG_CACHE' not in os.environ:
  24. os.environ['PYTHON_EGG_CACHE'] = tempfile.gettempdir()
  25. from trac.web import fcgi_frontend
  26. fcgi_frontend.run()
  27. except SystemExit:
  28. raise
  29. except Exception, e:
  30. print 'Content-Type: text/plain\r\n\r\n',
  31. print 'Oops...'
  32. print
  33. print 'Trac detected an internal error:'
  34. print
  35. print e
  36. print
  37. import traceback
  38. import StringIO
  39. tb = StringIO.StringIO()
  40. traceback.print_exc(file=tb)
  41. print tb.getvalue()