[packagekit] yum2 backend

Robin Norwood rnorwood at redhat.com
Sat Feb 16 11:17:06 PST 2008


On Sat, 16 Feb 2008 20:10:18 +0100
Tim Lauridsen <tim.lauridsen at googlemail.com> wrote:

> 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.

Ah, that makes perfect sense, thanks.

BTW, I just added a call to Exit() at the end of your tests -
especially useful now, when we don't have a timeout/quit feature on the
new yum backend yet.  I noticed this morning that the backend spawned
by the test suite I started last night was still running this
morning. :-)

-RN

-- 
Robin Norwood
Red Hat, Inc.

"The Sage does nothing, yet nothing remains undone."
-Lao Tzu, Te Tao Ching



More information about the PackageKit mailing list