From 0f0c47bbe48be6406db2d9580edf3b6f4b52eb8a Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Fri, 20 Dec 2019 12:54:42 -0700 Subject: [PATCH] Force selecting at least one partition/device --- scripts/wk/hw/ddrescue.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/wk/hw/ddrescue.py b/scripts/wk/hw/ddrescue.py index 2ea0e4a2..6e5bc06b 100644 --- a/scripts/wk/hw/ddrescue.py +++ b/scripts/wk/hw/ddrescue.py @@ -138,6 +138,8 @@ class State(): if not self.source: self.source = select_disk('Source') source_parts = select_disk_parts(mode, self.source) + self.update_top_panes() + std.pause() # Select destination self.destination = get_object(docopt_args['']) @@ -146,6 +148,7 @@ class State(): self.destination = select_disk('Destination', self.source) elif mode == 'Image': self.destination = select_path('Destination') + self.update_top_panes() # Update panes self.panes['Progress'] = tmux.split_window( @@ -153,7 +156,6 @@ class State(): watch_file=f'{self.log_dir}/progress.out', ) self.update_progress_pane() - self.update_top_panes() def init_tmux(self): """Initialize tmux layout.""" @@ -585,7 +587,9 @@ def select_disk_parts(prompt, disk): for option in menu.options.values(): option['Selected'] = False elif 'Proceed' in selection: - break + if any([option['Selected'] for option in menu.options.values()]): + # At least one partition/device selected/device selected + break elif 'Quit' in selection: raise std.GenericAbort()