android_mt6572_jiabo/system/connectivity/shill/test-scripts/debug-flimflam
2025-09-05 16:56:03 +08:00

41 lines
1.3 KiB
Python
Executable file

#!/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()