Added overall status line to ddrescue-tui
This commit is contained in:
parent
95338f1df7
commit
c96ffc5f59
2 changed files with 15 additions and 0 deletions
|
|
@ -261,6 +261,7 @@ class RecoveryState():
|
||||||
self.rescued = 0
|
self.rescued = 0
|
||||||
self.resumed = False
|
self.resumed = False
|
||||||
self.started = False
|
self.started = False
|
||||||
|
self.status = 'Inactive'
|
||||||
self.total_size = 0
|
self.total_size = 0
|
||||||
if mode not in ('clone', 'image'):
|
if mode not in ('clone', 'image'):
|
||||||
raise GenericError('Unsupported mode')
|
raise GenericError('Unsupported mode')
|
||||||
|
|
@ -768,6 +769,13 @@ def menu_main(state):
|
||||||
|
|
||||||
# Show menu
|
# Show menu
|
||||||
while True:
|
while True:
|
||||||
|
# Update status
|
||||||
|
if state.finished:
|
||||||
|
state.status = ' Finished'
|
||||||
|
else:
|
||||||
|
state.status = ' Inactive'
|
||||||
|
update_sidepane(state)
|
||||||
|
|
||||||
# Update entries
|
# Update entries
|
||||||
for opt in main_options:
|
for opt in main_options:
|
||||||
opt['Name'] = '[{}] {}'.format(
|
opt['Name'] = '[{}] {}'.format(
|
||||||
|
|
@ -922,6 +930,7 @@ def run_ddrescue(state, pass_settings):
|
||||||
"""Run ddrescue pass."""
|
"""Run ddrescue pass."""
|
||||||
return_code = -1
|
return_code = -1
|
||||||
aborted = False
|
aborted = False
|
||||||
|
state.status = ' In Progress'
|
||||||
|
|
||||||
if state.finished:
|
if state.finished:
|
||||||
clear_screen()
|
clear_screen()
|
||||||
|
|
@ -1036,6 +1045,9 @@ def run_ddrescue(state, pass_settings):
|
||||||
# Done
|
# Done
|
||||||
if str(return_code) != '0':
|
if str(return_code) != '0':
|
||||||
# Pause on errors
|
# Pause on errors
|
||||||
|
state.status = ' {YELLOW}NEEDS ATTENTION{CLEAR}'.format(**COLORS)
|
||||||
|
state.status = state.status.replace('33m', '33;5m')
|
||||||
|
update_sidepane(state)
|
||||||
pause('Press Enter to return to main menu... ')
|
pause('Press Enter to return to main menu... ')
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
|
|
@ -1292,6 +1304,7 @@ def update_sidepane(state):
|
||||||
output.append(' {BLUE}Cloning Status{CLEAR}'.format(**COLORS))
|
output.append(' {BLUE}Cloning Status{CLEAR}'.format(**COLORS))
|
||||||
else:
|
else:
|
||||||
output.append(' {BLUE}Imaging Status{CLEAR}'.format(**COLORS))
|
output.append(' {BLUE}Imaging Status{CLEAR}'.format(**COLORS))
|
||||||
|
output.append(state.status)
|
||||||
output.append('─────────────────────')
|
output.append('─────────────────────')
|
||||||
|
|
||||||
# Overall progress
|
# Overall progress
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
# Wizard Kit: Settings - ddrescue-tui
|
# Wizard Kit: Settings - ddrescue-tui
|
||||||
|
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
# General
|
# General
|
||||||
RECOMMENDED_FSTYPES = ['ext3', 'ext4', 'xfs']
|
RECOMMENDED_FSTYPES = ['ext3', 'ext4', 'xfs']
|
||||||
USAGE = """ {script_name} clone [source [destination]]
|
USAGE = """ {script_name} clone [source [destination]]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue