Improve management of lazy completion

This commit is contained in:
Vincent Jacques
2012-05-12 15:28:07 +02:00
parent 350c7a3726
commit a72d8b1358
42 changed files with 198 additions and 191 deletions
+3 -3
View File
@@ -6,9 +6,9 @@ from GithubObject import *
import GitTreeElement
class GitTree( object ):
def __init__( self, requester, attributes, lazy ):
def __init__( self, requester, attributes, completion ):
self.__requester = requester
self.__completed = False
self.__completed = completion != LazyCompletion
self.__initAttributes()
self.__useAttributes( attributes )
@@ -40,7 +40,7 @@ class GitTree( object ):
if "tree" in attributes and attributes[ "tree" ] is not None:
assert isinstance( attributes[ "tree" ], list ) and ( len( attributes[ "tree" ] ) == 0 or isinstance( attributes[ "tree" ][ 0 ], dict ) )
self.__tree = [
GitTreeElement.GitTreeElement( self.__requester, element, lazy = True )
GitTreeElement.GitTreeElement( self.__requester, element, completion = LazyCompletion )
for element in attributes[ "tree" ]
]
if "url" in attributes and attributes[ "url" ] is not None: