Skip to content

Commit

Permalink
Clean up render_sources()
Browse files Browse the repository at this point in the history
  • Loading branch information
zz1874 committed Nov 8, 2023
1 parent 0557a2d commit b62c8b1
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions PyPI_analysis/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down

0 comments on commit b62c8b1

Please sign in to comment.