Re: Renderer plugins

Steven Armstrong <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
Ross Burton wrote:
> Hi,
> 
> I've got a plugin written for Pyblosxom 0.8 which in cb_start checked if
> the request filename matched a certain name and if so send some data to
> the client and set renderer.rendered to 1:
> 
> def cb_start(args):
>     request = args['request']
>     pyhttp = request.getHttp()
>     config = request.getConfiguration()
>     renderer = request.getData()['renderer']
>     if pyhttp["PATH_INFO"].endswith("doap.rdf"):
>         data = open(config["datadir"] + pyhttp["PATH_INFO"]).read()
>         renderer.addHeader('Content-type', 'application/rdf_xml')
>         renderer.addHeader('Content-Length', len(data))
>         renderer.showHeaders()
>         renderer.write(data)
>         renderer.rendered = 1
> 
> However, this isn't working with Pyblosxom 1.1: there isn't a "renderer"
> item in the Request.getData() dict.  Is this a bug in 1.1, or is there
> an API change?
> 
> Thanks,
> Ross

Hi Ross

As of my understanding the callback chain is as follows:
...
def cb_start(args): pass
def cb_handle(args): pass
def cb_renderer(args): pass # here the renderer gets created
def cb_pathinfo(args): pass
...

So you should be fine if you rename your cb_start to cb_pathinfo.
I think ...

hth
cheers
Steven

ps: I thought the content-type for rdf was application/rdf+xml, is it not?



-------------------------------------------------------
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
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.