paulb@219 | 1 | #!/usr/bin/env python |
paulb@219 | 2 | |
paulb@219 | 3 | # Initialise paths and the dictionary. |
paulb@219 | 4 | # NOTE: Path manipulation requires manual customisation. |
paulb@219 | 5 | |
paulb@219 | 6 | import sys |
paulb@219 | 7 | sys.path.append("/home/paulb/Software/Python/WebStack") |
paulb@219 | 8 | sys.path.append("/home/paulb/Software/Python/XSLTools") |
paulb@219 | 9 | sys.path.append("/home/paulb/Software/Python/XSLTools/examples/Common") |
paulb@219 | 10 | sys.path.append("/home/paulb/Software/Python/libxml2dom") |
paulb@219 | 11 | filename = "/home/paulb/Software/Python/XSLTools/docs/LICENCE.txt" |
paulb@219 | 12 | encoding = None |
paulb@219 | 13 | |
paulb@219 | 14 | from WebStack.Adapters import ModPython |
paulb@219 | 15 | import Dictionary |
paulb@219 | 16 | from Dictionary.Dict import Dict |
paulb@219 | 17 | |
paulb@219 | 18 | dict = Dict(filename, encoding) |
paulb@219 | 19 | |
paulb@219 | 20 | # Get a simple Web site. |
paulb@219 | 21 | |
paulb@219 | 22 | resource = Dictionary.get_site(dict) |
paulb@219 | 23 | |
paulb@219 | 24 | # NOTE: Not sure if the resource should be maintained in a resource pool. |
paulb@219 | 25 | |
paulb@219 | 26 | def handler(req): |
paulb@219 | 27 | global resource |
paulb@219 | 28 | return ModPython.respond(req, resource, handle_errors=0) |
paulb@219 | 29 | |
paulb@219 | 30 | # vim: tabstop=4 expandtab shiftwidth=4 |