Skip to content

Commit

Permalink
Changed delay operations to log interactively rather than silently
Browse files Browse the repository at this point in the history
  • Loading branch information
horshack-dpreview committed Aug 29, 2020
1 parent 644ece8 commit c8b62c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion canomate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,14 +1356,14 @@ def convertTimeStrToSeconds(timeStr, fHandleConversionExeptions=True):
def delayWithConsoleMessage(delaySecs, delayReasonDesc=""):
if delaySecs > 0:
delayReasonStr = "(Reason: {:s})".format(delayReasonDesc) if delayReasonDesc != "" else ""
applog_i_nc("Delaying for {:.2f} seconds {:s}".format(delaySecs, delayReasonStr))
secsRemaining = delaySecs
while secsRemaining > 0:
secsDelayThisIteration = min(secsRemaining, 1)
consoleWriteLine("Delaying, {:.2f} seconds left {:}".format(secsRemaining, delayReasonStr))
time.sleep(secsDelayThisIteration)
secsRemaining -= secsDelayThisIteration
consoleClearLine()
applog_i("Delayed for {:.2f} seconds {:s}".format(delaySecs, delayReasonStr))

#
# Writes a message directly to console (stdout) without newline. This is used
Expand Down

0 comments on commit c8b62c3

Please sign in to comment.