@convert_local_errors
    def execute_command(self, cmd, pseudo_tty=False):
        process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                                   stderr=subprocess.PIPE)
        fds = [process.stdout, process.stderr]
        CHUNK = 2**20
        while process.poll() is None:
            r, w, e = select.select(fds, [], fds)
            if process.stdout in r:
                yield STDOUT, process.stdout.read(CHUNK)

            if process.stderr in r:
                yield STDERR, process.stderr.read(CHUNK)

        yield DONE, process.returncode
dataset/ETHPy150Open ohmu/poni/poni/rcontrol.py/LocalControl.execute_command/original