Simplify plumbum usage in update_wiki

This commit is contained in:
Ayaz Salikhov
2025-02-24 15:22:53 +00:00
parent 449ed285b2
commit 955ee9f987

View File

@@ -46,8 +46,7 @@ def calculate_monthly_stat(
images = year_month_file.content.count("Build manifest") images = year_month_file.content.count("Build manifest")
with plumbum.local.env(TZ="UTC"): with plumbum.local.env(TZ="UTC"):
future = ( git_log = git[
git[
"log", "log",
"--oneline", "--oneline",
"--since", "--since",
@@ -55,12 +54,8 @@ def calculate_monthly_stat(
"--until", "--until",
f"{year_month_date + relativedelta.relativedelta(months=1)}.midnight", f"{year_month_date + relativedelta.relativedelta(months=1)}.midnight",
"--first-parent", "--first-parent",
] ]()
& plumbum.BG commits = len(git_log.splitlines())
)
future.wait()
commits = len(future.stdout.splitlines())
return Statistics(builds=builds, images=images, commits=commits) return Statistics(builds=builds, images=images, commits=commits)