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