Re: Pidgin Plugin



2009/10/23 Chmouel Boudjnah <chmouel chmouel com>:
> Hi Ulrik,
>
> On 23/10/09 11:50, Ulrik Sverdrup wrote:
>>
>> Not that I know of. I have looked at Pidgin's D-Bus API (which is
>> HUGE) and thought about it, but not tried implementing anything.
>>
>> If you want to try it, I'm happy to test and review it. Otherwise,
>> what would your design of the plugin be, even if you can't make it
>> yourself: What objects should be available, what could the user do?
>
> I was thinking to implement the same way the gnome-do plugins does. It seems
> to do that in a very simple way by parsing the .purple/blist.xml config
> file.

Ok. I prefer using APIs to parsing, since there is less you can do
wrong. Both approaches have drawbacks. For example the Notes plugin
uses D-Bus so it can't index notes at all unless the Notes application
is running. XML is at least better to parse than some random format,
maybe the same kind of solution can be used for blist.xml as for
Rhythmbox -- look inside rhythmbox_support.py, it uses
xml.etree.ElementTree.

>
> It is possible i guess from there to check via dbus the availibity of the
> contact.
>
> I can have a try at this, what is the best way to start hacking on kupfer ?
> I mean aside of the docs and the code example, is Kupfer support
> autoreloading the plugin or need to do a restart all the time?

Autoreloading is not implemented, not even unload or load at runtime.
I wanted to solve this at some point but it might prove tricky or
impossible. One danger with the current architecture that builds on
one python module per plug-in is that it's easy to have some objects
that live on from the unloaded code and some that are created new from
the new code. This creates memory leaks and not so nice problems.

As for starting hacking, keep away from the GUI code ;-) ; I'm not so
happy with the code quality around the User Interface, and more proud
of the backend. Look into a simple plugin like wikipedia.py (a simple
action). Look in notes.py for an example of working with D-Bus, and a
full plugin with Sources, Leaves and Actions.

ulrik


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]