--- /dev/null
+#!/usr/bin/env python
+
+# UCC Door Server - fake finger client for cfingerd(8)
+# Released under an MIT-style license; see COPYING for details.
+
+# incorporate into the cfingerd.conf(5) file with a line similar to:
+# FILES finger_fakeusers = {
+# "door", "The Doors", FALSE, "/home/other/door/uccdoor/client-finger.py"
+# }
+
+import dbus
+
+# status strings
+doorstrings = {0: 'The door is currently closed.',
+ 1: 'The door is currently open.',
+ -1: 'The door sensor is currently malfunctioning.',}
+
+pirstrings = {0: 'There is nothing moving here.',
+ 1: 'There is something moving here.',
+ -1: 'There is a malfunctioning PIR here.',}
+
+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():
+ try:
+ remote_object = system_bus.get_object('au.asn.ucc.DoorServer', '/au/asn/ucc/doors/%s' % door)
+ state = remote_object.get_status(dbus_interface='au.asn.ucc.DoorInterface')
+ except:
+ state = -1
+ # map the status to a string
+ if door == 'uccpir':
+ doors[door] = pirstrings[state]
+ else:
+ doors[door] = doorstrings[state]
+
+ print """The doors...
+
+The UCC door:
+ %(uccdoor)s
+ %(uccpir)s
+
+The UCC Machine Room door:
+ %(mrdoor)s
+
+The UniSFA door:
+ %(unisfadoor)s
+
+The Cameron Hall top door:
+ %(chdoor)s
+
+Bing.""" % doors
+