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):
pywikibot-commits@lists.wikimedia.org