Add update_coreteam script.
This commit is contained in:
parent
58313884b2
commit
abcd97b1f1
@ -1,13 +1,14 @@
|
||||
- `Paul Richard Tagliamonte <https://github.com/paultag>`_
|
||||
- `J Kenneth King <https://github.com/agentultra>`_
|
||||
- `Julien Danjou <https://github.com/jd>`_
|
||||
- `Nicolas Dandrimont <https://github.com/olasd>`_
|
||||
- `Morten Linderud <https://github.com/Foxboron>`_
|
||||
- `Gergely Nagy <https://github.com/algernon>`_
|
||||
- `Karen Rustad <https://github.com/aldeka>`_
|
||||
- `Berker Peksag <https://github.com/berkerpeksag>`_
|
||||
- `Christopher Allan Webber <https://github.com/cwebber>`_
|
||||
- `Bob Tolbert <https://github.com/rwtolbert>`_
|
||||
- `Tuukka Turto <https://github.com/tuturto>`_
|
||||
- `Will Kahn-Greene <https://github.com/willkg>`_
|
||||
- `Konrad Hinsen <https://github.com/khinsen>`_
|
||||
* `Julien Danjou <https://github.com/jd>`_
|
||||
* `Morten Linderud <https://github.com/Foxboron>`_
|
||||
* `J Kenneth King <https://github.com/agentultra>`_
|
||||
* `Gergely Nagy <https://github.com/algernon>`_
|
||||
* `Tuukka Turto <https://github.com/tuturto>`_
|
||||
* `Karen Rustad <https://github.com/aldeka>`_
|
||||
* `Abhishek L <https://github.com/theanalyst>`_
|
||||
* `Christopher Allan Webber <https://github.com/cwebber>`_
|
||||
* `Konrad Hinsen <https://github.com/khinsen>`_
|
||||
* `Will Kahn-Greene <https://github.com/willkg>`_
|
||||
* `Paul Tagliamonte <https://github.com/paultag>`_
|
||||
* `Nicolas Dandrimont <https://github.com/olasd>`_
|
||||
* `Bob Tolbert <https://github.com/rwtolbert>`_
|
||||
* `Berker Peksag <https://github.com/berkerpeksag>`_
|
||||
|
45
scripts/update_coreteam.py
Normal file
45
scripts/update_coreteam.py
Normal file
@ -0,0 +1,45 @@
|
||||
"""
|
||||
You need to install the requests package first::
|
||||
|
||||
$ pip install requests
|
||||
|
||||
"""
|
||||
|
||||
import os.path
|
||||
import requests
|
||||
|
||||
API_URL = 'https://api.github.com/%s'
|
||||
|
||||
RST_FORMAT = '* `%s <%s>`_'
|
||||
MISSING_NAMES = {
|
||||
'khinsen': 'Konrad Hinsen',
|
||||
}
|
||||
# We have three concealed members on the hylang organization
|
||||
# and GitHub only shows public members if the requester is not
|
||||
# an owner of the organization.
|
||||
CONCEALED_MEMBERS = [
|
||||
('aldeka', 'Karen Rustad'),
|
||||
('rwtolbert', 'Bob Tolbert'),
|
||||
('tuturto', 'Tuukka Turto'),
|
||||
]
|
||||
|
||||
|
||||
def get_dev_name(login):
|
||||
name = requests.get(API_URL % 'users/' + login).json()['name']
|
||||
if not name:
|
||||
return MISSING_NAMES.get(login)
|
||||
return name
|
||||
|
||||
coredevs = requests.get(API_URL % 'orgs/hylang/members')
|
||||
|
||||
result = set()
|
||||
for dev in coredevs.json():
|
||||
result.add(RST_FORMAT % (get_dev_name(dev['login']), dev['html_url']))
|
||||
|
||||
for login, name in CONCEALED_MEMBERS:
|
||||
result.add(RST_FORMAT % (name, 'https://github.com/' + login))
|
||||
|
||||
filename = os.path.abspath(os.path.join(os.path.pardir,
|
||||
'docs', 'coreteam.rst'))
|
||||
with open(filename, 'w+') as fobj:
|
||||
fobj.write('\n'.join(result) + '\n')
|
Loading…
x
Reference in New Issue
Block a user