Release tizen_2.0_beta
[framework/connectivity/connman.git] / test / monitor-manager
1 #!/usr/bin/python
2
3 import gobject
4
5 import dbus
6 import dbus.mainloop.glib
7
8 def property_changed(name, value):
9         if name in ["Profiles", "Services", "Technologies"]:
10                 val = "["
11                 for i in value:
12                         val = val + " " + i[i.rfind("/") + 1:]
13                 val = val + " ]"
14         elif name in ["AvailableTechnologies", "EnabledTechnologies",
15                                                 "ConnectedTechnologies",
16                                 "AvailableDebugs", "EnabledDebugs"]:
17                 val = "["
18                 for i in value:
19                         val = val + " " + i
20                 val = val + " ]"
21         elif name in ["Strength", "Priority"]:
22                 val = int(value)
23         else:
24                 val = str(value)
25         print "%s = %s" % (name, val)
26
27 if __name__ == '__main__':
28         dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
29
30         bus = dbus.SystemBus()
31
32         bus.add_signal_receiver(property_changed,
33                                 bus_name="net.connman",
34                                 dbus_interface="net.connman.Manager",
35                                         signal_name = "PropertyChanged")
36
37         mainloop = gobject.MainLoop()
38         mainloop.run()