mirror of
https://github.com/Z4nzu/hackingtool
synced 2026-05-22 16:39:40 +00:00
Fix is_installed crash on sub-collections (OtherTools)
OtherTools.TOOLS contains HackingToolsCollection instances (like SocialMediaBruteforceTools) which don't have the is_installed property. - Guard is_installed access with hasattr() in both the status column and the not_installed count for Install All - Sub-collections show blank status; individual tools show ✔/✘
This commit is contained in:
parent
511a651e0a
commit
91135bdf5f
1 changed files with 4 additions and 3 deletions
7
core.py
7
core.py
|
|
@ -373,11 +373,12 @@ class HackingToolsCollection:
|
|||
for index, tool in enumerate(active, start=1):
|
||||
desc = getattr(tool, "DESCRIPTION", "") or "—"
|
||||
desc = desc.splitlines()[0] if desc != "—" else "—"
|
||||
status = "[green]✔[/green]" if tool.is_installed else "[dim]✘[/dim]"
|
||||
has_status = hasattr(tool, "is_installed")
|
||||
status = ("[green]✔[/green]" if tool.is_installed else "[dim]✘[/dim]") if has_status else ""
|
||||
table.add_row(str(index), status, tool.TITLE, desc)
|
||||
|
||||
# Count not-installed tools for "Install All" label
|
||||
not_installed = [t for t in active if not t.is_installed]
|
||||
# Count not-installed tools for "Install All" label (skip sub-collections)
|
||||
not_installed = [t for t in active if hasattr(t, "is_installed") and not t.is_installed]
|
||||
if not_installed:
|
||||
table.add_row(
|
||||
"[bold green]97[/bold green]", "",
|
||||
|
|
|
|||
Loading…
Reference in a new issue