Re: Help needed with writing a plugin for rss2 (a bit long)

will <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
On Tue, 21 Oct 2003, Rune Morling wrote:
>
> I would like to write a plugin for pyblosxom, both as a learning
> experience,
> but also out of a desire to get proper rss2.0 handling in pyblosxom via
> ?flav=rss2 or index.rss2.
>
> I've looked through the wiki and looked around in the code of pybloxom,
> but I'm not quite sure how to proceed. This will be a learning
> experience for me - I'm aiming to document the process thoroughly
> perhaps allowing my effort to be kind of a plugin writing HOWTO.

That's be cool--though I'm not sure how much a HOWTO will help.  I'll try
to answer all the questions below that I can.  Some of the questions I'd
have to research and I don't have time at the moment.

The key to plugins is callbacks.  A plugin itself does nothing.  It needs
to register with the specific callbacks that it needs to perform the
functionality it's performing.

Pyblosxom .8.1 (I'm assuming that's the version you're using) uses a
passive registration.  To register for a callback, you just have to
implement that function in your plugin.

For example, say I wanted to implement the filelist callback.  In my
plugin module, I have the following function:


def cb_filelist(args):
   pass


This function gets called when Pyblosxom calls the filelist callback.

For a list of the callbacks, what arguments they pass around, and what
they're expecting, look at:

http://roughingit.subtlehints.net/docs/public/ReadMeForPlugins-module.html


The complete API documentation for Pyblosxom:

http://roughingit.subtlehints.net/docs/


In the plugins registry, there are a bunch of plugins that implement
various things.  You should look at the code of these to get a feel for
what they do and how they go about doing it.

That should cover the general plugin issues.  In respects to rss2 and how
to implement it, someone else will have to answer--I don't know anything
about rss2.

Also, you should read the lifecycle of a Pyblosxom request.  I think it's
still accurate (I haven't touched it in a while):

http://wiki.subtlehints.net/moin/PyBlosxomLifeCycle


It walks through the lifecycle in respect to which callbacks are called
when.  If you couple this with the callbacks documentation in the first
link, then you should have a pretty complete picture of how Pyblosxom
works.

Hope that helps.

/will


-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
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.