Sfoglia il codice sorgente

Added activity: commits by year/month, year.

Heikki Hokkanen 18 anni fa
parent
commit
973664a6ef
2 ha cambiato i file con 26 aggiunte e 9 eliminazioni
  1. 10
    8
      TODO.txt
  2. 16
    1
      statgit

+ 10
- 8
TODO.txt Vedi File

@@ -27,6 +27,16 @@
27 27
 	- DONE Total Commits
28 28
 	- DONE Authors
29 29
 
30
+- Activity by Time?
31
+	- (G?) Last 30 days
32
+	- (G?) Last 12 months
33
+	- DONE Hour of Day
34
+	- DONE Day of Week
35
+		- Hour of weekday -> 7x25?
36
+	- Month of Year
37
+	- DONE Commits by year/month
38
+	- DONE Commits by year
39
+
30 40
 - Authors
31 41
 	- List of authors
32 42
 		- show only first 10 and rest on separate page?
@@ -44,14 +54,6 @@
44 54
 	- (T) Largest Files?
45 55
 	- (T) Files With Most Revisions?
46 56
 
47
-- Activity by Time?
48
-	- DONE Hour of Day
49
-	- DONE Day of Week
50
-		- Hour of weekday -> 7x25?
51
-	- Month of Year
52
-	- (G?) Last 30 days
53
-	- (G?) Last 12 months
54
-
55 57
 - (G) Lines of Code: x = date, y = lines
56 58
 
57 59
 - Tags

+ 16
- 1
statgit Vedi File

@@ -313,9 +313,24 @@ class HTMLReportCreator(ReportCreator):
313 313
 		f.write('</table>')
314 314
 		fp.close()
315 315
 
316
+		# Commits by year/month
317
+		f.write('<h2>Commits by year/month</h2>')
318
+		f.write('<table><tr><th>Month</th><th>Commits</th></tr>')
319
+		for yymm in reversed(sorted(data.commits_by_month.keys())):
320
+			f.write('<tr><td>%s</td><td>%d</td></tr>' % (yymm, data.commits_by_month[yymm]))
321
+		f.write('</table>')
322
+
323
+		# Commits by year
324
+		f.write('<h2>Commits by year</h2>')
325
+		f.write('<table><tr><th>Year</th><th>Commits</th></tr>')
326
+		for yy in reversed(sorted(data.commits_by_year.keys())):
327
+			f.write('<tr><td>%s</td><td>%d</td></tr>' % (yy, data.commits_by_year[yy]))
328
+		f.write('</table>')
329
+
316 330
 		f.close()
317 331
 
318
-		# authors.html
332
+		###
333
+		# Authors
319 334
 		f = open(path + '/authors.html', 'w')
320 335
 		self.printHeader(f)
321 336