mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 03:11:09 +00:00
Implement License API (#734)
* Implement License API * Update copyright
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user