def printer_loop(self):

        colors = ColorPicker()
        sleep_time = SLEEP_START

        try:
            while not self.finished:
                seen_data = False
                for name, fd in list(self.watched):
                    data = fd.readline()
                    while data:
                        seen_data = True
                        with colors[name]:
                            print('[%s]' % name, end='')
                        print(" ", end='')

                        print(data, end='')
                        data = fd.readline()

                if not seen_data:
                    time.sleep(sleep_time)
                    sleep_time = SLEEP_MAX if sleep_time >= SLEEP_MAX else sleep_time + SLEEP_INC
                else:
                    sleep_time = SLEEP_START

                self.manage_logs()

        finally:
            for _, fd in self.watched:
                try:
                    fd.close()
                except __HOLE__: pass
dataset/ETHPy150Open Anaconda-Platform/chalmers/chalmers/utils/mutiplex_io_pool.py/MultiPlexIOPool.printer_loop