http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11208
Revision: 11208
Author: russblau
Date: 2013-03-15 15:36:59 +0000 (Fri, 15 Mar 2013)
Log Message:
-----------
Fix bug #3607448: Preloading fails in combination with getReferences()
Modified Paths:
--------------
branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py
===================================================================
--- branches/rewrite/pywikibot/site.py 2013-03-15 07:46:41 UTC (rev 11207)
+++ branches/rewrite/pywikibot/site.py 2013-03-15 15:36:59 UTC (rev 11208)
@@ -1328,9 +1328,10 @@
# This checks to see if there is a normalized title in
# the response that corresponds to the canonical form
# used in the query.
- if pagedata['title'] in rvgen.normalized \
- and rvgen.normalized[pagedata['title']] in cache:
- cache[pagedata['title']] = cache[rvgen.normalized[pagedata['title']]]
+ for key in cache:
+ if self.sametitle(key, pagedata['title']):
+ cache[pagedata['title']] = cache[key]
+ break
else:
pywikibot.warning(
u"preloadpages: Query returned unexpected title '%s'"
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11207
Revision: 11207
Author: binbot
Date: 2013-03-15 07:46:41 +0000 (Fri, 15 Mar 2013)
Log Message:
-----------
Renaming German-specific fixes to -de in order to avoid conflicts (see mailing list); .yu expired 3 years ago
Modified Paths:
--------------
trunk/pywikipedia/fixes.py
Modified: trunk/pywikipedia/fixes.py
===================================================================
--- trunk/pywikipedia/fixes.py 2013-03-15 07:23:20 UTC (rev 11206)
+++ trunk/pywikipedia/fixes.py 2013-03-15 07:46:41 UTC (rev 11207)
@@ -5,7 +5,7 @@
"""
#
-# (C) Pywikipedia team, 2008-2010
+# (C) Pywikipedia team, 2008-2013
#
__version__ = '$Id$'
#
@@ -28,12 +28,11 @@
* grammar-de - fix grammar and typography in German
* vonbis - Ersetze Binde-/Gedankenstrich durch "bis"
in German
- * music - Links auf Begriffsklärungen in German
- * datum - specific date formats in German
+ * music-de - Links auf Begriffsklärungen in German
+ * datum-de - specific date formats in German
* correct-ar - Corrections for Arabic Wikipedia and any
Arabic wiki.
- * yu-tld - the yu top-level domain will soon be
- disabled, see
+ * yu-tld - the yu top-level domain is disabled
* fckeditor - Try to convert FCKeditor HTML tags to wiki
syntax.
http://lists.wikimedia.org/pipermail/wikibots-l/2009-February/000290.html
@@ -366,8 +365,8 @@
},
# some disambiguation stuff for de:
- # python replace.py -fix:music -subcat:Album
- 'music': {
+ # python replace.py -fix:music-de -subcat:Album
+ 'music-de': {
'regex': False,
'msg': {
'de':u'Bot: korrigiere Links auf Begriffsklärungen',
@@ -387,8 +386,8 @@
},
# format of dates of birth and death, for de:
- # python replace.py -fix:datum -ref:Vorlage:Personendaten
- 'datum': {
+ # python replace.py -fix:datum-de -ref:Vorlage:Personendaten
+ 'datum-de': {
'regex': True,
'msg': {
'de': u'Bot: Korrigiere Datumsformat',
@@ -589,7 +588,7 @@
(u'Special:Whatlinkshere', u'Special:WhatLinksHere'),
],
},
- # yu top-level domain will soon be disabled,
+ # yu top-level domain was disabled in 2010,
# see http://lists.wikimedia.org/pipermail/wikibots-l/2009-February/000290.html
# The following are domains that are often-used.
'yu-tld': {
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11205
Revision: 11205
Author: legoktm
Date: 2013-03-14 16:20:15 +0000 (Thu, 14 Mar 2013)
Log Message:
-----------
If the item does not exist, it will not have a lastrevid
so we should throw a NoPage error, rather than a general
KeyError.
Modified Paths:
--------------
branches/rewrite/pywikibot/page.py
Modified: branches/rewrite/pywikibot/page.py
===================================================================
--- branches/rewrite/pywikibot/page.py 2013-03-12 15:19:55 UTC (rev 11204)
+++ branches/rewrite/pywikibot/page.py 2013-03-14 16:20:15 UTC (rev 11205)
@@ -2230,7 +2230,10 @@
data = self.repo.loadcontent(self.__defined_by(), *args)
self.id = data.keys()[0]
self._content = data[self.id]
- self.lastrevid = self._content['lastrevid']
+ if 'lastrevid' in self._content:
+ self.lastrevid = self._content['lastrevid']
+ else:
+ raise pywikibot.NoPage
#aliases
self.aliases = {}
if 'aliases' in self._content: