Mercurial > p > roundup > code
comparison scripts/contributors.py @ 4825:b3bf0aa48368
contributors.py: Sort contributors by last contributor's year (newest first)
| author | anatoly techtonik <techtonik@gmail.com> |
|---|---|
| date | Sun, 25 Aug 2013 17:06:18 +0300 |
| parents | b83576aa3f74 |
| children | 7c765b6fc44b |
comparison
equal
deleted
inserted
replaced
| 4824:b83576aa3f74 | 4825:b3bf0aa48368 |
|---|---|
| 99 | 99 |
| 100 if years_for_contributors: | 100 if years_for_contributors: |
| 101 if verbose: | 101 if verbose: |
| 102 print("Years for each contributor...") | 102 print("Years for each contributor...") |
| 103 print('') | 103 print('') |
| 104 for author in sorted(names): | 104 |
| 105 # sort authors by last contribution date (newest first) | |
| 106 def last_year(name): | |
| 107 return sorted(list(names[name]))[-1] | |
| 108 | |
| 109 for author in sorted(list(names), key=last_year, reverse=True): | |
| 105 years = list(names[author]) | 110 years = list(names[author]) |
| 106 yearstr = compress(years) | 111 yearstr = compress(years) |
| 107 | 112 |
| 108 if 1: #DEBUG | 113 if 0: #DEBUG |
| 109 print(years, yearstr, author) | 114 print(years, yearstr, author) |
| 110 else: | 115 else: |
| 111 print(yearstr, author) | 116 print(yearstr, author) |
| 112 print('') | 117 print('') |
