Revision: 5636 Author: filnik Date: 2008-06-26 16:00:09 +0000 (Thu, 26 Jun 2008)
Log Message: ----------- Adding the docu to getDuplicates
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-06-26 14:53:46 UTC (rev 5635) +++ trunk/pywikipedia/wikipedia.py 2008-06-26 16:00:09 UTC (rev 5636) @@ -2638,12 +2638,14 @@ raise NoPage(u'API Error, nothing found in the APIs')
def getDuplicates(self): + """ Function that uses APIs to give the duplicates of the given image """ params = { 'action' :'query', 'titles' :self.title(), 'prop' :'imageinfo', 'iiprop' :'sha1', } + # First of all we need the Hash that identify an image data = query.GetData(params, useAPI = True, encodeTitle = False) pageid = data['query']['pages'].keys()[0] try: @@ -2654,6 +2656,7 @@ else: wikipedia.output(u'Image deleted before getting the Hash. Skipping...') return None + # Now get all the images with the same hash #action=query&format=xml&list=allimages&aisha1=%s image_namespace = "%s:" % self._site.image_namespace() # Image: params = {