Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit47a524b

Browse files
committed
Added pull requests issue comments method.
1 parentcc9e4aa commit47a524b

File tree

5 files changed

+353
-0
lines changed

5 files changed

+353
-0
lines changed

‎AUTHORS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ Contributors
4545
- James Pearson (@xiongchiamiov)
4646

4747
- INADA Naoki (@methane)
48+
49+
- Matias Bordese (@matiasb)

‎github3/pulls.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
fromgithub3.modelsimportGitHubObject,GitHubCore,BaseComment
1313
fromgithub3.usersimportUser
1414
fromgithub3.decoratorsimportrequires_auth
15+
fromgithub3.issues.commentimportIssueComment
1516

1617

1718
classPullDestination(GitHubCore):
@@ -252,6 +253,18 @@ def iter_files(self, number=-1, etag=None):
252253
url=self._build_url('files',base_url=self._api)
253254
returnself._iter(int(number),url,PullFile,etag=etag)
254255

256+
defiter_issue_comments(self,number=-1,etag=None):
257+
"""Iterate over the issue comments on this pull request.
258+
259+
:param int number: (optional), number of comments to return. Default:
260+
-1 returns all available comments.
261+
:param str etag: (optional), ETag from a previous request to the same
262+
endpoint
263+
:returns: generator of :class:`IssueComment <IssueComment>`\ s
264+
"""
265+
url=self._build_url(base_url=self.links['comments'])
266+
returnself._iter(int(number),url,IssueComment,etag=etag)
267+
255268
@requires_auth
256269
defmerge(self,commit_message=''):
257270
"""Merge this pull request.

‎tests/json/pull19

Lines changed: 299 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,299 @@
1+
{
2+
"url": "https://api.github.com/repos/sigmavirus24/github3.py/pulls/19",
3+
"id": 2500092,
4+
"html_url": "https://github.com/sigmavirus24/github3.py/pull/19",
5+
"diff_url": "https://github.com/sigmavirus24/github3.py/pull/19.diff",
6+
"patch_url": "https://github.com/sigmavirus24/github3.py/pull/19.patch",
7+
"issue_url": "https://github.com/sigmavirus24/github3.py/issues/19",
8+
"number": 19,
9+
"state": "closed",
10+
"title": "Fix pull request urls",
11+
"user": {
12+
"login": "seveas",
13+
"id": 200649,
14+
"avatar_url": "https://secure.gravatar.com/avatar/a42c4bd1fdb275185a574b2385418a3d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
15+
"gravatar_id": "a42c4bd1fdb275185a574b2385418a3d",
16+
"url": "https://api.github.com/users/seveas",
17+
"html_url": "https://github.com/seveas",
18+
"followers_url": "https://api.github.com/users/seveas/followers",
19+
"following_url": "https://api.github.com/users/seveas/following{/other_user}",
20+
"gists_url": "https://api.github.com/users/seveas/gists{/gist_id}",
21+
"starred_url": "https://api.github.com/users/seveas/starred{/owner}{/repo}",
22+
"subscriptions_url": "https://api.github.com/users/seveas/subscriptions",
23+
"organizations_url": "https://api.github.com/users/seveas/orgs",
24+
"repos_url": "https://api.github.com/users/seveas/repos",
25+
"events_url": "https://api.github.com/users/seveas/events{/privacy}",
26+
"received_events_url": "https://api.github.com/users/seveas/received_events",
27+
"type": "User"
28+
},
29+
"body": "Pull requet urls were generated as \nhttps://api.github.com/pulls/https://api.github.com/repos/login/repo\ndue to a type on repos.py. This commit fixes that.",
30+
"created_at": "2012-10-01T11:46:51Z",
31+
"updated_at": "2013-06-17T18:53:30Z",
32+
"closed_at": "2012-10-01T13:05:32Z",
33+
"merged_at": "2012-10-01T13:05:32Z",
34+
"merge_commit_sha": "8306d24fc26094ccececfa70e1a622d10d465bc7",
35+
"assignee": null,
36+
"milestone": null,
37+
"commits_url": "https://github.com/sigmavirus24/github3.py/pull/19/commits",
38+
"review_comments_url": "https://github.com/sigmavirus24/github3.py/pull/19/comments",
39+
"review_comment_url": "/repos/sigmavirus24/github3.py/pulls/comments/{number}",
40+
"comments_url": "https://api.github.com/repos/sigmavirus24/github3.py/issues/19/comments",
41+
"head": {
42+
"label": "seveas:master",
43+
"ref": "master",
44+
"sha": "7d851f7117d9348bc45131f92b9a00c9bbd0bc80",
45+
"user": {
46+
"login": "seveas",
47+
"id": 200649,
48+
"avatar_url": "https://secure.gravatar.com/avatar/a42c4bd1fdb275185a574b2385418a3d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
49+
"gravatar_id": "a42c4bd1fdb275185a574b2385418a3d",
50+
"url": "https://api.github.com/users/seveas",
51+
"html_url": "https://github.com/seveas",
52+
"followers_url": "https://api.github.com/users/seveas/followers",
53+
"following_url": "https://api.github.com/users/seveas/following{/other_user}",
54+
"gists_url": "https://api.github.com/users/seveas/gists{/gist_id}",
55+
"starred_url": "https://api.github.com/users/seveas/starred{/owner}{/repo}",
56+
"subscriptions_url": "https://api.github.com/users/seveas/subscriptions",
57+
"organizations_url": "https://api.github.com/users/seveas/orgs",
58+
"repos_url": "https://api.github.com/users/seveas/repos",
59+
"events_url": "https://api.github.com/users/seveas/events{/privacy}",
60+
"received_events_url": "https://api.github.com/users/seveas/received_events",
61+
"type": "User"
62+
},
63+
"repo": {
64+
"id": 6021532,
65+
"name": "github3.py",
66+
"full_name": "seveas/github3.py",
67+
"owner": {
68+
"login": "seveas",
69+
"id": 200649,
70+
"avatar_url": "https://secure.gravatar.com/avatar/a42c4bd1fdb275185a574b2385418a3d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
71+
"gravatar_id": "a42c4bd1fdb275185a574b2385418a3d",
72+
"url": "https://api.github.com/users/seveas",
73+
"html_url": "https://github.com/seveas",
74+
"followers_url": "https://api.github.com/users/seveas/followers",
75+
"following_url": "https://api.github.com/users/seveas/following{/other_user}",
76+
"gists_url": "https://api.github.com/users/seveas/gists{/gist_id}",
77+
"starred_url": "https://api.github.com/users/seveas/starred{/owner}{/repo}",
78+
"subscriptions_url": "https://api.github.com/users/seveas/subscriptions",
79+
"organizations_url": "https://api.github.com/users/seveas/orgs",
80+
"repos_url": "https://api.github.com/users/seveas/repos",
81+
"events_url": "https://api.github.com/users/seveas/events{/privacy}",
82+
"received_events_url": "https://api.github.com/users/seveas/received_events",
83+
"type": "User"
84+
},
85+
"private": false,
86+
"html_url": "https://github.com/seveas/github3.py",
87+
"description": "Python library for interfacing with the GitHub APIv3",
88+
"fork": true,
89+
"url": "https://api.github.com/repos/seveas/github3.py",
90+
"forks_url": "https://api.github.com/repos/seveas/github3.py/forks",
91+
"keys_url": "https://api.github.com/repos/seveas/github3.py/keys{/key_id}",
92+
"collaborators_url": "https://api.github.com/repos/seveas/github3.py/collaborators{/collaborator}",
93+
"teams_url": "https://api.github.com/repos/seveas/github3.py/teams",
94+
"hooks_url": "https://api.github.com/repos/seveas/github3.py/hooks",
95+
"issue_events_url": "https://api.github.com/repos/seveas/github3.py/issues/events{/number}",
96+
"events_url": "https://api.github.com/repos/seveas/github3.py/events",
97+
"assignees_url": "https://api.github.com/repos/seveas/github3.py/assignees{/user}",
98+
"branches_url": "https://api.github.com/repos/seveas/github3.py/branches{/branch}",
99+
"tags_url": "https://api.github.com/repos/seveas/github3.py/tags",
100+
"blobs_url": "https://api.github.com/repos/seveas/github3.py/git/blobs{/sha}",
101+
"git_tags_url": "https://api.github.com/repos/seveas/github3.py/git/tags{/sha}",
102+
"git_refs_url": "https://api.github.com/repos/seveas/github3.py/git/refs{/sha}",
103+
"trees_url": "https://api.github.com/repos/seveas/github3.py/git/trees{/sha}",
104+
"statuses_url": "https://api.github.com/repos/seveas/github3.py/statuses/{sha}",
105+
"languages_url": "https://api.github.com/repos/seveas/github3.py/languages",
106+
"stargazers_url": "https://api.github.com/repos/seveas/github3.py/stargazers",
107+
"contributors_url": "https://api.github.com/repos/seveas/github3.py/contributors",
108+
"subscribers_url": "https://api.github.com/repos/seveas/github3.py/subscribers",
109+
"subscription_url": "https://api.github.com/repos/seveas/github3.py/subscription",
110+
"commits_url": "https://api.github.com/repos/seveas/github3.py/commits{/sha}",
111+
"git_commits_url": "https://api.github.com/repos/seveas/github3.py/git/commits{/sha}",
112+
"comments_url": "https://api.github.com/repos/seveas/github3.py/comments{/number}",
113+
"issue_comment_url": "https://api.github.com/repos/seveas/github3.py/issues/comments/{number}",
114+
"contents_url": "https://api.github.com/repos/seveas/github3.py/contents/{+path}",
115+
"compare_url": "https://api.github.com/repos/seveas/github3.py/compare/{base}...{head}",
116+
"merges_url": "https://api.github.com/repos/seveas/github3.py/merges",
117+
"archive_url": "https://api.github.com/repos/seveas/github3.py/{archive_format}{/ref}",
118+
"downloads_url": "https://api.github.com/repos/seveas/github3.py/downloads",
119+
"issues_url": "https://api.github.com/repos/seveas/github3.py/issues{/number}",
120+
"pulls_url": "https://api.github.com/repos/seveas/github3.py/pulls{/number}",
121+
"milestones_url": "https://api.github.com/repos/seveas/github3.py/milestones{/number}",
122+
"notifications_url": "https://api.github.com/repos/seveas/github3.py/notifications{?since,all,participating}",
123+
"labels_url": "https://api.github.com/repos/seveas/github3.py/labels{/name}",
124+
"created_at": "2012-09-30T19:31:42Z",
125+
"updated_at": "2013-06-17T18:53:30Z",
126+
"pushed_at": "2013-06-17T18:53:28Z",
127+
"git_url": "git://github.com/seveas/github3.py.git",
128+
"ssh_url": "git@github.com:seveas/github3.py.git",
129+
"clone_url": "https://github.com/seveas/github3.py.git",
130+
"svn_url": "https://github.com/seveas/github3.py",
131+
"homepage": "http://github3py.readthedocs.org/",
132+
"size": 452,
133+
"watchers_count": 2,
134+
"language": "Python",
135+
"has_issues": false,
136+
"has_downloads": true,
137+
"has_wiki": false,
138+
"forks_count": 0,
139+
"mirror_url": null,
140+
"open_issues_count": 0,
141+
"forks": 0,
142+
"open_issues": 0,
143+
"watchers": 2,
144+
"master_branch": "master",
145+
"default_branch": "master"
146+
}
147+
},
148+
"base": {
149+
"label": "sigmavirus24:master",
150+
"ref": "master",
151+
"sha": "ef9f73ebc13218f5be12188d2fb7e63df254b9e0",
152+
"user": {
153+
"login": "sigmavirus24",
154+
"id": 240830,
155+
"avatar_url": "https://secure.gravatar.com/avatar/c148356d89f925e692178bee1d93acf7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
156+
"gravatar_id": "c148356d89f925e692178bee1d93acf7",
157+
"url": "https://api.github.com/users/sigmavirus24",
158+
"html_url": "https://github.com/sigmavirus24",
159+
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
160+
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
161+
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
162+
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
163+
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
164+
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
165+
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
166+
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
167+
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
168+
"type": "User"
169+
},
170+
"repo": {
171+
"id": 3710711,
172+
"name": "github3.py",
173+
"full_name": "sigmavirus24/github3.py",
174+
"owner": {
175+
"login": "sigmavirus24",
176+
"id": 240830,
177+
"avatar_url": "https://secure.gravatar.com/avatar/c148356d89f925e692178bee1d93acf7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
178+
"gravatar_id": "c148356d89f925e692178bee1d93acf7",
179+
"url": "https://api.github.com/users/sigmavirus24",
180+
"html_url": "https://github.com/sigmavirus24",
181+
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
182+
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
183+
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
184+
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
185+
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
186+
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
187+
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
188+
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
189+
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
190+
"type": "User"
191+
},
192+
"private": false,
193+
"html_url": "https://github.com/sigmavirus24/github3.py",
194+
"description": "Python library for interfacing with the GitHub APIv3",
195+
"fork": false,
196+
"url": "https://api.github.com/repos/sigmavirus24/github3.py",
197+
"forks_url": "https://api.github.com/repos/sigmavirus24/github3.py/forks",
198+
"keys_url": "https://api.github.com/repos/sigmavirus24/github3.py/keys{/key_id}",
199+
"collaborators_url": "https://api.github.com/repos/sigmavirus24/github3.py/collaborators{/collaborator}",
200+
"teams_url": "https://api.github.com/repos/sigmavirus24/github3.py/teams",
201+
"hooks_url": "https://api.github.com/repos/sigmavirus24/github3.py/hooks",
202+
"issue_events_url": "https://api.github.com/repos/sigmavirus24/github3.py/issues/events{/number}",
203+
"events_url": "https://api.github.com/repos/sigmavirus24/github3.py/events",
204+
"assignees_url": "https://api.github.com/repos/sigmavirus24/github3.py/assignees{/user}",
205+
"branches_url": "https://api.github.com/repos/sigmavirus24/github3.py/branches{/branch}",
206+
"tags_url": "https://api.github.com/repos/sigmavirus24/github3.py/tags",
207+
"blobs_url": "https://api.github.com/repos/sigmavirus24/github3.py/git/blobs{/sha}",
208+
"git_tags_url": "https://api.github.com/repos/sigmavirus24/github3.py/git/tags{/sha}",
209+
"git_refs_url": "https://api.github.com/repos/sigmavirus24/github3.py/git/refs{/sha}",
210+
"trees_url": "https://api.github.com/repos/sigmavirus24/github3.py/git/trees{/sha}",
211+
"statuses_url": "https://api.github.com/repos/sigmavirus24/github3.py/statuses/{sha}",
212+
"languages_url": "https://api.github.com/repos/sigmavirus24/github3.py/languages",
213+
"stargazers_url": "https://api.github.com/repos/sigmavirus24/github3.py/stargazers",
214+
"contributors_url": "https://api.github.com/repos/sigmavirus24/github3.py/contributors",
215+
"subscribers_url": "https://api.github.com/repos/sigmavirus24/github3.py/subscribers",
216+
"subscription_url": "https://api.github.com/repos/sigmavirus24/github3.py/subscription",
217+
"commits_url": "https://api.github.com/repos/sigmavirus24/github3.py/commits{/sha}",
218+
"git_commits_url": "https://api.github.com/repos/sigmavirus24/github3.py/git/commits{/sha}",
219+
"comments_url": "https://api.github.com/repos/sigmavirus24/github3.py/comments{/number}",
220+
"issue_comment_url": "https://api.github.com/repos/sigmavirus24/github3.py/issues/comments/{number}",
221+
"contents_url": "https://api.github.com/repos/sigmavirus24/github3.py/contents/{+path}",
222+
"compare_url": "https://api.github.com/repos/sigmavirus24/github3.py/compare/{base}...{head}",
223+
"merges_url": "https://api.github.com/repos/sigmavirus24/github3.py/merges",
224+
"archive_url": "https://api.github.com/repos/sigmavirus24/github3.py/{archive_format}{/ref}",
225+
"downloads_url": "https://api.github.com/repos/sigmavirus24/github3.py/downloads",
226+
"issues_url": "https://api.github.com/repos/sigmavirus24/github3.py/issues{/number}",
227+
"pulls_url": "https://api.github.com/repos/sigmavirus24/github3.py/pulls{/number}",
228+
"milestones_url": "https://api.github.com/repos/sigmavirus24/github3.py/milestones{/number}",
229+
"notifications_url": "https://api.github.com/repos/sigmavirus24/github3.py/notifications{?since,all,participating}",
230+
"labels_url": "https://api.github.com/repos/sigmavirus24/github3.py/labels{/name}",
231+
"created_at": "2012-03-13T19:58:53Z",
232+
"updated_at": "2013-06-21T16:38:02Z",
233+
"pushed_at": "2013-06-18T06:52:07Z",
234+
"git_url": "git://github.com/sigmavirus24/github3.py.git",
235+
"ssh_url": "git@github.com:sigmavirus24/github3.py.git",
236+
"clone_url": "https://github.com/sigmavirus24/github3.py.git",
237+
"svn_url": "https://github.com/sigmavirus24/github3.py",
238+
"homepage": "http://github3py.readthedocs.org/",
239+
"size": 932,
240+
"watchers_count": 99,
241+
"language": "Python",
242+
"has_issues": true,
243+
"has_downloads": true,
244+
"has_wiki": false,
245+
"forks_count": 29,
246+
"mirror_url": null,
247+
"open_issues_count": 9,
248+
"forks": 29,
249+
"open_issues": 9,
250+
"watchers": 99,
251+
"master_branch": "develop",
252+
"default_branch": "develop"
253+
}
254+
},
255+
"_links": {
256+
"self": {
257+
"href": "https://api.github.com/repos/sigmavirus24/github3.py/pulls/19"
258+
},
259+
"html": {
260+
"href": "https://github.com/sigmavirus24/github3.py/pull/19"
261+
},
262+
"issue": {
263+
"href": "https://api.github.com/repos/sigmavirus24/github3.py/issues/19"
264+
},
265+
"comments": {
266+
"href": "https://api.github.com/repos/sigmavirus24/github3.py/issues/19/comments"
267+
},
268+
"review_comments": {
269+
"href": "https://api.github.com/repos/sigmavirus24/github3.py/pulls/19/comments"
270+
}
271+
},
272+
"merged": true,
273+
"mergeable": null,
274+
"mergeable_state": "unknown",
275+
"merged_by": {
276+
"login": "sigmavirus24",
277+
"id": 240830,
278+
"avatar_url": "https://secure.gravatar.com/avatar/c148356d89f925e692178bee1d93acf7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
279+
"gravatar_id": "c148356d89f925e692178bee1d93acf7",
280+
"url": "https://api.github.com/users/sigmavirus24",
281+
"html_url": "https://github.com/sigmavirus24",
282+
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
283+
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
284+
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
285+
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
286+
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
287+
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
288+
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
289+
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
290+
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
291+
"type": "User"
292+
},
293+
"comments": 3,
294+
"review_comments": 0,
295+
"commits": 1,
296+
"additions": 1,
297+
"deletions": 1,
298+
"changed_files": 1
299+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp