Revision: 4591 Author: huji Date: 2007-11-25 14:08:16 +0000 (Sun, 25 Nov 2007)
Log Message: ----------- Allows detection of semi-protected pages
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2007-11-25 12:47:53 UTC (rev 4590) +++ trunk/pywikipedia/wikipedia.py 2007-11-25 14:08:16 UTC (rev 4591) @@ -736,6 +736,10 @@ if verbose: output(u"DBG> page may be locked?!") editRestriction = 'sysop' + # This is a hack to find if the page is semi-protected. + # TODO: Use API to check if the page is semi-protected. + if text.find('var wgRestrictionEdit = ["autoconfirmed"]') != -1: + editRestriction = 'autoconfirmed' m = self.site().redirectRegex().match(text[i1:i2]) if m: # page text matches the redirect pattern
pywikipedia-l@lists.wikimedia.org