http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10072
Revision: 10072
Author: xqt
Date: 2012-03-31 19:42:33 +0000 (Sat, 31 Mar 2012)
Log Message:
-----------
raise NotImplementedError if -simulate option is given without API, follow-up for r9909
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2012-03-31 17:58:16 UTC (rev 10071)
+++ trunk/pywikipedia/wikipedia.py 2012-03-31 19:42:33 UTC (rev 10072)
@@ -7764,13 +7764,15 @@
elif arg == '-cosmeticchanges' or arg == '-cc':
config.cosmetic_changes = not config.cosmetic_changes
output(u'NOTE: option cosmetic_changes is %s\n' % config.cosmetic_changes)
+ elif arg == '-simulate':
+ if not getSite().has_api():
+ raise NotImplementedError('-simulate option is implemented for API only')
+ config.actions_to_block = ['edit', 'watch', 'move', 'delete',
+ 'undelete', 'protect']
# global debug option for development purposes. Normally does nothing.
elif arg == '-debug':
debug = True
config.special_page_limit = 500
- elif arg == '-simulate':
- config.actions_to_block = ['edit', 'watch', 'move', 'delete',
- 'undelete', 'protect']
else:
# the argument is not global. Let the specific bot script care
# about it.
@@ -7842,7 +7844,7 @@
settings and restrictions are untouched.
-simulate Disables writing to the server. Useful for testing
- and debugging of new code.
+ and debugging of new code. (API only)
'''# % moduleName
output(globalHelp, toStdout=True)
try:
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10069
Revision: 10069
Author: xqt
Date: 2012-03-31 17:33:13 +0000 (Sat, 31 Mar 2012)
Log Message:
-----------
Hide -debug option from -help doc string. It's for debugging purposes only, not for general usage.
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2012-03-31 12:33:16 UTC (rev 10068)
+++ trunk/pywikipedia/wikipedia.py 2012-03-31 17:33:13 UTC (rev 10069)
@@ -7836,7 +7836,6 @@
-verbose Have the bot provide additional output that may be
-v useful in debugging.
--debug
-cosmeticchanges Toggles the cosmetic_changes setting made in config.py or
-cc user_config.py to its inverse and overrules it. All other