(args)
| 41 | |
| 42 | |
| 43 | def 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 | |
| 67 | def get_collaborators(args): |
no test coverage detected