jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/225045 )
Change subject: Allow no replacements by default
......................................................................
Allow no replacements by default
- InteractiveReplace should have only unlink and skip behavior.
Scripts may enable options as they wish.
- change the related scripts.
Change-Id: I141f35fb8835b7e92adf1931b507af98f9018098
---
M pywikibot/bot.py
M scripts/disambredir.py
M scripts/unlink.py
3 files changed, 5 insertions(+), 5 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index f78be24..5b20143 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -641,7 +641,7 @@
It shows various options which can be switched on and off:
* allow_skip_link = True (skip the current link)
* allow_unlink = True (unlink)
- * allow_replace = True (just replace target, keep section and label)
+ * allow_replace = False (just replace target, keep section and label)
* allow_replace_section = False (replace target and section, keep label)
* allow_replace_label = False (replace target and label, keep section)
* allow_replace_all = False (replace target, section and label)
@@ -691,7 +691,7 @@
self.context_delta = 0
self.allow_skip_link = True
self.allow_unlink = True
- self.allow_replace = True
+ self.allow_replace = False
self.allow_replace_section = False
self.allow_replace_label = False
self.allow_replace_all = False
diff --git a/scripts/disambredir.py b/scripts/disambredir.py
index 2460551..610be97 100755
--- a/scripts/disambredir.py
+++ b/scripts/disambredir.py
@@ -12,7 +12,7 @@
"""
#
# (C) André Engels, 2006-2009
-# (C) Pywikibot team, 2006-2015
+# (C) Pywikibot team, 2006-2017
#
# Distributed under the terms of the MIT license.
#
@@ -36,6 +36,7 @@
def _create_callback(self, old, new):
replace_callback = InteractiveReplace(
old, new, default='n', automatic_quit=False)
+ replace_callback.allow_replace = True
replace_callback.allow_replace_label = True
replace_callback.allow_replace_section = True
replace_callback.allow_replace_all = True
diff --git a/scripts/unlink.py b/scripts/unlink.py
index f8f7b1d..1e4de82 100755
--- a/scripts/unlink.py
+++ b/scripts/unlink.py
@@ -21,7 +21,7 @@
descriptions.
"""
#
-# (C) Pywikibot team, 2007-2016
+# (C) Pywikibot team, 2007-2017
#
# Distributed under the terms of the MIT license.
#
@@ -62,7 +62,6 @@
self.additional_choices = [AlwaysChoice(self, 'unlink all on page',
'p'),
self._always, EditReplacement()]
self._bot = bot
- self.allow_replace = False
self.context = 100
self.context_change = 100
--
To view, visit
https://gerrit.wikimedia.org/r/225045
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I141f35fb8835b7e92adf1931b507af98f9018098
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <Ladsgroup(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Multichill <maarten(a)mdammers.nl>
Gerrit-Reviewer: Russell Blau <russblau(a)imapmail.org>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>