jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/480126 )
Change subject: [cleanup] Deprecate tools.concat_options
......................................................................
[cleanup] Deprecate tools.concat_options
tools.concat_options isn't used anymore.
Deprecate it because bot_choice.Option and its subclasses should be used
instead.
Change-Id: Ia396c01bbcf5ac86e41efd89af8a0d39220f9f3a
---
M pywikibot/tools/__init__.py
1 file changed, 24 insertions(+), 23 deletions(-)
Approvals:
Zhuyifei1999: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index e68e9d5..76e0f7a 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -582,29 +582,6 @@
__setitem__ = update
-def concat_options(message, line_length, options):
- """Concatenate options."""
- indent = len(message) + 2
- line_length -= indent
- option_msg = ''
- option_line = ''
- for option in options:
- if option_line:
- option_line += ', '
- # +1 for ','
- if len(option_line) + len(option) + 1 > line_length:
- if option_msg:
- option_msg += '\n' + ' ' * indent
- option_msg += option_line[:-1] # remove space
- option_line = ''
- option_line += option
- if option_line:
- if option_msg:
- option_msg += '\n' + ' ' * indent
- option_msg += option_line
- return '{0} ({1}):'.format(message, option_msg)
-
-
class LazyRegex(object):
"""
@@ -2106,6 +2083,30 @@
setattr(self._wrapped, name, value)
+@deprecated('bot_choice.Option and its subclasses', since='20181217')
+def concat_options(message, line_length, options):
+ """DEPRECATED. Concatenate options."""
+ indent = len(message) + 2
+ line_length -= indent
+ option_msg = ''
+ option_line = ''
+ for option in options:
+ if option_line:
+ option_line += ', '
+ # +1 for ','
+ if len(option_line) + len(option) + 1 > line_length:
+ if option_msg:
+ option_msg += '\n' + ' ' * indent
+ option_msg += option_line[:-1] # remove space
+ option_line = ''
+ option_line += option
+ if option_line:
+ if option_msg:
+ option_msg += '\n' + ' ' * indent
+ option_msg += option_line
+ return '{0} ({1}):'.format(message, option_msg)
+
+
wrapper = ModuleDeprecationWrapper(__name__)
wrapper._add_deprecated_attr('Counter', collections.Counter, since='20160111')
wrapper._add_deprecated_attr('OrderedDict', collections.OrderedDict,
--
To view, visit https://gerrit.wikimedia.org/r/480126
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia396c01bbcf5ac86e41efd89af8a0d39220f9f3a
Gerrit-Change-Number: 480126
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Zhuyifei1999 <[email protected]>
Gerrit-Reviewer: jenkins-bot (75)
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits