--bug
[svn42.git] / update-xmpp-status.py
old mode 100644 (file)
new mode 100755 (executable)
index c4bb6d4..8e4cbce
@@ -187,6 +187,9 @@ def filterAndFormatMessage(new_status):
   else:
     (status,req,req_comment) = new_status
     high_priority_msg = False
+    req_msg=""
+    status_msg=""
+    comment_msg=""
     if status == "opened":
       status_msg = uwscfg.msg_status_opened_msg
     elif status == "closed":
@@ -240,6 +243,10 @@ RE_REQUEST = re.compile(r'Request: (\w+) (?:Card )?(.+)')
 RE_ERROR = re.compile(r'Error: (.+)')
 while True:
   try:
+    if not os.path.exists(socketfile):
+      logging.debug("Socketfile '%s' not found, waiting 5 secs" % socketfile)
+      time.sleep(5)
+      continue
     sockhandle = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
     sockhandle.connect(socketfile)
     conn = os.fdopen(sockhandle.fileno())