Commit 91135bdf authored by Hardik Zinzuvadiya's avatar Hardik Zinzuvadiya
Browse files

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 ✔️/✘
parent 511a651e
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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]", "",