|
5 | 5 | THISDIR = str(Path(__file__).resolve().parent) |
6 | 6 | sys.path.insert(0, os.path.dirname(THISDIR) + "/lib") |
7 | 7 |
|
8 | | -import githubREST |
| 8 | +import githubGraph |
9 | 9 | import utils |
10 | 10 |
|
11 | 11 | _username, death = utils.getUsernameAndLifespan() |
12 | | -repoName = input("Enter the user and repo name in the form (user/repo - eg. fredhappyface/python.imageround)\n>") |
| 12 | +author, repoName = input( |
| 13 | + "Enter the user and repo name in the form (user/repo - eg. fredhappyface/python.imageround)\n>" |
| 14 | + ).split("/") |
13 | 15 |
|
14 | 16 |
|
15 | 17 | """Is source repo alive? |
16 | 18 | """ |
17 | | -sourceRepo = githubREST.getRepo(repoName) |
18 | | -if githubREST.sourceAlive(sourceRepo, death): |
19 | | - utils.logPrint("Source repo is alive! Head to {}" .format(sourceRepo["html_url"]), "success") |
| 19 | +sourceRepo = githubGraph.getRepo(author, repoName) |
| 20 | +if githubGraph.sourceAlive(sourceRepo, death): |
| 21 | + utils.logPrint("Source repo is alive! Head to {}" .format(sourceRepo["url"]), "success") |
20 | 22 |
|
21 | 23 | """Get list of forked repos that are alive and newer than the source repo |
22 | 24 | """ |
23 | | -aliveRepos, forkedRepos = githubREST.getListOfAliveForks(sourceRepo, death) |
| 25 | +aliveRepos, forkedRepos = githubGraph.getListOfAliveForks(sourceRepo, death) |
24 | 26 |
|
25 | 27 | utils.logPrint("{} out of {} Forked repos are alive and newer than the source!" |
26 | 28 | .format(len(aliveRepos), len(forkedRepos)), "bold") |
27 | 29 | for aliveRepo in aliveRepos: |
28 | | - githubREST.printRepo(aliveRepo) |
| 30 | + githubGraph.printRepo(aliveRepo) |
0 commit comments