Skip to content

Commit

Permalink
Fix pylint and sphinx warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
bboe committed Jun 2, 2015
1 parent 4d4529c commit 46b1398
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
11 changes: 6 additions & 5 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ Unreleased
* **[FEATURE]** Added ``method`` as optional parameter to
:meth:`request_json`, so that a request method other than 'POST' can be
specified.
* **[FEATURE]** Added :meth:`hide` and :meth:`unhide`, which accept up to 50
fullnames to be hidden at one time. The appropriate methods in
:class:`objects.Hideable` now point here instead.
* **[FEATURE]** Added :meth:`praw.__init__.ReportMixin.hide` and
:meth:`praw.__init__.ReportMixin.unhide`, which accept up to 50 fullnames to
be hidden at one time. The appropriate methods in :class:`objects.Hideable`
now point here instead.
* **[REDDIT]** Removed ``send_feedback`` as it is no longer supported by
reddit.
* **[REDDIT]** Added ``DeprecationWarning`` to :meth:`login` as reddit will
Expand Down Expand Up @@ -629,8 +630,8 @@ PRAW 1.0.16
PRAW 1.0.15
-----------

* **[FEATURE]** Added the functions :meth:`.hide` and :meth:`.unhide` to
:class:`.Submission`.
* **[FEATURE]** Added the functions :meth:`~praw.objects.Hideable` and
:meth:`~praw.objects.Hideable.unhide` to :class:`.Submission`.
* **[FEATURE]** Added function :meth:`.is_username_available` to
:class:`.Reddit`.

Expand Down
11 changes: 5 additions & 6 deletions praw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2315,21 +2315,20 @@ def hide(self, thing_id, _unhide=False):
:param thing_id: A single fullname or list of fullnames,
representing objects which will be hidden.
:param _unhide: If True, unhide the object(s) instead.
Use :meth:`unhide` rather than setting this manually.
:param _unhide: If True, unhide the object(s) instead. Use
:meth:`~praw.__init__.ReportMixin.unhide` rather than setting this
manually.
:returns: The json response from the server.
"""
if not isinstance(thing_id, six.string_types):
thing_id = ','.join(thing_id)
method = 'unhide' if _unhide else 'hide'
url = self.config[method]
data = {'id': thing_id,
'executed': method}
response = self.request_json(url, data=data)
# pylint: enable=W0212
self.evict([urljoin(self.user._url, 'hidden')])
response = self.request_json(self.config[method], data=data)
self.evict(urljoin(self.user._url, 'hidden')) # pylint: disable=W0212
return response

def unhide(self, thing_id):
Expand Down
5 changes: 3 additions & 2 deletions praw/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,9 @@ class Hideable(RedditContentObject):
def hide(self, _unhide=False):
"""Hide object in the context of the logged in user.
:param _unhide: If True, unhide the item instead.
Use :meth:`unhide` instead of setting this manually.
:param _unhide: If True, unhide the item instead. Use
:meth:`~praw.objects.Hideable.unhide` instead of setting this
manually.
:returns: The json response from the server.
Expand Down

0 comments on commit 46b1398

Please sign in to comment.