-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactive_github.py
27 lines (24 loc) · 948 Bytes
/
active_github.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Use this program to get a list of forked repos that are active."""
from lib import github_graph
from lib.metprint import LogType
from lib.utils import getUsernameAndLifespan, printf
_username, death = getUsernameAndLifespan()
author, repoName = input(
"Enter the user and repo name in the form (user/repo - eg. "
"fredhappyface/python.activegithub)\n>"
).split("/")
"""Is source repo alive?
"""
sourceRepo = github_graph.getRepo(author, repoName)
if github_graph.sourceAlive(sourceRepo, death):
printf.logPrint(f"Source repo is alive! Head to {sourceRepo['url']}", LogType.SUCCESS)
"""Get list of forked repos that are alive and newer than the source repo
"""
aliveRepos, forkedRepos = github_graph.getListOfAliveForks(sourceRepo, death)
printf.logPrint(
f"{len(aliveRepos)} out of {len(forkedRepos)} Forked "
"repos are alive and newer than the source!",
LogType.BOLD,
)
for aliveRepo in aliveRepos:
github_graph.printRepo(aliveRepo)