From fa9e5df05ac600a78445a0da27cff495f376ac93 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Fri, 4 May 2012 14:48:19 +0200 Subject: [PATCH] Fix testDownloads (get_element) --- .../templates/GithubObject.Concatenation.py | 2 +- IntegrationTest.py | 16 +- .../description.001.normalized.json | 440 ++++++++++++++++++ JsonDescriptionOfGithubApiV3/normalize.py | 12 +- github/GithubObjects/AuthenticatedUser.py | 62 ++- github/GithubObjects/Authorization.py | 4 +- github/GithubObjects/Commit.py | 4 +- github/GithubObjects/CommitComment.py | 4 +- github/GithubObjects/Download.py | 2 +- github/GithubObjects/Gist.py | 16 +- github/GithubObjects/GistComment.py | 4 +- github/GithubObjects/GitRef.py | 4 +- github/GithubObjects/Hook.py | 4 +- github/GithubObjects/Issue.py | 20 +- github/GithubObjects/IssueComment.py | 4 +- github/GithubObjects/Label.py | 4 +- github/GithubObjects/Milestone.py | 6 +- github/GithubObjects/NamedUser.py | 18 +- github/GithubObjects/Organization.py | 30 +- github/GithubObjects/PullRequest.py | 16 +- github/GithubObjects/PullRequestComment.py | 4 +- github/GithubObjects/Repository.py | 188 ++++++-- github/GithubObjects/RepositoryKey.py | 4 +- github/GithubObjects/Team.py | 20 +- github/GithubObjects/UserKey.py | 4 +- 25 files changed, 731 insertions(+), 161 deletions(-) diff --git a/CodeGenerator/templates/GithubObject.Concatenation.py b/CodeGenerator/templates/GithubObject.Concatenation.py index 466857ad..a2453681 100644 --- a/CodeGenerator/templates/GithubObject.Concatenation.py +++ b/CodeGenerator/templates/GithubObject.Concatenation.py @@ -1 +1 @@ -{% for part in concatenation %}{% if forloop.counter0 > 0 %} + {% endif %}{% if part.type == "constant" %}"{{ part.value }}"{% endif %}{% if part.type == "argument" %}{{ part.value|join:"." }}{% endif %}{% if part.type == "attribute" %}self.{{ part.value|join:"." }}{% endif %}{% endfor %} \ No newline at end of file +{% for part in concatenation %}{% if forloop.counter0 > 0 %} + {% endif %}{% if part.type == "constant" %}"{{ part.value }}"{% endif %}{% if part.type == "argument" %}str( {{ part.value|join:"." }} ){% endif %}{% if part.type == "attribute" %}str( self.{{ part.value|join:"." }} ){% endif %}{% endfor %} \ No newline at end of file diff --git a/IntegrationTest.py b/IntegrationTest.py index ccc0c617..b44effb7 100644 --- a/IntegrationTest.py +++ b/IntegrationTest.py @@ -260,14 +260,14 @@ class IntegrationTest: r = u.create_repo( "CreatedByPyGithub", has_wiki = False ) self.printList( "Repos", u.get_repos(), lambda r: r.name ) - # def testDownloads( self ): - # r = self.g.get_user().get_repo( "TestPyGithub" ) - # self.printList( "Downloads", r.get_downloads(), lambda d: d.name ) - # d = r.create_download( "DownloadCreatedByPyGithub.txt", 1024 ) - # self.printList( "Downloads", r.get_downloads(), lambda d: d.name ) - # sameDownload = r.get_download( d.id ) - # sameDownload.delete() - # self.printList( "Downloads", r.get_downloads(), lambda d: d.name ) + def testDownloads( self ): + r = self.g.get_user().get_repo( "TestPyGithub" ) + self.printList( "Downloads", r.get_downloads(), lambda d: d.name ) + d = r.create_download( "DownloadCreatedByPyGithub.txt", 1024 ) + self.printList( "Downloads", r.get_downloads(), lambda d: d.name ) + sameDownload = r.get_download( d.id ) + sameDownload.delete() + self.printList( "Downloads", r.get_downloads(), lambda d: d.name ) def testEditAuthenticatedUser( self ): u = self.g.get_user() diff --git a/JsonDescriptionOfGithubApiV3/description.001.normalized.json b/JsonDescriptionOfGithubApiV3/description.001.normalized.json index 55ebf631..bf87ad9c 100644 --- a/JsonDescriptionOfGithubApiV3/description.001.normalized.json +++ b/JsonDescriptionOfGithubApiV3/description.001.normalized.json @@ -360,6 +360,28 @@ "get", "authorization" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/authorizations/" + }, + { + "type": "argument", + "value": [ + "id" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -526,6 +548,28 @@ "get", "key" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/keys/" + }, + { + "type": "argument", + "value": [ + "id" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -2500,6 +2544,28 @@ "get", "comment" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/comments/" + }, + { + "type": "argument", + "value": [ + "id" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -3490,6 +3556,28 @@ "get", "comment" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/comments/" + }, + { + "type": "argument", + "value": [ + "id" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -6009,6 +6097,28 @@ "get", "comment" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/comments/" + }, + { + "type": "argument", + "value": [ + "id" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -6937,6 +7047,28 @@ "get", "comment" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/comments/" + }, + { + "type": "argument", + "value": [ + "id" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -6992,6 +7124,28 @@ "get", "commit" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/commits/" + }, + { + "type": "argument", + "value": [ + "sha" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -7161,6 +7315,28 @@ "get", "download" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/downloads/" + }, + { + "type": "argument", + "value": [ + "id" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -7327,6 +7503,28 @@ "get", "git_blob" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/git_blobs/" + }, + { + "type": "argument", + "value": [ + "sha" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -7425,6 +7623,28 @@ "get", "git_commit" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/git_commits/" + }, + { + "type": "argument", + "value": [ + "sha" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -7498,6 +7718,28 @@ "get", "git_ref" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/git_refs/" + }, + { + "type": "argument", + "value": [ + "ref" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -7627,6 +7869,28 @@ "get", "git_tag" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/git_tags/" + }, + { + "type": "argument", + "value": [ + "sha" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -7701,6 +7965,28 @@ "get", "git_tree" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/git_trees/" + }, + { + "type": "argument", + "value": [ + "sha" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [ { "type": { @@ -7800,6 +8086,28 @@ "get", "hook" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/hooks/" + }, + { + "type": "argument", + "value": [ + "id" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -7929,6 +8237,28 @@ "get", "issue" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/issues/" + }, + { + "type": "argument", + "value": [ + "number" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -8049,6 +8379,28 @@ "get", "issues_event" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/issues_events/" + }, + { + "type": "argument", + "value": [ + "id" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -8153,6 +8505,28 @@ "get", "key" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/keys/" + }, + { + "type": "argument", + "value": [ + "id" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -8257,6 +8631,28 @@ "get", "label" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/labels/" + }, + { + "type": "argument", + "value": [ + "name" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -8378,6 +8774,28 @@ "get", "milestone" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/milestones/" + }, + { + "type": "argument", + "value": [ + "number" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, @@ -8458,6 +8876,28 @@ "get", "pull" ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/pulls/" + }, + { + "type": "argument", + "value": [ + "number" + ] + } + ], + "information": "data", + "verb": "GET" + }, "optional_parameters": [], "type": { "simple": false, diff --git a/JsonDescriptionOfGithubApiV3/normalize.py b/JsonDescriptionOfGithubApiV3/normalize.py index 77e23b5d..8e01a5b5 100644 --- a/JsonDescriptionOfGithubApiV3/normalize.py +++ b/JsonDescriptionOfGithubApiV3/normalize.py @@ -163,7 +163,17 @@ class Collection: } } else: - hack = dict() + hack = { + "request": { + "verb": "GET", + "url": [ + { "type": "attribute", "value": [ "url" ] }, + { "type": "constant", "value": "/" + desc[ "name" ] + "/" }, + { "type": "argument", "value": [ desc[ "get_element" ][ "parameter" ][ "name" ] ] }, + ], + "information": "data", + } + } self.methods.append( Function( desc[ "get_element" ], diff --git a/github/GithubObjects/AuthenticatedUser.py b/github/GithubObjects/AuthenticatedUser.py index b16d1051..ea2d20dc 100644 --- a/github/GithubObjects/AuthenticatedUser.py +++ b/github/GithubObjects/AuthenticatedUser.py @@ -150,7 +150,7 @@ class AuthenticatedUser( object ): def add_to_following( self, following ): status, headers, data = self.__requester.request( "PUT", - self.url + "/following/" + following.login, + str( self.url ) + "/following/" + str( following.login ), None, None ) @@ -158,7 +158,7 @@ class AuthenticatedUser( object ): def add_to_watched( self, watched ): status, headers, data = self.__requester.request( "PUT", - self.url + "/watched/" + watched.login, + str( self.url ) + "/watched/" + str( watched.login ), None, None ) @@ -174,7 +174,7 @@ class AuthenticatedUser( object ): post_parameters[ "note_url" ] = note_url status, headers, data = self.__requester.request( "POST", - self.url + "/authorizations", + str( self.url ) + "/authorizations", None, post_parameters ) @@ -183,7 +183,7 @@ class AuthenticatedUser( object ): def create_fork( self, repo ): status, headers, data = self.__requester.request( "POST", - "https://api.github.com/repos/" + repo.owner.login + "/" + repo.name + "/forks", + "https://api.github.com/repos/" + str( repo.owner.login ) + "/" + str( repo.name ) + "/forks", None, None ) @@ -198,7 +198,7 @@ class AuthenticatedUser( object ): post_parameters[ "description" ] = description status, headers, data = self.__requester.request( "POST", - self.url + "/gists", + str( self.url ) + "/gists", None, post_parameters ) @@ -211,7 +211,7 @@ class AuthenticatedUser( object ): } status, headers, data = self.__requester.request( "POST", - self.url + "/keys", + str( self.url ) + "/keys", None, post_parameters ) @@ -237,7 +237,7 @@ class AuthenticatedUser( object ): post_parameters[ "team_id" ] = team_id status, headers, data = self.__requester.request( "POST", - self.url + "/repos", + str( self.url ) + "/repos", None, post_parameters ) @@ -269,12 +269,18 @@ class AuthenticatedUser( object ): self.__useAttributes( data ) def get_authorization( self, id ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/authorizations/" + str( id ), + None, + None + ) + return Authorization.Authorization( self.__requester, data, lazy = True ) def get_authorizations( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/authorizations", + str( self.url ) + "/authorizations", None, None ) @@ -286,7 +292,7 @@ class AuthenticatedUser( object ): def get_emails( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/emails", + str( self.url ) + "/emails", None, None ) @@ -294,7 +300,7 @@ class AuthenticatedUser( object ): def get_events( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/events", + str( self.url ) + "/events", None, None ) @@ -306,7 +312,7 @@ class AuthenticatedUser( object ): def get_followers( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/followers", + str( self.url ) + "/followers", None, None ) @@ -318,7 +324,7 @@ class AuthenticatedUser( object ): def get_following( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/following", + str( self.url ) + "/following", None, None ) @@ -330,7 +336,7 @@ class AuthenticatedUser( object ): def get_gists( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/gists", + str( self.url ) + "/gists", None, None ) @@ -342,7 +348,7 @@ class AuthenticatedUser( object ): def get_issues( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/issues", + str( self.url ) + "/issues", None, None ) @@ -352,12 +358,18 @@ class AuthenticatedUser( object ): ] def get_key( self, id ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/keys/" + str( id ), + None, + None + ) + return UserKey.UserKey( self.__requester, data, lazy = True ) def get_keys( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/keys", + str( self.url ) + "/keys", None, None ) @@ -372,7 +384,7 @@ class AuthenticatedUser( object ): def get_orgs( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/orgs", + str( self.url ) + "/orgs", None, None ) @@ -384,7 +396,7 @@ class AuthenticatedUser( object ): def get_repo( self, name ): status, headers, data = self.__requester.request( "GET", - "https://api.github.com/repos/" + self.login + "/" + name, + "https://api.github.com/repos/" + str( self.login ) + "/" + str( name ), None, None ) @@ -393,7 +405,7 @@ class AuthenticatedUser( object ): def get_repos( self, type = None ): status, headers, data = self.__requester.request( "GET", - self.url + "/repos", + str( self.url ) + "/repos", None, None ) @@ -408,7 +420,7 @@ class AuthenticatedUser( object ): def get_watched( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/watched", + str( self.url ) + "/watched", None, None ) @@ -420,7 +432,7 @@ class AuthenticatedUser( object ): def has_in_following( self, following ): status, headers, data = self.__requester.request( "GET", - self.url + "/following/" + following.login, + str( self.url ) + "/following/" + str( following.login ), None, None ) @@ -429,7 +441,7 @@ class AuthenticatedUser( object ): def has_in_watched( self, watched ): status, headers, data = self.__requester.request( "GET", - self.url + "/watched/" + watched.login, + str( self.url ) + "/watched/" + str( watched.login ), None, None ) @@ -441,7 +453,7 @@ class AuthenticatedUser( object ): def remove_from_following( self, following ): status, headers, data = self.__requester.request( "DELETE", - self.url + "/following/" + following.login, + str( self.url ) + "/following/" + str( following.login ), None, None ) @@ -449,7 +461,7 @@ class AuthenticatedUser( object ): def remove_from_watched( self, watched ): status, headers, data = self.__requester.request( "DELETE", - self.url + "/watched/" + watched.login, + str( self.url ) + "/watched/" + str( watched.login ), None, None ) diff --git a/github/GithubObjects/Authorization.py b/github/GithubObjects/Authorization.py index 1fbcd81c..00a60945 100644 --- a/github/GithubObjects/Authorization.py +++ b/github/GithubObjects/Authorization.py @@ -59,7 +59,7 @@ class Authorization( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -79,7 +79,7 @@ class Authorization( object ): post_parameters[ "note_url" ] = note_url status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) diff --git a/github/GithubObjects/Commit.py b/github/GithubObjects/Commit.py index e48388ad..ac76032d 100644 --- a/github/GithubObjects/Commit.py +++ b/github/GithubObjects/Commit.py @@ -68,7 +68,7 @@ class Commit( object ): post_parameters[ "position" ] = position status, headers, data = self.__requester.request( "POST", - self.url + "/comments", + str( self.url ) + "/comments", None, post_parameters ) @@ -77,7 +77,7 @@ class Commit( object ): def get_comments( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/comments", + str( self.url ) + "/comments", None, None ) diff --git a/github/GithubObjects/CommitComment.py b/github/GithubObjects/CommitComment.py index ee22ba77..a025f8f6 100644 --- a/github/GithubObjects/CommitComment.py +++ b/github/GithubObjects/CommitComment.py @@ -70,7 +70,7 @@ class CommitComment( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -81,7 +81,7 @@ class CommitComment( object ): } status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) diff --git a/github/GithubObjects/Download.py b/github/GithubObjects/Download.py index fd3b360a..a19440b6 100644 --- a/github/GithubObjects/Download.py +++ b/github/GithubObjects/Download.py @@ -114,7 +114,7 @@ class Download( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) diff --git a/github/GithubObjects/Gist.py b/github/GithubObjects/Gist.py index 64ce58a2..9a36d69f 100644 --- a/github/GithubObjects/Gist.py +++ b/github/GithubObjects/Gist.py @@ -90,7 +90,7 @@ class Gist( object ): } status, headers, data = self.__requester.request( "POST", - self.url + "/comments", + str( self.url ) + "/comments", None, post_parameters ) @@ -102,7 +102,7 @@ class Gist( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -116,19 +116,25 @@ class Gist( object ): post_parameters[ "files" ] = files status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) self.__useAttributes( data ) def get_comment( self, id ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/comments/" + str( id ), + None, + None + ) + return GistComment.GistComment( self.__requester, data, lazy = True ) def get_comments( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/comments", + str( self.url ) + "/comments", None, None ) diff --git a/github/GithubObjects/GistComment.py b/github/GithubObjects/GistComment.py index 037b9482..858161e3 100644 --- a/github/GithubObjects/GistComment.py +++ b/github/GithubObjects/GistComment.py @@ -45,7 +45,7 @@ class GistComment( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -56,7 +56,7 @@ class GistComment( object ): } status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) diff --git a/github/GithubObjects/GitRef.py b/github/GithubObjects/GitRef.py index a77e2d35..e1078a4d 100644 --- a/github/GithubObjects/GitRef.py +++ b/github/GithubObjects/GitRef.py @@ -29,7 +29,7 @@ class GitRef( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -42,7 +42,7 @@ class GitRef( object ): post_parameters[ "force" ] = force status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) diff --git a/github/GithubObjects/Hook.py b/github/GithubObjects/Hook.py index 67250ad5..0c8f440d 100644 --- a/github/GithubObjects/Hook.py +++ b/github/GithubObjects/Hook.py @@ -59,7 +59,7 @@ class Hook( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -79,7 +79,7 @@ class Hook( object ): post_parameters[ "active" ] = active status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) diff --git a/github/GithubObjects/Issue.py b/github/GithubObjects/Issue.py index f49f7b30..1512a04d 100644 --- a/github/GithubObjects/Issue.py +++ b/github/GithubObjects/Issue.py @@ -110,7 +110,7 @@ class Issue( object ): } status, headers, data = self.__requester.request( "POST", - self.url + "/comments", + str( self.url ) + "/comments", None, post_parameters ) @@ -136,19 +136,25 @@ class Issue( object ): post_parameters[ "labels" ] = labels status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) self.__useAttributes( data ) def get_comment( self, id ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/comments/" + str( id ), + None, + None + ) + return IssueComment.IssueComment( self.__requester, data, lazy = True ) def get_comments( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/comments", + str( self.url ) + "/comments", None, None ) @@ -160,7 +166,7 @@ class Issue( object ): def get_events( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/events", + str( self.url ) + "/events", None, None ) @@ -172,7 +178,7 @@ class Issue( object ): def get_labels( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/labels", + str( self.url ) + "/labels", None, None ) @@ -184,7 +190,7 @@ class Issue( object ): def remove_from_labels( self, label ): status, headers, data = self.__requester.request( "DELETE", - self.url + "/labels/" + label.login, + str( self.url ) + "/labels/" + str( label.login ), None, None ) diff --git a/github/GithubObjects/IssueComment.py b/github/GithubObjects/IssueComment.py index 2e802637..3c557b1c 100644 --- a/github/GithubObjects/IssueComment.py +++ b/github/GithubObjects/IssueComment.py @@ -45,7 +45,7 @@ class IssueComment( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -56,7 +56,7 @@ class IssueComment( object ): } status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) diff --git a/github/GithubObjects/Label.py b/github/GithubObjects/Label.py index a46871ee..b95fce77 100644 --- a/github/GithubObjects/Label.py +++ b/github/GithubObjects/Label.py @@ -29,7 +29,7 @@ class Label( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -41,7 +41,7 @@ class Label( object ): } status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) diff --git a/github/GithubObjects/Milestone.py b/github/GithubObjects/Milestone.py index 1384b162..b4f2427c 100644 --- a/github/GithubObjects/Milestone.py +++ b/github/GithubObjects/Milestone.py @@ -66,7 +66,7 @@ class Milestone( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -83,7 +83,7 @@ class Milestone( object ): post_parameters[ "due_on" ] = due_on status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) @@ -92,7 +92,7 @@ class Milestone( object ): def get_labels( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/labels", + str( self.url ) + "/labels", None, None ) diff --git a/github/GithubObjects/NamedUser.py b/github/GithubObjects/NamedUser.py index fadb3709..ca778589 100644 --- a/github/GithubObjects/NamedUser.py +++ b/github/GithubObjects/NamedUser.py @@ -155,7 +155,7 @@ class NamedUser( object ): post_parameters[ "description" ] = description status, headers, data = self.__requester.request( "POST", - self.url + "/gists", + str( self.url ) + "/gists", None, post_parameters ) @@ -164,7 +164,7 @@ class NamedUser( object ): def get_events( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/events", + str( self.url ) + "/events", None, None ) @@ -176,7 +176,7 @@ class NamedUser( object ): def get_followers( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/followers", + str( self.url ) + "/followers", None, None ) @@ -188,7 +188,7 @@ class NamedUser( object ): def get_following( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/following", + str( self.url ) + "/following", None, None ) @@ -200,7 +200,7 @@ class NamedUser( object ): def get_gists( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/gists", + str( self.url ) + "/gists", None, None ) @@ -212,7 +212,7 @@ class NamedUser( object ): def get_orgs( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/orgs", + str( self.url ) + "/orgs", None, None ) @@ -233,7 +233,7 @@ class NamedUser( object ): def get_repo( self, name ): status, headers, data = self.__requester.request( "GET", - "https://api.github.com/repos/" + self.login + "/" + name, + "https://api.github.com/repos/" + str( self.login ) + "/" + str( name ), None, None ) @@ -242,7 +242,7 @@ class NamedUser( object ): def get_repos( self, type = None ): status, headers, data = self.__requester.request( "GET", - self.url + "/repos", + str( self.url ) + "/repos", None, None ) @@ -254,7 +254,7 @@ class NamedUser( object ): def get_watched( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/watched", + str( self.url ) + "/watched", None, None ) diff --git a/github/GithubObjects/Organization.py b/github/GithubObjects/Organization.py index 0b879b45..f562043f 100644 --- a/github/GithubObjects/Organization.py +++ b/github/GithubObjects/Organization.py @@ -138,7 +138,7 @@ class Organization( object ): def add_to_public_members( self, public_member ): status, headers, data = self.__requester.request( "PUT", - self.url + "/public_members/" + public_member.login, + str( self.url ) + "/public_members/" + str( public_member.login ), None, None ) @@ -146,7 +146,7 @@ class Organization( object ): def create_fork( self, repo ): status, headers, data = self.__requester.request( "POST", - "https://api.github.com/repos/" + repo.owner.login + "/" + repo.name + "/forks", + "https://api.github.com/repos/" + str( repo.owner.login ) + "/" + str( repo.name ) + "/forks", None, None ) @@ -172,7 +172,7 @@ class Organization( object ): post_parameters[ "team_id" ] = team_id status, headers, data = self.__requester.request( "POST", - self.url + "/repos", + str( self.url ) + "/repos", None, post_parameters ) @@ -188,7 +188,7 @@ class Organization( object ): post_parameters[ "permission" ] = permission status, headers, data = self.__requester.request( "POST", - self.url + "/teams", + str( self.url ) + "/teams", None, post_parameters ) @@ -211,7 +211,7 @@ class Organization( object ): post_parameters[ "name" ] = name status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) @@ -220,7 +220,7 @@ class Organization( object ): def get_events( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/events", + str( self.url ) + "/events", None, None ) @@ -232,7 +232,7 @@ class Organization( object ): def get_members( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/members", + str( self.url ) + "/members", None, None ) @@ -244,7 +244,7 @@ class Organization( object ): def get_public_members( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/public_members", + str( self.url ) + "/public_members", None, None ) @@ -256,7 +256,7 @@ class Organization( object ): def get_repo( self, name ): status, headers, data = self.__requester.request( "GET", - "https://api.github.com/repos/" + self.login + "/" + name, + "https://api.github.com/repos/" + str( self.login ) + "/" + str( name ), None, None ) @@ -265,7 +265,7 @@ class Organization( object ): def get_repos( self, type = None ): status, headers, data = self.__requester.request( "GET", - self.url + "/repos", + str( self.url ) + "/repos", None, None ) @@ -277,7 +277,7 @@ class Organization( object ): def get_teams( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/teams", + str( self.url ) + "/teams", None, None ) @@ -289,7 +289,7 @@ class Organization( object ): def has_in_members( self, member ): status, headers, data = self.__requester.request( "GET", - self.url + "/members/" + member.login, + str( self.url ) + "/members/" + str( member.login ), None, None ) @@ -298,7 +298,7 @@ class Organization( object ): def has_in_public_members( self, public_member ): status, headers, data = self.__requester.request( "GET", - self.url + "/public_members/" + public_member.login, + str( self.url ) + "/public_members/" + str( public_member.login ), None, None ) @@ -307,7 +307,7 @@ class Organization( object ): def remove_from_members( self, member ): status, headers, data = self.__requester.request( "DELETE", - self.url + "/members/" + member.login, + str( self.url ) + "/members/" + str( member.login ), None, None ) @@ -315,7 +315,7 @@ class Organization( object ): def remove_from_public_members( self, public_member ): status, headers, data = self.__requester.request( "DELETE", - self.url + "/public_members/" + public_member.login, + str( self.url ) + "/public_members/" + str( public_member.login ), None, None ) diff --git a/github/GithubObjects/PullRequest.py b/github/GithubObjects/PullRequest.py index 133f7518..9a759495 100644 --- a/github/GithubObjects/PullRequest.py +++ b/github/GithubObjects/PullRequest.py @@ -156,19 +156,25 @@ class PullRequest( object ): post_parameters[ "state" ] = state status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) self.__useAttributes( data ) def get_comment( self, id ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/comments/" + str( id ), + None, + None + ) + return PullRequestComment.PullRequestComment( self.__requester, data, lazy = True ) def get_comments( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/comments", + str( self.url ) + "/comments", None, None ) @@ -180,7 +186,7 @@ class PullRequest( object ): def get_commits( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/commits", + str( self.url ) + "/commits", None, None ) @@ -192,7 +198,7 @@ class PullRequest( object ): def get_files( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/files", + str( self.url ) + "/files", None, None ) diff --git a/github/GithubObjects/PullRequestComment.py b/github/GithubObjects/PullRequestComment.py index 7dd09e57..52eb0d62 100644 --- a/github/GithubObjects/PullRequestComment.py +++ b/github/GithubObjects/PullRequestComment.py @@ -70,7 +70,7 @@ class PullRequestComment( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -81,7 +81,7 @@ class PullRequestComment( object ): } status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) diff --git a/github/GithubObjects/Repository.py b/github/GithubObjects/Repository.py index fc6dbe85..e3402791 100644 --- a/github/GithubObjects/Repository.py +++ b/github/GithubObjects/Repository.py @@ -185,7 +185,7 @@ class Repository( object ): def add_to_collaborators( self, collaborator ): status, headers, data = self.__requester.request( "PUT", - self.url + "/collaborators/" + collaborator.login, + str( self.url ) + "/collaborators/" + str( collaborator.login ), None, None ) @@ -204,7 +204,7 @@ class Repository( object ): post_parameters[ "content_type" ] = content_type status, headers, data = self.__requester.request( "POST", - self.url + "/downloads", + str( self.url ) + "/downloads", None, post_parameters ) @@ -217,7 +217,7 @@ class Repository( object ): } status, headers, data = self.__requester.request( "POST", - self.url + "/git_blobs", + str( self.url ) + "/git_blobs", None, post_parameters ) @@ -235,7 +235,7 @@ class Repository( object ): post_parameters[ "committer" ] = committer status, headers, data = self.__requester.request( "POST", - self.url + "/git_commits", + str( self.url ) + "/git_commits", None, post_parameters ) @@ -248,7 +248,7 @@ class Repository( object ): } status, headers, data = self.__requester.request( "POST", - self.url + "/git_refs", + str( self.url ) + "/git_refs", None, post_parameters ) @@ -265,7 +265,7 @@ class Repository( object ): post_parameters[ "tagger" ] = tagger status, headers, data = self.__requester.request( "POST", - self.url + "/git_tags", + str( self.url ) + "/git_tags", None, post_parameters ) @@ -279,7 +279,7 @@ class Repository( object ): post_parameters[ "base_tree" ] = base_tree status, headers, data = self.__requester.request( "POST", - self.url + "/git_trees", + str( self.url ) + "/git_trees", None, post_parameters ) @@ -296,7 +296,7 @@ class Repository( object ): post_parameters[ "active" ] = active status, headers, data = self.__requester.request( "POST", - self.url + "/hooks", + str( self.url ) + "/hooks", None, post_parameters ) @@ -316,7 +316,7 @@ class Repository( object ): post_parameters[ "labels" ] = labels status, headers, data = self.__requester.request( "POST", - self.url + "/issues", + str( self.url ) + "/issues", None, post_parameters ) @@ -329,7 +329,7 @@ class Repository( object ): } status, headers, data = self.__requester.request( "POST", - self.url + "/keys", + str( self.url ) + "/keys", None, post_parameters ) @@ -342,7 +342,7 @@ class Repository( object ): } status, headers, data = self.__requester.request( "POST", - self.url + "/labels", + str( self.url ) + "/labels", None, post_parameters ) @@ -360,7 +360,7 @@ class Repository( object ): post_parameters[ "due_on" ] = due_on status, headers, data = self.__requester.request( "POST", - self.url + "/milestones", + str( self.url ) + "/milestones", None, post_parameters ) @@ -384,7 +384,7 @@ class Repository( object ): post_parameters[ "has_downloads" ] = has_downloads status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) @@ -393,7 +393,7 @@ class Repository( object ): def get_branches( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/branches", + str( self.url ) + "/branches", None, None ) @@ -405,7 +405,7 @@ class Repository( object ): def get_collaborators( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/collaborators", + str( self.url ) + "/collaborators", None, None ) @@ -415,12 +415,18 @@ class Repository( object ): ] def get_comment( self, id ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/comments/" + str( id ), + None, + None + ) + return CommitComment.CommitComment( self.__requester, data, lazy = True ) def get_comments( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/comments", + str( self.url ) + "/comments", None, None ) @@ -430,12 +436,18 @@ class Repository( object ): ] def get_commit( self, sha ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/commits/" + str( sha ), + None, + None + ) + return Commit.Commit( self.__requester, data, lazy = True ) def get_commits( self, sha = None, path = None ): status, headers, data = self.__requester.request( "GET", - self.url + "/commits", + str( self.url ) + "/commits", None, None ) @@ -447,7 +459,7 @@ class Repository( object ): def get_contributors( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/contributors", + str( self.url ) + "/contributors", None, None ) @@ -457,12 +469,18 @@ class Repository( object ): ] def get_download( self, id ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/downloads/" + str( id ), + None, + None + ) + return Download.Download( self.__requester, data, lazy = True ) def get_downloads( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/downloads", + str( self.url ) + "/downloads", None, None ) @@ -474,7 +492,7 @@ class Repository( object ): def get_events( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/events", + str( self.url ) + "/events", None, None ) @@ -486,7 +504,7 @@ class Repository( object ): def get_forks( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/forks", + str( self.url ) + "/forks", None, None ) @@ -496,18 +514,36 @@ class Repository( object ): ] def get_git_blob( self, sha ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/git_blobs/" + str( sha ), + None, + None + ) + return GitBlob.GitBlob( self.__requester, data, lazy = True ) def get_git_commit( self, sha ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/git_commits/" + str( sha ), + None, + None + ) + return GitCommit.GitCommit( self.__requester, data, lazy = True ) def get_git_ref( self, ref ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/git_refs/" + str( ref ), + None, + None + ) + return GitRef.GitRef( self.__requester, data, lazy = True ) def get_git_refs( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/git_refs", + str( self.url ) + "/git_refs", None, None ) @@ -517,18 +553,36 @@ class Repository( object ): ] def get_git_tag( self, sha ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/git_tags/" + str( sha ), + None, + None + ) + return GitTag.GitTag( self.__requester, data, lazy = True ) def get_git_tree( self, sha, recursive = None ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/git_trees/" + str( sha ), + None, + None + ) + return GitTree.GitTree( self.__requester, data, lazy = True ) def get_hook( self, id ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/hooks/" + str( id ), + None, + None + ) + return Hook.Hook( self.__requester, data, lazy = True ) def get_hooks( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/hooks", + str( self.url ) + "/hooks", None, None ) @@ -538,12 +592,18 @@ class Repository( object ): ] def get_issue( self, number ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/issues/" + str( number ), + None, + None + ) + return Issue.Issue( self.__requester, data, lazy = True ) def get_issues( self, milestone = None, state = None, assignee = None, mentioned = None, labels = None, sort = None, direction = None, since = None ): status, headers, data = self.__requester.request( "GET", - self.url + "/issues", + str( self.url ) + "/issues", None, None ) @@ -553,12 +613,18 @@ class Repository( object ): ] def get_issues_event( self, id ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/issues_events/" + str( id ), + None, + None + ) + return IssueEvent.IssueEvent( self.__requester, data, lazy = True ) def get_issues_events( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/issues_events", + str( self.url ) + "/issues_events", None, None ) @@ -568,12 +634,18 @@ class Repository( object ): ] def get_key( self, id ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/keys/" + str( id ), + None, + None + ) + return RepositoryKey.RepositoryKey( self.__requester, data, lazy = True ) def get_keys( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/keys", + str( self.url ) + "/keys", None, None ) @@ -583,12 +655,18 @@ class Repository( object ): ] def get_label( self, name ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/labels/" + str( name ), + None, + None + ) + return Label.Label( self.__requester, data, lazy = True ) def get_labels( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/labels", + str( self.url ) + "/labels", None, None ) @@ -601,12 +679,18 @@ class Repository( object ): pass def get_milestone( self, number ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/milestones/" + str( number ), + None, + None + ) + return Milestone.Milestone( self.__requester, data, lazy = True ) def get_milestones( self, state = None, sort = None, direction = None ): status, headers, data = self.__requester.request( "GET", - self.url + "/milestones", + str( self.url ) + "/milestones", None, None ) @@ -619,12 +703,18 @@ class Repository( object ): pass def get_pull( self, number ): - pass + status, headers, data = self.__requester.request( + "GET", + str( self.url ) + "/pulls/" + str( number ), + None, + None + ) + return PullRequest.PullRequest( self.__requester, data, lazy = True ) def get_pulls( self, state = None ): status, headers, data = self.__requester.request( "GET", - self.url + "/pulls", + str( self.url ) + "/pulls", None, None ) @@ -636,7 +726,7 @@ class Repository( object ): def get_tags( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/tags", + str( self.url ) + "/tags", None, None ) @@ -648,7 +738,7 @@ class Repository( object ): def get_teams( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/teams", + str( self.url ) + "/teams", None, None ) @@ -660,7 +750,7 @@ class Repository( object ): def get_watchers( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/watchers", + str( self.url ) + "/watchers", None, None ) @@ -672,7 +762,7 @@ class Repository( object ): def has_in_collaborators( self, collaborator ): status, headers, data = self.__requester.request( "GET", - self.url + "/collaborators/" + collaborator.login, + str( self.url ) + "/collaborators/" + str( collaborator.login ), None, None ) @@ -681,7 +771,7 @@ class Repository( object ): def remove_from_collaborators( self, collaborator ): status, headers, data = self.__requester.request( "DELETE", - self.url + "/collaborators/" + collaborator.login, + str( self.url ) + "/collaborators/" + str( collaborator.login ), None, None ) diff --git a/github/GithubObjects/RepositoryKey.py b/github/GithubObjects/RepositoryKey.py index df3ef3d2..d99fd921 100644 --- a/github/GithubObjects/RepositoryKey.py +++ b/github/GithubObjects/RepositoryKey.py @@ -34,7 +34,7 @@ class RepositoryKey( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -46,7 +46,7 @@ class RepositoryKey( object ): } status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) diff --git a/github/GithubObjects/Team.py b/github/GithubObjects/Team.py index 28035be1..f307163a 100644 --- a/github/GithubObjects/Team.py +++ b/github/GithubObjects/Team.py @@ -46,7 +46,7 @@ class Team( object ): def add_to_members( self, member ): status, headers, data = self.__requester.request( "PUT", - self.url + "/members/" + member.login, + str( self.url ) + "/members/" + str( member.login ), None, None ) @@ -54,7 +54,7 @@ class Team( object ): def add_to_repos( self, repo ): status, headers, data = self.__requester.request( "PUT", - self.url + "/repos/" + repo.login, + str( self.url ) + "/repos/" + str( repo.login ), None, None ) @@ -62,7 +62,7 @@ class Team( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -75,7 +75,7 @@ class Team( object ): post_parameters[ "permission" ] = permission status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters ) @@ -84,7 +84,7 @@ class Team( object ): def get_members( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/members", + str( self.url ) + "/members", None, None ) @@ -96,7 +96,7 @@ class Team( object ): def get_repos( self ): status, headers, data = self.__requester.request( "GET", - self.url + "/repos", + str( self.url ) + "/repos", None, None ) @@ -108,7 +108,7 @@ class Team( object ): def has_in_members( self, member ): status, headers, data = self.__requester.request( "GET", - self.url + "/members/" + member.login, + str( self.url ) + "/members/" + str( member.login ), None, None ) @@ -117,7 +117,7 @@ class Team( object ): def has_in_repos( self, repo ): status, headers, data = self.__requester.request( "GET", - self.url + "/repos/" + repo.login, + str( self.url ) + "/repos/" + str( repo.login ), None, None ) @@ -126,7 +126,7 @@ class Team( object ): def remove_from_members( self, member ): status, headers, data = self.__requester.request( "DELETE", - self.url + "/members/" + member.login, + str( self.url ) + "/members/" + str( member.login ), None, None ) @@ -134,7 +134,7 @@ class Team( object ): def remove_from_repos( self, repo ): status, headers, data = self.__requester.request( "DELETE", - self.url + "/repos/" + repo.login, + str( self.url ) + "/repos/" + str( repo.login ), None, None ) diff --git a/github/GithubObjects/UserKey.py b/github/GithubObjects/UserKey.py index 6f10c011..68fc5d3b 100644 --- a/github/GithubObjects/UserKey.py +++ b/github/GithubObjects/UserKey.py @@ -34,7 +34,7 @@ class UserKey( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - self.url, + str( self.url ), None, None ) @@ -48,7 +48,7 @@ class UserKey( object ): post_parameters[ "key" ] = key status, headers, data = self.__requester.request( "PATCH", - self.url, + str( self.url ), None, post_parameters )