Advertisement
Guest User

Untitled

a guest
Dec 27th, 2010
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import dbus, gobject
  3. from dbus.mainloop.glib import DBusGMainLoop
  4. class NPNtest:
  5.  
  6. def __init__(self):
  7. dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
  8. #self.bus = dbus.SessionBus()
  9. self.bus = dbus.SystemBus()
  10.  
  11. #self.bus.add_signal_receiver (monitor_session)
  12.  
  13. self.dbusSystemObject = "com.redhat.NewPrinterNotification"
  14. self.dbusSystemObjectPath = "/com/redhat/NewPrinterNotification"
  15. self.bus.add_signal_receiver(self.callback, dbus_interface=self.dbusSystemObject, path=self.dbusSystemObjectPath)
  16.  
  17. self.loop = gobject.MainLoop()
  18. self.loop.run()
  19.  
  20. def callback(self,*args):
  21. print "HERE"
  22.  
  23. l = NPNtest()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement