http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10776
Revision: 10776 Author: xqt Date: 2012-12-10 13:59:04 +0000 (Mon, 10 Dec 2012) Log Message: ----------- follow up for r10774, update from rewrite
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2012-12-10 13:56:56 UTC (rev 10775) +++ trunk/pywikipedia/wikipedia.py 2012-12-10 13:59:04 UTC (rev 10776) @@ -1595,14 +1595,15 @@ return True
try: - templates = self.templatesWithParams(get_redirect=True); + templates = self.templatesWithParams(get_redirect=True) except (NoPage, IsRedirectPage, SectionError): return True
# go through all templates and look for any restriction # multiple bots/nobots templates are allowed for template in templates: - if template[0].lower() == 'nobots': + title = template[0].title() + if title == 'Nobots': if len(template[1]) == 0: return False else: @@ -1610,7 +1611,7 @@ if 'all' in bots or calledModuleName() in bots \ or username in bots: return False - elif template[0].lower() == 'bots': + elif title == 'Bots': if len(template[1]) == 0: return True else:
pywikipedia-svn@lists.wikimedia.org