(self)
Drain signal queue.
Drain signal queue.
Drain signal queue .
def _drain_queue(self):
        """Drain signal queue."""
        while True:
            try:
                signal = self._video_queue.get(False)
            except queue.Empty:
                return True
            # putting task_done before the execution avoids hanging on join() after an exception
            self._video_queue.task_done()
            if signal.event_type == signals.QUIT:
                # close thread
                self.alive = False
            else:
                try:
                    self._handlers[signal.event_type](*signal.params)
                except KeyError:
                    pass
def _drain_queue ( self ) : while True : try : signal = self . _video_queue . get ( False ) except queue . Empty : return True # putting task_done before the execution avoids hanging on join() after an exception self . _video_queue . task_done ( ) if signal . event_type == signals . QUIT : # close thread self . alive = False else : try : self . _handlers [ signal . event_type ] ( * signal . params ) except KeyError : pass