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