From 293846bee3828bd49ec5fd5925ee3eb2d0d0b85c Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 5 Apr 2019 08:51:40 +0300 Subject: [PATCH] Add url parameter to include anonymous contributors in get_contributors() (#1075) Add the anon parameter missing from get_contributors() so anonymous contributors can be included in results as specified in the [Github REST API Reference](https://developer.github.com/v3/repos/#list-contributors). --- github/Repository.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/github/Repository.py b/github/Repository.py index 6d360020..1d4514f5 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -1799,18 +1799,24 @@ class Repository(github.GithubObject.CompletableGithubObject): for attributes in data ] - def get_contributors(self): + def get_contributors(self, anon=github.GithubObject.NotSet): """ :calls: `GET /repos/:owner/:repo/contributors `_ + :param anon: string :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` """ + url_parameters = dict() + if anon is not github.GithubObject.NotSet: + url_parameters["anon"] = anon + return github.PaginatedList.PaginatedList( github.NamedUser.NamedUser, self._requester, self.url + "/contributors", - None + url_parameters ) + def get_download(self, id): """ :calls: `GET /repos/:owner/:repo/downloads/:id `_