Add html_url attribute to comments.

html_url attributes were missing from IssueComment and PullRequestComment.
Added to both as per the GitHub API.
This commit is contained in:
Michael Stead
2013-05-27 14:13:14 -03:00
parent 42edda3f8d
commit 1f98067e95
2 changed files with 24 additions and 0 deletions
+12
View File
@@ -104,6 +104,14 @@ class PullRequestComment(github.GithubObject.CompletableGithubObject):
self._completeIfNotSet(self._url)
return self._NoneIfNotSet(self._url)
@property
def html_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._html_url)
return self._NoneIfNotSet(self._html_url)
@property
def user(self):
"""
@@ -153,6 +161,7 @@ class PullRequestComment(github.GithubObject.CompletableGithubObject):
self._position = github.GithubObject.NotSet
self._updated_at = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
self._html_url = github.GithubObject.NotSet
self._user = github.GithubObject.NotSet
def _useAttributes(self, attributes):
@@ -186,6 +195,9 @@ class PullRequestComment(github.GithubObject.CompletableGithubObject):
if "url" in attributes: # pragma no branch
assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"]
self._url = attributes["url"]
if "html_url" in attributes: # pragma no branch
assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"]
self._html_url = attributes["html_url"]
if "user" in attributes: # pragma no branch
assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"]
self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False)