mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Fix testEvents
This commit is contained in:
@@ -162,7 +162,7 @@ class AuthenticatedUser( object ):
|
||||
def add_to_following( self, following ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"PUT",
|
||||
str( self.url ) + "/following/" + str( following._identity ),
|
||||
str( self.url ) + "/following" + "/" + str( following._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -170,7 +170,7 @@ class AuthenticatedUser( object ):
|
||||
def add_to_watched( self, watched ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"PUT",
|
||||
str( self.url ) + "/watched/" + str( watched._identity ),
|
||||
str( self.url ) + "/watched" + "/" + str( watched._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -283,7 +283,7 @@ class AuthenticatedUser( object ):
|
||||
def get_authorization( self, id ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/authorizations/" + str( id ),
|
||||
str( self.url ) + "/authorizations" + "/" + str( id ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -315,7 +315,7 @@ class AuthenticatedUser( object ):
|
||||
def get_events( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/events",
|
||||
"https://api.github.com/events",
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -385,7 +385,7 @@ class AuthenticatedUser( object ):
|
||||
def get_key( self, id ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/keys/" + str( id ),
|
||||
str( self.url ) + "/keys" + "/" + str( id ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -406,7 +406,18 @@ class AuthenticatedUser( object ):
|
||||
)
|
||||
|
||||
def get_organization_events( self, org ):
|
||||
pass
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
"https://api.github.com/users/" + str( self.login ) + "/events/orgs/" + str( org.login ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
return PaginatedList.PaginatedList(
|
||||
Event.Event,
|
||||
self.__requester,
|
||||
headers,
|
||||
data
|
||||
)
|
||||
|
||||
def get_orgs( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
@@ -465,7 +476,7 @@ class AuthenticatedUser( object ):
|
||||
def has_in_following( self, following ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/following/" + str( following._identity ),
|
||||
str( self.url ) + "/following" + "/" + str( following._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -474,7 +485,7 @@ class AuthenticatedUser( object ):
|
||||
def has_in_watched( self, watched ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/watched/" + str( watched._identity ),
|
||||
str( self.url ) + "/watched" + "/" + str( watched._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -492,7 +503,7 @@ class AuthenticatedUser( object ):
|
||||
def remove_from_following( self, following ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"DELETE",
|
||||
str( self.url ) + "/following/" + str( following._identity ),
|
||||
str( self.url ) + "/following" + "/" + str( following._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -500,7 +511,7 @@ class AuthenticatedUser( object ):
|
||||
def remove_from_watched( self, watched ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"DELETE",
|
||||
str( self.url ) + "/watched/" + str( watched._identity ),
|
||||
str( self.url ) + "/watched" + "/" + str( watched._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -549,53 +560,53 @@ class AuthenticatedUser( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "avatar_url" in attributes:
|
||||
if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None:
|
||||
self.__avatar_url = attributes[ "avatar_url" ]
|
||||
if "bio" in attributes:
|
||||
if "bio" in attributes and attributes[ "bio" ] is not None:
|
||||
self.__bio = attributes[ "bio" ]
|
||||
if "blog" in attributes:
|
||||
if "blog" in attributes and attributes[ "blog" ] is not None:
|
||||
self.__blog = attributes[ "blog" ]
|
||||
if "collaborators" in attributes:
|
||||
if "collaborators" in attributes and attributes[ "collaborators" ] is not None:
|
||||
self.__collaborators = attributes[ "collaborators" ]
|
||||
if "company" in attributes:
|
||||
if "company" in attributes and attributes[ "company" ] is not None:
|
||||
self.__company = attributes[ "company" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "disk_usage" in attributes:
|
||||
if "disk_usage" in attributes and attributes[ "disk_usage" ] is not None:
|
||||
self.__disk_usage = attributes[ "disk_usage" ]
|
||||
if "email" in attributes:
|
||||
if "email" in attributes and attributes[ "email" ] is not None:
|
||||
self.__email = attributes[ "email" ]
|
||||
if "followers" in attributes:
|
||||
if "followers" in attributes and attributes[ "followers" ] is not None:
|
||||
self.__followers = attributes[ "followers" ]
|
||||
if "following" in attributes:
|
||||
if "following" in attributes and attributes[ "following" ] is not None:
|
||||
self.__following = attributes[ "following" ]
|
||||
if "gravatar_id" in attributes:
|
||||
if "gravatar_id" in attributes and attributes[ "gravatar_id" ] is not None:
|
||||
self.__gravatar_id = attributes[ "gravatar_id" ]
|
||||
if "hireable" in attributes:
|
||||
if "hireable" in attributes and attributes[ "hireable" ] is not None:
|
||||
self.__hireable = attributes[ "hireable" ]
|
||||
if "html_url" in attributes:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "location" in attributes:
|
||||
if "location" in attributes and attributes[ "location" ] is not None:
|
||||
self.__location = attributes[ "location" ]
|
||||
if "login" in attributes:
|
||||
if "login" in attributes and attributes[ "login" ] is not None:
|
||||
self.__login = attributes[ "login" ]
|
||||
if "name" in attributes:
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "owned_private_repos" in attributes:
|
||||
if "owned_private_repos" in attributes and attributes[ "owned_private_repos" ] is not None:
|
||||
self.__owned_private_repos = attributes[ "owned_private_repos" ]
|
||||
if "plan" in attributes:
|
||||
if "plan" in attributes and attributes[ "plan" ] is not None:
|
||||
self.__plan = attributes[ "plan" ]
|
||||
if "private_gists" in attributes:
|
||||
if "private_gists" in attributes and attributes[ "private_gists" ] is not None:
|
||||
self.__private_gists = attributes[ "private_gists" ]
|
||||
if "public_gists" in attributes:
|
||||
if "public_gists" in attributes and attributes[ "public_gists" ] is not None:
|
||||
self.__public_gists = attributes[ "public_gists" ]
|
||||
if "public_repos" in attributes:
|
||||
if "public_repos" in attributes and attributes[ "public_repos" ] is not None:
|
||||
self.__public_repos = attributes[ "public_repos" ]
|
||||
if "total_private_repos" in attributes:
|
||||
if "total_private_repos" in attributes and attributes[ "total_private_repos" ] is not None:
|
||||
self.__total_private_repos = attributes[ "total_private_repos" ]
|
||||
if "type" in attributes:
|
||||
if "type" in attributes and attributes[ "type" ] is not None:
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -119,21 +119,21 @@ class Authorization( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "app" in attributes:
|
||||
if "app" in attributes and attributes[ "app" ] is not None:
|
||||
self.__app = attributes[ "app" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "note" in attributes:
|
||||
if "note" in attributes and attributes[ "note" ] is not None:
|
||||
self.__note = attributes[ "note" ]
|
||||
if "note_url" in attributes:
|
||||
if "note_url" in attributes and attributes[ "note_url" ] is not None:
|
||||
self.__note_url = attributes[ "note_url" ]
|
||||
if "scopes" in attributes:
|
||||
if "scopes" in attributes and attributes[ "scopes" ] is not None:
|
||||
self.__scopes = attributes[ "scopes" ]
|
||||
if "token" in attributes:
|
||||
if "token" in attributes and attributes[ "token" ] is not None:
|
||||
self.__token = attributes[ "token" ]
|
||||
if "updated_at" in attributes:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -49,7 +49,7 @@ class Branch( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "commit" in attributes:
|
||||
if "commit" in attributes and attributes[ "commit" ] is not None:
|
||||
self.__commit = Commit.Commit( self.__requester, attributes[ "commit" ], lazy = True )
|
||||
if "name" in attributes:
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
self.__name = attributes[ "name" ]
|
||||
|
||||
@@ -121,19 +121,19 @@ class Commit( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "author" in attributes:
|
||||
if "author" in attributes and attributes[ "author" ] is not None:
|
||||
self.__author = NamedUser.NamedUser( self.__requester, attributes[ "author" ], lazy = True )
|
||||
if "commit" in attributes:
|
||||
if "commit" in attributes and attributes[ "commit" ] is not None:
|
||||
self.__commit = GitCommit.GitCommit( self.__requester, attributes[ "commit" ], lazy = True )
|
||||
if "committer" in attributes:
|
||||
if "committer" in attributes and attributes[ "committer" ] is not None:
|
||||
self.__committer = NamedUser.NamedUser( self.__requester, attributes[ "committer" ], lazy = True )
|
||||
if "files" in attributes:
|
||||
if "files" in attributes and attributes[ "files" ] is not None:
|
||||
self.__files = attributes[ "files" ]
|
||||
if "parents" in attributes:
|
||||
if "parents" in attributes and attributes[ "parents" ] is not None:
|
||||
self.__parents = attributes[ "parents" ]
|
||||
if "sha" in attributes:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "stats" in attributes:
|
||||
if "stats" in attributes and attributes[ "stats" ] is not None:
|
||||
self.__stats = attributes[ "stats" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -123,25 +123,25 @@ class CommitComment( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "body" in attributes:
|
||||
if "body" in attributes and attributes[ "body" ] is not None:
|
||||
self.__body = attributes[ "body" ]
|
||||
if "commit_id" in attributes:
|
||||
if "commit_id" in attributes and attributes[ "commit_id" ] is not None:
|
||||
self.__commit_id = attributes[ "commit_id" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "html_url" in attributes:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "line" in attributes:
|
||||
if "line" in attributes and attributes[ "line" ] is not None:
|
||||
self.__line = attributes[ "line" ]
|
||||
if "path" in attributes:
|
||||
if "path" in attributes and attributes[ "path" ] is not None:
|
||||
self.__path = attributes[ "path" ]
|
||||
if "position" in attributes:
|
||||
if "position" in attributes and attributes[ "position" ] is not None:
|
||||
self.__position = attributes[ "position" ]
|
||||
if "updated_at" in attributes:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], lazy = True )
|
||||
|
||||
@@ -164,43 +164,43 @@ class Download( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "accesskeyid" in attributes:
|
||||
if "accesskeyid" in attributes and attributes[ "accesskeyid" ] is not None:
|
||||
self.__accesskeyid = attributes[ "accesskeyid" ]
|
||||
if "acl" in attributes:
|
||||
if "acl" in attributes and attributes[ "acl" ] is not None:
|
||||
self.__acl = attributes[ "acl" ]
|
||||
if "bucket" in attributes:
|
||||
if "bucket" in attributes and attributes[ "bucket" ] is not None:
|
||||
self.__bucket = attributes[ "bucket" ]
|
||||
if "content_type" in attributes:
|
||||
if "content_type" in attributes and attributes[ "content_type" ] is not None:
|
||||
self.__content_type = attributes[ "content_type" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "description" in attributes:
|
||||
if "description" in attributes and attributes[ "description" ] is not None:
|
||||
self.__description = attributes[ "description" ]
|
||||
if "download_count" in attributes:
|
||||
if "download_count" in attributes and attributes[ "download_count" ] is not None:
|
||||
self.__download_count = attributes[ "download_count" ]
|
||||
if "expirationdate" in attributes:
|
||||
if "expirationdate" in attributes and attributes[ "expirationdate" ] is not None:
|
||||
self.__expirationdate = attributes[ "expirationdate" ]
|
||||
if "html_url" in attributes:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "mime_type" in attributes:
|
||||
if "mime_type" in attributes and attributes[ "mime_type" ] is not None:
|
||||
self.__mime_type = attributes[ "mime_type" ]
|
||||
if "name" in attributes:
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "path" in attributes:
|
||||
if "path" in attributes and attributes[ "path" ] is not None:
|
||||
self.__path = attributes[ "path" ]
|
||||
if "policy" in attributes:
|
||||
if "policy" in attributes and attributes[ "policy" ] is not None:
|
||||
self.__policy = attributes[ "policy" ]
|
||||
if "prefix" in attributes:
|
||||
if "prefix" in attributes and attributes[ "prefix" ] is not None:
|
||||
self.__prefix = attributes[ "prefix" ]
|
||||
if "redirect" in attributes:
|
||||
if "redirect" in attributes and attributes[ "redirect" ] is not None:
|
||||
self.__redirect = attributes[ "redirect" ]
|
||||
if "s3_url" in attributes:
|
||||
if "s3_url" in attributes and attributes[ "s3_url" ] is not None:
|
||||
self.__s3_url = attributes[ "s3_url" ]
|
||||
if "signature" in attributes:
|
||||
if "signature" in attributes and attributes[ "signature" ] is not None:
|
||||
self.__signature = attributes[ "signature" ]
|
||||
if "size" in attributes:
|
||||
if "size" in attributes and attributes[ "size" ] is not None:
|
||||
self.__size = attributes[ "size" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -111,27 +111,27 @@ class Event( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "actor" in attributes:
|
||||
if "actor" in attributes and attributes[ "actor" ] is not None:
|
||||
self.__actor = NamedUser.NamedUser( self.__requester, attributes[ "actor" ], lazy = True )
|
||||
if "commit_id" in attributes:
|
||||
if "commit_id" in attributes and attributes[ "commit_id" ] is not None:
|
||||
self.__commit_id = attributes[ "commit_id" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "event" in attributes:
|
||||
if "event" in attributes and attributes[ "event" ] is not None:
|
||||
self.__event = attributes[ "event" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "issue" in attributes:
|
||||
if "issue" in attributes and attributes[ "issue" ] is not None:
|
||||
self.__issue = attributes[ "issue" ]
|
||||
if "org" in attributes:
|
||||
if "org" in attributes and attributes[ "org" ] is not None:
|
||||
self.__org = Organization.Organization( self.__requester, attributes[ "org" ], lazy = True )
|
||||
if "payload" in attributes:
|
||||
if "payload" in attributes and attributes[ "payload" ] is not None:
|
||||
self.__payload = attributes[ "payload" ]
|
||||
if "public" in attributes:
|
||||
if "public" in attributes and attributes[ "public" ] is not None:
|
||||
self.__public = attributes[ "public" ]
|
||||
if "repo" in attributes:
|
||||
if "repo" in attributes and attributes[ "repo" ] is not None:
|
||||
self.__repo = Repository.Repository( self.__requester, attributes[ "repo" ], lazy = True )
|
||||
if "type" in attributes:
|
||||
if "type" in attributes and attributes[ "type" ] is not None:
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -131,7 +131,7 @@ class Gist( object ):
|
||||
def get_comment( self, id ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/comments/" + str( id ),
|
||||
str( self.url ) + "/comments" + "/" + str( id ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -193,31 +193,31 @@ class Gist( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "comments" in attributes:
|
||||
if "comments" in attributes and attributes[ "comments" ] is not None:
|
||||
self.__comments = attributes[ "comments" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "description" in attributes:
|
||||
if "description" in attributes and attributes[ "description" ] is not None:
|
||||
self.__description = attributes[ "description" ]
|
||||
if "files" in attributes:
|
||||
if "files" in attributes and attributes[ "files" ] is not None:
|
||||
self.__files = attributes[ "files" ]
|
||||
if "forks" in attributes:
|
||||
if "forks" in attributes and attributes[ "forks" ] is not None:
|
||||
self.__forks = attributes[ "forks" ]
|
||||
if "git_pull_url" in attributes:
|
||||
if "git_pull_url" in attributes and attributes[ "git_pull_url" ] is not None:
|
||||
self.__git_pull_url = attributes[ "git_pull_url" ]
|
||||
if "git_push_url" in attributes:
|
||||
if "git_push_url" in attributes and attributes[ "git_push_url" ] is not None:
|
||||
self.__git_push_url = attributes[ "git_push_url" ]
|
||||
if "history" in attributes:
|
||||
if "history" in attributes and attributes[ "history" ] is not None:
|
||||
self.__history = attributes[ "history" ]
|
||||
if "html_url" in attributes:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "public" in attributes:
|
||||
if "public" in attributes and attributes[ "public" ] is not None:
|
||||
self.__public = attributes[ "public" ]
|
||||
if "updated_at" in attributes:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], lazy = True )
|
||||
|
||||
@@ -93,15 +93,15 @@ class GistComment( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "body" in attributes:
|
||||
if "body" in attributes and attributes[ "body" ] is not None:
|
||||
self.__body = attributes[ "body" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "updated_at" in attributes:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], lazy = True )
|
||||
|
||||
@@ -66,13 +66,13 @@ class GitBlob( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "content" in attributes:
|
||||
if "content" in attributes and attributes[ "content" ] is not None:
|
||||
self.__content = attributes[ "content" ]
|
||||
if "encoding" in attributes:
|
||||
if "encoding" in attributes and attributes[ "encoding" ] is not None:
|
||||
self.__encoding = attributes[ "encoding" ]
|
||||
if "sha" in attributes:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "size" in attributes:
|
||||
if "size" in attributes and attributes[ "size" ] is not None:
|
||||
self.__size = attributes[ "size" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -79,17 +79,17 @@ class GitCommit( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "author" in attributes:
|
||||
if "author" in attributes and attributes[ "author" ] is not None:
|
||||
self.__author = attributes[ "author" ]
|
||||
if "committer" in attributes:
|
||||
if "committer" in attributes and attributes[ "committer" ] is not None:
|
||||
self.__committer = attributes[ "committer" ]
|
||||
if "message" in attributes:
|
||||
if "message" in attributes and attributes[ "message" ] is not None:
|
||||
self.__message = attributes[ "message" ]
|
||||
if "parents" in attributes:
|
||||
if "parents" in attributes and attributes[ "parents" ] is not None:
|
||||
self.__parents = attributes[ "parents" ]
|
||||
if "sha" in attributes:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "tree" in attributes:
|
||||
if "tree" in attributes and attributes[ "tree" ] is not None:
|
||||
self.__tree = GitTree.GitTree( self.__requester, attributes[ "tree" ], lazy = True )
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -76,9 +76,9 @@ class GitRef( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "object" in attributes:
|
||||
if "object" in attributes and attributes[ "object" ] is not None:
|
||||
self.__object = attributes[ "object" ]
|
||||
if "ref" in attributes:
|
||||
if "ref" in attributes and attributes[ "ref" ] is not None:
|
||||
self.__ref = attributes[ "ref" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -72,15 +72,15 @@ class GitTag( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "message" in attributes:
|
||||
if "message" in attributes and attributes[ "message" ] is not None:
|
||||
self.__message = attributes[ "message" ]
|
||||
if "object" in attributes:
|
||||
if "object" in attributes and attributes[ "object" ] is not None:
|
||||
self.__object = attributes[ "object" ]
|
||||
if "sha" in attributes:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "tag" in attributes:
|
||||
if "tag" in attributes and attributes[ "tag" ] is not None:
|
||||
self.__tag = attributes[ "tag" ]
|
||||
if "tagger" in attributes:
|
||||
if "tagger" in attributes and attributes[ "tagger" ] is not None:
|
||||
self.__tagger = attributes[ "tagger" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -60,11 +60,11 @@ class GitTree( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "recursive" in attributes:
|
||||
if "recursive" in attributes and attributes[ "recursive" ] is not None:
|
||||
self.__recursive = attributes[ "recursive" ]
|
||||
if "sha" in attributes:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "tree" in attributes:
|
||||
if "tree" in attributes and attributes[ "tree" ] is not None:
|
||||
self.__tree = attributes[ "tree" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -127,21 +127,21 @@ class Hook( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "active" in attributes:
|
||||
if "active" in attributes and attributes[ "active" ] is not None:
|
||||
self.__active = attributes[ "active" ]
|
||||
if "config" in attributes:
|
||||
if "config" in attributes and attributes[ "config" ] is not None:
|
||||
self.__config = attributes[ "config" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "events" in attributes:
|
||||
if "events" in attributes and attributes[ "events" ] is not None:
|
||||
self.__events = attributes[ "events" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "last_response" in attributes:
|
||||
if "last_response" in attributes and attributes[ "last_response" ] is not None:
|
||||
self.__last_response = attributes[ "last_response" ]
|
||||
if "name" in attributes:
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "updated_at" in attributes:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -157,7 +157,7 @@ class Issue( object ):
|
||||
def get_comment( self, id ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/comments/" + str( id ),
|
||||
str( self.url ) + "/comments" + "/" + str( id ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -208,7 +208,7 @@ class Issue( object ):
|
||||
def remove_from_labels( self, label ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"DELETE",
|
||||
str( self.url ) + "/labels/" + str( label._identity ),
|
||||
str( self.url ) + "/labels" + "/" + str( label._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -252,37 +252,37 @@ class Issue( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "assignee" in attributes:
|
||||
if "assignee" in attributes and attributes[ "assignee" ] is not None:
|
||||
self.__assignee = NamedUser.NamedUser( self.__requester, attributes[ "assignee" ], lazy = True )
|
||||
if "body" in attributes:
|
||||
if "body" in attributes and attributes[ "body" ] is not None:
|
||||
self.__body = attributes[ "body" ]
|
||||
if "closed_at" in attributes:
|
||||
if "closed_at" in attributes and attributes[ "closed_at" ] is not None:
|
||||
self.__closed_at = attributes[ "closed_at" ]
|
||||
if "closed_by" in attributes:
|
||||
if "closed_by" in attributes and attributes[ "closed_by" ] is not None:
|
||||
self.__closed_by = attributes[ "closed_by" ]
|
||||
if "comments" in attributes:
|
||||
if "comments" in attributes and attributes[ "comments" ] is not None:
|
||||
self.__comments = attributes[ "comments" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "html_url" in attributes:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "labels" in attributes:
|
||||
if "labels" in attributes and attributes[ "labels" ] is not None:
|
||||
self.__labels = attributes[ "labels" ]
|
||||
if "milestone" in attributes:
|
||||
if "milestone" in attributes and attributes[ "milestone" ] is not None:
|
||||
self.__milestone = Milestone.Milestone( self.__requester, attributes[ "milestone" ], lazy = True )
|
||||
if "number" in attributes:
|
||||
if "number" in attributes and attributes[ "number" ] is not None:
|
||||
self.__number = attributes[ "number" ]
|
||||
if "pull_request" in attributes:
|
||||
if "pull_request" in attributes and attributes[ "pull_request" ] is not None:
|
||||
self.__pull_request = attributes[ "pull_request" ]
|
||||
if "state" in attributes:
|
||||
if "state" in attributes and attributes[ "state" ] is not None:
|
||||
self.__state = attributes[ "state" ]
|
||||
if "title" in attributes:
|
||||
if "title" in attributes and attributes[ "title" ] is not None:
|
||||
self.__title = attributes[ "title" ]
|
||||
if "updated_at" in attributes:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], lazy = True )
|
||||
|
||||
@@ -93,15 +93,15 @@ class IssueComment( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "body" in attributes:
|
||||
if "body" in attributes and attributes[ "body" ] is not None:
|
||||
self.__body = attributes[ "body" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "updated_at" in attributes:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], lazy = True )
|
||||
|
||||
@@ -79,17 +79,17 @@ class IssueEvent( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "actor" in attributes:
|
||||
if "actor" in attributes and attributes[ "actor" ] is not None:
|
||||
self.__actor = NamedUser.NamedUser( self.__requester, attributes[ "actor" ], lazy = True )
|
||||
if "commit_id" in attributes:
|
||||
if "commit_id" in attributes and attributes[ "commit_id" ] is not None:
|
||||
self.__commit_id = attributes[ "commit_id" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "event" in attributes:
|
||||
if "event" in attributes and attributes[ "event" ] is not None:
|
||||
self.__event = attributes[ "event" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "issue" in attributes:
|
||||
if "issue" in attributes and attributes[ "issue" ] is not None:
|
||||
self.__issue = attributes[ "issue" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -75,9 +75,9 @@ class Label( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "color" in attributes:
|
||||
if "color" in attributes and attributes[ "color" ] is not None:
|
||||
self.__color = attributes[ "color" ]
|
||||
if "name" in attributes:
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -138,23 +138,23 @@ class Milestone( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "closed_issues" in attributes:
|
||||
if "closed_issues" in attributes and attributes[ "closed_issues" ] is not None:
|
||||
self.__closed_issues = attributes[ "closed_issues" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "creator" in attributes:
|
||||
if "creator" in attributes and attributes[ "creator" ] is not None:
|
||||
self.__creator = NamedUser.NamedUser( self.__requester, attributes[ "creator" ], lazy = True )
|
||||
if "description" in attributes:
|
||||
if "description" in attributes and attributes[ "description" ] is not None:
|
||||
self.__description = attributes[ "description" ]
|
||||
if "due_on" in attributes:
|
||||
if "due_on" in attributes and attributes[ "due_on" ] is not None:
|
||||
self.__due_on = attributes[ "due_on" ]
|
||||
if "number" in attributes:
|
||||
if "number" in attributes and attributes[ "number" ] is not None:
|
||||
self.__number = attributes[ "number" ]
|
||||
if "open_issues" in attributes:
|
||||
if "open_issues" in attributes and attributes[ "open_issues" ] is not None:
|
||||
self.__open_issues = attributes[ "open_issues" ]
|
||||
if "state" in attributes:
|
||||
if "state" in attributes and attributes[ "state" ] is not None:
|
||||
self.__state = attributes[ "state" ]
|
||||
if "title" in attributes:
|
||||
if "title" in attributes and attributes[ "title" ] is not None:
|
||||
self.__title = attributes[ "title" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -366,55 +366,55 @@ class NamedUser( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "avatar_url" in attributes:
|
||||
if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None:
|
||||
self.__avatar_url = attributes[ "avatar_url" ]
|
||||
if "bio" in attributes:
|
||||
if "bio" in attributes and attributes[ "bio" ] is not None:
|
||||
self.__bio = attributes[ "bio" ]
|
||||
if "blog" in attributes:
|
||||
if "blog" in attributes and attributes[ "blog" ] is not None:
|
||||
self.__blog = attributes[ "blog" ]
|
||||
if "collaborators" in attributes:
|
||||
if "collaborators" in attributes and attributes[ "collaborators" ] is not None:
|
||||
self.__collaborators = attributes[ "collaborators" ]
|
||||
if "company" in attributes:
|
||||
if "company" in attributes and attributes[ "company" ] is not None:
|
||||
self.__company = attributes[ "company" ]
|
||||
if "contributions" in attributes:
|
||||
if "contributions" in attributes and attributes[ "contributions" ] is not None:
|
||||
self.__contributions = attributes[ "contributions" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "disk_usage" in attributes:
|
||||
if "disk_usage" in attributes and attributes[ "disk_usage" ] is not None:
|
||||
self.__disk_usage = attributes[ "disk_usage" ]
|
||||
if "email" in attributes:
|
||||
if "email" in attributes and attributes[ "email" ] is not None:
|
||||
self.__email = attributes[ "email" ]
|
||||
if "followers" in attributes:
|
||||
if "followers" in attributes and attributes[ "followers" ] is not None:
|
||||
self.__followers = attributes[ "followers" ]
|
||||
if "following" in attributes:
|
||||
if "following" in attributes and attributes[ "following" ] is not None:
|
||||
self.__following = attributes[ "following" ]
|
||||
if "gravatar_id" in attributes:
|
||||
if "gravatar_id" in attributes and attributes[ "gravatar_id" ] is not None:
|
||||
self.__gravatar_id = attributes[ "gravatar_id" ]
|
||||
if "hireable" in attributes:
|
||||
if "hireable" in attributes and attributes[ "hireable" ] is not None:
|
||||
self.__hireable = attributes[ "hireable" ]
|
||||
if "html_url" in attributes:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "location" in attributes:
|
||||
if "location" in attributes and attributes[ "location" ] is not None:
|
||||
self.__location = attributes[ "location" ]
|
||||
if "login" in attributes:
|
||||
if "login" in attributes and attributes[ "login" ] is not None:
|
||||
self.__login = attributes[ "login" ]
|
||||
if "name" in attributes:
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "owned_private_repos" in attributes:
|
||||
if "owned_private_repos" in attributes and attributes[ "owned_private_repos" ] is not None:
|
||||
self.__owned_private_repos = attributes[ "owned_private_repos" ]
|
||||
if "plan" in attributes:
|
||||
if "plan" in attributes and attributes[ "plan" ] is not None:
|
||||
self.__plan = attributes[ "plan" ]
|
||||
if "private_gists" in attributes:
|
||||
if "private_gists" in attributes and attributes[ "private_gists" ] is not None:
|
||||
self.__private_gists = attributes[ "private_gists" ]
|
||||
if "public_gists" in attributes:
|
||||
if "public_gists" in attributes and attributes[ "public_gists" ] is not None:
|
||||
self.__public_gists = attributes[ "public_gists" ]
|
||||
if "public_repos" in attributes:
|
||||
if "public_repos" in attributes and attributes[ "public_repos" ] is not None:
|
||||
self.__public_repos = attributes[ "public_repos" ]
|
||||
if "total_private_repos" in attributes:
|
||||
if "total_private_repos" in attributes and attributes[ "total_private_repos" ] is not None:
|
||||
self.__total_private_repos = attributes[ "total_private_repos" ]
|
||||
if "type" in attributes:
|
||||
if "type" in attributes and attributes[ "type" ] is not None:
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -144,7 +144,7 @@ class Organization( object ):
|
||||
def add_to_public_members( self, public_member ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"PUT",
|
||||
str( self.url ) + "/public_members/" + str( public_member._identity ),
|
||||
str( self.url ) + "/public_members" + "/" + str( public_member._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -308,7 +308,7 @@ class Organization( object ):
|
||||
def has_in_members( self, member ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/members/" + str( member._identity ),
|
||||
str( self.url ) + "/members" + "/" + str( member._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -317,7 +317,7 @@ class Organization( object ):
|
||||
def has_in_public_members( self, public_member ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/public_members/" + str( public_member._identity ),
|
||||
str( self.url ) + "/public_members" + "/" + str( public_member._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -326,7 +326,7 @@ class Organization( object ):
|
||||
def remove_from_members( self, member ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"DELETE",
|
||||
str( self.url ) + "/members/" + str( member._identity ),
|
||||
str( self.url ) + "/members" + "/" + str( member._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -334,7 +334,7 @@ class Organization( object ):
|
||||
def remove_from_public_members( self, public_member ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"DELETE",
|
||||
str( self.url ) + "/public_members/" + str( public_member._identity ),
|
||||
str( self.url ) + "/public_members" + "/" + str( public_member._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -382,51 +382,51 @@ class Organization( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "avatar_url" in attributes:
|
||||
if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None:
|
||||
self.__avatar_url = attributes[ "avatar_url" ]
|
||||
if "billing_email" in attributes:
|
||||
if "billing_email" in attributes and attributes[ "billing_email" ] is not None:
|
||||
self.__billing_email = attributes[ "billing_email" ]
|
||||
if "blog" in attributes:
|
||||
if "blog" in attributes and attributes[ "blog" ] is not None:
|
||||
self.__blog = attributes[ "blog" ]
|
||||
if "collaborators" in attributes:
|
||||
if "collaborators" in attributes and attributes[ "collaborators" ] is not None:
|
||||
self.__collaborators = attributes[ "collaborators" ]
|
||||
if "company" in attributes:
|
||||
if "company" in attributes and attributes[ "company" ] is not None:
|
||||
self.__company = attributes[ "company" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "disk_usage" in attributes:
|
||||
if "disk_usage" in attributes and attributes[ "disk_usage" ] is not None:
|
||||
self.__disk_usage = attributes[ "disk_usage" ]
|
||||
if "email" in attributes:
|
||||
if "email" in attributes and attributes[ "email" ] is not None:
|
||||
self.__email = attributes[ "email" ]
|
||||
if "followers" in attributes:
|
||||
if "followers" in attributes and attributes[ "followers" ] is not None:
|
||||
self.__followers = attributes[ "followers" ]
|
||||
if "following" in attributes:
|
||||
if "following" in attributes and attributes[ "following" ] is not None:
|
||||
self.__following = attributes[ "following" ]
|
||||
if "gravatar_id" in attributes:
|
||||
if "gravatar_id" in attributes and attributes[ "gravatar_id" ] is not None:
|
||||
self.__gravatar_id = attributes[ "gravatar_id" ]
|
||||
if "html_url" in attributes:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "location" in attributes:
|
||||
if "location" in attributes and attributes[ "location" ] is not None:
|
||||
self.__location = attributes[ "location" ]
|
||||
if "login" in attributes:
|
||||
if "login" in attributes and attributes[ "login" ] is not None:
|
||||
self.__login = attributes[ "login" ]
|
||||
if "name" in attributes:
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "owned_private_repos" in attributes:
|
||||
if "owned_private_repos" in attributes and attributes[ "owned_private_repos" ] is not None:
|
||||
self.__owned_private_repos = attributes[ "owned_private_repos" ]
|
||||
if "plan" in attributes:
|
||||
if "plan" in attributes and attributes[ "plan" ] is not None:
|
||||
self.__plan = attributes[ "plan" ]
|
||||
if "private_gists" in attributes:
|
||||
if "private_gists" in attributes and attributes[ "private_gists" ] is not None:
|
||||
self.__private_gists = attributes[ "private_gists" ]
|
||||
if "public_gists" in attributes:
|
||||
if "public_gists" in attributes and attributes[ "public_gists" ] is not None:
|
||||
self.__public_gists = attributes[ "public_gists" ]
|
||||
if "public_repos" in attributes:
|
||||
if "public_repos" in attributes and attributes[ "public_repos" ] is not None:
|
||||
self.__public_repos = attributes[ "public_repos" ]
|
||||
if "total_private_repos" in attributes:
|
||||
if "total_private_repos" in attributes and attributes[ "total_private_repos" ] is not None:
|
||||
self.__total_private_repos = attributes[ "total_private_repos" ]
|
||||
if "type" in attributes:
|
||||
if "type" in attributes and attributes[ "type" ] is not None:
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -171,7 +171,7 @@ class PullRequest( object ):
|
||||
def get_comment( self, id ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/comments/" + str( id ),
|
||||
str( self.url ) + "/comments" + "/" + str( id ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -281,55 +281,55 @@ class PullRequest( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "additions" in attributes:
|
||||
if "additions" in attributes and attributes[ "additions" ] is not None:
|
||||
self.__additions = attributes[ "additions" ]
|
||||
if "base" in attributes:
|
||||
if "base" in attributes and attributes[ "base" ] is not None:
|
||||
self.__base = attributes[ "base" ]
|
||||
if "body" in attributes:
|
||||
if "body" in attributes and attributes[ "body" ] is not None:
|
||||
self.__body = attributes[ "body" ]
|
||||
if "changed_files" in attributes:
|
||||
if "changed_files" in attributes and attributes[ "changed_files" ] is not None:
|
||||
self.__changed_files = attributes[ "changed_files" ]
|
||||
if "closed_at" in attributes:
|
||||
if "closed_at" in attributes and attributes[ "closed_at" ] is not None:
|
||||
self.__closed_at = attributes[ "closed_at" ]
|
||||
if "comments" in attributes:
|
||||
if "comments" in attributes and attributes[ "comments" ] is not None:
|
||||
self.__comments = attributes[ "comments" ]
|
||||
if "commits" in attributes:
|
||||
if "commits" in attributes and attributes[ "commits" ] is not None:
|
||||
self.__commits = attributes[ "commits" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "deletions" in attributes:
|
||||
if "deletions" in attributes and attributes[ "deletions" ] is not None:
|
||||
self.__deletions = attributes[ "deletions" ]
|
||||
if "diff_url" in attributes:
|
||||
if "diff_url" in attributes and attributes[ "diff_url" ] is not None:
|
||||
self.__diff_url = attributes[ "diff_url" ]
|
||||
if "head" in attributes:
|
||||
if "head" in attributes and attributes[ "head" ] is not None:
|
||||
self.__head = attributes[ "head" ]
|
||||
if "html_url" in attributes:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "issue_url" in attributes:
|
||||
if "issue_url" in attributes and attributes[ "issue_url" ] is not None:
|
||||
self.__issue_url = attributes[ "issue_url" ]
|
||||
if "mergeable" in attributes:
|
||||
if "mergeable" in attributes and attributes[ "mergeable" ] is not None:
|
||||
self.__mergeable = attributes[ "mergeable" ]
|
||||
if "merged" in attributes:
|
||||
if "merged" in attributes and attributes[ "merged" ] is not None:
|
||||
self.__merged = attributes[ "merged" ]
|
||||
if "merged_at" in attributes:
|
||||
if "merged_at" in attributes and attributes[ "merged_at" ] is not None:
|
||||
self.__merged_at = attributes[ "merged_at" ]
|
||||
if "merged_by" in attributes:
|
||||
if "merged_by" in attributes and attributes[ "merged_by" ] is not None:
|
||||
self.__merged_by = attributes[ "merged_by" ]
|
||||
if "number" in attributes:
|
||||
if "number" in attributes and attributes[ "number" ] is not None:
|
||||
self.__number = attributes[ "number" ]
|
||||
if "patch_url" in attributes:
|
||||
if "patch_url" in attributes and attributes[ "patch_url" ] is not None:
|
||||
self.__patch_url = attributes[ "patch_url" ]
|
||||
if "review_comments" in attributes:
|
||||
if "review_comments" in attributes and attributes[ "review_comments" ] is not None:
|
||||
self.__review_comments = attributes[ "review_comments" ]
|
||||
if "state" in attributes:
|
||||
if "state" in attributes and attributes[ "state" ] is not None:
|
||||
self.__state = attributes[ "state" ]
|
||||
if "title" in attributes:
|
||||
if "title" in attributes and attributes[ "title" ] is not None:
|
||||
self.__title = attributes[ "title" ]
|
||||
if "updated_at" in attributes:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], lazy = True )
|
||||
|
||||
@@ -123,25 +123,25 @@ class PullRequestComment( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "body" in attributes:
|
||||
if "body" in attributes and attributes[ "body" ] is not None:
|
||||
self.__body = attributes[ "body" ]
|
||||
if "commit_id" in attributes:
|
||||
if "commit_id" in attributes and attributes[ "commit_id" ] is not None:
|
||||
self.__commit_id = attributes[ "commit_id" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "html_url" in attributes:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "line" in attributes:
|
||||
if "line" in attributes and attributes[ "line" ] is not None:
|
||||
self.__line = attributes[ "line" ]
|
||||
if "path" in attributes:
|
||||
if "path" in attributes and attributes[ "path" ] is not None:
|
||||
self.__path = attributes[ "path" ]
|
||||
if "position" in attributes:
|
||||
if "position" in attributes and attributes[ "position" ] is not None:
|
||||
self.__position = attributes[ "position" ]
|
||||
if "updated_at" in attributes:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], lazy = True )
|
||||
|
||||
@@ -90,21 +90,21 @@ class PullRequestFile( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "additions" in attributes:
|
||||
if "additions" in attributes and attributes[ "additions" ] is not None:
|
||||
self.__additions = attributes[ "additions" ]
|
||||
if "blob_url" in attributes:
|
||||
if "blob_url" in attributes and attributes[ "blob_url" ] is not None:
|
||||
self.__blob_url = attributes[ "blob_url" ]
|
||||
if "changes" in attributes:
|
||||
if "changes" in attributes and attributes[ "changes" ] is not None:
|
||||
self.__changes = attributes[ "changes" ]
|
||||
if "deletions" in attributes:
|
||||
if "deletions" in attributes and attributes[ "deletions" ] is not None:
|
||||
self.__deletions = attributes[ "deletions" ]
|
||||
if "filename" in attributes:
|
||||
if "filename" in attributes and attributes[ "filename" ] is not None:
|
||||
self.__filename = attributes[ "filename" ]
|
||||
if "patch" in attributes:
|
||||
if "patch" in attributes and attributes[ "patch" ] is not None:
|
||||
self.__patch = attributes[ "patch" ]
|
||||
if "raw_url" in attributes:
|
||||
if "raw_url" in attributes and attributes[ "raw_url" ] is not None:
|
||||
self.__raw_url = attributes[ "raw_url" ]
|
||||
if "sha" in attributes:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "status" in attributes:
|
||||
if "status" in attributes and attributes[ "status" ] is not None:
|
||||
self.__status = attributes[ "status" ]
|
||||
|
||||
@@ -191,7 +191,7 @@ class Repository( object ):
|
||||
def add_to_collaborators( self, collaborator ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"PUT",
|
||||
str( self.url ) + "/collaborators/" + str( collaborator._identity ),
|
||||
str( self.url ) + "/collaborators" + "/" + str( collaborator._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -427,7 +427,7 @@ class Repository( object ):
|
||||
def get_comment( self, id ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/comments/" + str( id ),
|
||||
str( self.url ) + "/comments" + "/" + str( id ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -450,7 +450,7 @@ class Repository( object ):
|
||||
def get_commit( self, sha ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/commits/" + str( sha ),
|
||||
str( self.url ) + "/commits" + "/" + str( sha ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -487,7 +487,7 @@ class Repository( object ):
|
||||
def get_download( self, id ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/downloads/" + str( id ),
|
||||
str( self.url ) + "/downloads" + "/" + str( id ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -538,7 +538,7 @@ class Repository( object ):
|
||||
def get_git_blob( self, sha ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/git_blobs/" + str( sha ),
|
||||
str( self.url ) + "/git_blobs" + "/" + str( sha ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -547,7 +547,7 @@ class Repository( object ):
|
||||
def get_git_commit( self, sha ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/git_commits/" + str( sha ),
|
||||
str( self.url ) + "/git_commits" + "/" + str( sha ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -556,7 +556,7 @@ class Repository( object ):
|
||||
def get_git_ref( self, ref ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/git_refs/" + str( ref ),
|
||||
str( self.url ) + "/git_refs" + "/" + str( ref ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -579,7 +579,7 @@ class Repository( object ):
|
||||
def get_git_tag( self, sha ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/git_tags/" + str( sha ),
|
||||
str( self.url ) + "/git_tags" + "/" + str( sha ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -588,7 +588,7 @@ class Repository( object ):
|
||||
def get_git_tree( self, sha, recursive = DefaultValueForOptionalParameters ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/git_trees/" + str( sha ),
|
||||
str( self.url ) + "/git_trees" + "/" + str( sha ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -597,7 +597,7 @@ class Repository( object ):
|
||||
def get_hook( self, id ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/hooks/" + str( id ),
|
||||
str( self.url ) + "/hooks" + "/" + str( id ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -620,7 +620,7 @@ class Repository( object ):
|
||||
def get_issue( self, number ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/issues/" + str( number ),
|
||||
str( self.url ) + "/issues" + "/" + str( number ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -643,7 +643,7 @@ class Repository( object ):
|
||||
def get_issues_event( self, id ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/issues_events/" + str( id ),
|
||||
str( self.url ) + "/issues/events" + "/" + str( id ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -652,7 +652,7 @@ class Repository( object ):
|
||||
def get_issues_events( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/issues_events",
|
||||
str( self.url ) + "/issues/events",
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -666,7 +666,7 @@ class Repository( object ):
|
||||
def get_key( self, id ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/keys/" + str( id ),
|
||||
str( self.url ) + "/keys" + "/" + str( id ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -689,7 +689,7 @@ class Repository( object ):
|
||||
def get_label( self, name ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/labels/" + str( name ),
|
||||
str( self.url ) + "/labels" + "/" + str( name ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -715,7 +715,7 @@ class Repository( object ):
|
||||
def get_milestone( self, number ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/milestones/" + str( number ),
|
||||
str( self.url ) + "/milestones" + "/" + str( number ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -736,12 +736,23 @@ class Repository( object ):
|
||||
)
|
||||
|
||||
def get_network_events( self ):
|
||||
pass
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
"https://api.github.com/networks/" + str( self.owner.login ) + "/" + str( self.name ) + "/events",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return PaginatedList.PaginatedList(
|
||||
Event.Event,
|
||||
self.__requester,
|
||||
headers,
|
||||
data
|
||||
)
|
||||
|
||||
def get_pull( self, number ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/pulls/" + str( number ),
|
||||
str( self.url ) + "/pulls" + "/" + str( number ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -806,7 +817,7 @@ class Repository( object ):
|
||||
def has_in_collaborators( self, collaborator ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/collaborators/" + str( collaborator._identity ),
|
||||
str( self.url ) + "/collaborators" + "/" + str( collaborator._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -815,7 +826,7 @@ class Repository( object ):
|
||||
def remove_from_collaborators( self, collaborator ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"DELETE",
|
||||
str( self.url ) + "/collaborators/" + str( collaborator._identity ),
|
||||
str( self.url ) + "/collaborators" + "/" + str( collaborator._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -874,63 +885,63 @@ class Repository( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "clone_url" in attributes:
|
||||
if "clone_url" in attributes and attributes[ "clone_url" ] is not None:
|
||||
self.__clone_url = attributes[ "clone_url" ]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "description" in attributes:
|
||||
if "description" in attributes and attributes[ "description" ] is not None:
|
||||
self.__description = attributes[ "description" ]
|
||||
if "fork" in attributes:
|
||||
if "fork" in attributes and attributes[ "fork" ] is not None:
|
||||
self.__fork = attributes[ "fork" ]
|
||||
if "forks" in attributes:
|
||||
if "forks" in attributes and attributes[ "forks" ] is not None:
|
||||
self.__forks = attributes[ "forks" ]
|
||||
if "git_url" in attributes:
|
||||
if "git_url" in attributes and attributes[ "git_url" ] is not None:
|
||||
self.__git_url = attributes[ "git_url" ]
|
||||
if "has_downloads" in attributes:
|
||||
if "has_downloads" in attributes and attributes[ "has_downloads" ] is not None:
|
||||
self.__has_downloads = attributes[ "has_downloads" ]
|
||||
if "has_issues" in attributes:
|
||||
if "has_issues" in attributes and attributes[ "has_issues" ] is not None:
|
||||
self.__has_issues = attributes[ "has_issues" ]
|
||||
if "has_wiki" in attributes:
|
||||
if "has_wiki" in attributes and attributes[ "has_wiki" ] is not None:
|
||||
self.__has_wiki = attributes[ "has_wiki" ]
|
||||
if "homepage" in attributes:
|
||||
if "homepage" in attributes and attributes[ "homepage" ] is not None:
|
||||
self.__homepage = attributes[ "homepage" ]
|
||||
if "html_url" in attributes:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "language" in attributes:
|
||||
if "language" in attributes and attributes[ "language" ] is not None:
|
||||
self.__language = attributes[ "language" ]
|
||||
if "master_branch" in attributes:
|
||||
if "master_branch" in attributes and attributes[ "master_branch" ] is not None:
|
||||
self.__master_branch = attributes[ "master_branch" ]
|
||||
if "mirror_url" in attributes:
|
||||
if "mirror_url" in attributes and attributes[ "mirror_url" ] is not None:
|
||||
self.__mirror_url = attributes[ "mirror_url" ]
|
||||
if "name" in attributes:
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "open_issues" in attributes:
|
||||
if "open_issues" in attributes and attributes[ "open_issues" ] is not None:
|
||||
self.__open_issues = attributes[ "open_issues" ]
|
||||
if "organization" in attributes:
|
||||
if "organization" in attributes and attributes[ "organization" ] is not None:
|
||||
self.__organization = attributes[ "organization" ]
|
||||
if "owner" in attributes:
|
||||
if "owner" in attributes and attributes[ "owner" ] is not None:
|
||||
self.__owner = NamedUser.NamedUser( self.__requester, attributes[ "owner" ], lazy = True )
|
||||
if "parent" in attributes:
|
||||
if "parent" in attributes and attributes[ "parent" ] is not None:
|
||||
self.__parent = Repository( self.__requester, attributes[ "parent" ], lazy = True )
|
||||
if "permissions" in attributes:
|
||||
if "permissions" in attributes and attributes[ "permissions" ] is not None:
|
||||
self.__permissions = attributes[ "permissions" ]
|
||||
if "private" in attributes:
|
||||
if "private" in attributes and attributes[ "private" ] is not None:
|
||||
self.__private = attributes[ "private" ]
|
||||
if "pushed_at" in attributes:
|
||||
if "pushed_at" in attributes and attributes[ "pushed_at" ] is not None:
|
||||
self.__pushed_at = attributes[ "pushed_at" ]
|
||||
if "size" in attributes:
|
||||
if "size" in attributes and attributes[ "size" ] is not None:
|
||||
self.__size = attributes[ "size" ]
|
||||
if "source" in attributes:
|
||||
if "source" in attributes and attributes[ "source" ] is not None:
|
||||
self.__source = Repository( self.__requester, attributes[ "source" ], lazy = True )
|
||||
if "ssh_url" in attributes:
|
||||
if "ssh_url" in attributes and attributes[ "ssh_url" ] is not None:
|
||||
self.__ssh_url = attributes[ "ssh_url" ]
|
||||
if "svn_url" in attributes:
|
||||
if "svn_url" in attributes and attributes[ "svn_url" ] is not None:
|
||||
self.__svn_url = attributes[ "svn_url" ]
|
||||
if "updated_at" in attributes:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "watchers" in attributes:
|
||||
if "watchers" in attributes and attributes[ "watchers" ] is not None:
|
||||
self.__watchers = attributes[ "watchers" ]
|
||||
|
||||
@@ -81,11 +81,11 @@ class RepositoryKey( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "key" in attributes:
|
||||
if "key" in attributes and attributes[ "key" ] is not None:
|
||||
self.__key = attributes[ "key" ]
|
||||
if "title" in attributes:
|
||||
if "title" in attributes and attributes[ "title" ] is not None:
|
||||
self.__title = attributes[ "title" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -61,11 +61,11 @@ class Tag( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "commit" in attributes:
|
||||
if "commit" in attributes and attributes[ "commit" ] is not None:
|
||||
self.__commit = Commit.Commit( self.__requester, attributes[ "commit" ], lazy = True )
|
||||
if "name" in attributes:
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "tarball_url" in attributes:
|
||||
if "tarball_url" in attributes and attributes[ "tarball_url" ] is not None:
|
||||
self.__tarball_url = attributes[ "tarball_url" ]
|
||||
if "zipball_url" in attributes:
|
||||
if "zipball_url" in attributes and attributes[ "zipball_url" ] is not None:
|
||||
self.__zipball_url = attributes[ "zipball_url" ]
|
||||
|
||||
@@ -52,7 +52,7 @@ class Team( object ):
|
||||
def add_to_members( self, member ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"PUT",
|
||||
str( self.url ) + "/members/" + str( member._identity ),
|
||||
str( self.url ) + "/members" + "/" + str( member._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -60,7 +60,7 @@ class Team( object ):
|
||||
def add_to_repos( self, repo ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"PUT",
|
||||
str( self.url ) + "/repos/" + str( repo._identity ),
|
||||
str( self.url ) + "/repos" + "/" + str( repo._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -118,7 +118,7 @@ class Team( object ):
|
||||
def has_in_members( self, member ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/members/" + str( member._identity ),
|
||||
str( self.url ) + "/members" + "/" + str( member._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -127,7 +127,7 @@ class Team( object ):
|
||||
def has_in_repos( self, repo ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
str( self.url ) + "/repos/" + str( repo._identity ),
|
||||
str( self.url ) + "/repos" + "/" + str( repo._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -136,7 +136,7 @@ class Team( object ):
|
||||
def remove_from_members( self, member ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"DELETE",
|
||||
str( self.url ) + "/members/" + str( member._identity ),
|
||||
str( self.url ) + "/members" + "/" + str( member._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -144,7 +144,7 @@ class Team( object ):
|
||||
def remove_from_repos( self, repo ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"DELETE",
|
||||
str( self.url ) + "/repos/" + str( repo._identity ),
|
||||
str( self.url ) + "/repos" + "/" + str( repo._identity ),
|
||||
None,
|
||||
None
|
||||
)
|
||||
@@ -174,15 +174,15 @@ class Team( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "members_count" in attributes:
|
||||
if "members_count" in attributes and attributes[ "members_count" ] is not None:
|
||||
self.__members_count = attributes[ "members_count" ]
|
||||
if "name" in attributes:
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "permission" in attributes:
|
||||
if "permission" in attributes and attributes[ "permission" ] is not None:
|
||||
self.__permission = attributes[ "permission" ]
|
||||
if "repos_count" in attributes:
|
||||
if "repos_count" in attributes and attributes[ "repos_count" ] is not None:
|
||||
self.__repos_count = attributes[ "repos_count" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -83,11 +83,11 @@ class UserKey( object ):
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
#@todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "id" in attributes:
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "key" in attributes:
|
||||
if "key" in attributes and attributes[ "key" ] is not None:
|
||||
self.__key = attributes[ "key" ]
|
||||
if "title" in attributes:
|
||||
if "title" in attributes and attributes[ "title" ] is not None:
|
||||
self.__title = attributes[ "title" ]
|
||||
if "url" in attributes:
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
Reference in New Issue
Block a user