[packagekit] yum2 backend

Tim Lauridsen tim.lauridsen at googlemail.com
Sat Feb 16 11:10:18 PST 2008


Robin Norwood wrote:
> On Fri, 15 Feb 2008 14:30:53 +0100
> Tim Lauridsen <tim.lauridsen at googlemail.com> wrote:
> 
>> I spend some time make the yum2 dbus backend work.
>>
>> Had to comment out all dbus service methods in the base class 
>> (deamonBackend.py) because it looks like overloading the methods in 
>> yumDBUSBackend.py was not working, so when calling the methods from
> 
> Thanks for fixing that up...I thought it was working for me the other
> night, but tests in the harsh light of day show that it doesn't work
> for me now either. Any python guys know anything about overloading
> decorators, and why this wouldn't be working?
> 
>> via dbus call the stubs in the baseclass, and they are not doing any
>> action. I have add a call to a self._check_init() in each dbus
>> method, it checks if Init() has been called and call it if not, it
>> also setup if we want to use the yum cache or not.
> 

> I was wondering if that was necessary, but should it be?  My
> understanding is that the backend should always call Init() - is this
> check just masking a bug in the backend?  Hughsie?

It is fine that the backend always starts calling Init(), but it make 
the API more safe and easier to test, that we can any methods without 
generating a traceback, if Init() is not called.
self._check_init() also make sure the yum cache is turn on or off 
depended on what we need in the current.
The self._check_init() only call Init() if not have been called, so if 
the backend have called Init(), then it will not be called again.
It really suck while testing the different methods directly (without 
using pk), that you have to call Init() first after every restart.

Tim






More information about the PackageKit mailing list