From c405320827c5b076a7781faa6dfb4ccb421ca581 Mon Sep 17 00:00:00 2001 From: Heikki Hokkanen Date: Sun, 12 Aug 2007 12:56:28 +0300 Subject: [PATCH] Activity: Month of Year (table). --- statgit | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/statgit b/statgit index 498142e..c215233 100755 --- a/statgit +++ b/statgit @@ -81,6 +81,7 @@ class GitDataCollector(DataCollector): self.activity_by_hour_of_day = {} # hour -> commits self.activity_by_day_of_week = {} # day -> commits + self.activity_by_month_of_year = {} # month [1-12] -> commits self.authors = {} # name -> {commits, first_commit_stamp, last_commit_stamp} @@ -145,6 +146,13 @@ class GitDataCollector(DataCollector): else: self.activity_by_day_of_week[day] = 1 + # month of year + month = date.month + if month in self.activity_by_month_of_year: + self.activity_by_month_of_year[month] += 1 + else: + self.activity_by_month_of_year[month] = 1 + # author stats if author not in self.authors: self.authors[author] = {} @@ -331,6 +339,17 @@ class HTMLReportCreator(ReportCreator): f.write('') fp.close() + # TODO Month of Year + f.write('\n

Month of Year

\n\n') + f.write('
') + f.write('') + for mm in range(1, 13): + commits = 0 + if mm in data.activity_by_month_of_year: + commits = data.activity_by_month_of_year[mm] + f.write('' % (mm, commits, (100.0 * commits) / data.getTotalCommits())) + f.write('
MonthCommits (%)
%d%d (%.2f %%)
') + # Commits by year/month f.write('

Commits by year/month

') f.write('
') -- 2.11.4.GIT
MonthCommits