You've already forked wakapi-readme-stats
Verbose logging environmental variable added
This commit is contained in:
@@ -5,6 +5,7 @@ from typing import Dict
|
||||
from manager_download import DownloadManager as DM
|
||||
from manager_environment import EnvironmentManager as EM
|
||||
from manager_github import GitHubManager as GHM
|
||||
from manager_debug import DebugManager as DBM
|
||||
|
||||
|
||||
async def calculate_yearly_commit_data(repositories: Dict) -> Dict:
|
||||
@@ -15,12 +16,14 @@ async def calculate_yearly_commit_data(repositories: Dict) -> Dict:
|
||||
:param repositories: user repositories info dictionary.
|
||||
:returns: Commit quarter yearly data dictionary.
|
||||
"""
|
||||
DBM.i("Calculating yearly commit data...")
|
||||
yearly_data = dict()
|
||||
total = len(repositories["data"]["user"]["repositories"]["nodes"])
|
||||
for ind, repo in enumerate(repositories["data"]["user"]["repositories"]["nodes"]):
|
||||
if repo["name"] not in EM.IGNORED_REPOS:
|
||||
print(f"{ind + 1}/{total}", "Retrieving repo:", repo["owner"]["login"], repo["name"])
|
||||
DBM.i(f"\t{ind + 1}/{total} Retrieving repo: {repo['owner']['login']}/{repo['name']}")
|
||||
await update_yearly_data_with_commit_stats(repo, yearly_data)
|
||||
DBM.g("Yearly commit data calculated!")
|
||||
return yearly_data
|
||||
|
||||
|
||||
@@ -35,7 +38,7 @@ async def update_yearly_data_with_commit_stats(repo_details: Dict, yearly_data:
|
||||
owner = repo_details["owner"]["login"]
|
||||
branch_data = await DM.get_remote_graphql("repo_branch_list", owner=owner, name=repo_details["name"])
|
||||
if branch_data["data"]["repository"] is None:
|
||||
print(f"\tSkipping repo: {repo_details['name']}")
|
||||
DBM.w(f"\t\tSkipping repo: {repo_details['name']}")
|
||||
return dict()
|
||||
|
||||
for branch in branch_data["data"]["repository"]["refs"]["nodes"]:
|
||||
|
||||
Reference in New Issue
Block a user