Fix destination selection and title pane handling
This commit is contained in:
parent
7e6cfa1896
commit
a2c41fbaf2
1 changed files with 12 additions and 10 deletions
|
|
@ -348,9 +348,8 @@ class State():
|
|||
self.progress_out: pathlib.Path = self.log_dir.joinpath('progress.out')
|
||||
self.mode: str = '?'
|
||||
self.source: hw_disk.Disk | None = None
|
||||
self.working_dir: pathlib.Path = pathlib.Path()
|
||||
self.working_dir: pathlib.Path | None = None
|
||||
self.ui: tui.TUI = tui.TUI('Source')
|
||||
self.ui.add_title_pane('Destination')
|
||||
|
||||
def _add_block_pair(self, source: hw_disk.Disk, destination: pathlib.Path) -> None:
|
||||
"""Add BlockPair object and run safety checks."""
|
||||
|
|
@ -655,7 +654,7 @@ class State():
|
|||
keep_history=True,
|
||||
timestamp=False,
|
||||
)
|
||||
self.ui.set_progress_file(self.progress_out)
|
||||
self.ui.set_progress_file(str(self.progress_out))
|
||||
|
||||
# Set mode
|
||||
self.mode = set_mode(docopt_args)
|
||||
|
|
@ -1109,13 +1108,14 @@ class State():
|
|||
),
|
||||
source_str,
|
||||
)
|
||||
self.ui.add_title_pane(
|
||||
ansi.color_string(
|
||||
['Destination', '' if dest_exists else ' (Missing)'],
|
||||
['BLUE', 'RED'],
|
||||
),
|
||||
dest_str,
|
||||
)
|
||||
if dest_str:
|
||||
self.ui.add_title_pane(
|
||||
ansi.color_string(
|
||||
['Destination', '' if dest_exists else ' (Missing)'],
|
||||
['BLUE', 'RED'],
|
||||
),
|
||||
dest_str,
|
||||
)
|
||||
|
||||
|
||||
# Functions
|
||||
|
|
@ -1620,6 +1620,8 @@ def get_object(path) -> hw_disk.Disk | pathlib.Path:
|
|||
obj = None
|
||||
|
||||
# Bail early
|
||||
if path is None:
|
||||
return obj
|
||||
if not path:
|
||||
raise FileNotFoundError(f'Path provided does not exist: {path}')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue