From ac94de3449a5322e08ff22403a65318708acc123 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Thu, 29 Sep 2011 17:58:07 +0200 Subject: [PATCH] Only output a sleeping notice once every minute Rather than every ten seconds, which is a bit chatty. Signed-off-by: Sebastian Spaeth --- offlineimap/ui/UIBase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/offlineimap/ui/UIBase.py b/offlineimap/ui/UIBase.py index b5a75dd..4e53d32 100644 --- a/offlineimap/ui/UIBase.py +++ b/offlineimap/ui/UIBase.py @@ -407,14 +407,14 @@ class UIBase: """Sleep for sleepsecs, display remainingsecs to go. Does nothing if sleepsecs <= 0. - Display a message on the screen every 10 seconds. + Display a message on the screen if we pass a full minute. This implementation in UIBase does not support this, but some implementations return 0 for successful sleep and 1 for an 'abort', ie a request to sync immediately. """ if sleepsecs > 0: - if remainingsecs % 10 == 0: - s._msg("Next refresh in %d seconds" % remainingsecs) + if remainingsecs//60 != (remainingsecs-sleepsecs)//60: + s._msg("Next refresh in %.1f minutes" % (remainingsecs/60.0)) time.sleep(sleepsecs) return 0