pycs-devel archive weblog

A blog for archiving the pycs-devel mailing list


Phillip Pearson: [PyCS-devel] PyCS / ht://Dig stuff now in PyCS CVS

I just committed some search stuff into CVS. This isn't everything just
yet - there's a decent-sized patch to ht://Dig itself to get it to build as
a Python module, and a small patch to Medusa:

The big deal here is that I'm using fork() to run the search code in a
separate process (because it's used to running as a CGI, and doesn't appear
to clean up after itself very well), which requires a couple of changes to
let the child processes exit properly. Also the authorizer and rewriting
code needed a bit of refactoring to work properly here.

Can't talk much now (in a hurry) but I wanted to post this so this is all
documented at least a little bit. Will blog more later and post the
ht://Dig patch.

Here are my CVS comments:

Added ht://Dig integration.

Makefile: added modules/system/ to the install list made it possible to call various functions without spitting
out a whole lot of junk to stdout

pycs.conf: added a new 'enablehtdig' variable that must be set before will do anything that would be dangerous without a patched copy of
medusa (i.e. fork),, now we store a copy of the
authorizer so can grab it later on (better than having to read it
each time) now we pass on SystemExit exceptions instead of
catching them, so an exiting child process actually exits (NB: we need
co-operation from medusa here - this is where the aforementioned patch to
medusa/ comes in) moved the core url rewriting stuff into a new
method, so can rewrite things as necessary when doing the security

www/index.html: added 'search' link

And here's the medusa patch:

RCS file: /cvsroot/oedipus/medusa/,v
retrieving revision 1.10
diff -u -r1.10
--- 18 Dec 2002 14:55:44 -0000 1.10
+++ 29 Mar 2003 10:47:59 -0000
@@ -495,6 +495,8 @@
# This isn't used anywhere.
# r.handler = h # CYCLE
h.handle_request (r)
+ except SystemExit:
+ raise
(file, fun, line), t, v, tbinfo =

Phil :)