Skip to content

Commit

Permalink
Fix pippin_status.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
OmegaLambda1998 committed Oct 5, 2023
1 parent 85ad5e8 commit bcb150b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pippin/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,18 @@ def get_task_dashboard(self, task):
status = "blocked"
return self.get_string_with_colour(task.name, status)

def get_dashboard_line(self, stage, tasks):
def get_dashboard_line(self, stage, tasks, prnt=True):
strings = [self.get_task_dashboard(task) for task in tasks]
line_width = 160

output = f"{stage:12s}"
for i, s in enumerate(strings):
if len(output + s) > line_width and i != len(strings) + 1:
self.logger.info(output)
output = " " * 12
if len(output.split("\n")[-1] + s) > line_width and i != len(strings) + 1:
if prnt:
self.logger.info(output)
output = " " * 12
else:
output += "\n" + (" " * 12)
output += s + " "

return output
Expand Down Expand Up @@ -285,7 +288,7 @@ def print_dashboard(self):
for name, task_class in zip(Manager.stages, Manager.task_order):
tasks = self.get_subtasks(task_class, all_tasks)
if tasks:
f.write(self.get_dashboard_line(name, tasks) + "\n")
f.write(self.get_dashboard_line(name, tasks, False) + "\n")
except:
self.logger.warning(f"Error opening {self.dashboard}")

Expand Down

0 comments on commit bcb150b

Please sign in to comment.