mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 18:20:27 +00:00
420b7913d4
2820ab0b51 Merge pull request #1076 from KhronosGroup/bitcast-pre-330-glsl 63bcbd511e GLSL: Need extension to use bitcast on GLSL < 330. 9f3bebe3d0 Merge pull request #1075 from lifpan/master b11c20fc1d Remove unreasonable assertion for OpTypeImage Sampled parameter. 1a592b7c0f Merge pull request #1067 from cdavis5e/msl-scalar-block-layout 28454facbb MSL: Handle packed matrices. ea5c0ed82f MSL: Fix alignment of packed types. 44f688bf0b Merge pull request #1070 from KhronosGroup/fix-1066 25c74b324e Forget loop variable enables after emitting block chain. 6b010e0cbc Merge pull request #1069 from KhronosGroup/fix-1053 f6f849397e MSL: Re-roll array expressions in initializers. e5fa7edfd6 MSL: Support scalar block layout. git-subtree-dir: deps/SPIRV-Cross git-subtree-split: 2820ab0b51bf5e4187435d904b34e762b988f48b
121 lines
2.7 KiB
Python
121 lines
2.7 KiB
Python
#!/usr/bin/python3
|
|
#
|
|
# Get list of repo contributors from GitHub using v4 GraphQL API
|
|
#
|
|
# Copyright (C) 2016-2019 - Brad Parker
|
|
#
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
from urllib.request import urlopen, Request
|
|
import json
|
|
|
|
### SETTINGS ###
|
|
# https://help.github.com/articles/creating-an-access-token-for-command-line-use/
|
|
TOKEN = 'Your access token here'
|
|
orgName = 'libretro'
|
|
repoName = 'RetroArch'
|
|
### END SETTINGS ###
|
|
|
|
######
|
|
|
|
lines = []
|
|
|
|
def get_contributors(after=None):
|
|
global lines
|
|
headers = {'Authorization': 'bearer ' + TOKEN}
|
|
url = 'https://api.github.com/graphql'
|
|
|
|
dataStr = """{
|
|
repository(owner: \"""" + orgName + """\", name: \"""" + repoName + """\") {
|
|
"""
|
|
|
|
if after:
|
|
dataStr += """
|
|
mentionableUsers(first: 100 after:\"""" + after + """\") {
|
|
"""
|
|
else:
|
|
dataStr += """
|
|
mentionableUsers(first: 100) {
|
|
"""
|
|
|
|
dataStr += """
|
|
edges {
|
|
node {
|
|
name
|
|
login
|
|
}
|
|
cursor
|
|
}
|
|
}
|
|
}
|
|
}
|
|
"""
|
|
|
|
d = {'query': dataStr}
|
|
|
|
data = json.dumps(d).encode('utf-8')
|
|
|
|
req = Request(url, data, headers)
|
|
|
|
with urlopen(req) as resp:
|
|
d = resp.read()
|
|
|
|
j = json.loads(d)
|
|
|
|
if len(j['data']['repository']['mentionableUsers']['edges']) == 0:
|
|
return None
|
|
|
|
cursor = None
|
|
|
|
for key in j['data']['repository']['mentionableUsers']['edges']:
|
|
line = ''
|
|
name = None
|
|
login = None
|
|
node = key['node']
|
|
|
|
if 'name' in node and node['name'] and len(node['name']) > 0:
|
|
name = node['name']
|
|
|
|
if 'login' in node and node['login'] and len(node['login']) > 0:
|
|
login = node['login']
|
|
|
|
if 'cursor' in key and key['cursor'] and len(key['cursor']) > 0:
|
|
cursor = key['cursor']
|
|
|
|
if name:
|
|
line = name
|
|
|
|
if login and login.lower() != name.lower():
|
|
line += ' (' + login + ')'
|
|
elif login:
|
|
line = login
|
|
else:
|
|
continue
|
|
|
|
if len(line) > 0:
|
|
lines.append(line)
|
|
|
|
if cursor and len(cursor) > 0:
|
|
return cursor
|
|
|
|
def doit(cont):
|
|
after = get_contributors(cont)
|
|
|
|
if after:
|
|
doit(after)
|
|
|
|
doit(None)
|
|
|
|
print('\n'.join(sorted(lines, key=str.lower)))
|