Author: dmeyer
Date: Sat Oct 13 11:25:01 2007
New Revision: 2861

Log:
better support for waiting on Query initial data

Modified:
   trunk/beacon/src/query.py

Modified: trunk/beacon/src/query.py
==============================================================================
--- trunk/beacon/src/query.py   (original)
+++ trunk/beacon/src/query.py   Sat Oct 13 11:25:01 2007
@@ -66,7 +66,6 @@
             'changed'   : kaa.notifier.Signal(),
             'progress'  : kaa.notifier.Signal(),
             'up-to-date': kaa.notifier.Signal(),
-            'yield'     : kaa.notifier.InProgress()
         }
         self.id = Query.NEXT_ID
         Query.NEXT_ID += 1
@@ -80,6 +79,8 @@
         self._client = client
         # some shortcuts from the client
         self._rpc = self._client.rpc
+        # InProgress object or YieldContinue
+        self._async = kaa.notifier.InProgress()
         # start inititial query
         self._beacon_start_query(query)
 
@@ -88,6 +89,14 @@
     # Public API
     # -------------------------------------------------------------------------
 
+
+    def wait(self):
+        """
+        Return InProgress object or YieldContinue when the object is valid.
+        """
+        return self._async
+
+
     def monitor(self, status=True):
         """
         Turn on/off query monitoring
@@ -211,9 +220,9 @@
 
         self.valid = True
         self.signals['changed'].emit()
-        if self.signals['yield']:
-            self.signals['yield'].emit(self)
-            self.signals['yield'] = None
+        if isinstance(self._async, kaa.notifier.InProgress):
+            self._async.emit(self)
+            self._async = kaa.notifier.YieldContinue
 
 
     def __repr__(self):

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to