Re: [Deskbar] Pushing handler updates from a central repo



2006/6/4, Sebastian Pölsterl <marduk k-d-w org>:
Hi!

The intergration of the updater changed. Instead of a deskbar-applet only
updater we now make use of dbus to provide a application independent
method for retrieving updates.

The package includes a dbus "daemon" ( dbus-object.py), a example client
(dbus-client.py) and a deskbar-applet specific specs file
(specs/deksbarapplet.py).

How it works:
Fist of all, you have to connect to the dbus object
org.gnome.NewStuffManager to spawn an application specific object.
Actually, this object handles the update stuff. First, get a list of all
available updates (neccessary or not). Second, provide a list of plugins
you want to be checked for available updates. This emits a signal for all
plugins telling you whether an update is available or not. You can also
skip this step and compare the versions in the client.
Last but not least, you can download and install an update.

The example client does all these steps. Currently, it's not integrated
within deskbar-applet. Actually, it places leoorg.py in
~/.gnome2/deskbar-applet/handlers, but it shows you how it works.

So download it at
http://www.k-d-w.org/clipboard/deskbar/updater-dbus.tar.gz and unpack it.
In addition, you'll need the python-elementtree package to get it working.
Now run dbus-object.py and dbus-client.py. Updater.py is just the old
version and won't work anymore.

Furthermore, have a look at http://live.gnome.org/DeskbarApplet/PluginManager

I'm going to write a intergration into deskbar-applet and some more
documentation later next week or so.

So please give it a try and let me know what you think.


Amazing! If I was the swearing kinda guy I would probably say OMFG, but now that I'm a responsible father, I resort to OMG :-D I thought it would take longer to do this. Although, there's still a lot of work, you are already on good track. Don't you just love Python for this kinda development!

I had to change the SPECS_DIR to get it running, but that was a no-brainer.

Notes:
---------
1) You might want to add "#!/usr/bin/env python" in the first line of you dbus client and server, so that they can be run like ./dbus- client.py and ./dbus-object.py.

2) Why not create a updater.Client class? As I understand dbus-client would be specific for deskbar, but if you create a generic client class you can ship it with the NewStuff "package", and have a client for all Python projects out there (plus a "tutorial" for other languages).

3) If the dbus-object is spawned by dbus activation, you might as well add a timeout every ten seconds to check if we have been doing anything lately, and if not simply quit the main loop. If we are needed again dbus will restart us.


This was just of the top of my head and not really thought through, but I hope you can use it :-D Anyway, you get my "Hacker of the Month" reward for this work (the fact that you had documented most things brings you way past the thousands of other runner ups :-D)!

Cheers,
Mikkel


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