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:
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11137
Revision: 11137
Author: legoktm
Date: 2013-02-28 03:28:20 +0000 (Thu, 28 Feb 2013)
Log Message:
-----------
Update documentation, patch by Hazard-Sy
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2013-02-27 13:05:01 UTC (rev 11136)
+++ trunk/pywikipedia/wikipedia.py 2013-02-28 03:28:20 UTC (rev 11137)
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
"""
-Library to get and put pages on a MediaWiki.
+Library to get and put pages on a MediaWiki wiki.
Contents of the library (objects and functions to be used outside)
Classes:
Page(site, title): A page on a MediaWiki site
+ DataPage(site, title): A Page object for the data repository.
ImagePage(site, title): An image descriptor Page
Site(lang, fam): A MediaWiki site
@@ -117,7 +118,7 @@
"""
#
-# (C) Pywikipedia bot team, 2003-2012
+# (C) Pywikipedia bot team, 2003-2013
#
# Distributed under the terms of the MIT license.
#
@@ -4072,7 +4073,7 @@
setitem : Setting item(s) on a page
setclaimvalue : Set the value of a Wikibase claim
createclaim : Create Wikibase claims
- creatitem : Create an item
+ createitem : Create an item
getentity : Getting item(s) of a page
getentities : Get the data for multiple Wikibase entities
searchentities : Search for entities