Ignore:
Timestamp:
Feb 2, 2010 4:15:01 PM (10 years ago)
Author:
mylan
Message:

Fix TestPinging?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/utils.py

    r1593 r1622  
    99def ping_google(url, sitemap_id): 
    1010    """Ping sitemap to Google""" 
    11     if DevelopmentMode: 
    12         #prevent pinging in debug mode 
    13         print "Pinging Google ...", url, sitemap_id 
     11 
     12    resurl = url + "/" + sitemap_id 
     13 
     14    if DevelopmentMode or testing: 
     15        #prevent pinging in debug or testing mode 
     16        print "Pinged %s sitemap to Google" % resurl 
    1417        return 0 
    1518 
    16     resurl = url + "/" + sitemap_id 
    1719    sitemap_url = urlquote(resurl) 
     20 
    1821    g = urlopen('http://www.google.com/webmasters/sitemaps/ping?sitemap='+sitemap_url) 
    1922    result = g.read() 
    2023    g.close() 
    21     if testing: 
    22         print "Pinged %s sitemap to google" % resurl 
     24 
    2325    return 0 
Note: See TracChangeset for help on using the changeset viewer.