'Send notification of the new Sitemap(s) to the search engines.'

def NotifySearch(self):

    if self._suppress:
        output.Log('Search    engine    notification    is    suppressed.', 1)
        return
    output.Log('Notifying    search    engines.', 1)
    class ExceptionURLopener(urllib.FancyURLopener, ):
        def http_error_default(self, url, fp, errcode, errmsg, headers):
            output.Log(('HTTP    error    %d:    %s' % (errcode, errmsg)), 2)
            raise IOError
    old_opener = urllib._urlopener
    urllib._urlopener = ExceptionURLopener()
    if (self._sitemaps > 1):
        url = self._filegen.GenerateURL(SITEINDEX_SUFFIX, self._base_url)
    else:
        url = self._filegen.GenerateURL(0, self._base_url)
    try:
        u = urllib.urlopen(url)
        u.close()
    except IOError:
        output.Error(('When    attempting    to    access    our    generated    Sitemap    at    the    following    URL:\n                %s\n        we    failed    to    read    it.        Please    verify    the    store_into    path    you    specified    in\n        your    configuration    file    is    web-accessable.        Consult    the    FAQ    for    more\n        information.' % url))
        output.Warn('Proceeding    to    notify    with    an    unverifyable    URL.')
    for ping in NOTIFICATION_SITES:
        query_map = ping[3]
        query_attr = ping[5]
        query_map[query_attr] = url
        query = urllib.urlencode(query_map)
        notify = urlparse.urlunsplit((ping[0], ping[1], ping[2], query, ping[4]))
        output.Log(('Notifying:    %s' % ping[1]), 1)
        output.Log(('Notification    URL:    %s' % notify), 2)
        try:
            u = urllib.urlopen(notify)
            u.read()
            u.close()
        except IOError:
            output.Warn(('Cannot    contact:    %s' % ping[1]))
    if old_opener:
        urllib._urlopener = old_opener
