client: use async call instead of sync call
[profile/ivi/automotive-message-broker.git] / tests / amb-get.py
1 #!/usr/bin/python
2
3 import dbus
4 import sys
5 import argparse
6 import json
7
8 print "This application is deprecated.  It will disappear in the future.  Use ambctl"
9
10 parser = argparse.ArgumentParser()
11 parser.add_argument("get", help="get {objectName}")
12 args = parser.parse_args()
13
14 objectName = args.get
15
16 bus = dbus.SystemBus()
17 managerObject = bus.get_object("org.automotive.message.broker", "/");
18 managerInterface = dbus.Interface(managerObject, "org.automotive.Manager")
19
20 objects = managerInterface.FindObject(objectName);
21
22 for o in objects:
23         propertiesInterface = dbus.Interface(bus.get_object("org.automotive.message.broker", o),"org.freedesktop.DBus.Properties")
24         print json.dumps(propertiesInterface.GetAll("org.automotive."+objectName), indent=2)