Fix completion and lazyness

This commit is contained in:
Vincent Jacques
2012-05-03 22:30:06 +01:00
parent 2f536fd95d
commit 82dc2225a7
31 changed files with 124 additions and 62 deletions
+4 -2
View File
@@ -13,6 +13,8 @@ class NamedUser( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def avatar_url( self ):
@@ -175,17 +177,17 @@ class NamedUser( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def create_gist( self, public, files, description = None ):
pass