[Pywikipedia-svn] SVN: [7262] branches/rewrite/pywikibot/site.py
russblau at svn.wikimedia.org
russblau at svn.wikimedia.org
Thu Sep 17 14:18:48 UTC 2009
Revision: 7262
Author: russblau
Date: 2009-09-17 14:18:48 +0000 (Thu, 17 Sep 2009)
Log Message:
-----------
Warn instead of die on finding unexpected page while preloading; move .nocapitalize to BaseSite
Modified Paths:
--------------
branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py
===================================================================
--- branches/rewrite/pywikibot/site.py 2009-09-17 13:39:38 UTC (rev 7261)
+++ branches/rewrite/pywikibot/site.py 2009-09-17 14:18:48 UTC (rev 7262)
@@ -116,6 +116,7 @@
% (self.__code, self.__family.name))
self._username = [user, sysop]
+ self.nocapitalize = self.code in self.family.nocapitalize
# following are for use with lock_page and unlock_page methods
self._pagemutex = threading.Lock()
@@ -617,7 +618,6 @@
}
self.sitelock = threading.Lock()
self._msgcache = {}
- self.nocapitalize = self.code in self.family.nocapitalize
# _loginstatus: -3 means login not yet attempted,
# -2 means login attempt in progress,
# -1 means not logged in (anon user),
@@ -1102,10 +1102,12 @@
logger.debug("Preloading %s" % pagedata)
try:
if pagedata['title'] not in cache:
- raise Error(
+ pywikibot.output(
u"preloadpages: Query returned unexpected title '%s'"
- % pagedata['title']
+ % pagedata['title'],
+ level=pywikibot.WARNING
)
+ continue
except KeyError:
logger.debug("No 'title' in %s" % pagedata)
logger.debug("pageids=%s" % pageids)
More information about the Pywikipedia-svn
mailing list