mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Simplify
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
import NamedUser
|
||||
|
||||
class CommitComment( 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 )
|
||||
@@ -74,13 +74,13 @@ class CommitComment( object ):
|
||||
post_parameters = {
|
||||
"body": body,
|
||||
}
|
||||
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.__body = None
|
||||
@@ -101,13 +101,13 @@ class CommitComment( 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 ):
|
||||
@@ -133,4 +133,4 @@ class CommitComment( object ):
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
self.__user = NamedUser.NamedUser( self.__github, attributes[ "user" ], lazy = True )
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], lazy = True )
|
||||
|
||||
Reference in New Issue
Block a user