|
|
@@ -32,7 +32,9 @@ def getoutput(cmd, quiet = False):
|
|
32
|
32
|
def getkeyssortedbyvalues(dict):
|
|
33
|
33
|
return map(lambda el : el[1], sorted(map(lambda el : (el[1], el[0]), dict.items())))
|
|
34
|
34
|
|
|
35
|
|
-# TODO getdictkeyssortedbyvaluekey(dict, key) - eg. dict['author'] = { 'commits' : 512 } - ...key(dict, 'commits')
|
|
|
35
|
+# dict['author'] = { 'commits': 512 } - ...key(dict, 'commits')
|
|
|
36
|
+def getkeyssortedbyvaluekey(d, key):
|
|
|
37
|
+ return map(lambda el : el[1], sorted(map(lambda el : (d[el][key], el), d.keys())))
|
|
36
|
38
|
|
|
37
|
39
|
class DataCollector:
|
|
38
|
40
|
"""Manages data collection from a revision control repository."""
|
|
|
@@ -527,10 +529,12 @@ class HTMLReportCreator(ReportCreator):
|
|
527
|
529
|
f.write(html_header(2, 'List of Authors'))
|
|
528
|
530
|
|
|
529
|
531
|
f.write('<table class="authors">')
|
|
530
|
|
- f.write('<tr><th>Author</th><th>Commits (%)</th><th>First commit</th><th>Last commit</th><th>Age</th></tr>')
|
|
|
532
|
+ f.write('<tr><th>Author</th><th>Commits (%)</th><th>First commit</th><th>Last commit</th><th>Age</th><th># by commits</th></tr>')
|
|
|
533
|
+ authors_by_commits = getkeyssortedbyvaluekey(data.authors, 'commits')
|
|
|
534
|
+ authors_by_commits.reverse() # most first
|
|
531
|
535
|
for author in sorted(data.getAuthors()):
|
|
532
|
536
|
info = data.getAuthorInfo(author)
|
|
533
|
|
- f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%s</td><td>%s</td><td>%s</td></tr>' % (author, info['commits'], info['commits_frac'], info['date_first'], info['date_last'], info['timedelta']))
|
|
|
537
|
+ f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%s</td><td>%s</td><td>%s</td><td>%d</td></tr>' % (author, info['commits'], info['commits_frac'], info['date_first'], info['date_last'], info['timedelta'], authors_by_commits.index(author) + 1))
|
|
534
|
538
|
f.write('</table>')
|
|
535
|
539
|
|
|
536
|
540
|
# Authors :: Author of Month
|