mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Repository.get_readme and Repository.get_contents (issue #65)
This commit is contained in:
@@ -22,6 +22,7 @@ import PaginatedList
|
||||
|
||||
import Branch
|
||||
import IssueEvent
|
||||
import ContentFile
|
||||
import Label
|
||||
import InputGitAuthor
|
||||
import GitBlob
|
||||
@@ -594,6 +595,16 @@ class Repository( GithubObject.GithubObject ):
|
||||
data
|
||||
)
|
||||
|
||||
def get_contents( self, path ):
|
||||
assert isinstance( path, ( str, unicode ) ), path
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
self.url + "/contents" + path,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return ContentFile.ContentFile( self._requester, data, completed = True )
|
||||
|
||||
def get_contributors( self ):
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -964,6 +975,15 @@ class Repository( GithubObject.GithubObject ):
|
||||
data
|
||||
)
|
||||
|
||||
def get_readme( self ):
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
self.url + "/readme",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return ContentFile.ContentFile( self._requester, data, completed = True )
|
||||
|
||||
def get_stargazers( self ):
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
|
||||
Reference in New Issue
Block a user