def print_tools(self, pattern=None, buf=sys.stdout):
seen = set()<EOL>rows = []<EOL>context = self.context<EOL>if context:<EOL><INDENT>data = context.get_tools()<EOL>conflicts = set(context.get_conflicting_tools().keys())<EOL>for _, (variant, tools) in sorted(data.items()):<EOL><INDENT>pkg_str = variant.qualified_package_name<EOL>for tool in tools:<EOL><INDENT>if pattern and not fnmatch(tool, pattern):<EOL><INDENT>continue<EOL><DEDENT>if tool in conflicts:<EOL><INDENT>label = "<STR_LIT>"<EOL>color = critical<EOL><DEDENT>else:<EOL><INDENT>label = '<STR_LIT>'<EOL>color = None<EOL><DEDENT>rows.append([tool, '<STR_LIT:->', pkg_str, "<STR_LIT>", label, color])<EOL>seen.add(tool)<EOL><DEDENT><DEDENT><DEDENT>for suite in self.suites:<EOL><INDENT>for tool, d in suite.get_tools().iteritems():<EOL><INDENT>if tool in seen:<EOL><INDENT>continue<EOL><DEDENT>if pattern and not fnmatch(tool, pattern):<EOL><INDENT>continue<EOL><DEDENT>label = []<EOL>color = None<EOL>path = which(tool)<EOL>if path:<EOL><INDENT>path_ = os.path.join(suite.tools_path, tool)<EOL>if path != path_:<EOL><INDENT>label.append("<STR_LIT>" % path)<EOL>color = warning<EOL><DEDENT><DEDENT>variant = d["<STR_LIT>"]<EOL>if isinstance(variant, set):<EOL><INDENT>pkg_str = "<STR_LIT:U+002CU+0020>".join(variant)<EOL>label.append("<STR_LIT>")<EOL>color = critical<EOL><DEDENT>else:<EOL><INDENT>pkg_str = variant.qualified_package_name<EOL><DEDENT>orig_tool = d["<STR_LIT>"]<EOL>if orig_tool == tool:<EOL><INDENT>orig_tool = '<STR_LIT:->'<EOL><DEDENT>label = '<STR_LIT:U+0020>'.join(label)<EOL>source = ("<STR_LIT>"<EOL>% (d["<STR_LIT>"], suite.load_path))<EOL>rows.append([tool, orig_tool, pkg_str, source, label, color])<EOL>seen.add(tool)<EOL><DEDENT><DEDENT>_pr = Printer(buf)<EOL>if not rows:<EOL><INDENT>_pr("<STR_LIT>")<EOL>return False<EOL><DEDENT>headers = [["<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", None],<EOL>["<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", None]]<EOL>rows = headers + sorted(rows, key=lambda x: x[<NUM_LIT:0>].lower())<EOL>print_colored_columns(_pr, rows)<EOL>return True<EOL>
Print a list of visible tools.

        Args:
            pattern (str): Only list tools that match this glob pattern.