Browse Source

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 years ago
parent
commit
5722b75c2b
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      gitstats

+ 3
- 3
gitstats View File

365
 			yymmdd = date.strftime('%Y-%m-%d')
365
 			yymmdd = date.strftime('%Y-%m-%d')
366
 			if 'last_active_day' not in self.authors[author]:
366
 			if 'last_active_day' not in self.authors[author]:
367
 				self.authors[author]['last_active_day'] = yymmdd
367
 				self.authors[author]['last_active_day'] = yymmdd
368
-				self.authors[author]['active_days'] = 1
368
+				self.authors[author]['active_days'] = set([yymmdd])
369
 			elif yymmdd != self.authors[author]['last_active_day']:
369
 			elif yymmdd != self.authors[author]['last_active_day']:
370
 				self.authors[author]['last_active_day'] = yymmdd
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
 			# project: active days
373
 			# project: active days
374
 			if yymmdd != self.last_active_day:
374
 			if yymmdd != self.last_active_day:
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>')
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
 		for author in data.getAuthors(conf['max_authors']):
864
 		for author in data.getAuthors(conf['max_authors']):
865
 			info = data.getAuthorInfo(author)
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
 		f.write('</table>')
867
 		f.write('</table>')
868
 
868
 
869
 		allauthors = data.getAuthors()
869
 		allauthors = data.getAuthors()