1
0
mirror of https://github.com/balkian/jupyterhub-oauth.git synced 2024-12-22 03:58:13 +00:00

Added download_users script

This commit is contained in:
J. Fernando Sánchez 2016-06-10 17:44:51 +02:00
parent 7be39b76cd
commit f8289e37ee
2 changed files with 50 additions and 33 deletions

32
download_users.py Normal file
View File

@ -0,0 +1,32 @@
from github import GitHub
import os
import sys
import json
ACCESS_TOKEN = os.environ.get("GH_ACCESS_TOKEN", None)
ORG = os.environ.get("GH_ORG", "gsi-upm")
gh = GitHub(access_token=ACCESS_TOKEN)
users = []
tfilter = sys.argv[1:]
allteams = gh.orgs(ORG).teams.get()
print(list(t["name"] for t in allteams))
tlist = list(t for t in allteams if t["name"] in tfilter)
print(tlist)
for t in tlist:
print("Getting team: %s" % t["name"])
t["members"] = gh.teams(t["id"]).members.get()
for m in t["members"]:
login = m["login"]
users.append(login)
with open("userlist", "w") as f:
for user in set(users):
f.write(user)
if user in ("oaraque", "balkian", "cif2cif"):
f.write(" admin")
f.write("\n")

View File

@ -1,36 +1,21 @@
balkian admin jochoaserna
cif2cif admin SergioML9
nachtkatze admin
adri87
AlbertoED
alejandroSaura
allopezf
alvarocarrera
amardomingo
antoniom-diaz
arturomtm
Batlin
carloscrespog
constanr
DanielLara
dmorenob
emilioserra emilioserra
enriquecs oaraque admin
gpoveda Drozzer
gsi-bot constanr
hopple antoniom-diaz
javiherrera Lorena25
JesusMSM
Krun
ladvan
miguelcb84
mtorresl
NachoCP NachoCP
neburdv rodbarest
neoner2002 alvarocarrera
pmoncadaisla gpoveda
RBermejo hopple
rmaestre AlbertoED
rongil
sunshengjing sunshengjing
toniprada balkian admin
pepos
antoniofll
enriquecs
miguelcb84
JesusMSM