Set ddrescue-tui EToC refresh rate in settings

This commit is contained in:
2Shirt 2019-03-20 15:48:01 -06:00
parent 28cea9697e
commit c022d3f9c6
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 3 additions and 2 deletions

View file

@ -416,8 +416,8 @@ class RecoveryState():
elif 'In Progress' not in self.status:
# Don't update when EToC is hidden
return
if now.second % 5 != 0:
# Limit updates to every 5 seconds
if now.second % ETOC_REFRESH_RATE != 0:
# Limit updates based on settings/ddrescue.py
return
self.etoc = 'Unknown'

View file

@ -35,6 +35,7 @@ DDRESCUE_SETTINGS = {
'--timeout': {'Enabled': True, 'Value': '5m', },
'-vvvv': {'Enabled': True, 'Hidden': True, },
}
ETOC_REFRESH_RATE = 30 # in seconds
REGEX_REMAINING_TIME = re.compile(
r'remaining time:'
r'\s*((?P<days>\d+)d)?'