From adb9e07a30a551ad5d69ea6840c0bf7f1ad25ea7 Mon Sep 17 00:00:00 2001 From: Jonathan Debonis Date: Thu, 29 Jan 2015 16:08:35 -0800 Subject: [PATCH] Added sort option to get_pulls. --- github/Repository.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/github/Repository.py b/github/Repository.py index f57a1aa3..b2a478de 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -1629,16 +1629,19 @@ class Repository(github.GithubObject.CompletableGithubObject): ) return github.PullRequest.PullRequest(self._requester, headers, data, completed=True) - def get_pulls(self, state=github.GithubObject.NotSet): + def get_pulls(self, state=github.GithubObject.NotSet, sort=github.GithubObject.NotSet): """ :calls: `GET /repos/:owner/:repo/pulls `_ :param state: 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 url_parameters = dict() if state is not github.GithubObject.NotSet: url_parameters["state"] = state + if sort is not github.GithubObject.NotSet: + url_parameters["sort"] = sort return github.PaginatedList.PaginatedList( github.PullRequest.PullRequest, self._requester,