mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
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:
@@ -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>`_
|
||||
|
||||
Reference in New Issue
Block a user