From 3010b94a64b3146576a84526fb1007a309307d10 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 20 Mar 2025 14:21:35 -0700 Subject: [PATCH] refactor: move tooltip text to global constants --- scripts/badges.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/badges.py b/scripts/badges.py index d8e50e184..f49683a0b 100755 --- a/scripts/badges.py +++ b/scripts/badges.py @@ -10,6 +10,13 @@ from dotenv import load_dotenv TOKENS_PER_WEEK = "15B" +# Badge tooltip texts +GITHUB_STARS_TOOLTIP = "Total number of GitHub stars the Aider project has received" +PYPI_DOWNLOADS_TOOLTIP = "Total number of installations via pip from PyPI" +TOKENS_WEEKLY_TOOLTIP = "Number of tokens processed weekly by Aider users" +OPENROUTER_TOOLTIP = "Aider's ranking among applications on the OpenRouter platform" +SINGULARITY_TOOLTIP = "Percentage of the new code in Aider's last release written by Aider itself" + def get_total_downloads(api_key, package_name="aider-chat"): """ @@ -128,15 +135,15 @@ def generate_badges_md(downloads, stars, aider_percentage): # Round aider percentage to whole number aider_percent_rounded = round(aider_percentage) - markdown = f""" GitHub StarsGitHub Stars - PyPI DownloadsPyPI Downloads - Tokens per week - OpenRouter RankingOpenRouter Ranking - SingularitySingularity""" # noqa return markdown