[packagekit] yum2 backend

Patryk Zawadzki patrys at pld-linux.org
Fri Feb 15 07:26:29 PST 2008


On Fri, Feb 15, 2008 at 3:58 PM, Robin Norwood <rnorwood at redhat.com> 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?

A decorator is an immediately evaluted function. It is evaluated at
declaration time, not at instance creation time. If it does some magic
tricks like passing the decorated method to an external library, it
does the magic on the exact method that it prepends. Also:

@foo
def bar:
    pass

is equal to:

def bar:
    pass
bar = foo(bar)

So you really overload the decorator's output, not the original method.

-- 
Patryk Zawadzki
PLD Linux Distribution



More information about the PackageKit mailing list