Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note for #1145 and style fixes #1150

Merged
merged 11 commits into from
Dec 7, 2019
9 changes: 6 additions & 3 deletions praw/models/reddit/redditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Redditor(
``is_mod`` Whether or not the Redditor mods any
subreddits.
``is_gold`` Whether or not the Redditor has active
gold status.
Reddit Premium status.
``link_karma`` The link karma for the Redditor.
``name`` The Redditor's username.
``subreddit`` If the Redditor has created a
Expand Down Expand Up @@ -168,7 +168,7 @@ def friend(self, note=None):
"""Friend the Redditor.

:param note: A note to save along with the relationship. Requires
reddit Gold (default: None).
Reddit Premium (default: None).

Calling this method subsequent times will update the note.

Expand All @@ -179,7 +179,7 @@ def friend_info(self):
"""Return a Redditor instance with specific friend-related attributes.

:returns: A :class:`.Redditor` instance with fields ``date``, ``id``,
and possibly ``note`` if the authenticated user has reddit Gold.
and possibly ``note`` if the authenticated user has Reddit Premium.

"""
return self._reddit.get(API_PATH["friend_v1"].format(user=self))
Expand All @@ -204,6 +204,9 @@ def moderated(self):
:returns: A ``list`` of :class:`~praw.models.Subreddit` objects.
Return ``[]`` if the redditor has no moderated subreddits.

The redditor's own user profile subreddit will not be returned,
kungming2 marked this conversation as resolved.
Show resolved Hide resolved
but other user profile subreddits they moderate will be returned.

Usage:

.. code:: python
Expand Down
36 changes: 18 additions & 18 deletions praw/models/reddit/subreddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ class Subreddit(
):
"""A class for Subreddits.

To obtain an instance of this class for subreddit ``/r/redditdev`` execute:
To obtain an instance of this class for subreddit ``r/redditdev`` execute:

.. code:: python

subreddit = reddit.subreddit('redditdev')

While ``/r/all`` is not a real subreddit, it can still be treated like
While ``r/all`` is not a real subreddit, it can still be treated like
one. The following outputs the titles of the 25 hottest submissions in
``/r/all``:
``r/all``:

.. code:: python

for submission in reddit.subreddit('all').hot(limit=25):
print(submission.title)

Multiple subreddits can be combined like so:
Multiple subreddits can be combined with a ``+`` like so:

.. code:: python

Expand Down Expand Up @@ -547,7 +547,7 @@ def random(self):
"""Return a random Submission.

Returns ``None`` on subreddits that do not support the random feature.
One example, at the time of writing, is /r/wallpapers.
One example, at the time of writing, is r/wallpapers.
"""
url = API_PATH["subreddit_random"].format(subreddit=self)
try:
Expand All @@ -564,7 +564,7 @@ def random(self):
def rules(self):
"""Return rules for the subreddit.

For example to show the rules of ``/r/redditdev`` try:
For example to show the rules of ``r/redditdev`` try:

.. code:: python

Expand Down Expand Up @@ -672,7 +672,7 @@ def submit(

Either ``selftext`` or ``url`` can be provided, but not both.

For example to submit a URL to ``/r/reddit_api_test`` do:
For example to submit a URL to ``r/reddit_api_test`` do:

.. code:: python

Expand Down Expand Up @@ -766,7 +766,7 @@ def submit_image(
program in a restricted network environment, or using a proxy
that doesn't support WebSockets connections.

For example to submit an image to ``/r/reddit_api_test`` do:
For example to submit an image to ``r/reddit_api_test`` do:

.. code:: python

Expand Down Expand Up @@ -859,7 +859,7 @@ def submit_video(
program in a restricted network environment, or using a proxy
that doesn't support WebSockets connections.

For example to submit a video to ``/r/reddit_api_test`` do:
For example to submit a video to ``r/reddit_api_test`` do:

.. code:: python

Expand Down Expand Up @@ -922,8 +922,8 @@ def traffic(self):
def unsubscribe(self, other_subreddits=None):
"""Unsubscribe from the subreddit.

:param other_subreddits: When provided, also unsubscribe to the
provided list of subreddits.
:param other_subreddits: When provided, also unsubscribe from
the provided list of subreddits.

"""
data = {
Expand Down Expand Up @@ -984,7 +984,7 @@ def add(self, subreddit):
:param subreddit: The subreddit to add to the filter list.

Items from subreddits added to the filtered list will no longer be
included when obtaining listings for ``/r/all``.
included when obtaining listings for ``r/all``.

Alternatively, you can filter a subreddit temporarily from a special
listing in a manner like so:
Expand Down Expand Up @@ -1781,7 +1781,7 @@ def update(self, **settings):
image hosting. Only applies to link-only subreddits.
:param allow_post_crossposts: Allow users to crosspost submissions from
other subreddits.
:param allow_top: Allow the subreddit to appear on ``/r/all`` as well
:param allow_top: Allow the subreddit to appear on ``r/all`` as well
as the default and trending lists.
:param collapse_deleted_comments: Collapse deleted and removed comments
on comments pages by default.
Expand All @@ -1797,7 +1797,7 @@ def update(self, **settings):
from modqueue/unmoderated.
:param header_hover_text: The text seen when hovering over the snoo.
:param hide_ads: Don't show ads within this subreddit. Only applies to
gold-user only subreddits.
Premium-user only subreddits.
:param key_color: A 6-digit rgb hex color (e.g. ``'#AABBCC'``), used as
a thematic color for your subreddit on mobile.
:param lang: A valid IETF language tag (underscore separated).
Expand Down Expand Up @@ -2093,7 +2093,7 @@ def add(self, redditor, permissions=None, **other_settings):
user.

For example, to invite ``'spez'`` with ``'posts'`` and ``'mail'``
permissions to ``'/r/test/``, try:
permissions to ``'r/test/``, try:
kungming2 marked this conversation as resolved.
Show resolved Hide resolved

.. code:: python

Expand All @@ -2116,7 +2116,7 @@ def invite(self, redditor, permissions=None, **other_settings):
provided ``None``, indicates full permissions.

For example, to invite ``'spez'`` with ``'posts'`` and ``'mail'``
permissions to ``'/r/test/``, try:
permissions to ``'r/test/``, try:
kungming2 marked this conversation as resolved.
Show resolved Hide resolved

.. code:: python

Expand Down Expand Up @@ -2933,7 +2933,7 @@ def create(self, name, content, reason=None, **other_settings):
:param reason: (Optional) The reason for the creation.
:param other_settings: Additional keyword arguments to pass.

To create the wiki page ``'praw_test'`` in ``'/r/test'`` try:
To create the wiki page ``'praw_test'`` in ``'r/test'`` try:
kungming2 marked this conversation as resolved.
Show resolved Hide resolved

.. code:: python

Expand All @@ -2952,7 +2952,7 @@ def revisions(self, **generator_kwargs):
Additional keyword arguments are passed in the initialization of
:class:`.ListingGenerator`.

To view the wiki revisions for ``'praw_test'`` in ``'/r/test'`` try:
To view the wiki revisions for ``'praw_test'`` in ``'r/test'`` try:

.. code:: python

Expand Down