From: David Adam (zanchey) Date: Mon, 7 Sep 2009 13:30:48 +0000 (+0800) Subject: client-synch.py: basic example client that runs synchronously X-Git-Url: https://git.ucc.asn.au/?p=uccdoor.git;a=commitdiff_plain;h=e7805a6eb795e717864d5c48d1efa5bb5390b16a client-synch.py: basic example client that runs synchronously --- 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)