jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/705194 )
Change subject: [doc] Additional documentation for bot choice
......................................................................
[doc] Additional documentation for bot choice
Change-Id: I75dce3c9d20fec18e5a37aabc4e500bf10216bbe
---
M pywikibot/bot_choice.py
1 file changed, 17 insertions(+), 6 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot_choice.py b/pywikibot/bot_choice.py
index f6dd49f..a26fbad 100755
--- a/pywikibot/bot_choice.py
+++ b/pywikibot/bot_choice.py
@@ -1,4 +1,4 @@
-"""Choices for input_choice."""
+"""Options and Choices for :py:meth:`pywikibot.input_choice`."""
#
# (C) Pywikibot team, 2015-2021
#
@@ -51,6 +51,10 @@
"""
Create a text with the options formatted into it.
+ This static method is used by :py:meth:`pywikibot.input_choice`.
+ It calls :py:obj:`format` for all *options* to combine the
+ question for :py:meth:`pywikibot.input`.
+
:param text: Text into which options are to be formatted
:param options: Option instances to be formatted
:param default: filler for any option's 'default' placeholder
@@ -101,11 +105,18 @@
"""An option that never stops and can output on each question.
- :Note: OutputOption must have a an "out" property which returns a
- string for output method.
+ :py:meth:`pywikibot.input_choice` uses before_question attribute to
+ decide whether to output before or after the question.
+
+ .. note:: OutputOption must have an :py:obj:`out` property which
+ returns a string for
+ :py:meth:`userinterface output()
+ <pywikibot.userinterfaces._interface_base.ABUIC.output>`
+ method.
"""
- before_question = False
+ #: Place output before or after the question
+ before_question = False # type: bool
@property
def stop(self) -> bool:
@@ -118,11 +129,11 @@
@property
def out(self) -> str:
- """String to be used when selected and possibly before the question.
+ """String to be used when selected before or after the question.
:Note: This method is used by ui.input_choice instead of output().
- *New in version 6.2.*
+ .. versionadded:: 6.2
"""
return ''
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/705194
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: I75dce3c9d20fec18e5a37aabc4e500bf10216bbe
Gerrit-Change-Number: 705194
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/705172 )
Change subject: [cleanup] remove strm parameter of init_handlers
......................................................................
[cleanup] remove strm parameter of init_handlers
strm parameter of init_handlers was never used neither in compat
nor in core. There is no implementation for it.
Change-Id: I1f16e7bd34d7d1b661844c36ee3f2d03a8f48892
---
M pywikibot/bot.py
1 file changed, 6 insertions(+), 7 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 8f3b122..c450d55 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -169,6 +169,7 @@
deprecated_args,
issue_deprecation_warning,
redirect_func,
+ remove_last_args,
suppress_warnings,
)
from pywikibot.tools._logging import LoggingFormatter
@@ -300,7 +301,8 @@
return '{}.{}{}'.format(root, qualifier, ext)
-def init_handlers(strm=None):
+@remove_last_args(['strm'])
+def init_handlers():
"""Initialize logging system for terminal-based bots.
This function must be called before using pywikibot.output(); and must
@@ -329,12 +331,9 @@
Accordingly, do **not** use print statements in bot code; instead,
use pywikibot.output function.
- *New in version 6.2:* different logfiles are uses if multiple
- processes of the same script are are running.
-
- :param strm: Output stream. If None, re-uses the last stream if one
- was defined, otherwise uses sys.stderr
-
+ ..versionchanged:: 6.2
+ Different logfiles are used if multiple processes of the same
+ script are running.
"""
global _handlers_initialized
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/705172
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: I1f16e7bd34d7d1b661844c36ee3f2d03a8f48892
Gerrit-Change-Number: 705172
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged