Changeset - 68bbfd164b23
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2020-03-28 15:28:25
mads@kiilerich.com
Grafted from: 9e910d962e53
scripts: in regexps, use + when we actually want to make long matches instead of empty

Greedyness seems to have changed with Python 3 and it is less forgiving and
would happily make empty matches everywhere.
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
scripts/update-copyrights.py
Show inline comments
 
@@ -131,44 +131,44 @@ def main():
 

	
 
    insert_entries(
 
        filename='kallithea/templates/about.html',
 
        all_entries=repo_entries + contributor_data.other_about + contributor_data.other,
 
        no_entries=contributor_data.no_about,
 
        domain_extra=contributor_data.domain_extra,
 
        split_re=r'(?:  <li>Copyright &copy; [^\n]*</li>\n)*',
 
        split_re=r'(?:  <li>Copyright &copy; [^\n]+</li>\n)+',
 
        normalize_name=lambda name: name.split('<', 1)[0].strip(),
 
        format_f=lambda years, name: '  <li>Copyright &copy; %s, %s</li>\n' % (nice_years(years, '&ndash;', ', '), name),
 
        )
 

	
 
    insert_entries(
 
        filename='CONTRIBUTORS',
 
        all_entries=repo_entries + contributor_data.other_contributors + contributor_data.other,
 
        no_entries=contributor_data.total_ignore,
 
        domain_extra=contributor_data.domain_extra,
 
        split_re=r'(?:    [^\n]*\n)*',
 
        split_re=r'(?:    [^\n]+\n)+',
 
        normalize_name=lambda name: name,
 
        format_f=lambda years, name: ('    %s%s%s\n' % (name, ' ' if years else '', nice_years(years))),
 
        )
 

	
 
    insert_entries(
 
        filename='kallithea/templates/base/base.html',
 
        all_entries=repo_entries,
 
        no_entries=contributor_data.total_ignore,
 
        domain_extra={},
 
        split_re=r'(?<=&copy;) .* (?=by various authors)',
 
        split_re=r'(?<=&copy;) .+ (?=by various authors)',
 
        normalize_name=lambda name: '',
 
        format_f=lambda years, name: ' ' + nice_years(years, '&ndash;', ', ') + ' ',
 
        )
 

	
 
    #docs/conf.py:copyright = u'2010-2016 by various authors, licensed as GPLv3.'
 
    insert_entries(
 
        filename='docs/conf.py',
 
        all_entries=repo_entries,
 
        no_entries=contributor_data.total_ignore,
 
        domain_extra={},
 
        split_re=r"(?<=copyright = u').*(?= by various authors)",
 
        split_re=r"(?<=copyright = ').+(?= by various authors)",
 
        normalize_name=lambda name: '',
 
        format_f=lambda years, name: nice_years(years, '-', ', '),
 
        )
 

	
 

	
 
if __name__ == '__main__':
0 comments (0 inline, 0 general)