Skip to content

Commit 5db3a7c

Browse files
authored
Added file=sys.stderr in some prints (#157)
1 parent 2e5355b commit 5db3a7c

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

src/fprime_gds/executables/comm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def main():
6464
)
6565
fprime_gds.common.communication.checksum = args.checksum_type
6666
if args.comm_adapter == "none":
67-
print("[ERROR] Comm adapter set to 'none'. Nothing to do but exit.")
67+
print("[ERROR] Comm adapter set to 'none'. Nothing to do but exit.", file=sys.stderr)
6868
sys.exit(-1)
6969

7070
# Create the handling components for either side of this script, adapter for hardware, and ground for the GDS side

src/fprime_gds/executables/run_deployment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def main():
168168
if parsed_args.adapter == "ip":
169169
launchers.append(launch_app)
170170
else:
171-
print("[WARNING] App cannot be auto-launched without IP adapter")
171+
print("[WARNING] App cannot be auto-launched without IP adapter", file=sys.stderr)
172172

173173
# Launch the desired GUI package
174174
if parsed_args.gui == "html":

src/fprime_gds/executables/utils.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ def get_artifacts_root() -> Path:
146146
ini_settings = IniSettings.load(ini_file)
147147
except FprimeLocationUnknownException:
148148
print(
149-
"[ERROR] Not in fprime project and no deployment path provided, unable to find dictionary and/or app"
149+
"[ERROR] Not in fprime project and no deployment path provided, unable to find dictionary and/or app",
150+
file=sys.stderr
150151
)
151152
sys.exit(-1)
152153
except FprimeSettingsException as e:
153-
print("[ERROR]", e)
154+
print("[ERROR]", e, file=sys.stderr)
154155
sys.exit(-1)
155156
assert (
156157
"install_destination" in ini_settings
@@ -165,17 +166,18 @@ def find_app(root: Path) -> Path:
165166
bin_dir = root / "bin"
166167

167168
if not bin_dir.exists():
168-
print(f"[ERROR] binary location {bin_dir} does not exist")
169+
print(f"[ERROR] binary location {bin_dir} does not exist", file=sys.stderr)
169170
sys.exit(-1)
170171

171172
files = [child for child in bin_dir.iterdir() if child.is_file()]
172173
if not files:
173-
print(f"[ERROR] App not found in {bin_dir}")
174+
print(f"[ERROR] App not found in {bin_dir}", file=sys.stderr)
174175
sys.exit(-1)
175176

176177
if len(files) > 1:
177178
print(
178-
f"[ERROR] Multiple app candidates in binary location {bin_dir}. Specify app manually with --app."
179+
f"[ERROR] Multiple app candidates in binary location {bin_dir}. Specify app manually with --app.",
180+
file=sys.stderr
179181
)
180182
sys.exit(-1)
181183

@@ -186,7 +188,7 @@ def find_dict(root: Path) -> Path:
186188
dict_dir = root / "dict"
187189

188190
if not dict_dir.exists():
189-
print(f"[ERROR] dictionary location {dict_dir} does not exist")
191+
print(f"[ERROR] dictionary location {dict_dir} does not exist", file=sys.stderr)
190192
sys.exit(-1)
191193

192194
files = [
@@ -196,12 +198,13 @@ def find_dict(root: Path) -> Path:
196198
]
197199

198200
if not files:
199-
print(f"[ERROR] No xml dictionary found in dictionary location {dict_dir}")
201+
print(f"[ERROR] No xml dictionary found in dictionary location {dict_dir}", file=sys.stderr)
200202
sys.exit(-1)
201203

202204
if len(files) > 1:
203205
print(
204-
f"[ERROR] Multiple xml dictionaries found in dictionary location {dict_dir}. Specify dictionary manually with --dictionary."
206+
f"[ERROR] Multiple xml dictionaries found in dictionary location {dict_dir}. Specify dictionary manually with --dictionary.",
207+
file=sys.stderr
205208
)
206209
sys.exit(-1)
207210

0 commit comments

Comments
 (0)