Author: dmeyer
Date: Sun Oct 14 17:10:28 2007
New Revision: 2874
Log:
do NOT call notifier.step, it can result in a dead app
Modified:
trunk/beacon/bin/beacon-search
Modified: trunk/beacon/bin/beacon-search
==============================================================================
--- trunk/beacon/bin/beacon-search (original)
+++ trunk/beacon/bin/beacon-search Sun Oct 14 17:10:28 2007
@@ -150,7 +150,8 @@
print 'Beacon has finished the query and parsing.'
-if __name__ == '__main__':
[EMAIL PROTECTED]()
+def main():
try:
# list of modes this script can start in
possible_modes = [ 'info', 'list-media', 'del-media']
@@ -259,9 +260,9 @@
t1 = time.time()
if 'dirname' in query:
async = kaa.beacon.get(query['dirname'])
- while not async.is_finished:
- kaa.notifier.step()
- directory = async.get_result()
+ if isinstance(async, kaa.notifier.InProgress):
+ yield async
+ directory = async.get_result()
if 'recursive' in query:
result = directory.list(recursive=True)
else:
@@ -269,6 +270,9 @@
else:
result = kaa.beacon.query(**query)
+ if not result.valid:
+ yield result.wait()
+
if not monitor:
def print_results_and_exit(result):
t2 = time.time()
@@ -290,3 +294,8 @@
kaa.notifier.loop()
sys.exit(0)
+
+if __name__ == '__main__':
+ main()
+ kaa.notifier.loop()
+
-------------------------------------------------------------------------
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