'Check to see if directory exists'

def __check_dir(self, the_dir):

    if (not the_dir):
        return
    dir_exists = os.path.isdir(the_dir)
    if (not dir_exists):
        msg = ('\n%s    is    not    a    directory' % the_dir)
        raise RtfInvalidCodeException(msg)
    return 1
