mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 05:14:59 +00:00
style: Format code according to linter rules
This commit is contained in:
parent
6687cc9465
commit
eaac00ad3f
1 changed files with 8 additions and 8 deletions
|
@ -34,14 +34,14 @@ def get_github_stars(repo="paul-gauthier/aider"):
|
||||||
"""
|
"""
|
||||||
url = f"https://api.github.com/repos/{repo}"
|
url = f"https://api.github.com/repos/{repo}"
|
||||||
headers = {"Accept": "application/vnd.github.v3+json"}
|
headers = {"Accept": "application/vnd.github.v3+json"}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = requests.get(url, headers=headers)
|
response = requests.get(url, headers=headers)
|
||||||
response.raise_for_status() # Raise an exception for HTTP errors
|
response.raise_for_status() # Raise an exception for HTTP errors
|
||||||
|
|
||||||
data = response.json()
|
data = response.json()
|
||||||
stars = data.get("stargazers_count", 0)
|
stars = data.get("stargazers_count", 0)
|
||||||
|
|
||||||
return stars
|
return stars
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
print(f"Error fetching GitHub stars: {e}", file=sys.stderr)
|
print(f"Error fetching GitHub stars: {e}", file=sys.stderr)
|
||||||
|
@ -52,9 +52,7 @@ def main():
|
||||||
# Load environment variables from .env file
|
# Load environment variables from .env file
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(description="Get total downloads and GitHub stars for aider")
|
||||||
description="Get total downloads and GitHub stars for aider"
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--api-key",
|
"--api-key",
|
||||||
help=(
|
help=(
|
||||||
|
@ -66,7 +64,9 @@ def main():
|
||||||
"--package", default="aider-chat", help="Package name (default: aider-chat)"
|
"--package", default="aider-chat", help="Package name (default: aider-chat)"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--github-repo", default="paul-gauthier/aider", help="GitHub repository (default: paul-gauthier/aider)"
|
"--github-repo",
|
||||||
|
default="paul-gauthier/aider",
|
||||||
|
help="GitHub repository (default: paul-gauthier/aider)",
|
||||||
)
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ def main():
|
||||||
# Get PyPI downloads
|
# Get PyPI downloads
|
||||||
total_downloads = get_total_downloads(api_key, args.package)
|
total_downloads = get_total_downloads(api_key, args.package)
|
||||||
print(f"Total downloads for {args.package}: {total_downloads:,}")
|
print(f"Total downloads for {args.package}: {total_downloads:,}")
|
||||||
|
|
||||||
# Get GitHub stars
|
# Get GitHub stars
|
||||||
stars = get_github_stars(args.github_repo)
|
stars = get_github_stars(args.github_repo)
|
||||||
if stars is not None:
|
if stars is not None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue