Skip to content

Commit 08d9e32

Browse files
committed
Add utility functions and Exceptions
These functions will be used to handle some of the error state and warning messages produced when the scripts attempt to select a valid toolchain.
1 parent 2b75dfd commit 08d9e32

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tools/utils.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ class NotSupportedException(Exception):
296296
class InvalidReleaseTargetException(Exception):
297297
pass
298298

299+
class NoValidToolchainException(Exception):
300+
"""A class representing no valid toolchain configurations found on
301+
the system"""
302+
pass
303+
299304
def split_path(path):
300305
"""spilt a file name into it's directory name, base name, and extension
301306
@@ -597,3 +602,16 @@ def generate_update_filename(name, target):
597602
name,
598603
getattr(target, "OUTPUT_EXT_UPDATE", "bin")
599604
)
605+
606+
def print_end_warnings(end_warnings):
607+
""" Print a formatted list of warnings
608+
609+
Positional arguments:
610+
end_warnings - A list of warnings (strings) to print
611+
"""
612+
if end_warnings:
613+
warning_separator = "-" * 60
614+
print(warning_separator)
615+
for end_warning in end_warnings:
616+
print(end_warning)
617+
print(warning_separator)

0 commit comments

Comments
 (0)