http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11139
Revision: 11139 Author: xqt Date: 2013-02-28 10:30:52 +0000 (Thu, 28 Feb 2013) Log Message: ----------- enable gender settings for namepaces 2, 3
Modified Paths: -------------- branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py =================================================================== --- branches/rewrite/pywikibot/site.py 2013-02-28 07:58:27 UTC (rev 11138) +++ branches/rewrite/pywikibot/site.py 2013-02-28 10:30:52 UTC (rev 11139) @@ -1706,9 +1706,20 @@ for pagedata in rvgen: if page is not None: if pagedata['title'] != page.title(withSection=False): - raise Error( - u"loadrevisions: Query on %s returned data on '%s'" - % (page, pagedata['title'])) + ok = False + namespace = page.namespace() + # gender settings ? + if namespace in [2, 3]: + ns, title = pagedata['title'].split(':', 1) + if ns in page.site.namespace(namespace, all=True) and \ + title == page.title(withSection=False, + withNamespace=False): + + ok = True + if not ok: + raise Error( + u"loadrevisions: Query on %s returned data on '%s'" + % (page, pagedata['title'])) if "missing" in pagedata: raise NoPage(page) else:
pywikipedia-svn@lists.wikimedia.org