wpaspy: Add optional timeout argument for pending()
authorJouni Malinen <j@w1.fi>
Sun, 5 Jan 2014 06:46:45 +0000 (08:46 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 7 Jan 2014 08:45:10 +0000 (10:45 +0200)
This can be used to wait for up to the specified limit on new event
messages.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpaspy/wpaspy.py

index 7c2314d..24c3719 100644 (file)
@@ -70,8 +70,8 @@ class Ctrl:
             return None
         raise Exception("DETACH failed")
 
-    def pending(self):
-        [r, w, e] = select.select([self.s], [], [], 0)
+    def pending(self, timeout=0):
+        [r, w, e] = select.select([self.s], [], [], timeout)
         if r:
             return True
         return False