jenkins-bot submitted this change.

View Change

Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
[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(-)

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 = {'&params;': 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 change 697074. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I1ab88fd9009969bd8762f685d44748f564a57fea
Gerrit-Change-Number: 697074
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia@gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged