diff --git a/packages/ess-migration-tool/newsfragments/1348.feature.md b/packages/ess-migration-tool/newsfragments/1348.feature.md new file mode 100644 index 00000000..b54d8fcc --- /dev/null +++ b/packages/ess-migration-tool/newsfragments/1348.feature.md @@ -0,0 +1 @@ +Use Rich library to display formatted tables for migration mappings, workers, secrets, and warnings in the CLI output. diff --git a/packages/ess-migration-tool/src/ess_migration_tool/rich_output.py b/packages/ess-migration-tool/src/ess_migration_tool/rich_output.py index 3b389cd6..def9638e 100644 --- a/packages/ess-migration-tool/src/ess_migration_tool/rich_output.py +++ b/packages/ess-migration-tool/src/ess_migration_tool/rich_output.py @@ -318,8 +318,7 @@ class ProgressReporter: # Pause for user input after each step (unless in quiet mode or testing) if not os.environ.get("PYTEST_CURRENT_TEST") and self.pretty_logger.level != logging.CRITICAL: self.pretty_logger.info(" Press Enter to continue...") - input() - self.pretty_logger.info("") + get_console().input() def report_success(self, output_dir: str, file_paths: list[str]) -> None: """Report successful completion. diff --git a/packages/ess-migration-tool/src/ess_migration_tool/utils.py b/packages/ess-migration-tool/src/ess_migration_tool/utils.py index e30697f8..43aa193a 100644 --- a/packages/ess-migration-tool/src/ess_migration_tool/utils.py +++ b/packages/ess-migration-tool/src/ess_migration_tool/utils.py @@ -507,8 +507,10 @@ def prompt_for_database_choice(pretty_logger: logging.Logger) -> bool: def press_enter_to_continue(pretty_logger: logging.Logger) -> None: if not is_quiet_mode(pretty_logger) and not os.environ.get("PYTEST_CURRENT_TEST"): print_prompt("Press Enter to continue...", logger=pretty_logger) - input() - print("") + if is_rich_enabled(): + get_console().input() + else: + input() def prompt_value(