Bläddra i källkod

Fix author active days calculation.

A set of dates is used now instead of an incremented value. This is the same as
what has been used for General -> active days already.
Heikki Hokkanen 15 år sedan
förälder
incheckning
5722b75c2b
1 ändrade filer med 3 tillägg och 3 borttagningar
  1. 3
    3
      gitstats

+ 3
- 3
gitstats Visa fil

@@ -365,10 +365,10 @@ class GitDataCollector(DataCollector):
365 365
 			yymmdd = date.strftime('%Y-%m-%d')
366 366
 			if 'last_active_day' not in self.authors[author]:
367 367
 				self.authors[author]['last_active_day'] = yymmdd
368
-				self.authors[author]['active_days'] = 1
368
+				self.authors[author]['active_days'] = set([yymmdd])
369 369
 			elif yymmdd != self.authors[author]['last_active_day']:
370 370
 				self.authors[author]['last_active_day'] = yymmdd
371
-				self.authors[author]['active_days'] += 1
371
+				self.authors[author]['active_days'].add(yymmdd)
372 372
 
373 373
 			# project: active days
374 374
 			if yymmdd != self.last_active_day:
@@ -863,7 +863,7 @@ class HTMLReportCreator(ReportCreator):
863 863
 		f.write('<tr><th>Author</th><th>Commits (%)</th><th>+ lines</th><th>- lines</th><th>First commit</th><th>Last commit</th><th class="unsortable">Age</th><th>Active days</th><th># by commits</th></tr>')
864 864
 		for author in data.getAuthors(conf['max_authors']):
865 865
 			info = data.getAuthorInfo(author)
866
-			f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%d</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%d</td><td>%d</td></tr>' % (author, info['commits'], info['commits_frac'], info['lines_added'], info['lines_removed'], info['date_first'], info['date_last'], info['timedelta'], info['active_days'], info['place_by_commits']))
866
+			f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%d</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%d</td><td>%d</td></tr>' % (author, info['commits'], info['commits_frac'], info['lines_added'], info['lines_removed'], info['date_first'], info['date_last'], info['timedelta'], len(info['active_days']), info['place_by_commits']))
867 867
 		f.write('</table>')
868 868
 
869 869
 		allauthors = data.getAuthors()