Revision: 4954
Author: filnik
Date: 2008-01-31 16:10:17 +0000 (Thu, 31 Jan 2008)
Log Message:
-----------
Adding another little check for cascading protection. Make sure that if the language in
preferences changes, the bot won't block.
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-01-31 15:58:27 UTC (rev 4953)
+++ trunk/pywikipedia/wikipedia.py 2008-01-31 16:10:17 UTC (rev 4954)
@@ -698,7 +698,10 @@
raise NoPage(self.site(), self.aslink(forceInterwiki = True))
# Some of the newest versions don't have a "view source"
tag for
# non-existant pages
- elif text.find(self.site().mediawiki_message('badaccess')) !=
-1:
+ # Check also the div class because if the language is not english
+ # the bot can not seeing that the page is blocked.
+ elif text.find(self.site().mediawiki_message('badaccess')) != -1
or \ # continue below
+ text.find("<div class=\"permissions-errors\">")
!= -1:
raise NoPage(self.site(), self.aslink(forceInterwiki = True))
else:
if text.find( "<title>Wikimedia Error</title>")
> -1:
Show replies by date