diff options
| author | 2012-05-12 19:04:23 +0200 | |
|---|---|---|
| committer | 2012-05-12 22:47:09 +0200 | |
| commit | 24a3ed5dcd2264a64e234ea7bd526049fafe7616 (patch) | |
| tree | 6131f221a9bf9b596dc139715d4e79f090bb55c3 /pygithub3/services/pull_requests/comments.py | |
| parent | Deleted 'dispatch' decorator. No sense (diff) | |
| download | python-github3-24a3ed5dcd2264a64e234ea7bd526049fafe7616.tar.xz python-github3-24a3ed5dcd2264a64e234ea7bd526049fafe7616.zip | |
Some fixes/typos and 'validate_body' related
Diffstat (limited to '')
| -rw-r--r-- | pygithub3/services/pull_requests/comments.py | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/pygithub3/services/pull_requests/comments.py b/pygithub3/services/pull_requests/comments.py index 3aa6d0e..2edbfdf 100644 --- a/pygithub3/services/pull_requests/comments.py +++ b/pygithub3/services/pull_requests/comments.py @@ -1,11 +1,10 @@ +# -*- encoding: utf-8 -*- from pygithub3.services.base import Service, MimeTypeMixin class Comments(Service, MimeTypeMixin): """Consume `Review Comments API - <http://developer.github.com/v3/pulls/comments/>`_ - - """ + <http://developer.github.com/v3/pulls/comments/>`_ """ def list(self, number, user=None, repo=None): """List all the comments for a pull request @@ -13,7 +12,10 @@ class Comments(Service, MimeTypeMixin): :param str number: The number of the pull request :param str user: Username :param str repo: Repository + :returns: A :doc:`result` + .. note:: + Remember :ref:`config precedence` """ return self._get_result( self.make_request('pull_requests.comments.list', number=number, @@ -27,37 +29,44 @@ class Comments(Service, MimeTypeMixin): :param str user: Username :param str repo: Repository + .. note:: + Remember :ref:`config precedence` """ return self._get( self.make_request('pull_requests.comments.get', number=number, user=user, repo=repo) ) - def create(self, number, body, user=None, repo=None): + def create(self, number, data, user=None, repo=None): """Create a comment :param str number: the pull request to comment on + :param dict data: Input. See `github pullrequests comments doc`_ :param str user: Username :param str repo: Repository + .. note:: + Remember :ref:`config precedence` """ return self._post( self.make_request('pull_requests.comments.create', number=number, - body=body, user=user, repo=repo) + body=data, user=user, repo=repo) ) - def edit(self, number, body, user=None, repo=None): + def update(self, number, message, user=None, repo=None): """Edit a comment :param str number: The id of the comment to edit + :param str message: Comment message :param str user: Username :param str repo: Repository + .. note:: + Remember :ref:`config precedence` """ - return self._patch( - self.make_request('pull_requests.comments.edit', number=number, - body=body, user=user, repo=repo) - ) + request = self.make_request('pull_requests.comments.edit', + number=number, body={'body': message}, user=user, repo=repo) + return self._patch(request) def delete(self, number, user=None, repo=None): """Delete a comment @@ -66,6 +75,8 @@ class Comments(Service, MimeTypeMixin): :param str user: Username :param str repo: Repository + .. note:: + Remember :ref:`config precedence` """ return self._delete( self.make_request('pull_requests.comments.delete', number=number, |
