Implement License API (#734)

* Implement License API

* Update copyright
This commit is contained in:
Wan Liuyang
2018-04-06 09:17:19 +08:00
committed by GitHub
parent 911bf61522
commit b54ccc784e
12 changed files with 315 additions and 0 deletions
+11
View File
@@ -90,6 +90,14 @@ class ContentFile(github.GithubObject.CompletableGithubObject):
self._completeIfNotSet(self._html_url)
return self._html_url.value
@property
def license(self):
"""
:type: :class:`github.License.License`
"""
self._completeIfNotSet(self._license)
return self._license.value
@property
def name(self):
"""
@@ -154,6 +162,7 @@ class ContentFile(github.GithubObject.CompletableGithubObject):
self._encoding = github.GithubObject.NotSet
self._git_url = github.GithubObject.NotSet
self._html_url = github.GithubObject.NotSet
self._license = github.GithubObject.NotSet
self._name = github.GithubObject.NotSet
self._path = github.GithubObject.NotSet
self._repository = github.GithubObject.NotSet
@@ -170,6 +179,8 @@ class ContentFile(github.GithubObject.CompletableGithubObject):
self._git_url = self._makeStringAttribute(attributes["git_url"])
if "html_url" in attributes: # pragma no branch
self._html_url = self._makeStringAttribute(attributes["html_url"])
if "license" in attributes: # pragma no branch
self._license = self._makeClassAttribute(github.License.License, attributes["license"])
if "name" in attributes: # pragma no branch
self._name = self._makeStringAttribute(attributes["name"])
if "path" in attributes: # pragma no branch