mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Adding base parameter to get_pulls() method.
This commit is contained in:
@@ -1664,17 +1664,19 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
)
|
||||
return github.PullRequest.PullRequest(self._requester, headers, data, completed=True)
|
||||
|
||||
def get_pulls(self, state=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet):
|
||||
def get_pulls(self, state=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet, base=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `GET /repos/:owner/:repo/pulls <http://developer.github.com/v3/pulls>`_
|
||||
:param state: string
|
||||
:param sort: string
|
||||
:param direction: string
|
||||
:param base: string
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequest.PullRequest`
|
||||
"""
|
||||
assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state
|
||||
assert sort is github.GithubObject.NotSet or isinstance(sort, (str, unicode)), sort
|
||||
assert direction is github.GithubObject.NotSet or isinstance(direction, (str, unicode)), direction
|
||||
assert base is github.GithubObject.NotSet or isinstance(base, (str, unicode)), base
|
||||
url_parameters = dict()
|
||||
if state is not github.GithubObject.NotSet:
|
||||
url_parameters["state"] = state
|
||||
@@ -1682,6 +1684,8 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
url_parameters["sort"] = sort
|
||||
if direction is not github.GithubObject.NotSet:
|
||||
url_parameters["direction"] = direction
|
||||
if base is not github.GithubObject.NotSet:
|
||||
url_parameters["base"] = base
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.PullRequest.PullRequest,
|
||||
self._requester,
|
||||
|
||||
Reference in New Issue
Block a user