Skip to content

Commit

Permalink
Only output a sleeping notice once every minute
Browse files Browse the repository at this point in the history
Rather than every ten seconds, which is a bit chatty.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
  • Loading branch information
spaetz committed Sep 29, 2011
1 parent 93b0521 commit ac94de3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions offlineimap/ui/UIBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,14 @@ def sleeping(s, sleepsecs, remainingsecs):
"""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

0 comments on commit ac94de3

Please sign in to comment.