Revision: 8701 Author: xqt Date: 2010-11-06 03:10:04 +0000 (Sat, 06 Nov 2010) Log Message: ----------- fix for KeyError bug #3097185
Modified Paths: -------------- trunk/pywikipedia/userlib.py
Modified: trunk/pywikipedia/userlib.py =================================================================== --- trunk/pywikipedia/userlib.py 2010-11-06 02:18:01 UTC (rev 8700) +++ trunk/pywikipedia/userlib.py 2010-11-06 03:10:04 UTC (rev 8701) @@ -294,8 +294,9 @@ raise pywikibot.Error for contrib in result['query']['usercontribs']: ts = pywikibot.parsetime2stamp(contrib['timestamp']) - yield (pywikibot.Page(self.site(), contrib['title'], defaultNamespace=contrib['ns']), - contrib['revid'], ts, contrib['comment'] + yield (pywikibot.Page(self.site(), contrib['title'], + defaultNamespace=contrib['ns']), + contrib['revid'], ts, contrib.get('comment', None) ) nbresults += 1 if nbresults >= limit: @@ -306,7 +307,6 @@ break return
- def uploadedImages(self, number=10): """ Yield tuples describing files uploaded by this user. Each tuple is composed of a pywikibot.Page, the timestamp