From 14e6550ac702cf54891a5313c4f29087802ff894 Mon Sep 17 00:00:00 2001 From: Simone Morettini Date: Fri, 15 Dec 2023 10:41:26 +0000 Subject: [PATCH] Added file=sys.stderr in some prints --- src/fprime_gds/executables/comm.py | 2 +- src/fprime_gds/executables/run_deployment.py | 2 +- src/fprime_gds/executables/utils.py | 19 +++++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/fprime_gds/executables/comm.py b/src/fprime_gds/executables/comm.py index ff3d687e..1cabd25b 100644 --- a/src/fprime_gds/executables/comm.py +++ b/src/fprime_gds/executables/comm.py @@ -64,7 +64,7 @@ def main(): ) fprime_gds.common.communication.checksum = args.checksum_type if args.comm_adapter == "none": - print("[ERROR] Comm adapter set to 'none'. Nothing to do but exit.") + print("[ERROR] Comm adapter set to 'none'. Nothing to do but exit.", file=sys.stderr) sys.exit(-1) # Create the handling components for either side of this script, adapter for hardware, and ground for the GDS side diff --git a/src/fprime_gds/executables/run_deployment.py b/src/fprime_gds/executables/run_deployment.py index 0b9b9a83..f0599505 100644 --- a/src/fprime_gds/executables/run_deployment.py +++ b/src/fprime_gds/executables/run_deployment.py @@ -168,7 +168,7 @@ def main(): if parsed_args.adapter == "ip": launchers.append(launch_app) else: - print("[WARNING] App cannot be auto-launched without IP adapter") + print("[WARNING] App cannot be auto-launched without IP adapter", file=sys.stderr) # Launch the desired GUI package if parsed_args.gui == "html": diff --git a/src/fprime_gds/executables/utils.py b/src/fprime_gds/executables/utils.py index 5acc1b2e..e81bfa6e 100644 --- a/src/fprime_gds/executables/utils.py +++ b/src/fprime_gds/executables/utils.py @@ -146,11 +146,12 @@ def get_artifacts_root() -> Path: ini_settings = IniSettings.load(ini_file) except FprimeLocationUnknownException: print( - "[ERROR] Not in fprime project and no deployment path provided, unable to find dictionary and/or app" + "[ERROR] Not in fprime project and no deployment path provided, unable to find dictionary and/or app", + file=sys.stderr ) sys.exit(-1) except FprimeSettingsException as e: - print("[ERROR]", e) + print("[ERROR]", e, file=sys.stderr) sys.exit(-1) assert ( "install_destination" in ini_settings @@ -165,17 +166,18 @@ def find_app(root: Path) -> Path: bin_dir = root / "bin" if not bin_dir.exists(): - print(f"[ERROR] binary location {bin_dir} does not exist") + print(f"[ERROR] binary location {bin_dir} does not exist", file=sys.stderr) sys.exit(-1) files = [child for child in bin_dir.iterdir() if child.is_file()] if not files: - print(f"[ERROR] App not found in {bin_dir}") + print(f"[ERROR] App not found in {bin_dir}", file=sys.stderr) sys.exit(-1) if len(files) > 1: print( - f"[ERROR] Multiple app candidates in binary location {bin_dir}. Specify app manually with --app." + f"[ERROR] Multiple app candidates in binary location {bin_dir}. Specify app manually with --app.", + file=sys.stderr ) sys.exit(-1) @@ -186,7 +188,7 @@ def find_dict(root: Path) -> Path: dict_dir = root / "dict" if not dict_dir.exists(): - print(f"[ERROR] dictionary location {dict_dir} does not exist") + print(f"[ERROR] dictionary location {dict_dir} does not exist", file=sys.stderr) sys.exit(-1) files = [ @@ -196,12 +198,13 @@ def find_dict(root: Path) -> Path: ] if not files: - print(f"[ERROR] No xml dictionary found in dictionary location {dict_dir}") + print(f"[ERROR] No xml dictionary found in dictionary location {dict_dir}", file=sys.stderr) sys.exit(-1) if len(files) > 1: print( - f"[ERROR] Multiple xml dictionaries found in dictionary location {dict_dir}. Specify dictionary manually with --dictionary." + f"[ERROR] Multiple xml dictionaries found in dictionary location {dict_dir}. Specify dictionary manually with --dictionary.", + file=sys.stderr ) sys.exit(-1)