summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-04-12 09:04:59 +0100
committerLars Wirzenius <liw@liw.fi>2013-04-12 09:04:59 +0100
commit2a58a974cc80902ddc71698885c19e8f1ebb775b (patch)
tree1c661be24a7a783f4e4a171afc5f6b0b131628fb
parenta03ef150b6dbdbe0b1d6b763ad164ffcdb396bae (diff)
downloaddesktop-cronish-2a58a974cc80902ddc71698885c19e8f1ebb775b.tar.gz
Tell what will be run after sleep
-rwxr-xr-xdesktop-cronish8
1 files changed, 4 insertions, 4 deletions
diff --git a/desktop-cronish b/desktop-cronish
index 0765bd2..58c2df7 100755
--- a/desktop-cronish
+++ b/desktop-cronish
@@ -67,7 +67,7 @@ class DesktopCronish(cliapp.Application):
max_jobs = self.settings['max-jobs']
while max_jobs == 0 or n < max_jobs:
job_name, when = self.choose_job()
- self.wait_until(when)
+ self.wait_until(when, job_name)
self.execute_job(job_name)
n += 1
self.status('Stopped executing after %d jobs' % n)
@@ -82,11 +82,11 @@ class DesktopCronish(cliapp.Application):
next_when = job_when
return next_job_name, next_when
- def wait_until(self, when):
+ def wait_until(self, when, for_what):
while self.now() < when:
seconds = when - self.now()
- t = time.localtime(when)
- self.status(time.strftime('Sleeping until %H:%M:%S', t))
+ t = time.strftime('%H:%M:%S', time.localtime(when))
+ self.status('Sleeping until %s for %s' % (t, for_what))
time.sleep(seconds)
def execute_job(self, job_name):