-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathlauncher.py
More file actions
executable file
·34 lines (28 loc) · 947 Bytes
/
Copy pathlauncher.py
File metadata and controls
executable file
·34 lines (28 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python3
# SPDX-License-Identifier: MIT
"""
This module is a launcher for the AMD Debug Tools package. It is meant for
launching various tools within the package without installation.
"""
import sys
import os
URL = "git://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git"
try:
import amd_debug
from amd_debug.common import fatal_error
except ModuleNotFoundError:
sys.exit(
f"\033[91m{sys.argv[0]} can not be run standalone.\n"
f"\033[0m\033[94mCheck out the full branch from {URL}\033[0m"
)
def main():
"""Main function to launch the appropriate tool based on the script name."""
try:
return amd_debug.launch_tool(os.path.basename(sys.argv[0]))
except ModuleNotFoundError as e:
fatal_error(
f"Missing dependency: {e}\n"
f"Run ./install_deps.py to install dependencies."
)
if __name__ == "__main__":
sys.exit(main())