From 2ef2e4d039ea6169e68e1c8bd101303e58d85c95 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 16 Nov 2021 06:37:59 -0500 Subject: [PATCH] Fix gathered output with non-rectangular geometry If we don't have a nice rectangular count of systems, the last row must tolerate index error in column. --- confluent_client/confluent/screensqueeze.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/confluent_client/confluent/screensqueeze.py b/confluent_client/confluent/screensqueeze.py index 0b863102..6e8f0c99 100644 --- a/confluent_client/confluent/screensqueeze.py +++ b/confluent_client/confluent/screensqueeze.py @@ -69,8 +69,11 @@ class ScreenPrinter(object): columns = [self.nodelist[x:x+currheight] for x in range(0, len(self.nodelist), currheight)] for currow in range(0, len(columns[0])): for col in columns: - node = col[currow] - sys.stdout.write(fieldformat.format(node, self.nodeoutput[node])) + try: + node = col[currow] + sys.stdout.write(fieldformat.format(node, self.nodeoutput[node])) + except IndexError: + break sys.stdout.write('\n') else: for node in self.nodelist: