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.progress_out: pathlib.Path = self.log_dir.joinpath('progress.out')
|
||||||
self.mode: str = '?'
|
self.mode: str = '?'
|
||||||
self.source: hw_disk.Disk | None = None
|
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: tui.TUI = tui.TUI('Source')
|
||||||
self.ui.add_title_pane('Destination')
|
|
||||||
|
|
||||||
def _add_block_pair(self, source: hw_disk.Disk, destination: pathlib.Path) -> None:
|
def _add_block_pair(self, source: hw_disk.Disk, destination: pathlib.Path) -> None:
|
||||||
"""Add BlockPair object and run safety checks."""
|
"""Add BlockPair object and run safety checks."""
|
||||||
|
|
@ -655,7 +654,7 @@ class State():
|
||||||
keep_history=True,
|
keep_history=True,
|
||||||
timestamp=False,
|
timestamp=False,
|
||||||
)
|
)
|
||||||
self.ui.set_progress_file(self.progress_out)
|
self.ui.set_progress_file(str(self.progress_out))
|
||||||
|
|
||||||
# Set mode
|
# Set mode
|
||||||
self.mode = set_mode(docopt_args)
|
self.mode = set_mode(docopt_args)
|
||||||
|
|
@ -1109,6 +1108,7 @@ class State():
|
||||||
),
|
),
|
||||||
source_str,
|
source_str,
|
||||||
)
|
)
|
||||||
|
if dest_str:
|
||||||
self.ui.add_title_pane(
|
self.ui.add_title_pane(
|
||||||
ansi.color_string(
|
ansi.color_string(
|
||||||
['Destination', '' if dest_exists else ' (Missing)'],
|
['Destination', '' if dest_exists else ' (Missing)'],
|
||||||
|
|
@ -1620,6 +1620,8 @@ def get_object(path) -> hw_disk.Disk | pathlib.Path:
|
||||||
obj = None
|
obj = None
|
||||||
|
|
||||||
# Bail early
|
# Bail early
|
||||||
|
if path is None:
|
||||||
|
return obj
|
||||||
if not path:
|
if not path:
|
||||||
raise FileNotFoundError(f'Path provided does not exist: {path}')
|
raise FileNotFoundError(f'Path provided does not exist: {path}')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue