Author: bugman Date: Thu Aug 25 17:59:23 2011 New Revision: 14460 URL: http://svn.gna.org/viewcvs/relax?rev=14460&view=rev Log: Created the GUI interpreter thread flush() method for blocking until the queue is empty. Modified: 1.3/gui/interpreter.py Modified: 1.3/gui/interpreter.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/interpreter.py?rev=14460&r1=14459&r2=14460&view=diff ============================================================================== --- 1.3/gui/interpreter.py (original) +++ 1.3/gui/interpreter.py Thu Aug 25 17:59:23 2011 @@ -29,6 +29,7 @@ from string import split import sys from threading import Thread +from time import sleep from traceback import print_exc import wx @@ -80,6 +81,14 @@ # Then queue a dummy user function. self._queue.put([None, None, None]) + + + def flush(self): + """Return only once the queue is empty.""" + + # Loop until empty. + while not self.empty(): + sleep(0.2) def join(self):