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@362 | 15 | # Set up the environment and run the demo program. |
paulb@362 | 16 | |
paulb@404 | 17 | pythonpath = os.environ.get("PYTHONPATH") |
paulb@401 | 18 | if pythonpath: |
paulb@401 | 19 | pythonpath = pythonpath + os.pathsep |
paulb@433 | 20 | else: |
paulb@433 | 21 | pythonpath = "" |
paulb@401 | 22 | |
paulb@401 | 23 | os.environ["PYTHONPATH"] = "%s%s%s%s" % (pythonpath, base, os.pathsep, os.path.join(base, "examples", "Common")) |
paulb@457 | 24 | os.system("%s %s %s" % (sys.executable, os.path.join(base, "examples", "BaseHTTPRequestHandler", "DemoApp.py"), |
paulb@457 | 25 | " ".join(sys.argv[1:]))) |
paulb@362 | 26 | |
paulb@362 | 27 | # vim: tabstop=4 expandtab shiftwidth=4 |