@@ -40,7 +40,6 @@ async def async_github_requests():
4040 """Make concurrent GitHub API requests"""
4141 async with httpx .AsyncClient () as client :
4242 tasks = [
43- fetch_github_data (client , f"https://api.github.com/repos/{ __author__ } /{ __title__ } " ),
4443 fetch_github_data (client , f"https://api.github.com/repos/{ __author__ } /{ __title__ } /releases" ),
4544 fetch_github_data (client , f"https://api.github.com/repos/{ __author__ } /{ __title__ } /commits" )
4645 ]
@@ -65,15 +64,12 @@ def update():
6564 """Check for updates on GitHub and display relevant information."""
6665 try :
6766 # Run async requests concurrently
68- response_reposity , response_releases , response_commits = asyncio .run (async_github_requests ())
67+ response_releases , response_commits = asyncio .run (async_github_requests ())
6968
7069 except Exception as e :
7170 console .print (f"[red]Error accessing GitHub API: { e } " )
7271 return
7372
74- # Get stargazers count from the repository
75- stargazers_count = response_reposity .get ('stargazers_count' , 0 )
76-
7773 # Calculate total download count from all releases
7874 total_download_count = sum (asset ['download_count' ] for release in response_releases for asset in release .get ('assets' , []))
7975
@@ -83,12 +79,6 @@ def update():
8379 else :
8480 last_version = 'Unknown'
8581
86- # Calculate percentual of stars based on download count
87- if total_download_count > 0 and stargazers_count > 0 :
88- percentual_stars = round (stargazers_count / total_download_count * 100 , 2 )
89- else :
90- percentual_stars = 0
91-
9282 # Get the current version (installed version)
9383 try :
9484 current_version = importlib .metadata .version (__title__ )
@@ -105,8 +95,14 @@ def update():
10595 if str (current_version ).replace ('v' , '' ) != str (last_version ).replace ('v' , '' ):
10696 console .print (f"\n [cyan]New version available: [yellow]{ last_version } " )
10797
108- console .print (f"\n [red]{ __title__ } has been downloaded [yellow]{ total_download_count } [red]times, but only [yellow]{ percentual_stars } % [red]of users have starred it.\n \
109- [yellow]{ get_execution_mode ()} - [green]Current installed version: [yellow]{ current_version } [green]last commit: [white]'[yellow]{ latest_commit_message .splitlines ()[0 ]} [white]'\n \
110- [cyan]Help the repository grow today by leaving a [yellow]star [cyan]and [yellow]sharing [cyan]it with others online!" )
98+ console .print (
99+ f"\n [red]{ __title__ } has been downloaded [yellow]{ total_download_count } "
100+ f"\n [yellow]{ get_execution_mode ()} - [green]Current installed version: [yellow]{ current_version } "
101+ f"[green]last commit: [white]'[yellow]{ latest_commit_message .splitlines ()[0 ]} [white]'\n "
102+ f" [cyan]Help the repository grow today by leaving a [yellow]star [cyan]and [yellow]sharing "
103+ f"[cyan]it with others online!\n "
104+ f" [magenta]If you'd like to support development and keep the program updated, consider leaving a "
105+ f"[yellow]donation[magenta]. Thank you!"
106+ )
111107
112108 time .sleep (1 )
0 commit comments