blob: f836a8922e3b9efd67b727c6da809c395cdf6f07 [file] [log] [blame]
#!/usr/bin/python
import gobject
import dbus
import dbus.mainloop.glib
def element_signal(path, member):
if member == "ElementAdded":
action = "Add "
elif member == "ElementRemoved":
action = "Remove"
elif member == "ElementUpdated":
action = "Update"
else:
return
print "%s [ %s ]" % (action, path)
if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
bus.add_signal_receiver(element_signal,
bus_name="org.chromium.flimflam",
signal_name = "ElementAdded",
path_keyword="path",
member_keyword="member")
bus.add_signal_receiver(element_signal,
bus_name="org.chromium.flimflam",
signal_name = "ElementRemoved",
path_keyword="path",
member_keyword="member")
bus.add_signal_receiver(element_signal,
bus_name="org.chromium.flimflam",
signal_name = "ElementUpdated",
path_keyword="path",
member_keyword="member")
mainloop = gobject.MainLoop()
mainloop.run()