2009-06-22 | Paul Boddie | file changeset files shortlog | Added some error handling to the questionnaire application. |
paulb@516 | 1 | #!/usr/bin/env python |
paulb@516 | 2 | |
paulb@516 | 3 | "Prepare the demonstration program's resources." |
paulb@516 | 4 | |
paulb@516 | 5 | import os, sys |
paulb@516 | 6 | |
paulb@516 | 7 | # Find out where the XSLTools distribution directory is. |
paulb@516 | 8 | |
paulb@516 | 9 | program = sys.argv[0] |
paulb@516 | 10 | cwd = os.path.split(program)[0] |
paulb@516 | 11 | parts = os.path.split(cwd) |
paulb@516 | 12 | if parts[-1] == "tools": |
paulb@516 | 13 | parts = parts[:-1] |
paulb@516 | 14 | base = os.path.join(*parts) |
paulb@516 | 15 | |
paulb@516 | 16 | # Set up the environment and obtain the demo resource. |
paulb@516 | 17 | |
paulb@522 | 18 | sys.path.insert(0, base) |
paulb@522 | 19 | sys.path.insert(0, os.path.join(base, "examples", "Common")) |
paulb@516 | 20 | |
paulb@516 | 21 | import DemoApp |
paulb@516 | 22 | DemoApp.prepare_resources() |
paulb@516 | 23 | |
paulb@516 | 24 | # vim: tabstop=4 expandtab shiftwidth=4 |