From: Allister L. S. <all...@gm...> - 2008-09-11 08:07:53
|
Hi Kim, I'm thinking that it should be simple to build a little header > dictionary that can parse the HTTP_ALL_HEADERS string, and use it from > all CGI scripts. That way, the headers are available similarly to > cgi.FieldStorage().headers, but in raw form. Hmmm, I think you're on to something interesting here... Maybe that's better or more efficient or more elegant than having so many environment variables... Looking forward to what you can cook up then :-) > That said, my Python-Fu is not so strong, either, so I'm not sure > what's involved in making a module that's importable from other > scripts...? As you may know, a module is simply a *.py file. To make it importable, simply put it in the same folder as the importing code or add the path to its containing folder to $PYTHONPATH. > > Also, I think it's better that we expose the command handles do_GET, > > do_POST, do_DELETE, etc. (as was the case in revision 90 of > > http_test_server.py) at the level of the HttpTestHandler class as we are > > most likely to overload them in the future to fully comply with RFC 2616. > > Ah, I just saw that they all delegated to the base, and so I figured > they were redundant. To me it seems better to just override when > necessary, but I don't have a strong opinion either way. > Okay, we'll cross the bridge when we get there :-) We'll add those functions when needed -- although I just thought someone out there might be interested (tempted) in writing the necessary code once he/she sees those poor unimplemented functions :-) Cheers, Allister |