Re: pyblosxom 3000
Steven Armstrong <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all
I've sucessfully patched in the inputstream/outputstream stuff.
Before I go any further I wanted to ask you all a few questions
regarding API changes for 1.2. Some of this is redundant with stuff I
previously posted, sorry for that.
Here are the changes I'ld like to propose:
Application startup (pyblosxom.cgi):
p = PyBlosxom(config, environ) # environ becomes ._http
# static
p.runStaticRenderer(incremental)
# test
p.testInstallation()
# cgi
p.run()
response = p.getResponse()
response.sendHeaders(sys.stdout)
response.sendBody(sys.stdout)
The response stuff in the #cgi part is required since mod_python and
twisted handle this part differently, hence p.run() should not write
headers or data directly.
Outputstream (pyblosxom.py):
response = request.getResponse()
response.addHeader('Content-Type', 'text/plain')
response.write("Hello World")
response.writelines(["whatever", "you", "want"])
Renderer (base.py):
rewrite showHeaders to call addHeader on the response instead of writing
to stdout.
Inputstream (pyblosxom.py):
infile = request.read()
infilepart = request.read(1024)
inline = request.readline()
inlines = request.readlines()
Form handling (pyblosxom.py):
form = request.getForm()
This allows a lazy approach for calling cgi.FieldStorage.
My problem with the current form handling is that the inputstream is
consumed by cgi.FieldStorage, whether a form is actually used anywhere
in the callback chain or not.
And when my poor plugin want's to read some xml which a client app has
sent there's nothing left to read from.
I believe this may also solve the problem Richard Chamberlain described
in his mail "xmlrpc_metaweblog.py problem" to the pyblosxom-users
mailing list.
This can be made backwards compatible if necessary.
That's about it. It's actually allready coded. If you think that all
sounds good I'll send in a patch.
Concerns? Ideas?
cheers
Steven
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl