2 # UCC Door Server - client which outputs JSON
4 # Released under an MIT-style license; see COPYING for details.
8 if __name__ == '__main__':
11 system_bus = dbus.SystemBus()
13 doors = ('uccdoor', 'unisfadoor', 'chdoor', 'mrdoor', 'uccpir')
15 objects = (system_bus.get_object('au.asn.ucc.DoorServer', '/au/asn/ucc/doors/%s' % door)
17 statuses = (remote_object.get_status(dbus_interface='au.asn.ucc.DoorInterface')
18 for remote_object in objects)
19 status_ints = (int(x) for x in statuses)
21 print "Content-Type: text/json"
23 print dict(zip(doors, status_ints))