Mercurial > p > roundup > code
comparison scripts/contributors.py @ 4827:f1c7f99e6fc0
contributors.py: Add aliases and process them
| author | anatoly techtonik <techtonik@gmail.com> |
|---|---|
| date | Sun, 25 Aug 2013 17:45:43 +0300 |
| parents | 7c765b6fc44b |
| children | 64daaa4bf816 |
comparison
equal
deleted
inserted
replaced
| 4826:7c765b6fc44b | 4827:f1c7f99e6fc0 |
|---|---|
| 13 contributors_by_year = True | 13 contributors_by_year = True |
| 14 years_for_contributors = True | 14 years_for_contributors = True |
| 15 verbose = True | 15 verbose = True |
| 16 # /-- | 16 # /-- |
| 17 | 17 |
| 18 # --- project specific configuration | |
| 19 ALIASES = { | |
| 20 'Richard Jones <richard@mechanicalcat.net>': | |
| 21 ['richard', | |
| 22 'Richard Jones <richard@users.sourceforge.net>'], | |
| 23 'Bernhard Reiter <bernhard@intevation.de>': | |
| 24 ['Bernhard Reiter <ber@users.sourceforge.net>', | |
| 25 'Bernhard Reiter <Bernhard.Reiter@intevation.de>'], | |
| 26 'Ralf Schlatterbeck <rsc@runtux.com>': | |
| 27 ['Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>'], | |
| 28 'Stefan Seefeld <stefan@seefeld.name>': | |
| 29 ['Stefan Seefeld <stefan@users.sourceforge.net>'], | |
| 30 'John P. Rouillard <rouilj@cs.umb.edu>': | |
| 31 ['rouilj'], | |
| 32 } | |
| 33 # /-- | |
| 18 | 34 |
| 19 | 35 |
| 20 def compress(years): | 36 def compress(years): |
| 21 """ | 37 """ |
| 22 Given a list of years like [2003, 2004, 2007], | 38 Given a list of years like [2003, 2004, 2007], |
| 74 | 90 |
| 75 if verbose: | 91 if verbose: |
| 76 print("Sorting...") | 92 print("Sorting...") |
| 77 years = {} # year -> set(author1, author2, ...) | 93 years = {} # year -> set(author1, author2, ...) |
| 78 names = {} # author -> set(years) | 94 names = {} # author -> set(years) |
| 79 for year,author in authorship: | 95 for year, author in authorship: |
| 96 # process aliases | |
| 97 for name, aliases in ALIASES.items(): | |
| 98 if author in aliases: | |
| 99 author = name | |
| 100 break | |
| 80 # years | 101 # years |
| 81 if not year in years: | 102 if not year in years: |
| 82 years[year] = set() | 103 years[year] = set() |
| 83 years[year].add(author) | 104 years[year].add(author) |
| 84 # names | 105 # names |
