"""This module contains the OutputRedirector class."""


class OutputRedirector(object):
    """ Wrapper to redirect stdout or stderr. """

    def __init__(self, fp):
        self.fp = fp

    def write(self, s):
        self.fp.write(s)

    def writelines(self, lines):
        self.fp.writelines(lines)

    def flush(self):
        self.fp.flush()
