You've already forked wakapi-readme-stats
Merge branch 'master' into fix/inter_api_commit_request_sleep
This commit is contained in:
@@ -6,7 +6,10 @@ ENV PYTHONDONTWRITEBYTECODE 1
|
|||||||
RUN mkdir -p /waka-readme-stats/assets
|
RUN mkdir -p /waka-readme-stats/assets
|
||||||
|
|
||||||
ADD requirements.txt /waka-readme-stats/requirements.txt
|
ADD requirements.txt /waka-readme-stats/requirements.txt
|
||||||
RUN apk add --no-cache g++ jpeg-dev zlib-dev libjpeg make && pip3 install -r /waka-readme-stats/requirements.txt
|
RUN apk add --no-cache g++ jpeg-dev zlib-dev libjpeg make git && pip3 install -r /waka-readme-stats/requirements.txt
|
||||||
|
|
||||||
|
RUN git config --global user.name "readme-bot"
|
||||||
|
RUN git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
ADD sources/* /waka-readme-stats/
|
ADD sources/* /waka-readme-stats/
|
||||||
ENTRYPOINT cd /waka-readme-stats/ && python3 main.py
|
ENTRYPOINT cd /waka-readme-stats/ && python3 main.py
|
||||||
|
|||||||
@@ -103,16 +103,17 @@ async def make_commit_day_time_list(time_zone: str, repositories: Dict, commit_d
|
|||||||
sum_week = sum(week_days)
|
sum_week = sum(week_days)
|
||||||
day_times = day_times[1:] + day_times[:1]
|
day_times = day_times[1:] + day_times[:1]
|
||||||
|
|
||||||
dt_names = [f"{DAY_TIME_EMOJI[i]} {FM.t(DAY_TIME_NAMES[i])}" for i in range(len(day_times))]
|
if EM.SHOW_COMMIT:
|
||||||
dt_texts = [f"{day_time} commits" for day_time in day_times]
|
dt_names = [f"{DAY_TIME_EMOJI[i]} {FM.t(DAY_TIME_NAMES[i])}" for i in range(len(day_times))]
|
||||||
dt_percents = [round((day_time / sum_day) * 100, 2) for day_time in day_times]
|
dt_texts = [f"{day_time} commits" for day_time in day_times]
|
||||||
title = FM.t("I am an Early") if sum(day_times[0:2]) >= sum(day_times[2:4]) else FM.t("I am a Night")
|
dt_percents = [0 if sum_day == 0 else round((day_time / sum_day) * 100, 2) for day_time in day_times]
|
||||||
stats += f"**{title}** \n\n```text\n{make_list(names=dt_names, texts=dt_texts, percents=dt_percents, top_num=7, sort=False)}\n```\n"
|
title = FM.t("I am an Early") if sum(day_times[0:2]) >= sum(day_times[2:4]) else FM.t("I am a Night")
|
||||||
|
stats += f"**{title}** \n\n```text\n{make_list(names=dt_names, texts=dt_texts, percents=dt_percents, top_num=7, sort=False)}\n```\n"
|
||||||
|
|
||||||
if EM.SHOW_DAYS_OF_WEEK:
|
if EM.SHOW_DAYS_OF_WEEK:
|
||||||
wd_names = [FM.t(week_day) for week_day in WEEK_DAY_NAMES]
|
wd_names = [FM.t(week_day) for week_day in WEEK_DAY_NAMES]
|
||||||
wd_texts = [f"{week_day} commits" for week_day in week_days]
|
wd_texts = [f"{week_day} commits" for week_day in week_days]
|
||||||
wd_percents = [round((week_day / sum_week) * 100, 2) for week_day in week_days]
|
wd_percents = [0 if sum_week == 0 else round((week_day / sum_week) * 100, 2) for week_day in week_days]
|
||||||
title = FM.t("I am Most Productive on") % wd_names[wd_percents.index(max(wd_percents))]
|
title = FM.t("I am Most Productive on") % wd_names[wd_percents.index(max(wd_percents))]
|
||||||
stats += f"📅 **{title}** \n\n```text\n{make_list(names=wd_names, texts=wd_texts, percents=wd_percents, top_num=7, sort=False)}\n```\n"
|
stats += f"📅 **{title}** \n\n```text\n{make_list(names=wd_names, texts=wd_texts, percents=wd_percents, top_num=7, sort=False)}\n```\n"
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ async def get_waka_time_stats(repositories: Dict, commit_dates: Dict) -> str:
|
|||||||
stats = str()
|
stats = str()
|
||||||
|
|
||||||
data = await DM.get_remote_json("waka_latest")
|
data = await DM.get_remote_json("waka_latest")
|
||||||
if EM.SHOW_COMMIT:
|
if EM.SHOW_COMMIT or EM.SHOW_DAYS_OF_WEEK: # if any on flag is turned on then we need to calculate the data and print accordingly
|
||||||
DBM.i("Adding user commit day time info...")
|
DBM.i("Adding user commit day time info...")
|
||||||
stats += f"{await make_commit_day_time_list(data['data']['timezone'], repositories, commit_dates)}\n\n"
|
stats += f"{await make_commit_day_time_list(data['data']['timezone'], repositories, commit_dates)}\n\n"
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ async def get_stats() -> str:
|
|||||||
stats = str()
|
stats = str()
|
||||||
repositories = await collect_user_repositories()
|
repositories = await collect_user_repositories()
|
||||||
|
|
||||||
if EM.SHOW_LINES_OF_CODE or EM.SHOW_LOC_CHART:
|
if EM.SHOW_LINES_OF_CODE or EM.SHOW_LOC_CHART or EM.SHOW_COMMIT or EM.SHOW_DAYS_OF_WEEK: # calculate commit data if any one of these is enabled
|
||||||
yearly_data, commit_data = await calculate_commit_data(repositories)
|
yearly_data, commit_data = await calculate_commit_data(repositories)
|
||||||
else:
|
else:
|
||||||
yearly_data, commit_data = dict(), dict()
|
yearly_data, commit_data = dict(), dict()
|
||||||
|
|||||||
Reference in New Issue
Block a user