From e7805a6eb795e717864d5c48d1efa5bb5390b16a Mon Sep 17 00:00:00 2001 From: "David Adam (zanchey)" Date: Mon, 7 Sep 2009 21:30:48 +0800 Subject: [PATCH] client-synch.py: basic example client that runs synchronously --- client-synch.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 client-synch.py diff --git a/client-synch.py b/client-synch.py new file mode 100644 index 0000000..b03c9f7 --- /dev/null +++ b/client-synch.py @@ -0,0 +1,19 @@ +# UCC Door Server - example synchronous client +# David Adam +# Released under an MIT-style license; see COPYING for details. + +import dbus + +if __name__ == '__main__': + + # get on the bus + system_bus = dbus.SystemBus() + + doors = {'uccdoor': None, 'unisfadoor': None, 'chdoor': None, 'mrdoor': None, 'uccpir': None} + + for door in doors.keys(): + doors[door] = system_bus.get_object('au.asn.ucc.DoorServer', '/au/asn/ucc/doors/%s' % door) + + for door, remote_object in doors.items(): + status = remote_object.get_status(dbus_interface='au.asn.ucc.DoorInterface') + print '%s: %d' % (door, status) -- 2.20.1