Added buildscript for authors.

This commit is contained in:
Michael Lazar
2016-07-28 18:32:41 -07:00
parent 03c842fcf6
commit 3d8fe457d5
3 changed files with 75 additions and 12 deletions

View File

@@ -1,4 +1,3 @@
================ ================
RTV Contributors RTV Contributors
================ ================
@@ -7,22 +6,26 @@ Thanks to the following people for their contributions to this project.
* `Michael Lazar <https://github.com/michael-lazar>`_ * `Michael Lazar <https://github.com/michael-lazar>`_
* `Tobin Brown <https://github.com/Brobin>`_ * `Tobin Brown <https://github.com/Brobin>`_
* `woorst <https://github.com/woorst>`_
* `Théo Piboubès <https://github.com/TheoPib>`_ * `Théo Piboubès <https://github.com/TheoPib>`_
* `Yusuke Sakamoto <https://github.com/yskmt>`_ * `Yusuke Sakamoto <https://github.com/yskmt>`_
* `Johnathan Jenkins <https://github.com/shaggytwodope>`_ * `Johnathan Jenkins <https://github.com/shaggytwodope>`_
* `obosob <https://github.com/obosob>`_ * `Gustavo Zambonin <https://github.com/zambonin>`_
* `mekhami <https://github.com/mekhami>`_ * `mekhami <https://github.com/mekhami>`_
* `Noah Morrison <https://github.com/noahmorrison>`_ * `obosob <https://github.com/obosob>`_
* `Toby Hughes <https://github.com/tobywhughes>`_ * `Toby Hughes <https://github.com/tobywhughes>`_
* `Shawn Hind <https://github.com/shanhind>`_ * `Noah Morrison <https://github.com/noahmorrison>`_
* `mardiqwop <https://github.com/mardiqwop>`_
* `Shawn Hind <https://github.com/shawnhind>`_
* `5225225 <https://github.com/5225225>`_
* `JuanPablo <https://github.com/juanpabloaj>`_ * `JuanPablo <https://github.com/juanpabloaj>`_
* `Robert Greener <https://github.com/ragreener1>`_ * `Robert Greener <https://github.com/ragreener1>`_
* `peterpans01 <https://github.com/peterpans01>`_ * `afloofloo <https://github.com/afloofloo>`_
* `Adam Talsma <https://github.com/a-tal>`_ * `Matthew Smith <https://github.com/msmith491>`_
* `Marc Abramowitz <https://github.com/msabramo>`_
* `Hans Roman <https://github.com/snahor>`_
* `Ram-Z <https://github.com/Ram-Z>`_ * `Ram-Z <https://github.com/Ram-Z>`_
* `mralext20 <https://github.com/mralext20>`_ * `Wieland Hoffmann <https://github.com/mineo>`_
* `Wieland Hoffmann <http://github.com/mineo>`_ * `Adam Talsma <https://github.com/a-tal>`_
* `Marc Abramowitz <http://github.com/msabramo>`_ * `Alexander Terry <https://github.com/mralext20>`_
* `Hans Roman <http://github.com/snahor>`_ * `peterpans01 <https://github.com/peterpans01>`_
* `Gustavo Zambonin <https://github.com/zambonin>`_

57
scripts/build_authors.py Executable file
View File

@@ -0,0 +1,57 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Scrape the project contributors list from Github and update AUTHORS.rst
"""
from __future__ import unicode_literals
import os
import time
import logging
import requests
_filepath = os.path.dirname(os.path.relpath(__file__))
FILENAME = os.path.abspath(os.path.join(_filepath, '..', 'AUTHORS.rst'))
URL = "https://api.github.com/repos/michael-lazar/rtv/contributors"
HEADER = """\
================
RTV Contributors
================
Thanks to the following people for their contributions to this project.
"""
def main():
logging.captureWarnings(True)
# Request the list of contributors
print('GET {}'.format(URL))
resp = requests.get(URL)
contributors = resp.json()
lines = []
for contributor in contributors:
time.sleep(1.0)
# Request each contributor individually to get the full name
print('GET {}'.format(contributor['url']))
resp = requests.get(contributor['url'])
user = resp.json()
name = user.get('name') or user['login']
url = user['html_url']
lines.append('* `{} <{}>`_'.format(name, url))
print('Writing to {}'.format(FILENAME))
text = HEADER + '\n'.join(lines)
text = text.encode('utf-8')
with open(FILENAME, 'wb') as fp:
fp.write(text)
if __name__ == '__main__':
main()

3
scripts/build_manpage.py Normal file → Executable file
View File

@@ -1,3 +1,5 @@
#!/usr/bin/env python
""" """
Internal tool used to automatically generate an up-to-date version of the rtv Internal tool used to automatically generate an up-to-date version of the rtv
man page. Currently this script should be manually ran after each version bump. man page. Currently this script should be manually ran after each version bump.
@@ -6,6 +8,7 @@ In the future, it would be nice to have this functionality built into setup.py.
Usage: Usage:
$ python scripts/build_manpage.py $ python scripts/build_manpage.py
""" """
import os import os
import sys import sys
from datetime import datetime from datetime import datetime