From 3df41d7a888bf5d02077b72754c12e6f484c9aab Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 11 Apr 2013 21:05:08 +0100 Subject: Fix progress reporting when --quiet --- desktop-cronish | 9 +++++---- tests/timeout.stderr | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/desktop-cronish b/desktop-cronish index 31dc563..0fd9676 100755 --- a/desktop-cronish +++ b/desktop-cronish @@ -42,6 +42,8 @@ class DesktopCronish(cliapp.Application): def process_args(self, args): self.ts = ttystatus.TerminalStatus(period=0.1) self.ts.format('%String(timestamp) %String(msg)') + if self.settings['quiet']: + self.ts.disable() self.jobs = {} self.previously = {} self.process_inputs(args) @@ -50,10 +52,9 @@ class DesktopCronish(cliapp.Application): def status(self, msg): logging.info(msg) - if not self.settings['quiet']: - self.ts['timestamp'] = time.strftime('%H:%M:%S') - self.ts['msg'] = msg - self.ts.flush() + self.ts['timestamp'] = time.strftime('%H:%M:%S') + self.ts['msg'] = msg + self.ts.flush() def process_input(self, filename): self.status('Loading jobs from %s' % filename) diff --git a/tests/timeout.stderr b/tests/timeout.stderr index a6741f6..acc9138 100644 --- a/tests/timeout.stderr +++ b/tests/timeout.stderr @@ -1 +1 @@ -ERROR: Job date: Command failed: timeout 1 sh -c sleep 1000 +ERROR: Job date: Command failed: sleep 1000 -- cgit v1.2.1