mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 03:11:09 +00:00
Simplify
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
import GitTree
|
||||
|
||||
class GitCommit( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
def __init__( self, requester, attributes, lazy ):
|
||||
self.__requester = requester
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
@@ -62,13 +62,13 @@ class GitCommit( object ):
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
result = self.__github._dataRequest(
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
self.__url,
|
||||
None,
|
||||
None
|
||||
)
|
||||
self.__useAttributes( result )
|
||||
self.__useAttributes( data )
|
||||
self.__completed = True
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
@@ -84,6 +84,6 @@ class GitCommit( object ):
|
||||
if "sha" in attributes:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "tree" in attributes:
|
||||
self.__tree = GitTree.GitTree( self.__github, attributes[ "tree" ], lazy = True )
|
||||
self.__tree = GitTree.GitTree( self.__requester, attributes[ "tree" ], lazy = True )
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
Reference in New Issue
Block a user