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).
This commit is contained in:
Alex
2019-04-05 13:51:40 +08:00
committed by Wan Liuyang
parent 5ae7af55ea
commit 293846bee3
+8 -2
View File
@@ -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 <http://developer.github.com/v3/repos>`_
: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 <http://developer.github.com/v3/repos/downloads>`_