'Register the writer for the current thread'

def register(self, writer):

    self.writers[thread.get_ident()] = writer
    if (self.origStdOut is None):
        self.origStdOut = sys.stdout
        sys.stdout = self
