(self)
Process input from streams.
Process input from streams.
Process input from streams .
def _process_input(self):
        """Process input from streams."""
        while True:
            time.sleep(TICK)
            if self._stop_threads:
                return
            if not self._active:
                continue
            queue = self._queues.inputs
            for stream in self._input_streams:
                instr = stream.read()
                if instr is None:
                    break
                elif instr:
                    queue.put(signals.Event(signals.STREAM_CHAR, (instr,)))
            else:
                # executed if not break
                continue
            # input stream is closed, remove it
            self._input_streams.remove(stream)
            # exit the interpreter if last input closed
            if not self._input_streams:
                queue.put(signals.Event(signals.STREAM_CLOSED))
                return
def _process_input ( self ) : while True : time . sleep ( TICK ) if self . _stop_threads : return if not self . _active : continue queue = self . _queues . inputs for stream in self . _input_streams : instr = stream . read ( ) if instr is None : break elif instr : queue . put ( signals . Event ( signals . STREAM_CHAR , ( instr , ) ) ) else : # executed if not break continue # input stream is closed, remove it self . _input_streams . remove ( stream ) # exit the interpreter if last input closed if not self . _input_streams : queue . put ( signals . Event ( signals . STREAM_CLOSED ) ) return