mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
Do all paginated calls inside PaginatedList
This was already the case for Legacy.PaginatedList. Doing it in PaginatedList.PaginatedList reduces the amount of repeated code and will allow a generic solution for issue #77
This commit is contained in:
+4
-16
@@ -105,31 +105,19 @@ class Commit( GithubObject.GithubObject ):
|
||||
return CommitStatus.CommitStatus( self._requester, data, completed = True )
|
||||
|
||||
def get_comments( self ):
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
self.url + "/comments",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return PaginatedList.PaginatedList(
|
||||
CommitComment.CommitComment,
|
||||
self._requester,
|
||||
headers,
|
||||
data
|
||||
self.url + "/comments",
|
||||
None
|
||||
)
|
||||
|
||||
def get_statuses( self ):
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
self._parentUrl( self._parentUrl( self.url ) ) + "/statuses/" + self.sha,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return PaginatedList.PaginatedList(
|
||||
CommitStatus.CommitStatus,
|
||||
self._requester,
|
||||
headers,
|
||||
data
|
||||
self._parentUrl( self._parentUrl( self.url ) ) + "/statuses/" + self.sha,
|
||||
None
|
||||
)
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user