jenkins-bot submitted this change.

View Change

Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
[cleanup] Remove deprecated setOptions/getOption OptionHandler methods

Change-Id: I6fd32f3b0993d928f149677e90b805156c086023
---
M pywikibot/bot.py
M scripts/movepages.py
2 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index d439154..a0b1c48 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -1134,10 +1134,6 @@
super().__setattr__(name, value)


-_DEPRECATION_MSG = 'Optionhandler.opt.option attribute ' \
- 'or Optionhandler.opt[option] item'
-
-
class OptionHandler:

"""Class to get and set options.
@@ -1195,11 +1191,6 @@
"""
self.set_options(**kwargs)

- @deprecated('set_options', since='20201006')
- def setOptions(self, **options: Any) -> None: # pragma: no cover
- """DEPRECATED. Set the instance options."""
- self.set_options(**options)
-
def set_options(self, **options: Any) -> None:
"""Set the instance options."""
valid_options = set(self.available_options)
@@ -1214,16 +1205,6 @@
pywikibot.warning('{} is not a valid option. It was ignored.'
.format(opt))

- @deprecated(_DEPRECATION_MSG, since='20201006')
- def getOption(self, option: str) -> Any: # pragma: no cover
- """DEPRECATED. Get the current value of an option.
-
- :param option: key defined in OptionHandler.available_options
- :raise pywikibot.exceptions.Error: No valid option is given with
- option parameter
- """
- return self.opt[option]
-

class BaseBot(OptionHandler):

diff --git a/scripts/movepages.py b/scripts/movepages.py
index 05ba0c6..7ee7fc9 100755
--- a/scripts/movepages.py
+++ b/scripts/movepages.py
@@ -84,7 +84,7 @@

def skip_page(self, page):
"""Treat only non-redirect pages if 'skipredirects' is set."""
- if self.getOption('skipredirects') and page.isRedirectPage():
+ if self.opt.skipredirects and page.isRedirectPage():
pywikibot.warning(
'Page {page} on {page.site} is a redirect; skipping'
.format(page=page))

To view, visit change 736186. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I6fd32f3b0993d928f149677e90b805156c086023
Gerrit-Change-Number: 736186
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