'Returns the output file object'

def get_outfile(self, outname):

    if outname:
        print(('Will    write    output    to    %s' % outname), file=sys.stderr)
        fobj = open(outname, 'wb')
        self.file_objects.append(fobj)
    else:
        print('Will    write    output    to    stdout', file=sys.stderr)
        fobj = sys.stdout
    return fobj
