Matching signals in Python
Sam Morris
sam at robots.org.uk
Sun Apr 16 06:03:06 PDT 2006
I'm trying to write a simple python program to listen for Evolution's new
mail signal. The code I have is as follows:
---
import gobject
import dbus
def print_mail (mailbox):
print 'mail: ', mailbox
bus = dbus.SessionBus ()
bus.add_signal_receiver (print_mail,
signal_name='Newmail',
dbus_interface='org.gnome.evolution.mail.dbus.Signal')
loop = gobject.MainLoop ()
loop.run ()
---
But print_mail is never called. The messages going over the bus look like
this:
signal sender=:1.24 -> dest=(null destination)
interface=org.gnome.evolution.mail.dbus.Signal; member=Newmail
string "spool:///var/mail/sam#INBOX"
This is with Dbus 0.61. Could someone please point me in the right
direction?
--
Sam Morris
http://robots.org.uk/
PGP key id 5EA01078
3412 EA18 1277 354B 991B C869 B219 7FDB 5EA0 1078
More information about the dbus
mailing list