Fix completion and lazyness

This commit is contained in:
Vincent Jacques
2012-05-03 22:30:06 +01:00
parent 2f536fd95d
commit 82dc2225a7
31 changed files with 124 additions and 62 deletions
+4 -2
View File
@@ -16,6 +16,8 @@ class AuthenticatedUser( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def avatar_url( self ):
@@ -172,17 +174,17 @@ class AuthenticatedUser( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def add_to_emails( self, *emails ):
pass
+4 -2
View File
@@ -8,6 +8,8 @@ class Authorization( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def app( self ):
@@ -68,17 +70,17 @@ class Authorization( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def delete( self ):
pass
+4 -2
View File
@@ -9,6 +9,8 @@ class Branch( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def commit( self ):
@@ -27,17 +29,17 @@ class Branch( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def __useAttributes( self, attributes ):
if "commit" in attributes:
+4 -2
View File
@@ -11,6 +11,8 @@ class Commit( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def author( self ):
@@ -65,17 +67,17 @@ class Commit( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def create_comment( self, body, commit_id = None, line = None, path = None, position = None ):
pass
+4 -2
View File
@@ -9,6 +9,8 @@ class CommitComment( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def body( self ):
@@ -81,17 +83,17 @@ class CommitComment( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def delete( self ):
pass
+4 -2
View File
@@ -8,6 +8,8 @@ class Download( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def accesskeyid( self ):
@@ -134,17 +136,17 @@ class Download( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def delete( self ):
pass
+4 -2
View File
@@ -11,6 +11,8 @@ class Event( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def actor( self ):
@@ -89,17 +91,17 @@ class Event( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def __useAttributes( self, attributes ):
if "actor" in attributes:
+4 -2
View File
@@ -11,6 +11,8 @@ class Gist( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def comments( self ):
@@ -101,17 +103,17 @@ class Gist( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def create_comment( self, body ):
pass
+4 -2
View File
@@ -9,6 +9,8 @@ class GistComment( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def body( self ):
@@ -51,17 +53,17 @@ class GistComment( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def delete( self ):
pass
+4 -2
View File
@@ -8,6 +8,8 @@ class GitBlob( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def content( self ):
@@ -44,17 +46,17 @@ class GitBlob( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def __useAttributes( self, attributes ):
if "content" in attributes:
+4 -2
View File
@@ -9,6 +9,8 @@ class GitCommit( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def author( self ):
@@ -57,17 +59,17 @@ class GitCommit( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def __useAttributes( self, attributes ):
if "author" in attributes:
+4 -2
View File
@@ -8,6 +8,8 @@ class GitRef( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def object( self ):
@@ -32,17 +34,17 @@ class GitRef( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def delete( self ):
pass
+4 -2
View File
@@ -8,6 +8,8 @@ class GitTag( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def message( self ):
@@ -50,17 +52,17 @@ class GitTag( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def __useAttributes( self, attributes ):
if "message" in attributes:
+4 -2
View File
@@ -8,6 +8,8 @@ class GitTree( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def recursive( self ):
@@ -38,17 +40,17 @@ class GitTree( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def __useAttributes( self, attributes ):
if "recursive" in attributes:
+4 -2
View File
@@ -8,6 +8,8 @@ class Hook( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def active( self ):
@@ -68,17 +70,17 @@ class Hook( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def delete( self ):
pass
+4 -2
View File
@@ -13,6 +13,8 @@ class Issue( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def assignee( self ):
@@ -121,17 +123,17 @@ class Issue( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def add_to_labels( self, *labels ):
pass
+4 -2
View File
@@ -9,6 +9,8 @@ class IssueComment( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def body( self ):
@@ -51,17 +53,17 @@ class IssueComment( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def delete( self ):
pass
+4 -2
View File
@@ -9,6 +9,8 @@ class IssueEvent( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def actor( self ):
@@ -57,17 +59,17 @@ class IssueEvent( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def __useAttributes( self, attributes ):
if "actor" in attributes:
+4 -2
View File
@@ -8,6 +8,8 @@ class Label( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def color( self ):
@@ -32,17 +34,17 @@ class Label( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def delete( self ):
pass
+4 -2
View File
@@ -10,6 +10,8 @@ class Milestone( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def closed_issues( self ):
@@ -76,17 +78,17 @@ class Milestone( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def delete( self ):
pass
+4 -2
View File
@@ -13,6 +13,8 @@ class NamedUser( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def avatar_url( self ):
@@ -175,17 +177,17 @@ class NamedUser( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def create_gist( self, public, files, description = None ):
pass
+4 -2
View File
@@ -12,6 +12,8 @@ class Organization( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def avatar_url( self ):
@@ -162,17 +164,17 @@ class Organization( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def add_to_public_members( self, public_member ):
pass
+4 -2
View File
@@ -12,6 +12,8 @@ class PullRequest( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def additions( self ):
@@ -174,17 +176,17 @@ class PullRequest( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def edit( self, title = None, body = None, state = None ):
post_parameters = {
+4 -2
View File
@@ -9,6 +9,8 @@ class PullRequestComment( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def body( self ):
@@ -81,17 +83,17 @@ class PullRequestComment( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def delete( self ):
pass
+4 -2
View File
@@ -8,6 +8,8 @@ class PullRequestFile( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def additions( self ):
@@ -68,17 +70,17 @@ class PullRequestFile( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def __useAttributes( self, attributes ):
if "additions" in attributes:
+4 -2
View File
@@ -29,6 +29,8 @@ class Repository( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def clone_url( self ):
@@ -215,17 +217,17 @@ class Repository( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def add_to_collaborators( self, collaborator ):
pass
+4 -2
View File
@@ -8,6 +8,8 @@ class RepositoryKey( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def id( self ):
@@ -38,17 +40,17 @@ class RepositoryKey( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def delete( self ):
pass
+4 -2
View File
@@ -9,6 +9,8 @@ class Tag( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def commit( self ):
@@ -39,17 +41,17 @@ class Tag( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def __useAttributes( self, attributes ):
if "commit" in attributes:
+4 -2
View File
@@ -10,6 +10,8 @@ class Team( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def id( self ):
@@ -52,17 +54,17 @@ class Team( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def add_to_members( self, member ):
pass
+4 -2
View File
@@ -8,6 +8,8 @@ class UserKey( object ):
self.__completed = False
self.__initAttributes()
self.__useAttributes( attributes )
if not lazy:
self.__complete()
@property
def id( self ):
@@ -38,17 +40,17 @@ class UserKey( object ):
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
self.__completed = True
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.url,
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def delete( self ):
pass