Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions aws_doc_sdk_examples_tools/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

def main(roots: List[str]):
base = DocGen.empty()
all_stats = []
for root in roots:
docgen_root = Path(root)
doc_gen = base.clone().for_root(docgen_root)
Expand All @@ -20,6 +21,9 @@ def main(roots: List[str]):
print(f"Snippets {stats['snippets']}")
genai = pformat(dict(stats["genai"]))
print(f"GenAI {genai}")
stats['root'] = docgen_root.name
all_stats.append(stats)
return all_stats
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you returning a list from a main? What's the goal for this change?

Copy link
Contributor Author

@ford-at-aws ford-at-aws Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want stats.py to return the stats, so it can be used like this: stats = doc_gen.stats(). Happy to create a separate method to implement this if that makes you more comfortable



if __name__ == "__main__":
Expand Down
Loading