Don't emit regular sleeping announcements in Basic UI
They are too noisy in the Basic UI, but are still included in TTYUI. Reported by John Wiegley. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
parent
1b30ab896e
commit
f2a94af522
@ -31,5 +31,6 @@ Changes
|
|||||||
|
|
||||||
* Don't fail when ~/netrc is not readable by us.
|
* Don't fail when ~/netrc is not readable by us.
|
||||||
|
|
||||||
|
* Don't emit noisy regular sleeping announcements in Basic UI.
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
---------
|
---------
|
||||||
|
@ -84,3 +84,19 @@ class TTYUI(UIBase):
|
|||||||
else:
|
else:
|
||||||
UIBase.mainException(self)
|
UIBase.mainException(self)
|
||||||
|
|
||||||
|
def sleeping(self, sleepsecs, remainingsecs):
|
||||||
|
"""Sleep for sleepsecs, display remainingsecs to go.
|
||||||
|
|
||||||
|
Does nothing if sleepsecs <= 0.
|
||||||
|
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//60 != (remainingsecs-sleepsecs)//60:
|
||||||
|
self.logger.info("Next refresh in %.1f minutes" % (
|
||||||
|
remainingsecs/60.0))
|
||||||
|
time.sleep(sleepsecs)
|
||||||
|
return 0
|
||||||
|
@ -493,7 +493,7 @@ class UIBase(object):
|
|||||||
"""
|
"""
|
||||||
if sleepsecs > 0:
|
if sleepsecs > 0:
|
||||||
if remainingsecs//60 != (remainingsecs-sleepsecs)//60:
|
if remainingsecs//60 != (remainingsecs-sleepsecs)//60:
|
||||||
self.logger.info("Next refresh in %.1f minutes" % (
|
self.logger.debug("Next refresh in %.1f minutes" % (
|
||||||
remainingsecs/60.0))
|
remainingsecs/60.0))
|
||||||
time.sleep(sleepsecs)
|
time.sleep(sleepsecs)
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user