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