mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
#193: Add a param to Requester.requestXxx for request headers
This commit is contained in:
@@ -319,6 +319,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"PUT",
|
||||
self.url + "/collaborators/" + collaborator._identity,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
|
||||
@@ -335,6 +336,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/compare/" + base + "..." + head,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.Comparison.Comparison(self._requester, headers, data, completed=True)
|
||||
@@ -364,6 +366,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/downloads",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
return github.Download.Download(self._requester, headers, data, completed=True)
|
||||
@@ -385,6 +388,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/git/blobs",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
return github.GitBlob.GitBlob(self._requester, headers, data, completed=True)
|
||||
@@ -417,6 +421,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/git/commits",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
return github.GitCommit.GitCommit(self._requester, headers, data, completed=True)
|
||||
@@ -438,6 +443,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/git/refs",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
return github.GitRef.GitRef(self._requester, headers, data, completed=True)
|
||||
@@ -469,6 +475,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/git/tags",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
return github.GitTag.GitTag(self._requester, headers, data, completed=True)
|
||||
@@ -491,6 +498,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/git/trees",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
return github.GitTree.GitTree(self._requester, headers, data, completed=True)
|
||||
@@ -520,6 +528,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/hooks",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
return github.Hook.Hook(self._requester, headers, data, completed=True)
|
||||
@@ -554,6 +563,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/issues",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
return github.Issue.Issue(self._requester, headers, data, completed=True)
|
||||
@@ -575,6 +585,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/keys",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
return github.RepositoryKey.RepositoryKey(self._requester, headers, data, completed=True, repoUrl=self._url)
|
||||
@@ -596,6 +607,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/labels",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
return github.Label.Label(self._requester, headers, data, completed=True)
|
||||
@@ -626,6 +638,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/milestones",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
return github.Milestone.Milestone(self._requester, headers, data, completed=True)
|
||||
@@ -664,6 +677,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/pulls",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
return github.PullRequest.PullRequest(self._requester, headers, data, completed=True)
|
||||
@@ -677,6 +691,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"DELETE",
|
||||
self.url,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
|
||||
@@ -722,6 +737,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"PATCH",
|
||||
self.url,
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
self._useAttributes(data)
|
||||
@@ -742,6 +758,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
url,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return headers["location"]
|
||||
@@ -769,6 +786,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/branches/" + branch,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.Branch.Branch(self._requester, headers, data, completed=True)
|
||||
@@ -808,6 +826,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/comments/" + str(id),
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.CommitComment.CommitComment(self._requester, headers, data, completed=True)
|
||||
@@ -835,6 +854,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/commits/" + sha,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.Commit.Commit(self._requester, headers, data, completed=True)
|
||||
@@ -893,6 +913,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/contents" + path,
|
||||
url_parameters,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.ContentFile.ContentFile(self._requester, headers, data, completed=True)
|
||||
@@ -913,6 +934,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/contents" + path,
|
||||
url_parameters,
|
||||
None,
|
||||
None
|
||||
)
|
||||
|
||||
@@ -922,6 +944,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
headers['location'],
|
||||
url_parameters,
|
||||
None,
|
||||
None
|
||||
)
|
||||
|
||||
@@ -953,6 +976,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/downloads/" + str(id),
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.Download.Download(self._requester, headers, data, completed=True)
|
||||
@@ -1004,6 +1028,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/git/blobs/" + sha,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.GitBlob.GitBlob(self._requester, headers, data, completed=True)
|
||||
@@ -1019,6 +1044,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/git/commits/" + sha,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.GitCommit.GitCommit(self._requester, headers, data, completed=True)
|
||||
@@ -1037,6 +1063,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + prefix + ref,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.GitRef.GitRef(self._requester, headers, data, completed=True)
|
||||
@@ -1064,6 +1091,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/git/tags/" + sha,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.GitTag.GitTag(self._requester, headers, data, completed=True)
|
||||
@@ -1084,6 +1112,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/git/trees/" + sha,
|
||||
url_parameters,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.GitTree.GitTree(self._requester, headers, data, completed=True)
|
||||
@@ -1099,6 +1128,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/hooks/" + str(id),
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.Hook.Hook(self._requester, headers, data, completed=True)
|
||||
@@ -1126,6 +1156,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/issues/" + str(number),
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.Issue.Issue(self._requester, headers, data, completed=True)
|
||||
@@ -1217,6 +1248,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/issues/events/" + str(id),
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.IssueEvent.IssueEvent(self._requester, headers, data, completed=True)
|
||||
@@ -1244,6 +1276,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/keys/" + str(id),
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.RepositoryKey.RepositoryKey(self._requester, headers, data, completed=True, repoUrl=self._url)
|
||||
@@ -1271,6 +1304,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/labels/" + urllib.quote(name),
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.Label.Label(self._requester, headers, data, completed=True)
|
||||
@@ -1296,6 +1330,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/languages",
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return data
|
||||
@@ -1311,6 +1346,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/milestones/" + str(number),
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.Milestone.Milestone(self._requester, headers, data, completed=True)
|
||||
@@ -1363,6 +1399,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/pulls/" + str(number),
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.PullRequest.PullRequest(self._requester, headers, data, completed=True)
|
||||
@@ -1433,6 +1470,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/readme",
|
||||
url_parameters,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return github.ContentFile.ContentFile(self._requester, headers, data, completed=True)
|
||||
@@ -1508,6 +1546,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/assignees/" + assignee._identity,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return status == 204
|
||||
@@ -1523,6 +1562,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
self.url + "/collaborators/" + collaborator._identity,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return status == 204
|
||||
@@ -1540,6 +1580,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"GET",
|
||||
"/legacy/issues/search/" + self.owner.login + "/" + self.name + "/" + state + "/" + urllib.quote(keyword),
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
@@ -1568,6 +1609,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
self.url + "/merges",
|
||||
None,
|
||||
None,
|
||||
post_parameters
|
||||
)
|
||||
if data is None:
|
||||
@@ -1586,6 +1628,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"DELETE",
|
||||
self.url + "/collaborators/" + collaborator._identity,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
|
||||
@@ -1627,6 +1670,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"POST",
|
||||
"/hub",
|
||||
None,
|
||||
None,
|
||||
post_parameters,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user