mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Do not try to __complete objects without url
This commit is contained in:
@@ -559,7 +559,6 @@ class AuthenticatedUser( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -106,7 +106,6 @@ class Authorization( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -15,38 +15,19 @@ class Branch( object ):
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
if not lazy:
|
||||
self.__complete()
|
||||
|
||||
@property
|
||||
def commit( self ):
|
||||
self.__completeIfNeeded( self.__commit )
|
||||
return self.__commit
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
self.__completeIfNeeded( self.__name )
|
||||
return self.__name
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__commit = None
|
||||
self.__name = None
|
||||
|
||||
def __completeIfNeeded( self, testedAttribute ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
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 No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "commit" in attributes and attributes[ "commit" ] is not None:
|
||||
|
||||
@@ -108,7 +108,6 @@ class Commit( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -110,7 +110,6 @@ class CommitComment( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -151,7 +151,6 @@ class Download( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -98,7 +98,6 @@ class Event( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -202,7 +202,6 @@ class Gist( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -80,7 +80,6 @@ class GistComment( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -53,7 +53,6 @@ class GitBlob( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -66,7 +66,6 @@ class GitCommit( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -63,7 +63,6 @@ class GitRef( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -59,7 +59,6 @@ class GitTag( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -47,7 +47,6 @@ class GitTree( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -114,7 +114,6 @@ class Hook( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -239,7 +239,6 @@ class Issue( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -80,7 +80,6 @@ class IssueComment( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -66,7 +66,6 @@ class IssueEvent( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -62,7 +62,6 @@ class Label( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -125,7 +125,6 @@ class Milestone( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -353,7 +353,6 @@ class NamedUser( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -369,7 +369,6 @@ class Organization( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -14,27 +14,21 @@ class Plan( object ):
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
if not lazy:
|
||||
self.__complete()
|
||||
|
||||
@property
|
||||
def collaborators( self ):
|
||||
self.__completeIfNeeded( self.__collaborators )
|
||||
return self.__collaborators
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
self.__completeIfNeeded( self.__name )
|
||||
return self.__name
|
||||
|
||||
@property
|
||||
def private_repos( self ):
|
||||
self.__completeIfNeeded( self.__private_repos )
|
||||
return self.__private_repos
|
||||
|
||||
@property
|
||||
def space( self ):
|
||||
self.__completeIfNeeded( self.__space )
|
||||
return self.__space
|
||||
|
||||
def __initAttributes( self ):
|
||||
@@ -43,21 +37,6 @@ class Plan( object ):
|
||||
self.__private_repos = None
|
||||
self.__space = None
|
||||
|
||||
def __completeIfNeeded( self, testedAttribute ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
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 No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "collaborators" in attributes and attributes[ "collaborators" ] is not None:
|
||||
|
||||
@@ -268,7 +268,6 @@ class PullRequest( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -110,7 +110,6 @@ class PullRequestComment( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -14,52 +14,41 @@ class PullRequestFile( object ):
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
if not lazy:
|
||||
self.__complete()
|
||||
|
||||
@property
|
||||
def additions( self ):
|
||||
self.__completeIfNeeded( self.__additions )
|
||||
return self.__additions
|
||||
|
||||
@property
|
||||
def blob_url( self ):
|
||||
self.__completeIfNeeded( self.__blob_url )
|
||||
return self.__blob_url
|
||||
|
||||
@property
|
||||
def changes( self ):
|
||||
self.__completeIfNeeded( self.__changes )
|
||||
return self.__changes
|
||||
|
||||
@property
|
||||
def deletions( self ):
|
||||
self.__completeIfNeeded( self.__deletions )
|
||||
return self.__deletions
|
||||
|
||||
@property
|
||||
def filename( self ):
|
||||
self.__completeIfNeeded( self.__filename )
|
||||
return self.__filename
|
||||
|
||||
@property
|
||||
def patch( self ):
|
||||
self.__completeIfNeeded( self.__patch )
|
||||
return self.__patch
|
||||
|
||||
@property
|
||||
def raw_url( self ):
|
||||
self.__completeIfNeeded( self.__raw_url )
|
||||
return self.__raw_url
|
||||
|
||||
@property
|
||||
def sha( self ):
|
||||
self.__completeIfNeeded( self.__sha )
|
||||
return self.__sha
|
||||
|
||||
@property
|
||||
def status( self ):
|
||||
self.__completeIfNeeded( self.__status )
|
||||
return self.__status
|
||||
|
||||
def __initAttributes( self ):
|
||||
@@ -73,21 +62,6 @@ class PullRequestFile( object ):
|
||||
self.__sha = None
|
||||
self.__status = None
|
||||
|
||||
def __completeIfNeeded( self, testedAttribute ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
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 No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "additions" in attributes and attributes[ "additions" ] is not None:
|
||||
|
||||
@@ -884,7 +884,6 @@ class Repository( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -68,7 +68,6 @@ class RepositoryKey( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -15,27 +15,21 @@ class Tag( object ):
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
if not lazy:
|
||||
self.__complete()
|
||||
|
||||
@property
|
||||
def commit( self ):
|
||||
self.__completeIfNeeded( self.__commit )
|
||||
return self.__commit
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
self.__completeIfNeeded( self.__name )
|
||||
return self.__name
|
||||
|
||||
@property
|
||||
def tarball_url( self ):
|
||||
self.__completeIfNeeded( self.__tarball_url )
|
||||
return self.__tarball_url
|
||||
|
||||
@property
|
||||
def zipball_url( self ):
|
||||
self.__completeIfNeeded( self.__zipball_url )
|
||||
return self.__zipball_url
|
||||
|
||||
def __initAttributes( self ):
|
||||
@@ -44,21 +38,6 @@ class Tag( object ):
|
||||
self.__tarball_url = None
|
||||
self.__zipball_url = None
|
||||
|
||||
def __completeIfNeeded( self, testedAttribute ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
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 No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "commit" in attributes and attributes[ "commit" ] is not None:
|
||||
|
||||
@@ -161,7 +161,6 @@ class Team( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
@@ -70,7 +70,6 @@ class UserKey( object ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
# @todo Do not generate __complete if type has no url attribute
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
|
||||
Reference in New Issue
Block a user