client-synch.py: basic example client that runs synchronously
authorDavid Adam (zanchey) <zanchey@ucc.gu.uwa.edu.au>
Mon, 7 Sep 2009 13:30:48 +0000 (21:30 +0800)
committerDavid Adam (zanchey) <zanchey@ucc.gu.uwa.edu.au>
Tue, 13 Oct 2009 14:38:46 +0000 (22:38 +0800)
client-synch.py [new file with mode: 0644]

diff --git a/client-synch.py b/client-synch.py
new file mode 100644 (file)
index 0000000..b03c9f7
--- /dev/null
@@ -0,0 +1,19 @@
+# UCC Door Server - example synchronous client
+# David Adam <zanchey@ucc.gu.uwa.edu.au>
+# 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)

UCC git Repository :: git.ucc.asn.au