[packagekit] Python bindings part 2

Aidan Skinner aidan at skinner.me.uk
Sun Jul 20 10:48:17 PDT 2008


On Thu, 2008-07-17 at 13:46 +0100, Martin Pitt wrote:

> Ah, thanks for the quick howto. git makes me weep :)

I've yet to find a [D]VCS that didn't elicit tears in some shape or
form ;)

> The diff looks mostly good to me, but you should consider dropping the
> complicated _wait() implementation again and use self.main_loop.run()
> (and self.main_loop.quit() in _h_finished(). It's a much cleaner
> implementation. The current implementation was just a test for
> circumventing the dbus-glib bug I mentioned, but it doesn't work.

I've made those changes, added a few more functions (UpdateSystem,
GetUpdates, SearchDetails) and changed others (Resolve, GetDetails,
SearchName) to return a dict. I haven't got a glib mainloop in the
program I'm working on, so I don't hit that bug (fortunately for me.
Threading in python is bad ju-ju, glib related threading more so).

I'm at a point where the next thing is probably going to involve making
more things async, similar to how Install and Remove are implemented.
Might go the whole hog and allow callers to specify Finished and
ErrorCode handlers as well (and use the existing ones as defaults for
synchronous callers), but I don't really need this so might not. 

What definitely needs doing is some refactoring as it's a bit
copy-paste-tastic ATM, and some unit tests added.

- Aidan



More information about the PackageKit mailing list