def input(self, message, **unused_kwargs):
# pylint: disable=no-self-use
"""Accept input from the user.
:param str message: message to display to the user
:param dict _kwargs: absorbs default / cli_args
:returns: tuple of (`code`, `input`) where
`code` - str display exit code
`input` - str of the user's input
:rtype: tuple
"""
ans = raw_input(
textwrap.fill(
"%s (Enter 'c' to cancel): " % message,
80,
break_long_words=False,
break_on_hyphens=False))
if ans == "c" or ans == "C":
return CANCEL, "-1"
else:
return OK, ans
评论列表
文章目录