Skip to content

Commit f3cdb3f

Browse files
committed
app: Add optional end argument to banner print methods
Allow passing a custom end to banner methods. This is useful for example to print a carriage return. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent c8e0337 commit f3cdb3f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/west/commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,16 +440,16 @@ def inf(self, *args, colorize: bool = False, end: str = '\n'):
440440
if colorize:
441441
self._reset_colors(sys.stdout)
442442

443-
def banner(self, *args):
443+
def banner(self, *args, end: str = '\n'):
444444
'''Prints args as a "banner" using inf().
445445
446446
The args are prefixed with '=== ' and colorized by default.'''
447-
self.inf('===', *args, colorize=True)
447+
self.inf('===', *args, colorize=True, end=end)
448448

449-
def small_banner(self, *args):
449+
def small_banner(self, *args, end: str = '\n'):
450450
'''Prints args as a smaller banner(), i.e. prefixed with '-- ' and
451451
not colorized.'''
452-
self.inf('---', *args, colorize=False)
452+
self.inf('---', *args, colorize=False, end=end)
453453

454454
def wrn(self, *args, end: str = '\n'):
455455
'''Print a warning.

0 commit comments

Comments
 (0)