25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

trac.cgi 1.3 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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-test'
  23. if 'PYTHON_EGG_CACHE' not in os.environ:
  24. os.environ['PYTHON_EGG_CACHE'] = tempfile.gettempdir()
  25. from trac.web import cgi_frontend
  26. cgi_frontend.run()
  27. except SystemExit:
  28. raise
  29. except Exception, e:
  30. import sys
  31. import traceback
  32. print>>sys.stderr, e
  33. traceback.print_exc(file=sys.stderr)
  34. print 'Status: 500 Internal Server Error'
  35. print 'Content-Type: text/plain'
  36. print
  37. print 'Oops...'
  38. print
  39. print 'Trac detected an internal error:', e
  40. print
  41. traceback.print_exc(file=sys.stdout)