diff --git a/scripts/wk/clone/ddrescue.py b/scripts/wk/clone/ddrescue.py index 6f5b9445..d1082b9c 100644 --- a/scripts/wk/clone/ddrescue.py +++ b/scripts/wk/clone/ddrescue.py @@ -172,6 +172,12 @@ class BlockPair(): # Set initial status self.set_initial_status() + def __getstate__(self): + """Override to allow pickling ddrescue.State() objects.""" + bp_state = self.__dict__.copy() + del bp_state['view_proc'] + return bp_state + def get_error_size(self) -> int: """Get error size in bytes, returns int.""" return self.size - self.get_rescued_size() @@ -680,14 +686,6 @@ class State(): cli.clear_screen() disk_menu = menus.disks() source_parts = [] - - # Set log - log.update_log_path( - dest_dir=self.log_dir, - dest_name='main', - keep_history=True, - timestamp=False, - ) self.ui.set_progress_file(str(self.progress_out)) # Set mode @@ -1984,6 +1982,8 @@ def source_or_destination_changed(state) -> bool: def main() -> None: """Main function for ddrescue TUI.""" args = docopt(DOCSTRING) + + # Log setup log_dir = log.format_log_path() log_dir = pathlib.Path( f'{log_dir.parent}/'