jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/428927 )
Change subject: [IMPR] Wrap formatted options of an option bar to prevent ugly line
breaks
......................................................................
[IMPR] Wrap formatted options of an option bar to prevent ugly line breaks
e.g. a lot of input_choice options may break inside the option text;
this patch solves this.
Change-Id: I0e8f7398592795e0277e84437e783acd044e8d50
---
M pywikibot/bot_choice.py
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
Dvorapa: Looks good to me, but someone else must approve
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot_choice.py b/pywikibot/bot_choice.py
index ddc04ec..db6b1bd 100755
--- a/pywikibot/bot_choice.py
+++ b/pywikibot/bot_choice.py
@@ -7,6 +7,8 @@
#
from __future__ import absolute_import, unicode_literals
+from textwrap import fill
+
import pywikibot
@@ -40,7 +42,8 @@
formatted_options = []
for option in options:
formatted_options.append(option.format(default=default))
- return '{0} ({1})'.format(text, ', '.join(formatted_options))
+ return fill('{0} ({1})'.format(text, ',
'.join(formatted_options)),
+ width=77)
@property
def stop(self):
--
To view, visit
https://gerrit.wikimedia.org/r/428927
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0e8f7398592795e0277e84437e783acd044e8d50
Gerrit-Change-Number: 428927
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>