#!/usr/bin/python

import gobject

import dbus
import dbus.mainloop.glib

def property_changed(property, value):
	print "Manager property %s changed to %s" % (name, value)

if __name__ == "__main__":
	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

	bus = dbus.SystemBus()

	manager = dbus.Interface(bus.get_object('org.ofono', '/'),
							'org.ofono.Manager')

	manager.connect_to_signal("PropertyChanged", property_changed)

	try:
		properties = manager.GetProperties()
		print properties['Modems']
	except dbus.DBusException, e:
		print "Unable to call GetProperties %s" % e

	mainloop = gobject.MainLoop()
	mainloop.run()
