[KERNEL][TEST] Refactor tool check

git-svn-id: svn://kolibrios.org@9311 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Magomed Kostoev (mkostoevr) 2021-11-25 20:32:59 +00:00
parent 2510534664
commit 2c7ecbb305
1 changed files with 7 additions and 3 deletions

View File

@ -50,8 +50,12 @@ def check_tools(tools):
not_exists.append((name, package))
if len(not_exists) != 0:
log("Sorry, I can't find some tools:")
max_name_len = len("name")
max_package_name_len = len("package")
header_name = "Name"
header_package = "Package (probably)"
max_name_len = len(header_name)
max_package_name_len = len(header_package)
for name, package in not_exists:
if len(package) > max_package_name_len:
max_package_name_len = len(package)
@ -65,7 +69,7 @@ def check_tools(tools):
log(f" +-{'-' * max_name_len}-+-{'-' * max_package_name_len}-+")
draw_line()
draw_row("Name", "Package")
draw_row(header_name, header_package)
draw_line()
for name, package in not_exists:
draw_row(name, package)