Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tui: warn about large flows #4102

Merged
merged 3 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cylc/flow/scripts/tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@

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.
oliver-sanders marked this conversation as resolved.
Show resolved Hide resolved
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

from textwrap import indent

from urwid import html_fragment
Expand Down
24 changes: 15 additions & 9 deletions cylc/flow/tui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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, *_):
Expand Down
1 change: 1 addition & 0 deletions etc/bin/shellchecker
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down