mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 11:51:10 +00:00
Remove completion of Hook
This commit is contained in:
@@ -637,7 +637,6 @@
|
||||
},
|
||||
{
|
||||
"name": "Hook",
|
||||
"isCompletable": true,
|
||||
"edit": {
|
||||
"mandatoryParameters": [
|
||||
{ "name": "name", "type": "@todo" },
|
||||
|
||||
@@ -3477,7 +3477,7 @@
|
||||
"name": "url"
|
||||
}
|
||||
],
|
||||
"isCompletable": true,
|
||||
"isCompletable": false,
|
||||
"name": "Hook",
|
||||
"methods": [
|
||||
{
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user