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@600 | 7 | #sys.path.append("/home/paulb/Software/Python/WebStack") |
paulb@600 | 8 | #sys.path.append("/home/paulb/Software/Python/XSLTools") |
paulb@600 | 9 | #sys.path.append("/home/paulb/Software/Python/XSLTools/examples/Common") |
paulb@600 | 10 | #sys.path.append("/home/paulb/Software/Python/libxml2dom") |
paulb@600 | 11 | #filename = "/home/paulb/Software/Python/XSLTools/docs/LICENCE.txt" |
paulb@600 | 12 | filename = "/usr/share/doc/python2.4-xsltools/docs/gpl-3.0.txt" |
paulb@219 | 13 | encoding = None |
paulb@219 | 14 | |
paulb@219 | 15 | from WebStack.Adapters import ModPython |
paulb@219 | 16 | import Dictionary |
paulb@219 | 17 | from Dictionary.Dict import Dict |
paulb@219 | 18 | |
paulb@219 | 19 | dict = Dict(filename, encoding) |
paulb@219 | 20 | |
paulb@219 | 21 | # Get a simple Web site. |
paulb@219 | 22 | |
paulb@219 | 23 | resource = Dictionary.get_site(dict) |
paulb@219 | 24 | |
paulb@219 | 25 | # NOTE: Not sure if the resource should be maintained in a resource pool. |
paulb@219 | 26 | |
paulb@219 | 27 | def handler(req): |
paulb@219 | 28 | global resource |
paulb@219 | 29 | return ModPython.respond(req, resource, handle_errors=0) |
paulb@219 | 30 | |
paulb@219 | 31 | # vim: tabstop=4 expandtab shiftwidth=4 |