@@ -55,17 +55,19 @@ def __init__(self, outfile):
55
55
super (FileDisplay , self ).__init__ ()
56
56
self .outfile = outfile
57
57
58
- def notification (self , message , pause = True ):
58
+ def notification (self , message , pause = True , wrap = True ):
59
59
# pylint: disable=unused-argument
60
60
"""Displays a notification and waits for user acceptance.
61
61
62
62
:param str message: Message to display
63
63
:param bool pause: Whether or not the program should pause for the
64
64
user's confirmation
65
+ :param bool wrap: Whether or not the application should wrap text
65
66
66
67
"""
67
68
side_frame = "-" * 79
68
- message = _wrap_lines (message )
69
+ if wrap :
70
+ message = _wrap_lines (message )
69
71
self .outfile .write (
70
72
"{line}{frame}{line}{msg}{line}{frame}{line}" .format (
71
73
line = os .linesep , frame = side_frame , msg = message ))
@@ -322,16 +324,18 @@ def _interaction_fail(self, message, cli_flag, extra=""):
322
324
msg += "\n \n (You can set this with the {0} flag)" .format (cli_flag )
323
325
raise errors .MissingCommandlineFlag (msg )
324
326
325
- def notification (self , message , pause = False ):
327
+ def notification (self , message , pause = False , wrap = True ):
326
328
# pylint: disable=unused-argument
327
329
"""Displays a notification without waiting for user acceptance.
328
330
329
331
:param str message: Message to display to stdout
330
332
:param bool pause: The NoninteractiveDisplay waits for no keyboard
333
+ :param bool wrap: Whether or not the application should wrap text
331
334
332
335
"""
333
336
side_frame = "-" * 79
334
- message = _wrap_lines (message )
337
+ if wrap :
338
+ message = _wrap_lines (message )
335
339
self .outfile .write (
336
340
"{line}{frame}{line}{msg}{line}{frame}{line}" .format (
337
341
line = os .linesep , frame = side_frame , msg = message ))
0 commit comments