Revision: 4102 Author: misza13 Date: 2007-08-24 15:47:51 +0000 (Fri, 24 Aug 2007)
Log Message: ----------- Move ignore_bot_templates switch to wikipedia.py (to allow multiple bots under same account have different settings).
Modified Paths: -------------- trunk/pywikipedia/config.py trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/config.py =================================================================== --- trunk/pywikipedia/config.py 2007-08-24 15:40:08 UTC (rev 4101) +++ trunk/pywikipedia/config.py 2007-08-24 15:47:51 UTC (rev 4102) @@ -369,12 +369,6 @@ # 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 15:40:08 UTC (rev 4101) +++ trunk/pywikipedia/wikipedia.py 2007-08-24 15:47:51 UTC (rev 4102) @@ -149,6 +149,15 @@ WIDEBUILD = False
+# Local settings + +# 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 + + # Local exceptions
class Error(Exception): @@ -747,7 +756,8 @@ 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" + global ignore_bot_templates + if ignore_bot_templates: #Check the "master ignore switch" return True
import re;