summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-04-11 21:05:08 +0100
committerLars Wirzenius <liw@liw.fi>2013-04-11 21:05:08 +0100
commit3df41d7a888bf5d02077b72754c12e6f484c9aab (patch)
treed54611feb5372bce2ccb9602c34aefd2e4560e3d
parent1bb1bd5e2d3ff0e1157ab3a8b38d7d013bbe533e (diff)
downloaddesktop-cronish-3df41d7a888bf5d02077b72754c12e6f484c9aab.tar.gz
Fix progress reporting when --quiet
-rwxr-xr-xdesktop-cronish9
-rw-r--r--tests/timeout.stderr2
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