[packagekit] yum2 backend

Owen Taylor otaylor at redhat.com
Fri Feb 15 08:27:36 PST 2008


On Fri, 2008-02-15 at 11:17 -0500, Robin Norwood wrote:
> Ok...I knew decorators were evaluated 'early', but I'm still not clear
> on why this doesn't (seem to) work:
> 
> class Foo:
>     ...
>     
>     @decfoo
>     def bar:
>         pass
> 
> class Bar(Foo):
>     ...
> 
>     @decfoo
>     def bar:
>         print "Hello world\n"
> 
> 
> And what the proper syntax is to get it to do what I want.  In the case
> of the signals, I mostly want to use the base class to implement them,
> because really all the code for them is in the decorator - I (mostly)
> don't need to override them at all.

Hopefully this "mostly" can be removed, since it actually isn't possible
to override a dbus Signal... they do get tightly bound at the time the
declarator is called.

But I think putting anything inside a @dbus.service.signal annotated
method other than 'pass' or maybe a debug print is weird. The primary
meaning of calling a dbus.service.signal is "emit this signal over the
bus, so there should be no need to do anything locally. If there is such
a need, it's better handled with a wrapper function.

> 
> For the methods, however, we want to use the base class as essentially
> an interface, so that someone starting a new dbus-based python backend
> knows what functions to implement.  We can live with out this, but it
> would make me happy.

This should just work as far as I can tell... 

- Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/packagekit/attachments/20080215/380ecc9f/attachment-0004.pgp>


More information about the PackageKit mailing list