http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9527
Revision: 9527 Author: xqt Date: 2011-09-18 12:45:29 +0000 (Sun, 18 Sep 2011) Log Message: ----------- removed tabs
Modified Paths: -------------- trunk/pywikipedia/imageharvest.py
Modified: trunk/pywikipedia/imageharvest.py =================================================================== --- trunk/pywikipedia/imageharvest.py 2011-09-18 12:37:35 UTC (rev 9526) +++ trunk/pywikipedia/imageharvest.py 2011-09-18 12:45:29 UTC (rev 9527) @@ -33,15 +33,15 @@ soup = BeautifulSoup.BeautifulSoup(file.read()) file.close() if not shown: - tagname = "a" + tagname = "a" elif shown == "just": - tagname = "img" + tagname = "img" else: tagname = ["a", "img"]
for tag in soup.findAll(tagname): - link = tag.get("src", tag.get("href", None)) - if link: + link = tag.get("src", tag.get("href", None)) + if link: ext = os.path.splitext(link)[1].lower().strip('.') if ext in fileformats: links.append(urllib.basejoin(url, link))