From 3bae980020e7581397f194b1c2d4e42149015747 Mon Sep 17 00:00:00 2001 From: Sebastiaan Huber Date: Mon, 24 Oct 2022 16:49:19 +0200 Subject: [PATCH] Add wrapping for exit code messages. Also move required messages for inputs/outputs to bottom. --- aiida/cmdline/utils/common.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/aiida/cmdline/utils/common.py b/aiida/cmdline/utils/common.py index 501f431d8f..7d777b3794 100644 --- a/aiida/cmdline/utils/common.py +++ b/aiida/cmdline/utils/common.py @@ -448,7 +448,6 @@ def build_entries(ports): if process_spec.inputs: echo.echo('\nInputs:', fg=echo.COLORS['report'], bold=True) - echo.echo(style('Required inputs are displayed in bold red\n', italic=True)) table = [] @@ -457,10 +456,10 @@ def build_entries(ports): if table: echo.echo(tabulate(table, tablefmt='plain', colalign=('right',))) + echo.echo(style('\nRequired inputs are displayed in bold red.\n', italic=True)) if process_spec.outputs: - echo.echo('\nOutputs:', fg=echo.COLORS['report'], bold=True) - echo.echo(style('Required outputs are displayed in bold red\n', italic=True)) + echo.echo('Outputs:', fg=echo.COLORS['report'], bold=True) table = [] @@ -469,9 +468,10 @@ def build_entries(ports): if table: echo.echo(tabulate(table, tablefmt='plain', colalign=('right',))) + echo.echo(style('\nRequired outputs are displayed in bold red.\n', italic=True)) if process_spec.exit_codes: - echo.echo('\nExit codes:\n', fg=echo.COLORS['report'], bold=True) + echo.echo('Exit codes:\n', fg=echo.COLORS['report'], bold=True) table = [('0', 'The process finished successfully.')] @@ -480,7 +480,7 @@ def build_entries(ports): status = style(exit_code.status, bold=True, fg='red') else: status = exit_code.status - table.append((status, exit_code.message)) + table.append((status, '\n'.join(textwrap.wrap(exit_code.message, width=75)))) echo.echo(tabulate(table, tablefmt='plain')) echo.echo(style('\nExit codes that invalidate the cache are marked in bold red.\n', italic=True))