diff --git a/codegen/templates/GithubObject.Concatenation.argument.py b/codegen/templates/GithubObject.Concatenation.argument.py index c2a2d8b8..060fdde9 100644 --- a/codegen/templates/GithubObject.Concatenation.argument.py +++ b/codegen/templates/GithubObject.Concatenation.argument.py @@ -1 +1 @@ -str( {{ value|join:"." }} ) \ No newline at end of file +{{ value|join:"." }} \ No newline at end of file diff --git a/codegen/templates/GithubObject.Concatenation.attribute.py b/codegen/templates/GithubObject.Concatenation.attribute.py index 50c2585f..3a83dcd6 100644 --- a/codegen/templates/GithubObject.Concatenation.attribute.py +++ b/codegen/templates/GithubObject.Concatenation.attribute.py @@ -1 +1 @@ -str( self.{{ value|join:"." }} ) \ No newline at end of file +self.{{ value|join:"." }} \ No newline at end of file diff --git a/codegen/templates/GithubObject.Concatenation.identity.py b/codegen/templates/GithubObject.Concatenation.identity.py index c05ab3d5..1689978d 100644 --- a/codegen/templates/GithubObject.Concatenation.identity.py +++ b/codegen/templates/GithubObject.Concatenation.identity.py @@ -1 +1 @@ -str( {{ value|join:"." }}._identity ) \ No newline at end of file +{{ value|join:"." }}._identity \ No newline at end of file diff --git a/src/github/AuthenticatedUser.py b/src/github/AuthenticatedUser.py index f46d7846..42a54d9d 100644 --- a/src/github/AuthenticatedUser.py +++ b/src/github/AuthenticatedUser.py @@ -156,7 +156,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): assert isinstance( following, NamedUser.NamedUser ), following status, headers, data = self._request( "PUT", - "https://api.github.com/user/following/" + str( following._identity ), + "https://api.github.com/user/following/" + following._identity, None, None ) @@ -166,7 +166,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): assert isinstance( watched, Repository.Repository ), watched status, headers, data = self._request( "PUT", - "https://api.github.com/user/watched/" + str( watched._identity ), + "https://api.github.com/user/watched/" + watched._identity, None, None ) @@ -196,7 +196,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): assert isinstance( repo, Repository.Repository ), repo status, headers, data = self._request( "POST", - "https://api.github.com/repos/" + str( repo.owner.login ) + "/" + str( repo.name ) + "/forks", + "https://api.github.com/repos/" + repo.owner.login + "/" + repo.name + "/forks", None, None ) @@ -443,7 +443,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): assert isinstance( org, Organization.Organization ), org status, headers, data = self._request( "GET", - "https://api.github.com/users/" + str( self.login ) + "/events/orgs/" + str( org.login ), + "https://api.github.com/users/" + self.login + "/events/orgs/" + org.login, None, None ) @@ -474,7 +474,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): assert isinstance( name, ( str, unicode ) ), name status, headers, data = self._request( "GET", - "https://api.github.com/repos/" + str( self.login ) + "/" + str( name ), + "https://api.github.com/repos/" + self.login + "/" + name, None, None ) @@ -540,7 +540,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): assert isinstance( following, NamedUser.NamedUser ), following status, headers, data = self._request( "GET", - "https://api.github.com/user/following/" + str( following._identity ), + "https://api.github.com/user/following/" + following._identity, None, None ) @@ -550,7 +550,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): assert isinstance( watched, Repository.Repository ), watched status, headers, data = self._request( "GET", - "https://api.github.com/user/watched/" + str( watched._identity ), + "https://api.github.com/user/watched/" + watched._identity, None, None ) @@ -571,7 +571,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): assert isinstance( following, NamedUser.NamedUser ), following status, headers, data = self._request( "DELETE", - "https://api.github.com/user/following/" + str( following._identity ), + "https://api.github.com/user/following/" + following._identity, None, None ) @@ -581,7 +581,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): assert isinstance( watched, Repository.Repository ), watched status, headers, data = self._request( "DELETE", - "https://api.github.com/user/watched/" + str( watched._identity ), + "https://api.github.com/user/watched/" + watched._identity, None, None ) diff --git a/src/github/Authorization.py b/src/github/Authorization.py index a8c963a5..2498495e 100644 --- a/src/github/Authorization.py +++ b/src/github/Authorization.py @@ -54,7 +54,7 @@ class Authorization( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) @@ -79,7 +79,7 @@ class Authorization( GithubObject.GithubObject ): post_parameters[ "note_url" ] = note_url status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) diff --git a/src/github/Commit.py b/src/github/Commit.py index 376e816f..2f75f11b 100644 --- a/src/github/Commit.py +++ b/src/github/Commit.py @@ -68,7 +68,7 @@ class Commit( GithubObject.GithubObject ): post_parameters[ "position" ] = position status, headers, data = self._request( "POST", - str( self.url ) + "/comments", + self.url + "/comments", None, post_parameters ) @@ -78,7 +78,7 @@ class Commit( GithubObject.GithubObject ): def get_comments( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/comments", + self.url + "/comments", None, None ) diff --git a/src/github/CommitComment.py b/src/github/CommitComment.py index a8390c5c..07bb2385 100644 --- a/src/github/CommitComment.py +++ b/src/github/CommitComment.py @@ -64,7 +64,7 @@ class CommitComment( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) @@ -77,7 +77,7 @@ class CommitComment( GithubObject.GithubObject ): } status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) diff --git a/src/github/Download.py b/src/github/Download.py index 4c25620e..6653fcb4 100644 --- a/src/github/Download.py +++ b/src/github/Download.py @@ -107,7 +107,7 @@ class Download( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) diff --git a/src/github/Gist.py b/src/github/Gist.py index 677a50c3..f22d26fd 100644 --- a/src/github/Gist.py +++ b/src/github/Gist.py @@ -94,7 +94,7 @@ class Gist( GithubObject.GithubObject ): } status, headers, data = self._request( "POST", - str( self.url ) + "/comments", + self.url + "/comments", None, post_parameters ) @@ -104,7 +104,7 @@ class Gist( GithubObject.GithubObject ): def create_fork( self ): status, headers, data = self._request( "POST", - str( self.url ) + "/fork", + self.url + "/fork", None, None ) @@ -114,7 +114,7 @@ class Gist( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) @@ -130,7 +130,7 @@ class Gist( GithubObject.GithubObject ): post_parameters[ "files" ] = dict( ( key, value._identity ) for key, value in files.iteritems() ) status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) @@ -151,7 +151,7 @@ class Gist( GithubObject.GithubObject ): def get_comments( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/comments", + self.url + "/comments", None, None ) @@ -166,7 +166,7 @@ class Gist( GithubObject.GithubObject ): def is_starred( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/star", + self.url + "/star", None, None ) @@ -175,7 +175,7 @@ class Gist( GithubObject.GithubObject ): def reset_starred( self ): status, headers, data = self._request( "DELETE", - str( self.url ) + "/star", + self.url + "/star", None, None ) @@ -184,7 +184,7 @@ class Gist( GithubObject.GithubObject ): def set_starred( self ): status, headers, data = self._request( "PUT", - str( self.url ) + "/star", + self.url + "/star", None, None ) diff --git a/src/github/GistComment.py b/src/github/GistComment.py index a44aea23..182b1716 100644 --- a/src/github/GistComment.py +++ b/src/github/GistComment.py @@ -39,7 +39,7 @@ class GistComment( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) @@ -52,7 +52,7 @@ class GistComment( GithubObject.GithubObject ): } status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) diff --git a/src/github/GitCommit.py b/src/github/GitCommit.py index 8f74c7f9..06aac405 100644 --- a/src/github/GitCommit.py +++ b/src/github/GitCommit.py @@ -45,7 +45,7 @@ class GitCommit( GithubObject.GithubObject ): @property def _identity( self ): - return str( self.sha ) + return self.sha def _initAttributes( self ): self._author = GithubObject.NotSet diff --git a/src/github/GitRef.py b/src/github/GitRef.py index 994e383d..767b1549 100644 --- a/src/github/GitRef.py +++ b/src/github/GitRef.py @@ -24,7 +24,7 @@ class GitRef( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) @@ -40,7 +40,7 @@ class GitRef( GithubObject.GithubObject ): post_parameters[ "force" ] = force status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) diff --git a/src/github/Hook.py b/src/github/Hook.py index e5118dea..537f46b0 100644 --- a/src/github/Hook.py +++ b/src/github/Hook.py @@ -54,7 +54,7 @@ class Hook( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) @@ -81,7 +81,7 @@ class Hook( GithubObject.GithubObject ): post_parameters[ "active" ] = active status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) @@ -91,7 +91,7 @@ class Hook( GithubObject.GithubObject ): def test( self ): status, headers, data = self._request( "POST", - str( self.url ) + "/test", + self.url + "/test", None, None ) diff --git a/src/github/Issue.py b/src/github/Issue.py index 9a6bf9aa..d0aa2511 100644 --- a/src/github/Issue.py +++ b/src/github/Issue.py @@ -108,7 +108,7 @@ class Issue( GithubObject.GithubObject ): post_parameters = [ label._identity for label in labels ] status, headers, data = self._request( "POST", - str( self.url ) + "/labels", + self.url + "/labels", None, post_parameters ) @@ -121,7 +121,7 @@ class Issue( GithubObject.GithubObject ): } status, headers, data = self._request( "POST", - str( self.url ) + "/comments", + self.url + "/comments", None, post_parameters ) @@ -131,7 +131,7 @@ class Issue( GithubObject.GithubObject ): def delete_labels( self ): status, headers, data = self._request( "DELETE", - str( self.url ) + "/labels", + self.url + "/labels", None, None ) @@ -159,7 +159,7 @@ class Issue( GithubObject.GithubObject ): post_parameters[ "labels" ] = labels status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) @@ -170,7 +170,7 @@ class Issue( GithubObject.GithubObject ): assert isinstance( id, int ), id status, headers, data = self._request( "GET", - self._parentUrl( str( self.url ) ) + "/comments/" + str( id ), + self._parentUrl( self.url ) + "/comments/" + str( id ), None, None ) @@ -180,7 +180,7 @@ class Issue( GithubObject.GithubObject ): def get_comments( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/comments", + self.url + "/comments", None, None ) @@ -195,7 +195,7 @@ class Issue( GithubObject.GithubObject ): def get_events( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/events", + self.url + "/events", None, None ) @@ -210,7 +210,7 @@ class Issue( GithubObject.GithubObject ): def get_labels( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/labels", + self.url + "/labels", None, None ) @@ -226,7 +226,7 @@ class Issue( GithubObject.GithubObject ): assert isinstance( label, Label.Label ), label status, headers, data = self._request( "DELETE", - str( self.url ) + "/labels/" + str( label._identity ), + self.url + "/labels/" + label._identity, None, None ) @@ -237,7 +237,7 @@ class Issue( GithubObject.GithubObject ): post_parameters = [ label._identity for label in labels ] status, headers, data = self._request( "PUT", - str( self.url ) + "/labels", + self.url + "/labels", None, post_parameters ) diff --git a/src/github/IssueComment.py b/src/github/IssueComment.py index f29fbd2f..db19f812 100644 --- a/src/github/IssueComment.py +++ b/src/github/IssueComment.py @@ -39,7 +39,7 @@ class IssueComment( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) @@ -52,7 +52,7 @@ class IssueComment( GithubObject.GithubObject ): } status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) diff --git a/src/github/Label.py b/src/github/Label.py index b23feb88..438ed31a 100644 --- a/src/github/Label.py +++ b/src/github/Label.py @@ -24,7 +24,7 @@ class Label( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) @@ -39,7 +39,7 @@ class Label( GithubObject.GithubObject ): } status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) @@ -48,7 +48,7 @@ class Label( GithubObject.GithubObject ): @property def _identity( self ): - return urllib.quote( str( self.name ) ) + return urllib.quote( self.name ) def _initAttributes( self ): self._color = GithubObject.NotSet diff --git a/src/github/Milestone.py b/src/github/Milestone.py index 2303b51c..002dc0d8 100644 --- a/src/github/Milestone.py +++ b/src/github/Milestone.py @@ -66,7 +66,7 @@ class Milestone( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) @@ -88,7 +88,7 @@ class Milestone( GithubObject.GithubObject ): post_parameters[ "due_on" ] = due_on status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) @@ -98,7 +98,7 @@ class Milestone( GithubObject.GithubObject ): def get_labels( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/labels", + self.url + "/labels", None, None ) diff --git a/src/github/NamedUser.py b/src/github/NamedUser.py index 2a8a1531..34501855 100644 --- a/src/github/NamedUser.py +++ b/src/github/NamedUser.py @@ -155,7 +155,7 @@ class NamedUser( GithubObject.GithubObject ): post_parameters[ "description" ] = description status, headers, data = self._request( "POST", - str( self.url ) + "/gists", + self.url + "/gists", None, post_parameters ) @@ -165,7 +165,7 @@ class NamedUser( GithubObject.GithubObject ): def get_events( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/events", + self.url + "/events", None, None ) @@ -180,7 +180,7 @@ class NamedUser( GithubObject.GithubObject ): def get_followers( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/followers", + self.url + "/followers", None, None ) @@ -195,7 +195,7 @@ class NamedUser( GithubObject.GithubObject ): def get_following( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/following", + self.url + "/following", None, None ) @@ -210,7 +210,7 @@ class NamedUser( GithubObject.GithubObject ): def get_gists( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/gists", + self.url + "/gists", None, None ) @@ -225,7 +225,7 @@ class NamedUser( GithubObject.GithubObject ): def get_orgs( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/orgs", + self.url + "/orgs", None, None ) @@ -240,7 +240,7 @@ class NamedUser( GithubObject.GithubObject ): def get_public_events( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/events/public", + self.url + "/events/public", None, None ) @@ -255,7 +255,7 @@ class NamedUser( GithubObject.GithubObject ): def get_public_received_events( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/received_events/public", + self.url + "/received_events/public", None, None ) @@ -270,7 +270,7 @@ class NamedUser( GithubObject.GithubObject ): def get_received_events( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/received_events", + self.url + "/received_events", None, None ) @@ -286,7 +286,7 @@ class NamedUser( GithubObject.GithubObject ): assert isinstance( name, ( str, unicode ) ), name status, headers, data = self._request( "GET", - "https://api.github.com/repos/" + str( self.login ) + "/" + str( name ), + "https://api.github.com/repos/" + self.login + "/" + name, None, None ) @@ -300,7 +300,7 @@ class NamedUser( GithubObject.GithubObject ): url_parameters[ "type" ] = type status, headers, data = self._request( "GET", - str( self.url ) + "/repos", + self.url + "/repos", url_parameters, None ) @@ -315,7 +315,7 @@ class NamedUser( GithubObject.GithubObject ): def get_watched( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/watched", + self.url + "/watched", None, None ) @@ -329,7 +329,7 @@ class NamedUser( GithubObject.GithubObject ): @property def _identity( self ): - return str( self.login ) + return self.login def _initAttributes( self ): self._avatar_url = GithubObject.NotSet diff --git a/src/github/Organization.py b/src/github/Organization.py index 294633e7..a983f57e 100644 --- a/src/github/Organization.py +++ b/src/github/Organization.py @@ -135,7 +135,7 @@ class Organization( GithubObject.GithubObject ): assert isinstance( public_member, NamedUser.NamedUser ), public_member status, headers, data = self._request( "PUT", - str( self.url ) + "/public_members/" + str( public_member._identity ), + self.url + "/public_members/" + public_member._identity, None, None ) @@ -144,11 +144,11 @@ class Organization( GithubObject.GithubObject ): def create_fork( self, repo ): assert isinstance( repo, Repository.Repository ), repo url_parameters = { - "org": str( self.login ), + "org": self.login, } status, headers, data = self._request( "POST", - "https://api.github.com/repos/" + str( repo.owner.login ) + "/" + str( repo.name ) + "/forks", + "https://api.github.com/repos/" + repo.owner.login + "/" + repo.name + "/forks", url_parameters, None ) @@ -183,7 +183,7 @@ class Organization( GithubObject.GithubObject ): post_parameters[ "team_id" ] = team_id status, headers, data = self._request( "POST", - str( self.url ) + "/repos", + self.url + "/repos", None, post_parameters ) @@ -203,7 +203,7 @@ class Organization( GithubObject.GithubObject ): post_parameters[ "permission" ] = permission status, headers, data = self._request( "POST", - str( self.url ) + "/teams", + self.url + "/teams", None, post_parameters ) @@ -232,7 +232,7 @@ class Organization( GithubObject.GithubObject ): post_parameters[ "name" ] = name status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) @@ -242,7 +242,7 @@ class Organization( GithubObject.GithubObject ): def get_events( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/events", + self.url + "/events", None, None ) @@ -257,7 +257,7 @@ class Organization( GithubObject.GithubObject ): def get_members( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/members", + self.url + "/members", None, None ) @@ -272,7 +272,7 @@ class Organization( GithubObject.GithubObject ): def get_public_members( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/public_members", + self.url + "/public_members", None, None ) @@ -288,7 +288,7 @@ class Organization( GithubObject.GithubObject ): assert isinstance( name, ( str, unicode ) ), name status, headers, data = self._request( "GET", - "https://api.github.com/repos/" + str( self.login ) + "/" + str( name ), + "https://api.github.com/repos/" + self.login + "/" + name, None, None ) @@ -302,7 +302,7 @@ class Organization( GithubObject.GithubObject ): url_parameters[ "type" ] = type status, headers, data = self._request( "GET", - str( self.url ) + "/repos", + self.url + "/repos", url_parameters, None ) @@ -328,7 +328,7 @@ class Organization( GithubObject.GithubObject ): def get_teams( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/teams", + self.url + "/teams", None, None ) @@ -344,7 +344,7 @@ class Organization( GithubObject.GithubObject ): assert isinstance( member, NamedUser.NamedUser ), member status, headers, data = self._request( "GET", - str( self.url ) + "/members/" + str( member._identity ), + self.url + "/members/" + member._identity, None, None ) @@ -354,7 +354,7 @@ class Organization( GithubObject.GithubObject ): assert isinstance( public_member, NamedUser.NamedUser ), public_member status, headers, data = self._request( "GET", - str( self.url ) + "/public_members/" + str( public_member._identity ), + self.url + "/public_members/" + public_member._identity, None, None ) @@ -364,7 +364,7 @@ class Organization( GithubObject.GithubObject ): assert isinstance( member, NamedUser.NamedUser ), member status, headers, data = self._request( "DELETE", - str( self.url ) + "/members/" + str( member._identity ), + self.url + "/members/" + member._identity, None, None ) @@ -374,7 +374,7 @@ class Organization( GithubObject.GithubObject ): assert isinstance( public_member, NamedUser.NamedUser ), public_member status, headers, data = self._request( "DELETE", - str( self.url ) + "/public_members/" + str( public_member._identity ), + self.url + "/public_members/" + public_member._identity, None, None ) diff --git a/src/github/PullRequest.py b/src/github/PullRequest.py index c7b4ea23..eb13d227 100644 --- a/src/github/PullRequest.py +++ b/src/github/PullRequest.py @@ -155,7 +155,7 @@ class PullRequest( GithubObject.GithubObject ): } status, headers, data = self._request( "POST", - str( self.url ) + "/comments", + self.url + "/comments", None, post_parameters ) @@ -175,7 +175,7 @@ class PullRequest( GithubObject.GithubObject ): post_parameters[ "state" ] = state status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) @@ -186,7 +186,7 @@ class PullRequest( GithubObject.GithubObject ): assert isinstance( id, int ), id status, headers, data = self._request( "GET", - self._parentUrl( str( self.url ) ) + "/comments/" + str( id ), + self._parentUrl( self.url ) + "/comments/" + str( id ), None, None ) @@ -196,7 +196,7 @@ class PullRequest( GithubObject.GithubObject ): def get_comments( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/comments", + self.url + "/comments", None, None ) @@ -211,7 +211,7 @@ class PullRequest( GithubObject.GithubObject ): def get_commits( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/commits", + self.url + "/commits", None, None ) @@ -226,7 +226,7 @@ class PullRequest( GithubObject.GithubObject ): def get_files( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/files", + self.url + "/files", None, None ) @@ -241,7 +241,7 @@ class PullRequest( GithubObject.GithubObject ): def is_merged( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/merge", + self.url + "/merge", None, None ) @@ -254,7 +254,7 @@ class PullRequest( GithubObject.GithubObject ): post_parameters[ "commit_message" ] = commit_message status, headers, data = self._request( "PUT", - str( self.url ) + "/merge", + self.url + "/merge", None, post_parameters ) diff --git a/src/github/PullRequestComment.py b/src/github/PullRequestComment.py index ad272ae2..6c720d9c 100644 --- a/src/github/PullRequestComment.py +++ b/src/github/PullRequestComment.py @@ -64,7 +64,7 @@ class PullRequestComment( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) @@ -77,7 +77,7 @@ class PullRequestComment( GithubObject.GithubObject ): } status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) diff --git a/src/github/Repository.py b/src/github/Repository.py index bf6bc9b4..d11702bc 100644 --- a/src/github/Repository.py +++ b/src/github/Repository.py @@ -188,7 +188,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( collaborator, NamedUser.NamedUser ), collaborator status, headers, data = self._request( "PUT", - str( self.url ) + "/collaborators/" + str( collaborator._identity ), + self.url + "/collaborators/" + collaborator._identity, None, None ) @@ -199,7 +199,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( head, ( str, unicode ) ), head status, headers, data = self._request( "GET", - str( self.url ) + "/compare/" + str( base ) + "..." + str( head ), + self.url + "/compare/" + base + "..." + head, None, None ) @@ -221,7 +221,7 @@ class Repository( GithubObject.GithubObject ): post_parameters[ "content_type" ] = content_type status, headers, data = self._request( "POST", - str( self.url ) + "/downloads", + self.url + "/downloads", None, post_parameters ) @@ -237,7 +237,7 @@ class Repository( GithubObject.GithubObject ): } status, headers, data = self._request( "POST", - str( self.url ) + "/git/blobs", + self.url + "/git/blobs", None, post_parameters ) @@ -261,7 +261,7 @@ class Repository( GithubObject.GithubObject ): post_parameters[ "committer" ] = committer._identity status, headers, data = self._request( "POST", - str( self.url ) + "/git/commits", + self.url + "/git/commits", None, post_parameters ) @@ -277,7 +277,7 @@ class Repository( GithubObject.GithubObject ): } status, headers, data = self._request( "POST", - str( self.url ) + "/git/refs", + self.url + "/git/refs", None, post_parameters ) @@ -300,7 +300,7 @@ class Repository( GithubObject.GithubObject ): post_parameters[ "tagger" ] = tagger._identity status, headers, data = self._request( "POST", - str( self.url ) + "/git/tags", + self.url + "/git/tags", None, post_parameters ) @@ -317,7 +317,7 @@ class Repository( GithubObject.GithubObject ): post_parameters[ "base_tree" ] = base_tree status, headers, data = self._request( "POST", - str( self.url ) + "/git/trees", + self.url + "/git/trees", None, post_parameters ) @@ -339,7 +339,7 @@ class Repository( GithubObject.GithubObject ): post_parameters[ "active" ] = active status, headers, data = self._request( "POST", - str( self.url ) + "/hooks", + self.url + "/hooks", None, post_parameters ) @@ -365,7 +365,7 @@ class Repository( GithubObject.GithubObject ): post_parameters[ "labels" ] = labels status, headers, data = self._request( "POST", - str( self.url ) + "/issues", + self.url + "/issues", None, post_parameters ) @@ -381,7 +381,7 @@ class Repository( GithubObject.GithubObject ): } status, headers, data = self._request( "POST", - str( self.url ) + "/keys", + self.url + "/keys", None, post_parameters ) @@ -397,7 +397,7 @@ class Repository( GithubObject.GithubObject ): } status, headers, data = self._request( "POST", - str( self.url ) + "/labels", + self.url + "/labels", None, post_parameters ) @@ -420,7 +420,7 @@ class Repository( GithubObject.GithubObject ): post_parameters[ "due_on" ] = due_on status, headers, data = self._request( "POST", - str( self.url ) + "/milestones", + self.url + "/milestones", None, post_parameters ) @@ -450,7 +450,7 @@ class Repository( GithubObject.GithubObject ): post_parameters = kwds status, headers, data = self._request( "POST", - str( self.url ) + "/pulls", + self.url + "/pulls", None, post_parameters ) @@ -482,7 +482,7 @@ class Repository( GithubObject.GithubObject ): post_parameters[ "has_downloads" ] = has_downloads status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) @@ -492,7 +492,7 @@ class Repository( GithubObject.GithubObject ): def get_branches( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/branches", + self.url + "/branches", None, None ) @@ -507,7 +507,7 @@ class Repository( GithubObject.GithubObject ): def get_collaborators( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/collaborators", + self.url + "/collaborators", None, None ) @@ -523,7 +523,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( id, int ), id status, headers, data = self._request( "GET", - str( self.url ) + "/comments/" + str( id ), + self.url + "/comments/" + str( id ), None, None ) @@ -533,7 +533,7 @@ class Repository( GithubObject.GithubObject ): def get_comments( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/comments", + self.url + "/comments", None, None ) @@ -549,7 +549,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( sha, ( str, unicode ) ), sha status, headers, data = self._request( "GET", - str( self.url ) + "/commits/" + str( sha ), + self.url + "/commits/" + sha, None, None ) @@ -566,7 +566,7 @@ class Repository( GithubObject.GithubObject ): url_parameters[ "path" ] = path status, headers, data = self._request( "GET", - str( self.url ) + "/commits", + self.url + "/commits", url_parameters, None ) @@ -581,7 +581,7 @@ class Repository( GithubObject.GithubObject ): def get_contributors( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/contributors", + self.url + "/contributors", None, None ) @@ -597,7 +597,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( id, int ), id status, headers, data = self._request( "GET", - str( self.url ) + "/downloads/" + str( id ), + self.url + "/downloads/" + str( id ), None, None ) @@ -607,7 +607,7 @@ class Repository( GithubObject.GithubObject ): def get_downloads( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/downloads", + self.url + "/downloads", None, None ) @@ -622,7 +622,7 @@ class Repository( GithubObject.GithubObject ): def get_events( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/events", + self.url + "/events", None, None ) @@ -637,7 +637,7 @@ class Repository( GithubObject.GithubObject ): def get_forks( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/forks", + self.url + "/forks", None, None ) @@ -653,7 +653,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( sha, ( str, unicode ) ), sha status, headers, data = self._request( "GET", - str( self.url ) + "/git/blobs/" + str( sha ), + self.url + "/git/blobs/" + sha, None, None ) @@ -664,7 +664,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( sha, ( str, unicode ) ), sha status, headers, data = self._request( "GET", - str( self.url ) + "/git/commits/" + str( sha ), + self.url + "/git/commits/" + sha, None, None ) @@ -675,7 +675,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( ref, ( str, unicode ) ), ref status, headers, data = self._request( "GET", - str( self.url ) + "/git/" + str( ref ), + self.url + "/git/" + ref, None, None ) @@ -685,7 +685,7 @@ class Repository( GithubObject.GithubObject ): def get_git_refs( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/git/refs", + self.url + "/git/refs", None, None ) @@ -701,7 +701,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( sha, ( str, unicode ) ), sha status, headers, data = self._request( "GET", - str( self.url ) + "/git/tags/" + str( sha ), + self.url + "/git/tags/" + sha, None, None ) @@ -716,7 +716,7 @@ class Repository( GithubObject.GithubObject ): url_parameters[ "recursive" ] = recursive status, headers, data = self._request( "GET", - str( self.url ) + "/git/trees/" + str( sha ), + self.url + "/git/trees/" + sha, url_parameters, None ) @@ -727,7 +727,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( id, int ), id status, headers, data = self._request( "GET", - str( self.url ) + "/hooks/" + str( id ), + self.url + "/hooks/" + str( id ), None, None ) @@ -737,7 +737,7 @@ class Repository( GithubObject.GithubObject ): def get_hooks( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/hooks", + self.url + "/hooks", None, None ) @@ -753,7 +753,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( number, int ), number status, headers, data = self._request( "GET", - str( self.url ) + "/issues/" + str( number ), + self.url + "/issues/" + str( number ), None, None ) @@ -788,7 +788,7 @@ class Repository( GithubObject.GithubObject ): url_parameters[ "since" ] = since status, headers, data = self._request( "GET", - str( self.url ) + "/issues", + self.url + "/issues", url_parameters, None ) @@ -804,7 +804,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( id, int ), id status, headers, data = self._request( "GET", - str( self.url ) + "/issues/events/" + str( id ), + self.url + "/issues/events/" + str( id ), None, None ) @@ -814,7 +814,7 @@ class Repository( GithubObject.GithubObject ): def get_issues_events( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/issues/events", + self.url + "/issues/events", None, None ) @@ -830,7 +830,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( id, int ), id status, headers, data = self._request( "GET", - str( self.url ) + "/keys/" + str( id ), + self.url + "/keys/" + str( id ), None, None ) @@ -840,7 +840,7 @@ class Repository( GithubObject.GithubObject ): def get_keys( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/keys", + self.url + "/keys", None, None ) @@ -856,7 +856,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( name, ( str, unicode ) ), name status, headers, data = self._request( "GET", - str( self.url ) + "/labels/" + urllib.quote( str( name ) ), + self.url + "/labels/" + urllib.quote( name ), None, None ) @@ -866,7 +866,7 @@ class Repository( GithubObject.GithubObject ): def get_labels( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/labels", + self.url + "/labels", None, None ) @@ -881,7 +881,7 @@ class Repository( GithubObject.GithubObject ): def get_languages( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/languages", + self.url + "/languages", None, None ) @@ -892,7 +892,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( number, int ), number status, headers, data = self._request( "GET", - str( self.url ) + "/milestones/" + str( number ), + self.url + "/milestones/" + str( number ), None, None ) @@ -912,7 +912,7 @@ class Repository( GithubObject.GithubObject ): url_parameters[ "direction" ] = direction status, headers, data = self._request( "GET", - str( self.url ) + "/milestones", + self.url + "/milestones", url_parameters, None ) @@ -927,7 +927,7 @@ class Repository( GithubObject.GithubObject ): def get_network_events( self ): status, headers, data = self._request( "GET", - "https://api.github.com/networks/" + str( self.owner.login ) + "/" + str( self.name ) + "/events", + "https://api.github.com/networks/" + self.owner.login + "/" + self.name + "/events", None, None ) @@ -943,7 +943,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( number, int ), number status, headers, data = self._request( "GET", - str( self.url ) + "/pulls/" + str( number ), + self.url + "/pulls/" + str( number ), None, None ) @@ -957,7 +957,7 @@ class Repository( GithubObject.GithubObject ): url_parameters[ "state" ] = state status, headers, data = self._request( "GET", - str( self.url ) + "/pulls", + self.url + "/pulls", url_parameters, None ) @@ -972,7 +972,7 @@ class Repository( GithubObject.GithubObject ): def get_tags( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/tags", + self.url + "/tags", None, None ) @@ -987,7 +987,7 @@ class Repository( GithubObject.GithubObject ): def get_teams( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/teams", + self.url + "/teams", None, None ) @@ -1002,7 +1002,7 @@ class Repository( GithubObject.GithubObject ): def get_watchers( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/watchers", + self.url + "/watchers", None, None ) @@ -1018,7 +1018,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( collaborator, NamedUser.NamedUser ), collaborator status, headers, data = self._request( "GET", - str( self.url ) + "/collaborators/" + str( collaborator._identity ), + self.url + "/collaborators/" + collaborator._identity, None, None ) @@ -1028,7 +1028,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( collaborator, NamedUser.NamedUser ), collaborator status, headers, data = self._request( "DELETE", - str( self.url ) + "/collaborators/" + str( collaborator._identity ), + self.url + "/collaborators/" + collaborator._identity, None, None ) @@ -1036,7 +1036,7 @@ class Repository( GithubObject.GithubObject ): @property def _identity( self ): - return str( self.owner.login ) + "/" + str( self.name ) + return self.owner.login + "/" + self.name def _initAttributes( self ): self._clone_url = GithubObject.NotSet diff --git a/src/github/Team.py b/src/github/Team.py index 51a99e55..3b9da6e0 100644 --- a/src/github/Team.py +++ b/src/github/Team.py @@ -42,7 +42,7 @@ class Team( GithubObject.GithubObject ): assert isinstance( member, NamedUser.NamedUser ), member status, headers, data = self._request( "PUT", - str( self.url ) + "/members/" + str( member._identity ), + self.url + "/members/" + member._identity, None, None ) @@ -52,7 +52,7 @@ class Team( GithubObject.GithubObject ): assert isinstance( repo, Repository.Repository ), repo status, headers, data = self._request( "PUT", - str( self.url ) + "/repos/" + str( repo._identity ), + self.url + "/repos/" + repo._identity, None, None ) @@ -61,7 +61,7 @@ class Team( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) @@ -77,7 +77,7 @@ class Team( GithubObject.GithubObject ): post_parameters[ "permission" ] = permission status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters ) @@ -87,7 +87,7 @@ class Team( GithubObject.GithubObject ): def get_members( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/members", + self.url + "/members", None, None ) @@ -102,7 +102,7 @@ class Team( GithubObject.GithubObject ): def get_repos( self ): status, headers, data = self._request( "GET", - str( self.url ) + "/repos", + self.url + "/repos", None, None ) @@ -118,7 +118,7 @@ class Team( GithubObject.GithubObject ): assert isinstance( member, NamedUser.NamedUser ), member status, headers, data = self._request( "GET", - str( self.url ) + "/members/" + str( member._identity ), + self.url + "/members/" + member._identity, None, None ) @@ -128,7 +128,7 @@ class Team( GithubObject.GithubObject ): assert isinstance( repo, Repository.Repository ), repo status, headers, data = self._request( "GET", - str( self.url ) + "/repos/" + str( repo._identity ), + self.url + "/repos/" + repo._identity, None, None ) @@ -138,7 +138,7 @@ class Team( GithubObject.GithubObject ): assert isinstance( member, NamedUser.NamedUser ), member status, headers, data = self._request( "DELETE", - str( self.url ) + "/members/" + str( member._identity ), + self.url + "/members/" + member._identity, None, None ) @@ -148,7 +148,7 @@ class Team( GithubObject.GithubObject ): assert isinstance( repo, Repository.Repository ), repo status, headers, data = self._request( "DELETE", - str( self.url ) + "/repos/" + str( repo._identity ), + self.url + "/repos/" + repo._identity, None, None ) diff --git a/src/github/UserKey.py b/src/github/UserKey.py index 44b84da4..8df3ce29 100644 --- a/src/github/UserKey.py +++ b/src/github/UserKey.py @@ -32,7 +32,7 @@ class UserKey( GithubObject.GithubObject ): def delete( self ): status, headers, data = self._request( "DELETE", - str( self.url ), + self.url, None, None ) @@ -48,7 +48,7 @@ class UserKey( GithubObject.GithubObject ): post_parameters[ "key" ] = key status, headers, data = self._request( "PATCH", - str( self.url ), + self.url, None, post_parameters )