Revision: 4101 Author: misza13 Date: 2007-08-24 15:40:08 +0000 (Fri, 24 Aug 2007)
Log Message: ----------- Added a new configuration option, "ignore_bot_templates". Default value is False. When set to True, the bot will ignore the {{bots}} and {{nobots}} templates (botMayEdit() will always return True).
Modified Paths: -------------- trunk/pywikipedia/config.py trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/config.py =================================================================== --- trunk/pywikipedia/config.py 2007-08-24 04:53:17 UTC (rev 4100) +++ trunk/pywikipedia/config.py 2007-08-24 15:40:08 UTC (rev 4101) @@ -369,6 +369,12 @@ # foreign wiki, set cosmetic_changes_mylang_only to False, but be careful! cosmetic_changes_mylang_only = True
+# If ignore_bot_templates is True, the bot will always ignore {{bots}} +# and {{nobots}} templates - botMayEdit() will always return True. +# In the default (False) state, it will honor these directives and +# refuse to save pages that forbid it from editing. +ignore_bot_templates = False + # End of configuration section # ============================ # System-level and User-level changes.
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2007-08-24 04:53:17 UTC (rev 4100) +++ trunk/pywikipedia/wikipedia.py 2007-08-24 15:40:08 UTC (rev 4101) @@ -747,6 +747,9 @@ is desired to implement authorization-checking for a particular bot, the bot must call this method before editing. """ + if config.ignore_bot_templates: #Check the "master ignore switch" + return True + import re; p = re.compile(r"{{(?P<type>bots|nobots)|?(?P<data>.*?)}}") try: