'Check to see if files exist'

def __check_file(self, the_file, type):

    if hasattr(the_file, 'read'):
        return
    if (the_file is None):
        if (type == 'file_to_parse'):
            msg = '\nYou    must    provide    a    file    for    the    script    to    work'
        raise RtfInvalidCodeException(msg)
    elif os.path.exists(the_file):
        pass
    else:
        msg = ("\nThe    file    '%s'    cannot    be    found" % the_file)
        raise RtfInvalidCodeException(msg)
