Advertisement
Guest User

vArDo

a guest
Jun 15th, 2008
1,117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. #!/usr/bin/env python
  2. INTERFACE = 'org.gajim.dbus.RemoteInterface'
  3. SIGNAL_NAME = 'NewMessage'
  4.  
  5. from dbus.mainloop.glib import DBusGMainLoop
  6. DBusGMainLoop(set_as_default=True)
  7.  
  8. import dbus
  9.  
  10. bus = dbus.SessionBus()
  11.  
  12. def dog_barks(data):
  13.     print "Data: %s"%(data)
  14.     print "Dog barks"
  15.  
  16. bus.add_signal_receiver(dog_barks, signal_name=SIGNAL_NAME,
  17.         dbus_interface=INTERFACE)
  18.  
  19. import gobject
  20. loop = gobject.MainLoop()
  21. loop.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement