Re: pyblosxom 3000

Steven Armstrong <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
Bill Mill wrote:
<snip>
> 
> This is the type of change I think we need to get started on. Do we
> want to break compatibility for some modules for the next release? I
> say yes, and that we should start breaking what we need to soon, so
> that we can get a solid 1.2 api in place.
> 
> 
<snip>
> 
> I like it; want to work on it and submit a patch? I don't think it'd
> be that hard to redirect all output through a response object.
> 

Currently I do this by subclassing Pyblosxom.pyblosxom.Request and 
adding a few methods like those shown below.

Inputstream:
infile = request.read()
infilepart = request.read(1024)
inline = request.readline()
inlines = request.readlines()

Outputstream:
response = request.getResponse()
response.addHeader('Content-Type', 'text/plain')
response.write("Hello World")
response.writelines(["whatever", "you", "want"])

See http://www.c-area.ch/code/pyblosxom/wsgi.py for details.

I use a custom renderer that overrides showHeaders and proxies the given 
headers through to the response object.
http://www.c-area.ch/code/pyblosxom/renderers/wsgi.py

I have also written a compatibility plugin that emulates the above so my 
other plugins also work in a non wsgi environment.
http://www.c-area.ch/code/pyblosxom/plugins/compatibility.py


One possibility I see is to just add the modules I wrote to the core 
distribution. The other to actually patch my code in.

Pick your poison :)

Other thoughts/ideas?

cheers
Steven


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.