Removes old startup helper blocks that are no longer used.
()
| 1973 | break |
| 1974 | cursor = page_info.get("endCursor") |
| 1975 | if not cursor: |
| 1976 | break |
| 1977 | |
| 1978 | rank = calculate_github_rank(total_stars, total_forks, total_watchers, total_commits, repo_count) |
| 1979 | return { |
| 1980 | "username": username, |
| 1981 | "repositories": repo_count, |
| 1982 | "stars": total_stars, |
| 1983 | "forks": total_forks, |
| 1984 | "watchers": total_watchers, |
| 1985 | "commits": total_commits, |
| 1986 | "rank": rank, |
| 1987 | }, None |
| 1988 | |
| 1989 | |
| 1990 | def calculate_github_rank(stars, forks, watchers, commits, repo_count): |
| 1991 | score = (stars * 8) + (forks * 5) + (watchers * 2) + (commits * 0.03) + (repo_count * 2) |
| 1992 | thresholds = [ |
| 1993 | (2500, "S++"), (1600, "S+"), (1000, "S"), |
| 1994 | (650, "A++"), (400, "A+"), (250, "A"), (150, "A-"), |
| 1995 | (90, "B+"), (50, "B"), (25, "B-"), (10, "C"), |
| 1996 | ] |
| 1997 | for needed, label in thresholds: |
| 1998 | if score >= needed: |
| 1999 | return label |
| 2000 | return "D" |
| 2001 | |
| 2002 | |
| 2003 | def show_github_stats(): |
| 2004 | print("=== " + _("Show GitHub Stats") + " ===") |
| 2005 | stats, error = fetch_github_account_stats() |
| 2006 | if error: |
| 2007 | print("[!] " + str(error)) |
| 2008 | return |
| 2009 | print(f"{_('GitHub username')}: {stats['username']}") |