X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=client-synch.py;fp=client-synch.py;h=b03c9f7b24ef37e8fedd5d120a75971cb96b03d4;hb=e7805a6eb795e717864d5c48d1efa5bb5390b16a;hp=0000000000000000000000000000000000000000;hpb=252392fc60849325996aab1488f25d1639138d36;p=uccdoor.git 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)