|
|
@@ -99,11 +99,11 @@ def getcommitrange(defaultrange = 'HEAD', end_only = False):
|
|
99
|
99
|
return defaultrange
|
|
100
|
100
|
|
|
101
|
101
|
def getkeyssortedbyvalues(dict):
|
|
102
|
|
- return list(map(lambda el : el[1], sorted(map(lambda el : (el[1], el[0]), dict.items()))))
|
|
|
102
|
+ return [el[1] for el in sorted([(el[1], el[0]) for el in list(dict.items())])]
|
|
103
|
103
|
|
|
104
|
104
|
# dict['author'] = { 'commits': 512 } - ...key(dict, 'commits')
|
|
105
|
105
|
def getkeyssortedbyvaluekey(d, key):
|
|
106
|
|
- return list(map(lambda el : el[1], sorted(map(lambda el : (d[el][key], el), d.keys()))))
|
|
|
106
|
+ return [el[1] for el in sorted([(d[el][key], el) for el in list(d.keys())])]
|
|
107
|
107
|
|
|
108
|
108
|
def getstatsummarycounts(line):
|
|
109
|
109
|
numbers = re.findall('\d+', line)
|
|
|
@@ -168,6 +168,7 @@ class DataCollector:
|
|
168
|
168
|
self.lineactivity_by_hour_of_week_busiest = 0
|
|
169
|
169
|
self.lineactivity_by_year_week = {} # yy_wNN -> commits
|
|
170
|
170
|
self.lineactivity_by_year_week_peak = 0
|
|
|
171
|
+ self.changes_by_date_by_author = {} # stamp -> author -> lines_added
|
|
171
|
172
|
|
|
172
|
173
|
self.authors = {} # name -> {commits, first_commit_stamp, last_commit_stamp, last_active_day, active_days, lines_added, lines_removed}
|
|
173
|
174
|
|
|
|
@@ -649,7 +650,7 @@ class GitDataCollector(DataCollector):
|
|
649
|
650
|
|
|
650
|
651
|
numbers = getstatsummarycounts(last_line)
|
|
651
|
652
|
if len(numbers) == 3:
|
|
652
|
|
- (files, inserted, deleted) = map(lambda el : int(el), numbers)
|
|
|
653
|
+ (files, inserted, deleted) = [int(el) for el in numbers]
|
|
653
|
654
|
total_lines += inserted
|
|
654
|
655
|
total_lines -= deleted
|
|
655
|
656
|
self.total_lines_added += inserted
|
|
|
@@ -669,7 +670,6 @@ class GitDataCollector(DataCollector):
|
|
669
|
670
|
# Per-author statistics
|
|
670
|
671
|
|
|
671
|
672
|
# defined for stamp, author only if author commited at this timestamp.
|
|
672
|
|
- self.changes_by_date_by_author = {} # stamp -> author -> lines_added
|
|
673
|
673
|
|
|
674
|
674
|
# Similar to the above, but never use --first-parent
|
|
675
|
675
|
# (we need to walk through every commit to know who
|
|
|
@@ -714,7 +714,7 @@ class GitDataCollector(DataCollector):
|
|
714
|
714
|
numbers = getstatsummarycounts(line);
|
|
715
|
715
|
|
|
716
|
716
|
if len(numbers) == 3:
|
|
717
|
|
- (files, inserted, deleted) = list(map(lambda el : int(el), numbers))
|
|
|
717
|
+ (files, inserted, deleted) = [int(el) for el in numbers]
|
|
718
|
718
|
else:
|
|
719
|
719
|
print('Warning: failed to handle line "%s"' % line)
|
|
720
|
720
|
(files, inserted, deleted) = (0, 0, 0)
|
|
|
@@ -1432,7 +1432,7 @@ class HTMLReportCreator(ReportCreator):
|
|
1432
|
1432
|
f.write('<table class="tags">')
|
|
1433
|
1433
|
f.write('<tr><th>Name</th><th>Date</th><th>Commits</th><th>Authors</th></tr>')
|
|
1434
|
1434
|
# sort the tags by date desc
|
|
1435
|
|
- tags_sorted_by_date_desc = list(map(lambda el : el[1], reversed(sorted(map(lambda el : (el[1]['date'], el[0]), data.tags.items())))))
|
|
|
1435
|
+ tags_sorted_by_date_desc = [el[1] for el in reversed(sorted([(el[1]['date'], el[0]) for el in list(data.tags.items())]))]
|
|
1436
|
1436
|
for tag in tags_sorted_by_date_desc:
|
|
1437
|
1437
|
authorinfo = []
|
|
1438
|
1438
|
self.authors_by_commits = getkeyssortedbyvalues(data.tags[tag]['authors'])
|