From a627c9d4cae32d019409d961abe40e41fb54f52b Mon Sep 17 00:00:00 2001 From: Michael Stead Date: Fri, 2 Nov 2012 21:13:18 -0300 Subject: [PATCH] Add 'assignee' attribute to PullRequest It seems as though this may have been added to the github API and was not being included in the PullRequest object. --- github/PullRequest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/github/PullRequest.py b/github/PullRequest.py index a31b4a45..8ec0d608 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -29,6 +29,11 @@ class PullRequest(GithubObject.GithubObject): self._completeIfNotSet(self._additions) return self._NoneIfNotSet(self._additions) + @property + def assignee(self): + self._completeIfNotSet(self._assignee) + return self._NoneIfNotSet(self._assignee) + @property def base(self): self._completeIfNotSet(self._base) @@ -290,6 +295,7 @@ class PullRequest(GithubObject.GithubObject): def _initAttributes(self): self._additions = GithubObject.NotSet + self._assignee = GithubObject.NotSet self._base = GithubObject.NotSet self._body = GithubObject.NotSet self._changed_files = GithubObject.NotSet @@ -320,6 +326,9 @@ class PullRequest(GithubObject.GithubObject): if "additions" in attributes: # pragma no branch assert attributes["additions"] is None or isinstance(attributes["additions"], int), attributes["additions"] self._additions = attributes["additions"] + if "assignee" in attributes: # pragma no branch + assert attributes["assignee"] is None or isinstance(attributes["assignee"], dict), attributes["assignee"] + self._assignee = None if attributes["assignee"] is None else NamedUser.NamedUser(self._requester, attributes["assignee"], completed=False) if "base" in attributes: # pragma no branch assert attributes["base"] is None or isinstance(attributes["base"], dict), attributes["base"] self._base = None if attributes["base"] is None else PullRequestPart.PullRequestPart(self._requester, attributes["base"], completed=False)