Revision: 5261 Author: rotem Date: 2008-04-23 13:56:51 +0000 (Wed, 23 Apr 2008)
Log Message: ----------- * Error was shown also when cascading protection was not enabled. * Code style cleanup. * The term is 'protect', not 'block'.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-04-23 13:26:33 UTC (rev 5260) +++ trunk/pywikipedia/wikipedia.py 2008-04-23 13:56:51 UTC (rev 5261) @@ -2297,17 +2297,23 @@
token = self.site().getToken(self, sysop = True)
- #Translate 'none' to '' + # Translate 'none' to '' if edit == 'none': edit = '' if move == 'none': move = '' + + # Translate no duration to infinite if duration == 'none' or duration == None: duration = 'infinite' - if cascading == False: cascading = '0' - else: cascading = '1'
- if edit != 'sysop' or move != 'sysop': - # You can't block a page as autoconfirmed and cascading, prevent the error + # Get cascading + if cascading == False: cascading = '0' - output(u"NOTE: The page can't be blocked with cascading and not also with only-sysop. Set cascading "off"") + else: + if edit != 'sysop' or move != 'sysop': + # You can't protect a page as autoconfirmed and cascading, prevent the error + cascading = '0' + output(u"NOTE: The page can't be protected with cascading and not also with only-sysop. Set cascading "off"") + else: + cascading = '1'
predata = { 'mwProtect-cascade': cascading,