SHARE
TWEET

vArDo

a guest Jun 15th, 2008 1,070 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data
Want to get better at Python?
Learn to code Python in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top