From 2a58a974cc80902ddc71698885c19e8f1ebb775b Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 12 Apr 2013 09:04:59 +0100 Subject: Tell what will be run after sleep --- desktop-cronish | 8 ++++---- 1 file 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): -- cgit v1.2.1