http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10361
Revision: 10361
Author: drtrigon
Date: 2012-06-16 19:21:45 +0000 (Sat, 16 Jun 2012)
Log Message:
-----------
bug fix; follow up to r10353 and r10360
allow all 'export_address' calls since they do not write
Modified Paths:
--------------
trunk/pywikipedia/config.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/config.py
===================================================================
--- trunk/pywikipedia/config.py 2012-06-15 05:52:09 UTC (rev 10360)
+++ trunk/pywikipedia/config.py 2012-06-16 19:21:45 UTC (rev 10361)
@@ -476,7 +476,7 @@
# servers. Allows simulation runs of bots to be carried out without changing any
# page on the server side. This setting may be overridden in user_config.py.
actions_to_block = ['edit', 'watch', 'move', 'delete', 'undelete', 'protect',
- 'emailuser']
+ 'emailuser', 'submit'] # 'submit' is for non-API
# How many pages should be put to a queue in asynchroneous mode.
# If maxsize is <= 0, the queue size is infinite.
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2012-06-15 05:52:09 UTC (rev 10360)
+++ trunk/pywikipedia/wikipedia.py 2012-06-16 19:21:45 UTC (rev 10361)
@@ -5728,7 +5728,8 @@
"""
if ('action' in predata) and pywikibot.simulate and \
- (predata['action'] in pywikibot.config.actions_to_block):
+ (predata['action'] in pywikibot.config.actions_to_block) and \
+ (address not in [self.export_address()]):
pywikibot.output(u'\03{lightyellow}SIMULATION: %s action blocked.\03{default}'%\
predata['action'])
import StringIO
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10360
Revision: 10360
Author: xqt
Date: 2012-06-15 05:52:09 +0000 (Fri, 15 Jun 2012)
Log Message:
-----------
revert parts of r10353: pages could not been read with blocking submit action. Should be fixed.
Modified Paths:
--------------
trunk/pywikipedia/config.py
Modified: trunk/pywikipedia/config.py
===================================================================
--- trunk/pywikipedia/config.py 2012-06-13 12:58:26 UTC (rev 10359)
+++ trunk/pywikipedia/config.py 2012-06-15 05:52:09 UTC (rev 10360)
@@ -476,7 +476,7 @@
# servers. Allows simulation runs of bots to be carried out without changing any
# page on the server side. This setting may be overridden in user_config.py.
actions_to_block = ['edit', 'watch', 'move', 'delete', 'undelete', 'protect',
- 'emailuser', 'submit'] # 'submit' is for non-API
+ 'emailuser']
# How many pages should be put to a queue in asynchroneous mode.
# If maxsize is <= 0, the queue size is infinite.
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10357
Revision: 10357
Author: drtrigon
Date: 2012-06-13 11:59:13 +0000 (Wed, 13 Jun 2012)
Log Message:
-----------
follow-up; minor changes and bug fixes for r10354
Modified Paths:
--------------
trunk/pywikipedia/basic.py
trunk/pywikipedia/sum_disc.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/basic.py
===================================================================
--- trunk/pywikipedia/basic.py 2012-06-13 11:40:44 UTC (rev 10356)
+++ trunk/pywikipedia/basic.py 2012-06-13 11:59:13 UTC (rev 10357)
@@ -9,7 +9,9 @@
¶ms;
--
+-summary:XYZ Set the summary message text for the edit to XYZ, bypassing
+ the predefined message texts with original and replacements
+ inserted.
All other parameters will be regarded as part of the title of a single page,
and the bot will only work on that single page.
@@ -39,7 +41,7 @@
# The file containing these messages should have the same name as the caller
# script (i.e. basic.py in this case)
- def __init__(self, generator, dry):
+ def __init__(self, generator, dry, summary):
"""
Constructor. Parameters:
@param generator: The page generator that determines on which pages
@@ -48,13 +50,18 @@
@param dry: If True, doesn't do any real changes, but only shows
what would have been changed.
@type dry: boolean.
+ @param summary: Set the summary message text for the edit.
+ @type summary: (unicode) string.
"""
self.generator = generator
self.dry = dry
# init constants
self.site = pywikibot.getSite(code=pywikibot.default_code)
# Set the edit summary message
- self.summary = i18n.twtranslate(self.site, 'basic-changing')
+ if summary:
+ self.summary = summary
+ else:
+ self.summary = i18n.twtranslate(self.site, 'basic-changing')
def run(self):
for page in self.generator:
@@ -137,7 +144,7 @@
_REGEX_eol = re.compile(u'\n')
def __init__(self):
- BasicBot.__init__(self, None, None)
+ BasicBot.__init__(self, None, None, None)
## @since 10326
# @remarks needed by various bots
@@ -259,13 +266,18 @@
# This temporary array is used to read the page title if one single
# page to work on is specified by the arguments.
pageTitleParts = []
+ # summary message
+ editSummary = ''
# Parse command line arguments
for arg in pywikibot.handleArgs():
- # check if a standard argument like
- # -start:XYZ or -ref:Asdf was given.
- if not genFactory.handleArg(arg):
- pageTitleParts.append(arg)
+ if arg.startswith('-summary:'):
+ editSummary = arg[9:]
+ else:
+ # check if a standard argument like
+ # -start:XYZ or -ref:Asdf was given.
+ if not genFactory.handleArg(arg):
+ pageTitleParts.append(arg)
if pageTitleParts != []:
# We will only work on a single page.
@@ -279,7 +291,7 @@
# The preloading generator is responsible for downloading multiple
# pages from the wiki simultaneously.
gen = pagegenerators.PreloadingGenerator(gen)
- bot = BasicBot(gen, pywikibot.simulate)
+ bot = BasicBot(gen, pywikibot.simulate, editSummary)
bot.run()
else:
pywikibot.showHelp()
Modified: trunk/pywikipedia/sum_disc.py
===================================================================
--- trunk/pywikipedia/sum_disc.py 2012-06-13 11:40:44 UTC (rev 10356)
+++ trunk/pywikipedia/sum_disc.py 2012-06-13 11:59:13 UTC (rev 10357)
@@ -228,7 +228,6 @@
# debug tools
# (look at 'bot_control.py' for more info)
debug = [] # no write, all users
-#debug.append( 'write2wiki' ) # write to wiki (operational mode)
#debug.append( 'user' ) # skip users
#debug.append( 'page' ) # skip pages
#debug.append( 'write2hist' ) # write history (operational mode)
@@ -313,7 +312,7 @@
pywikibot.output(u'\03{lightred}** Receiving Job Queue (Maintenance Messages)\03{default}')
page = pywikibot.Page(self.site, bot_config['maintenance_queue'])
self.maintenance_msg = self.loadJobQueue(page, bot_config['queue_security'],
- reset=('write2wiki' in self._debug))
+ reset=(not pywikibot.simulate))
self._wday = time.gmtime().tm_wday
@@ -1054,49 +1053,46 @@
pywikibot.output(u'===='*15 + u'\n' + buf + u'\n' + u'===='*15)
pywikibot.output(u'[%i entries]' % count )
- if 'write2wiki' in debug:
- head = i18n.twtranslate(self.site,
- 'thirdparty-drtrigonbot-sum_disc-summary-head') \
- + u' '
- add = i18n.twtranslate(self.site,
- 'thirdparty-drtrigonbot-sum_disc-summary-add')
- mod = i18n.twtranslate(self.site,
- 'thirdparty-drtrigonbot-sum_disc-summary-mod')
- clean = i18n.twtranslate(self.site,
- 'thirdparty-drtrigonbot-sum_disc-summary-clean')
- if not self._mode:
- # default: write direct to user disc page
- comment = head + add % {'num':count}
- #self.append(self._userPage, buf, comment=comment, minorEdit=False)
- (page, text, minEd) = (self._userPage, buf, False)
- else:
- # enhanced (with template): update user disc page and write to user specified page
- tmplsite = pywikibot.Page(self.site, self._tmpl_data)
- comment = head + mod % {'num':count, 'page':tmplsite.title(asLink=True)}
- self.save(self._userPage, self._content, comment=comment, minorEdit=False)
- comment = head + add % {'num':count}
- #self.append(tmplsite, buf, comment=comment)
- (page, text, minEd) = (tmplsite, buf, True) # 'True' is default
- if (self._param['cleanup_count'] < 0):
- # default mode, w/o cleanup
- try:
- self.append(page, text, comment=comment, minorEdit=minEd)
- except pywikibot.MaxTriesExceededError:
- logging.getLogger('sum_disc').warning(
- u'Problem MaxTriesExceededError occurred, thus skipping this user!')
- return # skip history write
- else:
- # append with cleanup
- text = self.cleanupDiscSum( self.load(page) or u'',
- days=self._param['cleanup_count'] ) + u'\n\n' + text
- comment = head + clean % {'num':count}
- self.save(page, text, comment=comment, minorEdit=minEd)
- purge = self._userPage.purgeCache()
-
- pywikibot.output(u'\03{lightpurple}*** Discussion updates added to: %s (purge: %s)\03{default}' % (self._userPage.title(asLink=True), purge))
+ head = i18n.twtranslate(self.site,
+ 'thirdparty-drtrigonbot-sum_disc-summary-head') \
+ + u' '
+ add = i18n.twtranslate(self.site,
+ 'thirdparty-drtrigonbot-sum_disc-summary-add')
+ mod = i18n.twtranslate(self.site,
+ 'thirdparty-drtrigonbot-sum_disc-summary-mod')
+ clean = i18n.twtranslate(self.site,
+ 'thirdparty-drtrigonbot-sum_disc-summary-clean')
+ if not self._mode:
+ # default: write direct to user disc page
+ comment = head + add % {'num':count}
+ #self.append(self._userPage, buf, comment=comment, minorEdit=False)
+ (page, text, minEd) = (self._userPage, buf, False)
else:
- pywikibot.output(u'\03{lightyellow}=== ! DEBUG MODE NOTHING WRITTEN TO WIKI ! ===\03{default}')
+ # enhanced (with template): update user disc page and write to user specified page
+ tmplsite = pywikibot.Page(self.site, self._tmpl_data)
+ comment = head + mod % {'num':count, 'page':tmplsite.title(asLink=True)}
+ self.save(self._userPage, self._content, comment=comment, minorEdit=False)
+ comment = head + add % {'num':count}
+ #self.append(tmplsite, buf, comment=comment)
+ (page, text, minEd) = (tmplsite, buf, True) # 'True' is default
+ if (self._param['cleanup_count'] < 0):
+ # default mode, w/o cleanup
+ try:
+ self.append(page, text, comment=comment, minorEdit=minEd)
+ except pywikibot.MaxTriesExceededError:
+ logging.getLogger('sum_disc').warning(
+ u'Problem MaxTriesExceededError occurred, thus skipping this user!')
+ return # skip history write
+ else:
+ # append with cleanup
+ text = self.cleanupDiscSum( self.load(page) or u'',
+ days=self._param['cleanup_count'] ) + u'\n\n' + text
+ comment = head + clean % {'num':count}
+ self.save(page, text, comment=comment, minorEdit=minEd)
+ purge = self._userPage.purgeCache()
+ pywikibot.output(u'\03{lightpurple}*** Discussion updates added to: %s (purge: %s)\03{default}' % (self._userPage.title(asLink=True), purge))
+
if 'write2hist' in debug:
self.putHistory(self.pages.hist)
else:
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2012-06-13 11:40:44 UTC (rev 10356)
+++ trunk/pywikipedia/wikipedia.py 2012-06-13 11:59:13 UTC (rev 10357)
@@ -8103,7 +8103,7 @@
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':
+ elif arg in ['-simulate', '-dry']:
simulate = True
# global debug option for development purposes. Normally does nothing.
elif arg == '-debug':
@@ -8188,8 +8188,10 @@
-cc user_config.py to its inverse and overrules it. All other
settings and restrictions are untouched.
--simulate Disables writing to the server. Useful for testing
- and debugging of new code.
+-simulate Disables writing to the server. Useful for testing and
+(-dry) debugging of new code (if given, doesn't do any real
+ changes, but only shows what would have been changed).
+ DEPRECATED: please use -simulate instead of -dry
'''# % moduleName
output(globalHelp, toStdout=True)
try:
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10354
Revision: 10354
Author: drtrigon
Date: 2012-06-13 10:26:56 +0000 (Wed, 13 Jun 2012)
Log Message:
-----------
follow-up; in order to r10353 replace '-dry' by '-simulate'
Modified Paths:
--------------
trunk/pywikipedia/basic.py
trunk/pywikipedia/blockreview.py
trunk/pywikipedia/djvutext.py
trunk/pywikipedia/featured.py
trunk/pywikipedia/pagefromfile.py
trunk/pywikipedia/piper.py
Modified: trunk/pywikipedia/basic.py
===================================================================
--- trunk/pywikipedia/basic.py 2012-06-13 09:10:13 UTC (rev 10353)
+++ trunk/pywikipedia/basic.py 2012-06-13 10:26:56 UTC (rev 10354)
@@ -9,8 +9,7 @@
¶ms;
--dry If given, doesn't do any real changes, but only shows
- what would have been changed.
+-
All other parameters will be regarded as part of the title of a single page,
and the bot will only work on that single page.
@@ -260,19 +259,13 @@
# This temporary array is used to read the page title if one single
# page to work on is specified by the arguments.
pageTitleParts = []
- # If dry is True, doesn't do any real changes, but only show
- # what would have been changed.
- dry = False
# Parse command line arguments
for arg in pywikibot.handleArgs():
- if arg.startswith("-dry"):
- dry = True
- else:
- # check if a standard argument like
- # -start:XYZ or -ref:Asdf was given.
- if not genFactory.handleArg(arg):
- pageTitleParts.append(arg)
+ # check if a standard argument like
+ # -start:XYZ or -ref:Asdf was given.
+ if not genFactory.handleArg(arg):
+ pageTitleParts.append(arg)
if pageTitleParts != []:
# We will only work on a single page.
@@ -286,7 +279,7 @@
# The preloading generator is responsible for downloading multiple
# pages from the wiki simultaneously.
gen = pagegenerators.PreloadingGenerator(gen)
- bot = BasicBot(gen, dry)
+ bot = BasicBot(gen, pywikibot.simulate)
bot.run()
else:
pywikibot.showHelp()
Modified: trunk/pywikipedia/blockreview.py
===================================================================
--- trunk/pywikipedia/blockreview.py 2012-06-13 09:10:13 UTC (rev 10353)
+++ trunk/pywikipedia/blockreview.py 2012-06-13 10:26:56 UTC (rev 10354)
@@ -9,8 +9,7 @@
The following parameters are supported:
--dry If given, doesn't do any real changes, but only shows
- what would have been changed.
+-
All other parameters will be regarded as part of the title of a single page,
and the bot will only work on that single page.
@@ -283,19 +282,14 @@
return False
def main():
- # If dry is True, doesn't do any real changes, but only show
- # what would have been changed.
- dry = show = False
+ show = False
# Parse command line arguments
for arg in pywikibot.handleArgs():
- if arg == "-dry":
- dry = True
- else:
- show = True
+ show = True
if not show:
- bot = BlockreviewBot(dry)
+ bot = BlockreviewBot(pywikibot.simulate)
bot.run()
else:
pywikibot.showHelp()
Modified: trunk/pywikipedia/djvutext.py
===================================================================
--- trunk/pywikipedia/djvutext.py 2012-06-13 09:10:13 UTC (rev 10353)
+++ trunk/pywikipedia/djvutext.py 2012-06-13 10:26:56 UTC (rev 10354)
@@ -6,8 +6,6 @@
The following parameters are supported:
- -dry If given, doesn't do any real changes, but only shows
- what would have been changed.
-ask Ask for confirmation before uploading each page.
(Default: ask when overwriting pages)
-overwrite:no When asking for confirmation, the answer is no.
@@ -40,7 +38,7 @@
class DjVuTextBot:
- def __init__(self, djvu, index, pages, ask=False, overwrite='ask', debug=False):
+ def __init__(self, djvu, index, pages, ask=False, overwrite='ask', dry=False):
"""
Constructor. Parameters:
djvu : filename
@@ -50,7 +48,7 @@
self.djvu = djvu
self.index = index
self.pages = pages
- self.dry = debug
+ self.dry = dry
self.ask = ask
self.overwrite = overwrite
@@ -188,15 +186,12 @@
djvu = None
pages = None
# what would have been changed.
- dry = False
ask = False
overwrite = 'ask'
# Parse command line arguments
for arg in pywikibot.handleArgs():
- if arg.startswith("-dry"):
- dry = True
- elif arg.startswith("-ask"):
+ if arg.startswith("-ask"):
ask = True
elif arg.startswith("-overwrite:"):
overwrite = arg[11:12]
@@ -236,7 +231,7 @@
raise pywikibot.NoPage(u"Page '%s' does not exist" % index)
pywikibot.output(u"uploading text from %s to %s"
% (djvu, index_page.title(asLink=True)) )
- bot = DjVuTextBot(djvu, index, pages, ask, overwrite, dry)
+ bot = DjVuTextBot(djvu, index, pages, ask, overwrite, pywikibot.simulate)
if not bot.has_text():
raise ValueError("No text layer in djvu file")
bot.run()
Modified: trunk/pywikipedia/featured.py
===================================================================
--- trunk/pywikipedia/featured.py 2012-06-13 09:10:13 UTC (rev 10353)
+++ trunk/pywikipedia/featured.py 2012-06-13 10:26:56 UTC (rev 10354)
@@ -35,8 +35,6 @@
-quiet no corresponding pages are displayed.
--dry for debug purposes. No changes will be made.
-
usage: featured.py [-interactive] [-nocache] [-top] [-after:zzzz] [-fromlang:xx,yy--zz|-fromall]
"""
@@ -561,7 +559,6 @@
doAll = False
part = False
quiet = False
- dry = False
for arg in pywikibot.handleArgs():
if arg == '-interactive':
interactive=1
@@ -586,8 +583,6 @@
processType = 'former'
elif arg == '-quiet':
quiet = True
- elif arg == '-dry':
- dry = True
if part:
try:
@@ -657,7 +652,8 @@
break
elif fromsite != pywikibot.getSite():
featuredWithInterwiki(fromsite, pywikibot.getSite(),
- template_on_top, processType, quiet, dry)
+ template_on_top, processType, quiet,
+ pywikibot.simulate)
except KeyboardInterrupt:
pywikibot.output('\nQuitting program...')
finally:
Modified: trunk/pywikipedia/pagefromfile.py
===================================================================
--- trunk/pywikipedia/pagefromfile.py 2012-06-13 09:10:13 UTC (rev 10353)
+++ trunk/pywikipedia/pagefromfile.py 2012-06-13 10:26:56 UTC (rev 10354)
@@ -33,8 +33,6 @@
-autosummary Use MediaWikis autosummary when creating a new page,
overrides -summary in this case
-minor set minor edit flag on page edits
--dry Do not really upload pages, just check and report
- messages
If the page to be uploaded already exists:
-safe do nothing (default)
@@ -146,14 +144,14 @@
}
def __init__(self, reader, force, append, summary, minor, autosummary,
- debug,nocontents):
+ dry, nocontents):
self.reader = reader
self.force = force
self.append = append
self.summary = summary
self.minor = minor
self.autosummary = autosummary
- self.dry = debug
+ self.dry = dry
self.nocontents=nocontents
def run(self):
@@ -318,7 +316,6 @@
summary = None
minor = False
autosummary = False
- dry = False
for arg in pywikibot.handleArgs():
if arg.startswith("-start:"):
@@ -335,8 +332,6 @@
append = "Bottom"
elif arg == "-force":
force=True
- elif arg == "-dry":
- dry = True
elif arg == "-safe":
force = False
append = None
@@ -358,8 +353,10 @@
pywikibot.output(u"Disregarding unknown argument %s." % arg)
reader = PageFromFileReader(filename, pageStartMarker, pageEndMarker,
- titleStartMarker, titleEndMarker, include, notitle)
- bot = PageFromFileRobot(reader, force, append, summary, minor, autosummary, dry,nocontents)
+ titleStartMarker, titleEndMarker, include,
+ notitle)
+ bot = PageFromFileRobot(reader, force, append, summary, minor, autosummary,
+ pywikibot.simulate, nocontents)
bot.run()
if __name__ == "__main__":
Modified: trunk/pywikipedia/piper.py
===================================================================
--- trunk/pywikipedia/piper.py 2012-06-13 09:10:13 UTC (rev 10353)
+++ trunk/pywikipedia/piper.py 2012-06-13 10:26:56 UTC (rev 10354)
@@ -20,9 +20,6 @@
¶ms;
- -dry If given, doesn't do any real changes, but only shows
- what would have been changed.
-
-always Always commit changes without asking you to accept them
-filter: Filter the article text through this program, can be
@@ -65,17 +62,17 @@
'nl': u'Bot: paginatekst door %s geleid'
}
- def __init__(self, generator, debug, filters, always):
+ def __init__(self, generator, dry, filters, always):
"""
Constructor. Parameters:
* generator - The page generator that determines on which pages
to work on.
- * debug - If True, doesn't do any real changes, but only shows
+ * dry - If True, doesn't do any real changes, but only shows
what would have been changed.
* always - If True, don't prompt for changes
"""
self.generator = generator
- self.dry = debug
+ self.dry = dry
self.always = always
self.filters = filters
@@ -173,9 +170,6 @@
# This temporary array is used to read the page title if one single
# page to work on is specified by the arguments.
pageTitleParts = []
- # If dry is True, doesn't do any real changes, but only show
- # what would have been changed.
- dry = False
# will become True when the user uses the -always flag.
always = False
# The program to pipe stuff through
@@ -183,9 +177,7 @@
# Parse command line arguments
for arg in pywikibot.handleArgs():
- if arg.startswith("-dry"):
- dry = True
- elif arg.startswith("-filter:"):
+ if arg.startswith("-filter:"):
prog = arg[8:]
filters.append(prog)
elif arg.startswith("-always"):
@@ -208,7 +200,7 @@
# The preloading generator is responsible for downloading multiple
# pages from the wiki simultaneously.
gen = pagegenerators.PreloadingGenerator(gen)
- bot = PiperBot(gen, dry, filters, always)
+ bot = PiperBot(gen, pywikibot.simulate, filters, always)
bot.run()
else:
pywikibot.showHelp()
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10353
Revision: 10353
Author: drtrigon
Date: 2012-06-13 09:10:13 +0000 (Wed, 13 Jun 2012)
Log Message:
-----------
follow-up; enhance r9909 and r10174 to non-API calls
Modified Paths:
--------------
trunk/pywikipedia/config.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/config.py
===================================================================
--- trunk/pywikipedia/config.py 2012-06-12 16:46:30 UTC (rev 10352)
+++ trunk/pywikipedia/config.py 2012-06-13 09:10:13 UTC (rev 10353)
@@ -476,7 +476,7 @@
# servers. Allows simulation runs of bots to be carried out without changing any
# page on the server side. This setting may be overridden in user_config.py.
actions_to_block = ['edit', 'watch', 'move', 'delete', 'undelete', 'protect',
- 'emailuser']
+ 'emailuser', 'submit'] # 'submit' is for non-API
# How many pages should be put to a queue in asynchroneous mode.
# If maxsize is <= 0, the queue size is infinite.
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2012-06-12 16:46:30 UTC (rev 10352)
+++ trunk/pywikipedia/wikipedia.py 2012-06-13 09:10:13 UTC (rev 10353)
@@ -5727,6 +5727,15 @@
body of the response.
"""
+ if ('action' in predata) and pywikibot.simulate and \
+ (predata['action'] in pywikibot.config.actions_to_block):
+ pywikibot.output(u'\03{lightyellow}SIMULATION: %s action blocked.\03{default}'%\
+ predata['action'])
+ import StringIO
+ f_dummy = StringIO.StringIO()
+ f_dummy.__dict__.update({u'code': 0, u'msg': u''})
+ return f_dummy, u''
+
data = self.urlEncode(predata)
try:
if cookies:
@@ -8095,9 +8104,6 @@
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')
simulate = True
# global debug option for development purposes. Normally does nothing.
elif arg == '-debug':
@@ -8183,7 +8189,7 @@
settings and restrictions are untouched.
-simulate Disables writing to the server. Useful for testing
- and debugging of new code. (API only)
+ and debugging of new code.
'''# % moduleName
output(globalHelp, toStdout=True)
try: