jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697109 )
Change subject: [bugfix] Fix botMayEdit logic
......................................................................
[bugfix] Fix botMayEdit logic
The warning was printed when there was a valid key but the value didn't match any skip condition.
Also, store calledModuleName() in a variable to save space (and a little time).
Change-Id: Ibfce75f9157dae8fb94255e109b222e82323ed04
---
M pywikibot/page/__init__.py
1 file changed, 16 insertions(+), 18 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index c6048e8..ccd8f41 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -1047,6 +1047,7 @@
return True
username = self.site.username()
+ module = pywikibot.calledModuleName()
try:
templates = self.templatesWithParams()
except (NoPageError, IsRedirectPageError, SectionError):
@@ -1056,7 +1057,7 @@
restrictions = set(self.site.get_edit_restricted_templates())
# also add archive templates for non-archive bots
- if pywikibot.calledModuleName() != 'archivebot':
+ if module != 'archivebot':
restrictions.update(self.site.get_archived_page_templates())
# multiple bots/nobots templates are allowed
@@ -1095,9 +1096,7 @@
'Edit declined' % key)
return False
- if 'all' in names \
- or pywikibot.calledModuleName() in names \
- or username in names:
+ if 'all' in names or module in names or username in names:
return False
if title == 'Bots':
@@ -1111,24 +1110,23 @@
'{{bots|%s=}} is not valid. Ignoring.' % key)
continue
- if key == 'allow' and not ('all' in names
- or username in names):
- return False
+ if key == 'allow':
+ if not ('all' in names or username in names):
+ return False
- if key == 'deny' and ('all' in names or username in names):
- return False
+ elif key == 'deny':
+ if 'all' in names or username in names:
+ return False
- if key == 'allowscript' \
- and not ('all' in names
- or pywikibot.calledModuleName() in names):
- return False
+ elif key == 'allowscript':
+ if not ('all' in names or module in names):
+ return False
- if key == 'denyscript' \
- and ('all' in names
- or pywikibot.calledModuleName() in names):
- return False
+ elif key == 'denyscript':
+ if 'all' in names or module in names:
+ return False
- if key: # ignore unrecognized keys with a warning
+ elif key: # ignore unrecognized keys with a warning
pywikibot.warning(
'{{bots|%s}} is not valid. Ignoring.' % params[0])
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697109
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ibfce75f9157dae8fb94255e109b222e82323ed04
Gerrit-Change-Number: 697109
Gerrit-PatchSet: 3
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697138 )
Change subject: [bugfix] remove lru_cache from botMayEdit method
......................................................................
[bugfix] remove lru_cache from botMayEdit method
- lru_cache keeps all page references and leads to exhausting memory
usage if a lot of pages are loaded.
See also https://bugs.python.org/issue19859
Replace lru_cache by the Page attribute "_bot_may_edit"
- delete this cache attribute if a page is reloaded with Page.get(force)
from life wiki because the content can have been changed
Bug: T283957
Change-Id: Ia491a9e70203634e722caaa8e50a7388057376aa
---
M pywikibot/page/__init__.py
1 file changed, 9 insertions(+), 2 deletions(-)
Approvals:
Zhuyifei1999: Looks good to me, but someone else must approve
Rubin: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index dc4542d..c6048e8 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -30,7 +30,7 @@
import pywikibot
from pywikibot import config, i18n, textlib
-from pywikibot.backports import Dict, Iterable, List, Tuple, cache
+from pywikibot.backports import Dict, Iterable, List, Tuple
from pywikibot.comms import http
from pywikibot.exceptions import (
APIError,
@@ -440,6 +440,8 @@
"""
if force:
del self.latest_revision_id
+ if hasattr(self, '_bot_may_edit'):
+ del self._bot_may_edit
try:
self._getInternals()
except IsRedirectPageError:
@@ -1017,7 +1019,6 @@
"""DEPRECATED. Determine whether the page may be edited."""
return self.has_permission()
- @cache
def botMayEdit(self) -> bool:
"""
Determine whether the active bot is allowed to edit the page.
@@ -1033,6 +1034,12 @@
to override this by setting ignore_bot_templates=True in
user-config.py, or using page.put(force=True).
"""
+ if not hasattr(self, '_bot_may_edit'):
+ self._bot_may_edit = self._check_bot_may_edit()
+ return self._bot_may_edit
+
+ def _check_bot_may_edit(self) -> bool:
+ """A botMayEdit helper method."""
if not hasattr(self, 'templatesWithParams'):
return True
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697138
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ia491a9e70203634e722caaa8e50a7388057376aa
Gerrit-Change-Number: 697138
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Rubin <rubin.happy(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/695548 )
Change subject: [IMPR] Refactor and test add_text argument parsing
......................................................................
[IMPR] Refactor and test add_text argument parsing
Splitting add_text's argument parsing into its own method with test coverage.
This is a pattern I loved within tor [1], and if approved I'll do the same for
other scripts as I go along.
The only functional changes to add_text are...
* Rearranged -help arguments by prominence. Either -text or -textfile are
mandatory so placing them first.
* The '-newimages' argument was unimplemented. Removed it from our help.
* Unrecognized arguments are now rejected rather than ignored.
* Error if both -text and -textfile are used rather than ignoring the later.
[1] https://gitweb.torproject.org/stem.git/tree/stem/interpreter/arguments.py
Change-Id: I6b4ca274278c8a4488a1a82ec063181d668d4c36
---
M scripts/add_text.py
M tests/add_text_tests.py
2 files changed, 176 insertions(+), 68 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/add_text.py b/scripts/add_text.py
index 1cfa980..b790d50 100755
--- a/scripts/add_text.py
+++ b/scripts/add_text.py
@@ -10,24 +10,22 @@
Furthermore, the following command line parameters are supported:
--talkpage Put the text onto the talk page instead
--talk
-
-text Define what text to add. "\n" are interpreted as newlines.
-textfile Define a texfile name which contains the text to add
-summary Define the summary to use
--excepturl Use the html page as text where you want to see if there's
- the text, not the wiki-page.
-
--newimages Add text in the new images
+-up If used, put the text at the top of the page
-always If used, the bot won't ask if it should add the specified
text
--up If used, put the text at the top of the page
+-talkpage Put the text onto the talk page instead
+-talk
+
+-excepturl Use the html page as text where you want to see if there's
+ the text, not the wiki-page.
-noreorder Avoid reordering cats and interwiki
@@ -57,6 +55,7 @@
# Distributed under the terms of the MIT license.
#
import codecs
+import collections
import re
import sys
from typing import Optional, Union
@@ -78,6 +77,24 @@
from pywikibot.tools import issue_deprecation_warning
from pywikibot.tools.formatter import color_format
+DEFAULT_ARGS = {
+ 'text': None,
+ 'text_file': None,
+ 'summary': None,
+ 'up': False,
+ 'always': False,
+ 'talk_page': False,
+ 'reorder': True,
+ 'regex_skip_url': None,
+}
+
+ARG_PROMPT = {
+ '-text': 'What text do you want to add?',
+ '-textfile': 'Which text file do you want to append to the page?',
+ '-summary': 'What summary do you want to use?',
+ '-excepturl': 'What url pattern should we skip?',
+}
+
docuReplacements = {'¶ms;': pagegenerators.parameterHelp} # noqa: N816
@@ -274,76 +291,99 @@
error_count += 1
-def main(*args: Tuple[str, ...]) -> None:
+def main(*argv: Tuple[str, ...]) -> None:
"""
Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used.
- @param args: Command line arguments
+ @param argv: Command line arguments
"""
- # If none, the var is set only for check purpose.
- summary = None
- addText = None
- regexSkipUrl = None
- always = False
- textfile = None
- talkPage = False
- reorderEnabled = True
+ generator_factory = pagegenerators.GeneratorFactory()
- # Put the text above or below the text?
- up = False
-
- # Process global args and prepare generator args parser
- local_args = pywikibot.handle_args(args)
- genFactory = pagegenerators.GeneratorFactory()
-
- # Loading the arguments
- for arg in local_args:
- option, sep, value = arg.partition(':')
- if option == '-textfile':
- textfile = value or pywikibot.input(
- 'Which textfile do you want to add?')
- elif option == '-text':
- addText = value or pywikibot.input('What text do you want to add?')
- elif option == '-summary':
- summary = value or pywikibot.input(
- 'What summary do you want to use?')
- elif option == '-excepturl':
- regexSkipUrl = value or pywikibot.input('What text should I skip?')
- elif option == '-except':
- new_arg = ''.join(['-grepnot', sep, value])
- issue_deprecation_warning(arg, new_arg,
- 2, ArgumentDeprecationWarning,
- since='20201224')
- genFactory.handle_arg(new_arg)
- elif option == '-up':
- up = True
- elif option == '-noreorder':
- reorderEnabled = False
- elif option == '-always':
- always = True
- elif option in ('-talk', '-talkpage'):
- talkPage = True
- else:
- genFactory.handle_arg(arg)
-
- if textfile and not addText:
- with codecs.open(textfile, 'r', config.textfile_encoding) as f:
- addText = f.read()
-
- generator = genFactory.getCombinedGenerator()
- additional_text = '' if addText else "The text to add wasn't given."
- if pywikibot.bot.suggest_help(missing_generator=not generator,
- additional_text=additional_text):
+ try:
+ args = parse(argv, generator_factory)
+ except ValueError as exc:
+ pywikibot.bot.suggest_help(additional_text=str(exc))
return
- if talkPage:
+ text = args.text
+
+ if args.text_file:
+ with codecs.open(args.text_file, 'r', config.textfile_encoding) as f:
+ text = f.read()
+
+ generator = generator_factory.getCombinedGenerator()
+
+ if pywikibot.bot.suggest_help(missing_generator=not generator):
+ return
+
+ if args.talk_page:
generator = pagegenerators.PageWithTalkPageGenerator(generator, True)
+
for page in generator:
- add_text(page, addText, summary,
- regexSkipUrl=regexSkipUrl, always=always, up=up,
- reorderEnabled=reorderEnabled, create=talkPage)
+ add_text(page, text, args.summary,
+ regexSkipUrl=args.regex_skip_url, always=args.always,
+ up=args.up, reorderEnabled=args.reorder,
+ create=args.talk_page)
+
+
+def parse(argv: Tuple[str, ...],
+ generator_factory: pagegenerators.GeneratorFactory
+ ) -> collections.namedtuple:
+ """
+ Parses our arguments and provide a named tuple with their values.
+
+ @param argv: input arguments to be parsed
+ @param generator_factory: factory that will determine the page to edit
+
+ @return: a namedtuple with our parsed arguments
+
+ @raise: ValueError if we receive invalid arguments
+ """
+ args = dict(DEFAULT_ARGS)
+ argv = pywikibot.handle_args(argv)
+ argv = generator_factory.handle_args(argv)
+
+ for arg in argv:
+ option, _, value = arg.partition(':')
+
+ if not value and option in ARG_PROMPT:
+ value = pywikibot.input(ARG_PROMPT[option])
+
+ if option == '-text':
+ args['text'] = value
+ elif option == '-textfile':
+ args['text_file'] = value
+ elif option == '-summary':
+ args['summary'] = value
+ elif option == '-up':
+ args['up'] = True
+ elif option == '-always':
+ args['always'] = True
+ elif option in ('-talk', '-talkpage'):
+ args['talk_page'] = True
+ elif option == '-noreorder':
+ args['reorder'] = False
+ elif option == '-except':
+ page_gen_arg = '-grepnot:{}'.format(value)
+ issue_deprecation_warning(arg, page_gen_arg,
+ 2, ArgumentDeprecationWarning,
+ since='20201224')
+ generator_factory.handle_arg(page_gen_arg)
+ elif option == '-excepturl':
+ args['regex_skip_url'] = value
+ else:
+ raise ValueError("Argument '{}' is unrecognized".format(option))
+
+ if not args['text'] and not args['text_file']:
+ raise ValueError("Either the '-text' or '-textfile' is required")
+
+ if args['text'] and args['text_file']:
+ raise ValueError("'-text' and '-textfile' cannot both be used")
+
+ Args = collections.namedtuple('Args', args.keys())
+ return Args(**args)
if __name__ == '__main__':
diff --git a/tests/add_text_tests.py b/tests/add_text_tests.py
index fca8331..30d987f 100644
--- a/tests/add_text_tests.py
+++ b/tests/add_text_tests.py
@@ -5,9 +5,14 @@
# Distributed under the terms of the MIT license.
#
import unittest
+from unittest.mock import Mock, patch
import pywikibot
-from scripts.add_text import add_text, get_text
+import pywikibot.pagegenerators
+
+from pywikibot.exceptions import ArgumentDeprecationWarning
+from pywikibot.tools import suppress_warnings
+from scripts.add_text import add_text, get_text, parse
from tests.aspects import TestCase
@@ -24,6 +29,69 @@
"""Setup test."""
super().setUp()
self.page = pywikibot.Page(self.site, 'foo')
+ self.generator_factory = pywikibot.pagegenerators.GeneratorFactory()
+
+ @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
+ def test_parse(self):
+ """Basic argument parsing."""
+ args = parse(['-text:"hello world"'], self.generator_factory)
+ self.assertEqual('"hello world"', args.text)
+ self.assertFalse(args.up)
+ self.assertTrue(args.reorder)
+
+ args = parse(['-text:hello', '-up', '-noreorder'],
+ self.generator_factory)
+ self.assertEqual('hello', args.text)
+ self.assertTrue(args.up)
+ self.assertFalse(args.reorder)
+
+ @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
+ def test_unrecognized_argument(self):
+ """Provide an argument that doesn't exist."""
+ expected_error = "Argument '-no_such_arg' is unrecognized"
+
+ for invalid_arg in ('-no_such_arg', '-no_such_arg:hello'):
+ with self.assertRaisesRegex(ValueError, expected_error):
+ parse([invalid_arg], self.generator_factory)
+
+ @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
+ def test_neither_text_argument(self):
+ """Don't provide either -text or -textfile."""
+ expected_error = "Either the '-text' or '-textfile' is required"
+
+ with self.assertRaisesRegex(ValueError, expected_error):
+ parse(['-noreorder'], self.generator_factory)
+
+ @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
+ def test_both_text_arguments(self):
+ """Provide both -text and -textfile."""
+ expected_error = "'-text' and '-textfile' cannot both be used"
+
+ with self.assertRaisesRegex(ValueError, expected_error):
+ parse(['-text:hello', '-textfile:/some/path'],
+ self.generator_factory)
+
+ @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
+ def test_except_argument(self):
+ """Check the deprecated -except argument."""
+ generator_factory = Mock()
+ generator_factory.handle_args.side_effect = lambda args: args
+
+ with suppress_warnings('-except:stuff is deprecated',
+ ArgumentDeprecationWarning):
+ parse(['-text:hello', '-except:stuff'], generator_factory)
+
+ generator_factory.handle_arg.assert_called_with('-grepnot:stuff')
+
+ @patch('pywikibot.input')
+ @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
+ def test_argument_prompt(self, input_mock):
+ """Reqest an argument that requres a prompt."""
+ input_mock.return_value = 'hello world'
+
+ args = parse(['-text'], self.generator_factory)
+ self.assertEqual('hello world', args.text)
+ input_mock.assert_called_with('What text do you want to add?')
def test_basic(self):
"""Test adding text."""
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/695548
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I6b4ca274278c8a4488a1a82ec063181d668d4c36
Gerrit-Change-Number: 695548
Gerrit-PatchSet: 4
Gerrit-Owner: Damian <atagar1(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/692884 )
Change subject: [IMPR] show a {black;yellow} bar on simulation
......................................................................
[IMPR] show a {black;yellow} bar on simulation
Use a yellow bar. Otherwise the message would interfer the
transliteration text (lightyellow on black)
Change-Id: I6716f9176d7c013335f5e5124c8508a1033d9f25
---
M pywikibot/data/api.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 733ef13..ab699fb 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1330,7 +1330,7 @@
if action and config.simulate and (
self.write or action in config.actions_to_block):
pywikibot.output(color_format(
- '{lightyellow}SIMULATION: {0} action blocked.{default}',
+ '{black;yellow}SIMULATION: {} action blocked.{default}',
action))
# for more realistic simulation
if config.simulate is not True:
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/692884
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I6716f9176d7c013335f5e5124c8508a1033d9f25
Gerrit-Change-Number: 692884
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697074 )
Change subject: [IMPR] Remove MultipleSitesBot if subclassing is not necessary
......................................................................
[IMPR] Remove MultipleSitesBot if subclassing is not necessary
- MultipleSitesBot is just an alias for BaseBot and has no functionality.
Remove it if any other bot class is used already.
- Update documentation
Change-Id: I1ab88fd9009969bd8762f685d44748f564a57fea
---
M pywikibot/bot.py
M scripts/category.py
M scripts/cosmetic_changes.py
M scripts/delete.py
M scripts/movepages.py
M scripts/redirect.py
6 files changed, 14 insertions(+), 20 deletions(-)
Approvals:
JJMC89: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 3112344..6805d1d 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -5,7 +5,9 @@
conjunction. Each bot should subclass at least one of these four classes:
* L{BaseBot}: Basic bot class in case where the site is handled differently,
- like working on two sites in parallel.
+ like working on multiple sites in parallel. No site attribute is provided.
+ Instead site of the current page should be used. This class should
+ normally not be used directly.
* L{SingleSiteBot}: Bot class which should only be run on a single site. They
usually store site specific content and thus can't be easily run when the
@@ -13,10 +15,8 @@
can also be changed. If the generator returns a page of a different site
it'll skip that page.
-* L{MultipleSitesBot}: Bot class which supports to be run on multiple sites
- without the need to manually initialize it every time. It is not possible to
- set the C{site} property and it's deprecated to request it. Instead site of
- the current page should be used. And out of C{run} that sit isn't defined.
+* L{MultipleSitesBot}: An alias of L{BaseBot}. Should not be used if any
+ other bot class is used.
* L{ConfigParserBot}: Bot class which supports reading options from a
scripts.ini configuration file. That file consists of sections, led by a
diff --git a/scripts/category.py b/scripts/category.py
index 1fea6ec..246875c 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -134,7 +134,6 @@
Bot,
ContextOption,
IntegerOption,
- MultipleSitesBot,
StandardOption,
suggest_help,
)
@@ -403,7 +402,7 @@
.format(config.shortpath(filename)))
-class CategoryAddBot(MultipleSitesBot, CategoryPreprocess):
+class CategoryAddBot(CategoryPreprocess):
"""A robot to mass-add a category to a list of pages."""
diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py
index 40770ba..edb77c5 100755
--- a/scripts/cosmetic_changes.py
+++ b/scripts/cosmetic_changes.py
@@ -34,7 +34,7 @@
import pywikibot
from pywikibot import config, i18n, pagegenerators
from pywikibot.backports import Tuple
-from pywikibot.bot import ExistingPageBot, MultipleSitesBot, NoRedirectPageBot
+from pywikibot.bot import ExistingPageBot, NoRedirectPageBot
from pywikibot.cosmetic_changes import (
CANCEL_ALL,
CANCEL_MATCH,
@@ -56,7 +56,7 @@
}
-class CosmeticChangesBot(MultipleSitesBot, ExistingPageBot, NoRedirectPageBot):
+class CosmeticChangesBot(ExistingPageBot, NoRedirectPageBot):
"""Cosmetic changes bot."""
diff --git a/scripts/delete.py b/scripts/delete.py
index 739541a..459e3b1 100755
--- a/scripts/delete.py
+++ b/scripts/delete.py
@@ -60,7 +60,7 @@
import pywikibot
from pywikibot import i18n, pagegenerators
from pywikibot.backports import DefaultDict, Set, Tuple
-from pywikibot.bot import CurrentPageBot, MultipleSitesBot
+from pywikibot.bot import CurrentPageBot
from pywikibot.page import Page
from pywikibot.site import Namespace
from pywikibot.tools import islice_with_ellipsis
@@ -123,7 +123,7 @@
return set(namespaces) & set(self.ref_table)
-class DeletionRobot(MultipleSitesBot, CurrentPageBot):
+class DeletionRobot(CurrentPageBot):
"""This robot allows deletion of pages en masse."""
diff --git a/scripts/movepages.py b/scripts/movepages.py
index 7c4523c..3ce2562 100755
--- a/scripts/movepages.py
+++ b/scripts/movepages.py
@@ -39,7 +39,7 @@
import pywikibot
from pywikibot import i18n, pagegenerators
-from pywikibot.bot import CurrentPageBot, MultipleSitesBot
+from pywikibot.bot import CurrentPageBot
from pywikibot.exceptions import PageRelatedError
@@ -48,7 +48,7 @@
docuReplacements = {'¶ms;': pagegenerators.parameterHelp} # noqa: N816
-class MovePagesBot(MultipleSitesBot, CurrentPageBot):
+class MovePagesBot(CurrentPageBot):
"""Page move bot."""
diff --git a/scripts/redirect.py b/scripts/redirect.py
index 599a983..02ace44 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -78,12 +78,7 @@
import pywikibot.data
from pywikibot import i18n, pagegenerators, xmlreader
from pywikibot.backports import Dict, List, Set, Tuple
-from pywikibot.bot import (
- ExistingPageBot,
- MultipleSitesBot,
- OptionHandler,
- RedirectPageBot,
-)
+from pywikibot.bot import ExistingPageBot, OptionHandler, RedirectPageBot
from pywikibot.exceptions import (
CircularRedirectError,
InterwikiRedirectPageError,
@@ -378,7 +373,7 @@
continue
-class RedirectRobot(MultipleSitesBot, ExistingPageBot, RedirectPageBot):
+class RedirectRobot(ExistingPageBot, RedirectPageBot):
"""Redirect bot."""
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697074
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I1ab88fd9009969bd8762f685d44748f564a57fea
Gerrit-Change-Number: 697074
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged