Revision: 4322 Author: cosoleto Date: 2007-09-18 16:30:40 +0000 (Tue, 18 Sep 2007)
Log Message: ----------- revert and fix in wikipedia.py the set/list problem
Modified Paths: -------------- trunk/pywikipedia/imagetransfer.py trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/imagetransfer.py =================================================================== --- trunk/pywikipedia/imagetransfer.py 2007-09-18 16:21:08 UTC (rev 4321) +++ trunk/pywikipedia/imagetransfer.py 2007-09-18 16:30:40 UTC (rev 4322) @@ -166,9 +166,8 @@ sourceImagePage.put(sourceImagePage.get() + '\n\n' + nowCommonsTemplate[sourceSite.lang] % targetFilename, comment = nowCommonsMessage[sourceSite.lang])
def showImageList(self, imagelist): - i = 0 - for image in imagelist: - i += 1 + for i in range(len(imagelist)): + image = imagelist[i] #sourceSite = sourceImagePage.site() print "-"*60 wikipedia.output(u"%s. Found image: %s"% (i, image.aslink()))
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2007-09-18 16:21:08 UTC (rev 4321) +++ trunk/pywikipedia/wikipedia.py 2007-09-18 16:30:40 UTC (rev 4322) @@ -1442,7 +1442,7 @@ imageR = re.compile('\w\w\w+.(?:gif|png|jpg|jpeg|svg)', re.IGNORECASE) for imageName in imageR.findall(pageText): results.append(ImagePage(self.site(), ns + ':' + imageName)) - return set(results) + return list(set(results))
def templates(self): """
pywikipedia-l@lists.wikimedia.org