[Pywikipedia-svn] SVN: [7292] branches/rewrite/pywikibot/site.py
russblau at svn.wikimedia.org
russblau at svn.wikimedia.org
Wed Sep 23 17:43:40 UTC 2009
Revision: 7292
Author: russblau
Date: 2009-09-23 17:43:39 +0000 (Wed, 23 Sep 2009)
Log Message:
-----------
fix handling of API-normalized page titles
Modified Paths:
--------------
branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py
===================================================================
--- branches/rewrite/pywikibot/site.py 2009-09-23 14:46:31 UTC (rev 7291)
+++ branches/rewrite/pywikibot/site.py 2009-09-23 17:43:39 UTC (rev 7292)
@@ -957,15 +957,21 @@
inprop="protection")
for pageitem in query:
if pageitem['title'] != title:
- if pageitem['title'] in query.normalized_to \
- and query.normalized_to[pageitem['title']] == title:
+ if pageitem['title'] in query.normalized \
+ and query.normalized[pageitem['title']] == title:
# page title was normalized by api
- # TODO
- pass
+ # this should never happen because the Link() constructor
+ # normalizes the title
+ pywikibot.output(
+ u"loadpageinfo: Page title '%s' was normalized to '%s'"
+ % (title, pageitem['title']),
+ level=pywikibot.ERROR)
else:
- raise Error(
+ pywikibot.output(
u"loadpageinfo: Query on %s returned data on '%s'"
- % (page, pageitem['title']))
+ % (page, pageitem['title']),
+ level=pywikibot.WARNING)
+ continue
api.update_page(page, pageitem)
def loadimageinfo(self, page, history=False):
More information about the Pywikipedia-svn
mailing list