|
4 | 4 | from re import match
|
5 | 5 | from json import dumps
|
6 | 6 | from ..decorators import requires_auth
|
7 |
| -from .comment import IssueComment |
| 7 | +from .comment import IssueComment, issue_comment_params |
8 | 8 | from .event import IssueEvent
|
9 | 9 | from .label import Label
|
10 | 10 | from .milestone import Milestone
|
@@ -155,15 +155,25 @@ def comment(self, id_num):
|
155 | 155 | json = self._json(self._get(url), 200)
|
156 | 156 | return self._instance_or_null(IssueComment, json)
|
157 | 157 |
|
158 |
| - def comments(self, number=-1): |
159 |
| - r"""Iterate over the comments on this issue. |
| 158 | + def comments(self, number=-1, sort='', direction='', since=None): |
| 159 | + """Iterate over the comments on this issue. |
160 | 160 |
|
161 | 161 | :param int number: (optional), number of comments to iterate over
|
| 162 | + Default: -1 returns all comments |
| 163 | + :param str sort: accepted valuees: ('created', 'updated') |
| 164 | + api-default: created |
| 165 | + :param str direction: accepted values: ('asc', 'desc') |
| 166 | + Ignored without the sort parameter |
| 167 | + :param since: (optional), Only issues after this date will |
| 168 | + be returned. This can be a `datetime` or an ISO8601 formatted |
| 169 | + date string, e.g., 2012-05-20T23:10:27Z |
| 170 | + :type since: datetime or string |
162 | 171 | :returns: iterator of
|
163 | 172 | :class:`IssueComment <github3.issues.comment.IssueComment>`\ s
|
164 | 173 | """
|
165 | 174 | url = self._build_url('comments', base_url=self._api)
|
166 |
| - return self._iter(int(number), url, IssueComment) |
| 175 | + params = issue_comment_params(sort, direction, since) |
| 176 | + return self._iter(int(number), url, IssueComment, params) |
167 | 177 |
|
168 | 178 | @requires_auth
|
169 | 179 | def create_comment(self, body):
|
|
0 commit comments