From 15dcf09ec1aacac12f6635c2504e792ff906f38c Mon Sep 17 00:00:00 2001 From: Slawek Koszewski Date: Thu, 20 Nov 2025 09:29:20 +0100 Subject: [PATCH] Added ability to specify the Organization object or ogranization name for harvest_readmes function. --- harvester/harvester.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/harvester/harvester.py b/harvester/harvester.py index 24f19c7..06ee8d9 100644 --- a/harvester/harvester.py +++ b/harvester/harvester.py @@ -15,9 +15,12 @@ def sanitize_name(name: str) -> str: """Sanitize a name to be filesystem-friendly.""" return name.lower().replace(" ", "-").replace("_", "-") -def harvest_readmes(organization: str, branch: list[str | None] = ["main", "dev", None], projects: list[str] = [], output_path: str = "reference") -> None: +def harvest_readmes(organization: str | Organization, branch: list[str | None] = ["main", "dev", None], projects: list[str] = [], output_path: str = "reference") -> None: """Harvest README files from repositories.""" - org = Organization("https://dev.azure.com/" + organization, token=get_token()) + if isinstance(organization, str): + org = Organization("https://dev.azure.com/" + organization, token=get_token()) + else: + org = organization if projects: # Target specific projects