Re: making flavours easier III

will guaraldi <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
Well, the easy way to do this is create your "meta-plugin" and have call a 
callback asking for something like "sidebar data" (things like archives 
listings, calendar, blogroll, ...).  The callback lists are populated in 
the order the plugins are loaded.  So the user can affect which comes 
first, second, third, ....

So then the issue becomes that of getting the various plugin authors to go 
through and add code to their plugin to support your callback.  It 
shouldn't be hard.  Something like:

    def cb_sidebar_data(args):
       // build a list of the variables that i create that should
       // go in the sidebar

       ...

       return list_of_variables

I'd be happy to add that sort of thing to all the contributed plugins 
(pycalendar, pyarchives, ...).

Anyone else have any thoughts on this?

/will


On Mon, 14 Mar 2005, Russell Nelson wrote:
> 
> Hmmm....  Maybe we can make flavours even easier?  Right now, if you
> use a plugin, you have to edit the flavour file in the right place:
> e.g. pyarchives or pycalendar.  If the plugin results were available
> in a structured form, then a meta-plugin could take all those results
> and insert them into a flavour in a structured manner.
>
> I imagine a meta-plugin which knows about plugins and then (through some
> magic) fetches and inserts their results.  It would be called from a
> flavour like this:
>    $util::plugins("<li>%(value)s</li>").
> or like this:
>    $util::plugins("<li>%(name)s:<ul><li>%(value)s</li></ul></li>").
> or like this:
>    $util::plugins("<p>%(value)s</p>").
> or like this:
>    $util::plugins("%(value)s<br />").
>
> It would take each of the plugin results and return them in situ.
> It would use a new configuration variable to set the order of the
> plugins.  No, no, wait, even better: it would look at the order in
> which plugins were specified in 'load_plugins'.
>
> The stumbling block to simply writing this as a plugin is that I see
> no current way to identify variables created by a plugin.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
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.