"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "scripts/contributors.py" between
roundup-1.6.1.tar.gz and roundup-2.0.0.tar.gz

About: Roundup is an highly customisable issue-tracking system with command-line, web and e-mail interfaces (written in Python).

contributors.py  (roundup-1.6.1):contributors.py  (roundup-2.0.0)
""" """
Get Mercurial history data and output list of contributors with years. Get Mercurial history data and output list of contributors with years.
Public domain work by: Public domain work by:
anatoly techtonik <techtonik@gmail.com> anatoly techtonik <techtonik@gmail.com>
""" """
from __future__ import print_function
from subprocess import check_output from subprocess import check_output
# --- output settings # --- output settings
contributors_by_year = True contributors_by_year = True
years_for_contributors = True years_for_contributors = True
verbose = True verbose = True
# /-- # /--
# --- project specific configuration # --- project specific configuration
ALIASES = { ALIASES = {
skipping to change at line 136 skipping to change at line 137
print('') print('')
def last_year(name): def last_year(name):
"""Return year of the latest contribution for a given name""" """Return year of the latest contribution for a given name"""
return sorted(list(names[name]))[-1] return sorted(list(names[name]))[-1]
def first_year(name): def first_year(name):
"""Return year of the first contribution""" """Return year of the first contribution"""
return sorted(list(names[name]))[0] return sorted(list(names[name]))[0]
def year_cmp(name1, name2): def year_key(name):
""" """
Year comparison function. First sort by latest contribution year (desc). Year key function. First sort by latest contribution year (desc).
If it matches, compare first contribution year (asc). This ensures that If it matches, compare first contribution year (asc). This ensures that
the most recent and long-term contributors are at the top. the most recent and long-term contributors are at the top.
""" """
if last_year(name1) != last_year(name2): return (last_year(name), -first_year(name))
return last_year(name1) - last_year(name2)
else:
return first_year(name2) - first_year(name1)
print("Copyright (c)") print("Copyright (c)")
for author in sorted(list(names), cmp=year_cmp, reverse=True): for author in sorted(list(names), key=year_key, reverse=True):
years = list(names[author]) years = list(names[author])
yearstr = compress(years) yearstr = compress(years)
if 0: #DEBUG if 0: #DEBUG
print(years, yearstr, author) print(years, yearstr, author)
else: else:
print(" %s %s" % (yearstr, author)) print(" %s %s" % (yearstr, author))
print('') print('')
 End of changes. 5 change blocks. 
7 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)