WebStack

tools/demo.py

394:91ead0a6d5ec
2005-07-16 paulb [project @ 2005-07-16 14:39:32 by paulb] Fixed CGI newlines at end of headers.
     1 #!/usr/bin/env python     2      3 "Start the demonstration program."     4      5 import os, sys     6      7 # Find out where WebStack's distribution directory is.     8      9 cwd = os.getcwd()    10 parts = os.path.split(cwd)    11 if parts[-1] == "tools":    12     parts = parts[:-1]    13 base = os.path.join(*parts)    14     15 # Set up a sessions directory if necessary.    16     17 sessions = os.path.join(base, "WebStack-sessions")    18 if not os.path.exists(sessions):    19     os.mkdir(sessions)    20     21 # Set up the environment and run the demo program.    22     23 os.environ["PYTHONPATH"] = "%s%s%s" % (base, os.pathsep, os.path.join(base, "examples", "Common"))    24 os.system("%s %s" % (sys.executable, os.path.join(base, "examples", "BaseHTTPRequestHandler", "DemoApp.py")))    25     26 # vim: tabstop=4 expandtab shiftwidth=4