From 79f1e3439c46c71f9dc4b54e29d47f2249f194fa Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Fri, 26 Feb 2021 16:59:10 +0000 Subject: [PATCH 1/3] tui: add warning about using with large flows * https://github.com/cylc/cylc-flow/issues/3527 --- cylc/flow/scripts/tui.py | 7 ++++++- cylc/flow/tui/app.py | 24 +++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/cylc/flow/scripts/tui.py b/cylc/flow/scripts/tui.py index 67933d5d349..fabff6ae01e 100644 --- a/cylc/flow/scripts/tui.py +++ b/cylc/flow/scripts/tui.py @@ -18,8 +18,13 @@ View and control running suites in the terminal. -(TUI = Terminal User Interface) +(Tui = Terminal User Interface) + +WARNING: Tui is experimental and may break with large flows. """ +# TODO: remove this warning once Tui is delta-driven +# https://github.com/cylc/cylc-flow/issues/3527 + from textwrap import indent from urwid import html_fragment diff --git a/cylc/flow/tui/app.py b/cylc/flow/tui/app.py index a7a8e46bb3d..db89035ffa3 100644 --- a/cylc/flow/tui/app.py +++ b/cylc/flow/tui/app.py @@ -322,7 +322,7 @@ def get_snapshot(self): }) except (ClientError, ClientTimeout) as exc: # catch network / client errors - self.set_header(('suite_error', str(exc))) + self.set_header([('suite_error', str(exc))]) return False if isinstance(data, list): @@ -331,7 +331,7 @@ def get_snapshot(self): message = data[0]['error']['message'] except (IndexError, KeyError): message = str(data) - self.set_header(('suite_error', message)) + self.set_header([('suite_error', message)]) return False if len(data['workflows']) != 1: @@ -353,7 +353,7 @@ def get_node_id(node): """ return node.get_value()['id_'] - def set_header(self, message): + def set_header(self, message: list): """Set the header message for this widget. Arguments: @@ -363,12 +363,18 @@ def set_header(self, message): """ # put in a one line gap - if isinstance(message, list): - message.append('\n') - elif isinstance(message, tuple): - message = (message[0], message[1] + '\n') - else: - message += '\n' + message.append('\n') + + # TODO: remove once Tui is delta-driven + # https://github.com/cylc/cylc-flow/issues/3527 + message.extend([ + ( + 'suite_error', + 'TUI is experimental and may break with large flows' + ), + '\n' + ]) + self.view.header = urwid.Text(message) def _update(self, *_): From 58f420751144bf2a63e1617f4ee22da114caf5d2 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Fri, 26 Feb 2021 17:00:05 +0000 Subject: [PATCH 2/3] shellchecker: skip git repo --- etc/bin/shellchecker | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/bin/shellchecker b/etc/bin/shellchecker index 38b82282978..8b114b36828 100755 --- a/etc/bin/shellchecker +++ b/etc/bin/shellchecker @@ -76,6 +76,7 @@ default () { # run a strict check on all "functional" scripts main '.' \ --exclude 'etc/bin/live-graph-movie.sh' \ + --exclude '.git' \ -- -e SC1090 } From 39788e975d49d24dea2bdbe41be44de85647bf10 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Mon, 1 Mar 2021 09:07:37 +0000 Subject: [PATCH 3/3] Update cylc/flow/scripts/tui.py Co-authored-by: Hilary James Oliver --- cylc/flow/scripts/tui.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cylc/flow/scripts/tui.py b/cylc/flow/scripts/tui.py index fabff6ae01e..333de02cb73 100644 --- a/cylc/flow/scripts/tui.py +++ b/cylc/flow/scripts/tui.py @@ -21,6 +21,8 @@ (Tui = Terminal User Interface) WARNING: Tui is experimental and may break with large flows. +An upcoming change to the way Tui receives data from the scheduler will make it +much more efficient in the future. """ # TODO: remove this warning once Tui is delta-driven # https://github.com/cylc/cylc-flow/issues/3527