From b62c8b15cc5b6b5a6c8a74c8fbca7f0e5d56c740 Mon Sep 17 00:00:00 2001 From: Zhihan Zhang Date: Wed, 8 Nov 2023 16:42:53 +0100 Subject: [PATCH] Clean up render_sources() --- PyPI_analysis/main.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/PyPI_analysis/main.py b/PyPI_analysis/main.py index 1db760e9..66189324 100644 --- a/PyPI_analysis/main.py +++ b/PyPI_analysis/main.py @@ -137,21 +137,6 @@ def print_json(self, out: TextIO) -> None: def print_human_readable(self, out: TextIO, detailed: bool = True) -> None: """Print a human-readable rendering of this analysis to 'out'.""" - def render_sources() -> Iterator[str]: - if detailed: - # Sort sources by type, then by path - source_types = [ - (CodeSource, "Sources of Python code:"), - (DepsSource, "Sources of declared dependencies:"), - ] - for source_type, heading in source_types: - filtered = {s for s in self.sources if s.source_type is source_type} - if filtered: - yield "\n" + heading - yield from sorted([f" {src.render(True)}" for src in filtered]) - else: - yield from sorted({src.render(False) for src in self.sources}) - def render_dep_files() -> Iterator[str]: if detailed: yield "Dependency declaration files:"