trepan/inout/output.py
def open(self, output, opts=None):
        """Use this to set where to write to. output can be a
        file object or a string. This code raises IOError on error."""
        if isinstance(output, io.TextIOWrapper) or \
           isinstance(output, io.StringIO) or \
           output == sys.stdout:
            pass
        elif isinstance(output, 'string'.__class__):  # FIXME
            output = open(output, 'w')
        else:
            raise IOError("Invalid output type (%s) for %s" %
                          (output.__class__.__name__, output))
            # raise IOError("Invalid output type (%s) for %s" % (type(output),
            #                                                     output))
        self.output = output
        return
def open(self, output, opts=None):
        """Use this to set where to write to. output can be a
        file object or a string. This code raises IOError on error."""
        if isinstance(output, io.TextIOWrapper) or \
           isinstance(output, io.StringIO) or \
           output == sys.stdout:
            pass
        elif isinstance(output, 'string'.__class__):  # FIXME
            output = open(output, 'w')
        else:
            raise IOError("Invalid output type (%s) for %s" %
                          (output.__class__.__name__, output))
            # raise IOError("Invalid output type (%s) for %s" % (type(output),
            #                                                     output))
        self.output = output
        return
Use this to set where to write to. output can be a
        file object or a string. This code raises IOError on error.