Revision: 6731 Author: nicdumz Date: 2009-04-27 05:45:22 +0000 (Mon, 27 Apr 2009)
Log Message: ----------- Using wikipedia.output instead of prints
Modified Paths: -------------- trunk/pywikipedia/watchlist.py
Modified: trunk/pywikipedia/watchlist.py =================================================================== --- trunk/pywikipedia/watchlist.py 2009-04-26 11:58:34 UTC (rev 6730) +++ trunk/pywikipedia/watchlist.py 2009-04-27 05:45:22 UTC (rev 6731) @@ -41,7 +41,7 @@ file_age = time.time() - os.path.getmtime(fn) # if it's older than 1 month, reload it if file_age > 30 * 24 * 60 * 60: - print 'Copy of watchlist is one month old, reloading' + wikipedia.output('Copy of watchlist is one month old, reloading') refresh(site) except OSError: # no saved watchlist exists yet, retrieve one @@ -60,11 +60,11 @@ def refresh(site): # get watchlist special page's URL path = site.watchlist_address() - print 'Retrieving watchlist for %s' % repr(site) + wikipedia.output('Retrieving watchlist for %s' % repr(site)) #wikipedia.put_throttle() # It actually is a get, but a heavy one. watchlistHTML = site.getUrl(path)
- print 'Parsing watchlist' + wikipedia.ouput('Parsing watchlist') watchlist = [] for itemR in [re.compile(r'<li><input type="checkbox" name="id\[\]" value="(.+?)" />'), re.compile(r'<li><input name="titles\[\]" type="checkbox" value="(.+?)" />')]: for m in itemR.finditer(watchlistHTML):