Xqt has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/981376
)
Change subject: [cleanup] deprecate SequenceOutputter.output() method
......................................................................
[cleanup] deprecate SequenceOutputter.output() method
SequenceOutputter acts like a bot_choice Option and
output() methods were derecated in Pywikibot 6.2 in favour
of out property due to cache_output implementation
Change-Id: I0dd4fdc006d7adde16f1aa22ff3fa0eee4c66831
---
M scripts/solve_disambiguation.py
M ROADMAP.rst
M pywikibot/tools/formatter.py
3 files changed, 21 insertions(+), 2 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/ROADMAP.rst b/ROADMAP.rst
index c95ddc6..a0e7f09 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -29,6 +29,7 @@
Deprecations
------------
+* 9.0.0: ``SequenceOutputter.output()`` is deprecated in favour of
:attr:`tools.formatter.SequenceOutputter.out` property
* 9.0.0: *nullcontext* context manager and *SimpleQueue* queue of :mod:`backports` are
derecated
* 8.4.0: *modules_only_mode* parameter of :class:`data.api.ParamInfo`, its
*paraminfo_keys* class attribute
and its preloaded_modules property will be removed
diff --git a/pywikibot/tools/formatter.py b/pywikibot/tools/formatter.py
index 7008347..6ad82f5 100644
--- a/pywikibot/tools/formatter.py
+++ b/pywikibot/tools/formatter.py
@@ -55,8 +55,13 @@
content = ''
return self.prefix + content + self.suffix
+ @deprecated('pywikibot.info(SequenceOutputter.out)', since='9.0.0')
def output(self) -> None:
- """Output the text of the current sequence."""
+ """Output the text of the current sequence.
+
+ .. deprecated:: 9.0
+ Use :func:`pywikibot.info` with *out* property
+ """
info(self.out)
diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
index 45e5956..ac7f4ad 100755
--- a/scripts/solve_disambiguation.py
+++ b/scripts/solve_disambiguation.py
@@ -1275,7 +1275,7 @@
self.opt.pos.sort(key=lambda x: x.lower())
else:
self.opt.pos.sort()
- SequenceOutputter(self.opt.pos).output()
+ pywikibot.info(SequenceOutputter(self.opt.pos).out)
gen = ReferringPageGeneratorWithIgnore(
page,
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/981376
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: I0dd4fdc006d7adde16f1aa22ff3fa0eee4c66831
Gerrit-Change-Number: 981376
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <dalangi-ctr(a)wikimedia.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged