Ticket #185: mptest.py

File mptest.py, 579 bytes (added by Richard Boulton, 17 years ago)

mod-python script testing xapian

Line 
1from mod_python import apache
2import sys
3import os
4
5# Change these to point to your xapian installation:
6sys.path.insert(0, '/home/richard/private/Working/xapian/build/xapian-bindings/python/.libs')
7sys.path.insert(0, '/home/richard/private/Working/xapian/build/xapian-bindings/python')
8import xapian
9
10import threading
11
12def handler(req):
13 req.content_type = "text/html"
14 req.write('Begin')
15 req.write(repr(req.interpreter))
16 req.write(str(os.getpid()))
17 req.write('...')
18
19 d = xapian.Database('my/index/path')
20
21 req.write(' OK')
22 return apache.OK