MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / get_contributors

Function get_contributors

etc/scripts/util/contributorer.py:43–64  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

41
42
43def get_contributors(args):
44 contributors = []
45 link = 'https://api.github.com/repos/{}/contributors'.format(args.repository)
46 while link is not None:
47 print(link)
48 result = get_oauth(link, args, params={'per_page': 80})
49 links = result.headers.get('link')
50 if links is None:
51 link = None
52 else:
53 splits = links.split(',')
54 for split in splits:
55 bits = split.split(';')
56 # If there is a next rel link, follow it
57 if len(bits) == 2 and bits[1].strip() == 'rel="next"':
58 link = bits[0].strip()[1:-1]
59 else:
60 link = None
61
62 for contributor in result.json():
63 contributors.append(contributor)
64 return contributors
65
66
67def get_collaborators(args):

Callers 1

create_fileFunction · 0.85

Calls 4

get_oauthFunction · 0.85
jsonMethod · 0.80
getMethod · 0.65
formatMethod · 0.45

Tested by

no test coverage detected