Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import dbus, gobject
- from dbus.mainloop.glib import DBusGMainLoop
- class NPNtest:
- def __init__(self):
- dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
- #self.bus = dbus.SessionBus()
- self.bus = dbus.SystemBus()
- #self.bus.add_signal_receiver (monitor_session)
- self.dbusSystemObject = "com.redhat.NewPrinterNotification"
- self.dbusSystemObjectPath = "/com/redhat/NewPrinterNotification"
- self.bus.add_signal_receiver(self.callback, dbus_interface=self.dbusSystemObject, path=self.dbusSystemObjectPath)
- self.loop = gobject.MainLoop()
- self.loop.run()
- def callback(self,*args):
- print "HERE"
- l = NPNtest()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement