Remove completion of Hook

This commit is contained in:
Vincent Jacques
2012-05-19 07:05:25 +01:00
parent 667937b437
commit 350e014d55
3 changed files with 1 additions and 27 deletions
-25
View File
@@ -10,52 +10,41 @@ class Hook( object ):
self.__completed = completion != LazyCompletion
self.__initAttributes()
self.__useAttributes( attributes )
if completion == ImmediateCompletion:
self.__complete()
@property
def active( self ):
self.__completeIfNeeded( self.__active )
return self.__active
@property
def config( self ):
self.__completeIfNeeded( self.__config )
return self.__config
@property
def created_at( self ):
self.__completeIfNeeded( self.__created_at )
return self.__created_at
@property
def events( self ):
self.__completeIfNeeded( self.__events )
return self.__events
@property
def id( self ):
self.__completeIfNeeded( self.__id )
return self.__id
@property
def last_response( self ):
self.__completeIfNeeded( self.__last_response )
return self.__last_response
@property
def name( self ):
self.__completeIfNeeded( self.__name )
return self.__name
@property
def updated_at( self ):
self.__completeIfNeeded( self.__updated_at )
return self.__updated_at
@property
def url( self ):
self.__completeIfNeeded( self.__url )
return self.__url
def delete( self ):
@@ -106,20 +95,6 @@ class Hook( object ):
self.__updated_at = None
self.__url = None
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
def __complete( self ):
status, headers, data = self.__requester.request(
"GET",
self.__url,
None,
None
)
self.__useAttributes( data )
self.__completed = True
def __useAttributes( self, attributes ):
# @todo Remove this debug weakness: we shall assume that github will add new attributes
for attribute in attributes: