mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Simplify
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
|
||||
|
||||
class Authorization( 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 )
|
||||
@@ -72,13 +72,13 @@ class Authorization( object ):
|
||||
post_parameters[ "note" ] = note
|
||||
if note_url is not None:
|
||||
post_parameters[ "note_url" ] = note_url
|
||||
result = self.__github._dataRequest(
|
||||
status, headers, data = self.__requester.request(
|
||||
"PATCH",
|
||||
"https://api.github.com/user",
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
self.__useAttributes( result )
|
||||
self.__useAttributes( data )
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__app = None
|
||||
@@ -97,13 +97,13 @@ class Authorization( 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 ):
|
||||
|
||||
Reference in New Issue
Block a user