Skip to content

Commit

Permalink
play: print the logo to the user's terminal only (cylc#6170)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-sanders authored Jun 27, 2024
1 parent 22cd58b commit 747e2af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions changes.d/fix.6170.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix an issue where the Cylc logo could appear in the workflow log.
12 changes: 8 additions & 4 deletions cylc/flow/scheduler_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,12 @@ async def scheduler_cli(
# upgrade the workflow DB (after user has confirmed upgrade)
_upgrade_database(db_file)

# re-execute on another host if required
_distribute(options.host, workflow_id_raw, workflow_id, options.color)

# print the start message
_print_startup_message(options)

# re-execute on another host if required
_distribute(options.host, workflow_id_raw, workflow_id, options.color)

# setup the scheduler
# NOTE: asyncio.run opens an event loop, runs your coro,
# then shutdown async generators and closes the event loop
Expand Down Expand Up @@ -561,10 +561,14 @@ def _upgrade_database(db_file: Path) -> None:


def _print_startup_message(options):
"""Print the Cylc header including the CLI logo."""
"""Print the Cylc header including the CLI logo to the user's terminal."""
if (
cylc.flow.flags.verbosity > -1
and (options.no_detach or options.format == 'plain')
# don't print the startup message on reinvocation (note
# --host=localhost is the best indication we have that reinvokation has
# happened)
and options.host != 'localhost'
):
print(
cparse(
Expand Down

0 comments on commit 747e2af

Please sign in to comment.