/Tools/faqwiz/faqw.py

http://unladen-swallow.googlecode.com/ · Python · 33 lines · 16 code · 5 blank · 12 comment · 2 complexity · a94a5b621dec2353c7dcc94d7e1878e0 MD5 · raw file

  1. #! /usr/local/bin/python
  2. """FAQ wizard bootstrap."""
  3. # This is a longer version of the bootstrap script given at the end of
  4. # faqwin.py; it prints timing statistics at the end of the regular CGI
  5. # script's output (so you can monitor how it is doing).
  6. # This script should be placed in your cgi-bin directory and made
  7. # executable.
  8. # You need to edit the first line and the lines that define FAQDIR and
  9. # SRCDIR, below: change /usr/local/bin/python to where your Python
  10. # interpreter lives, change the value for FAQDIR to where your FAQ
  11. # lives, and change the value for SRCDIR to where your faqwiz.py
  12. # module lives. The faqconf.py and faqcust.py files live there, too.
  13. import os
  14. t1 = os.times() # If this doesn't work, just get rid of the timing code!
  15. try:
  16. FAQDIR = "/usr/people/guido/python/FAQ"
  17. SRCDIR = "/usr/people/guido/python/src/Tools/faqwiz"
  18. import os, sys
  19. os.chdir(FAQDIR)
  20. sys.path.insert(0, SRCDIR)
  21. import faqwiz
  22. except SystemExit, n:
  23. sys.exit(n)
  24. except:
  25. t, v, tb = sys.exc_info()
  26. print
  27. import cgi
  28. cgi.print_exception(t, v, tb)