it's always good to assign variables before use
[uccdoor.git] / client-xmpp.py
index b9af4cb..7d8d9dd 100755 (executable)
@@ -3,6 +3,7 @@
 # David Adam <[email protected]>
 # Released under an MIT-style license; see COPYING for details.
 
+import syslog
 import dbus
 import gobject
 import xmpp
@@ -43,12 +44,15 @@ class Door(object):
         
         try:
             new_state = self.remoteobj.get_status(dbus_interface='au.asn.ucc.DoorInterface')
-        except:
+        except Exception, e:
+            syslog.syslog(142, "get_status failed: %s" % e)
             pass
         
+        self.doorname = doorname
         self.state_changed(new_state)
     
     def state_changed(self, new_state):
+        print "xmpp state change detected for %s from %i to %i" % (self.doorname, self.state, newstate)
         self.state = new_state
         # look up the dictionary object for the current state, then construct
         # a presence object using that as a keyword argument

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