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:
pywikipedia-svn@lists.wikimedia.org