From 62bf3412a20b97626f179d7910f01966a88707ac Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Mon, 25 Jan 2016 16:39:38 +0000 Subject: [PATCH] Added a status (yellow) for when a job is paused. --- tools.py | 7 ++++--- vigil | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tools.py b/tools.py index 2be39b9..fd909b6 100644 --- a/tools.py +++ b/tools.py @@ -47,14 +47,15 @@ _STATUS_COLORS = [(Status.ok, termstr.Color.green), (Status.problem, termstr.Color.red), (Status.normal, termstr.Color.white), (Status.not_applicable, termstr.Color.grey_100), - (Status.running, termstr.Color.light_blue)] + (Status.running, termstr.Color.light_blue), + (Status.paused, termstr.Color.yellow)] STATUS_MEANINGS = [ (Status.normal, "Normal"), (Status.ok, "Ok"), (Status.problem, "Problem"), (Status.not_applicable, "Not applicable"), - (Status.running, "Running"), (Status.pending, "Pending"), - (Status.error, "Error")] + (Status.running, "Running"), (Status.paused, "Paused"), + (Status.pending, "Pending"), (Status.error, "Error")] _STATUS_TO_TERMSTR = { status: termstr.TermStr(" ", termstr.CharStyle(fg_color=color)) for status, color in _STATUS_COLORS} diff --git a/vigil b/vigil index dbb7b3f..57d3e8e 100755 --- a/vigil +++ b/vigil @@ -829,8 +829,12 @@ class Runner: def pause(self): self.worker.pause() + if self.result.status == tools.Status.running: + self.result.set_status(tools.Status.paused) def continue_(self): + if self.result.status == tools.Status.paused: + self.result.set_status(tools.Status.running) self.worker.continue_()