From a620be202efb7fb619cb765eb62c44416ccf5dd5 Mon Sep 17 00:00:00 2001 From: Nathan Falvey Date: Sat, 28 Feb 2026 14:11:13 +0000 Subject: [PATCH] Enhance README generation by adding access links to repositories and improving release count display; update debug request functionality --- update_profile.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/update_profile.py b/update_profile.py index d02a2b5..1c2737d 100644 --- a/update_profile.py +++ b/update_profile.py @@ -74,16 +74,17 @@ def do_readme_parse(): md += f"## Welcome to {username}'s Gitea Developer Hub! This is a collection of repositories and projects that I have created and maintained on my Gitea instance. Here you can find various projects that I have worked on, ranging from personal projects to open-source contributions.\n\n" if data["repos"]: md += f"### 📂 Repository Breakdown\n\n" - tab_headers = ["Name", "Language", "Size", "Releases", "Private", "Archived"] + tab_headers = ["Name", "Language", "Size", "Releases", "Private", "Archived", "Access Link"] tab_rows = [] for repo in data["repos"]: tab_rows.append([ repo["name"], repo["language"], format_bytes(repo["size"]), - repo["release_count"], + repo["release_count"]if repo["release_count"] > 0 else "None", "Yes" if repo["private"] else "No", - "Yes" if repo["archived"] else "No" + "Yes" if repo["archived"] else "No", + f"[View]({GITEA_URL}/{USERNAME}/{repo['name']})" ]) md += tabulate.tabulate(tab_rows, headers=tab_headers, tablefmt="pipe") md += "\n\n" @@ -125,6 +126,8 @@ def do_readme_build(): def debug_request(): headers = {"Authorization": f"token {GITEA_TOKEN}"} version_info = do_request(f"{GITEA_URL}/api/v1/version", headers=headers) + users_heatmap = do_request(f"{GITEA_URL}/api/v1/users/{USERNAME}/heatmap", headers=headers) + print(f"User Heatmap: {users_heatmap}") version_string = version_info.get("version", "Unknown") if version_info else "Unknown" if version_info: print(f"Gitea Version: {version_string}") @@ -153,5 +156,5 @@ def debug_request(): print("!"*30) if __name__ == "__main__": - #debug_request() # Uncomment this line to run the debug function and see the API responses and collected data - do_readme_build() # This will build the README file using the collected data from the Gitea API and the template defined in the do_readme_parse function. \ No newline at end of file + debug_request() # Uncomment this line to run the debug function and see the API responses and collected data + #do_readme_build() # This will build the README file using the collected data from the Gitea API and the template defined in the do_readme_parse function. \ No newline at end of file