Skip to content

Commit

Permalink
Note for #1145 and style fixes (#1150)
Browse files Browse the repository at this point in the history
* Add note regarding user profile sub behavior

* Added note for `moderated()` per the discussion in #1145. Also updated old outdated references to Reddit Gold to Reddit Premium.

* Standardization of r/ and update to Premium

* Capitalization fix for Markdown.

* Formatting standardization.

* Updated Python requirement to 3.5+ per the actual documentation in the README.
  • Loading branch information
kungming2 authored and bboe committed Dec 7, 2019
1 parent 1571176 commit 6eaddb5
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 31 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Documentation Contributors
- theonefoster `@theonefoster <https://github.com/theonefoster>`_
- Eric Woolard `@ericwoolard <https://github.com/ericwoolard>`_
- Marc `@PerhapsSomeone <https://github.com/PerhapsSomeone>`_
- kungming2 `@kungming2 <https://github.com/kungming2>`_
- Add "Name <email (optional)> and github profile link" above this line.


Expand Down
2 changes: 1 addition & 1 deletion praw/models/reddit/live.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def __init__(self, thread):
def add(self, body):
"""Add an update to the live thread.
:param body: The markdown formatted content for the update.
:param body: The Markdown formatted content for the update.
Usage:
Expand Down
2 changes: 1 addition & 1 deletion praw/models/reddit/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def read(self, other_conversations=None): # noqa: D207, D301
def reply(self, body, author_hidden=False, internal=False):
"""Reply to the conversation.
:param body: The markdown formatted content for a message.
:param body: The Markdown formatted content for a message.
:param author_hidden: When True, author is hidden from non-moderators
(default: False).
:param internal: When True, message is a private moderator note,
Expand Down
2 changes: 1 addition & 1 deletion praw/models/reddit/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def update(self, **updated_settings):
longer than 50 characters.
:param subreddits: Subreddits for this multireddit.
:param description_md: Description for this multireddit, formatted in
markdown.
Markdown.
:param icon_name: Can be one of: ``art and design``, ``ask``,
``books``, ``business``, ``cars``, ``comics``, ``cute animals``,
``diy``, ``entertainment``, ``food and drink``, ``funny``,
Expand Down
10 changes: 7 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,10 @@ def moderated(self):
:returns: A ``list`` of :class:`~praw.models.Subreddit` objects.
Return ``[]`` if the redditor has no moderated subreddits.
.. note:: The redditor's own user profile subreddit will not be
returned, but other user profile subreddits they moderate
will be returned.
Usage:
.. code:: python
Expand Down
46 changes: 23 additions & 23 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 @@ -364,7 +364,7 @@ def stream(self):
Additionally, new submissions can be retrieved via the stream. In the
following example all submissions are fetched via the special subreddit
``all``:
``r/all``:
.. 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 @@ -650,7 +650,7 @@ def submit(
"""Add a submission to the subreddit.
:param title: The title of the submission.
:param selftext: The markdown formatted content for a ``text``
:param selftext: The Markdown formatted content for a ``text``
submission. Use an empty string, ``''``, to make a title-only
submission.
:param url: The URL for a ``link`` submission.
Expand All @@ -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:
.. code:: python
Expand All @@ -2115,8 +2115,8 @@ def invite(self, redditor, permissions=None, **other_settings):
grant. An empty list ``[]`` indicates no permissions, and when not
provided ``None``, indicates full permissions.
For example, to invite ``'spez'`` with ``'posts'`` and ``'mail'``
permissions to ``'/r/test/``, try:
For example, to invite ``'spez'`` with ``posts`` and ``mail``
permissions to ``r/test``, try:
.. code:: python
Expand Down Expand Up @@ -2196,8 +2196,8 @@ def update_invite(self, redditor, permissions=None):
grant. An empty list ``[]`` indicates no permissions, and when not
provided, ``None``, indicates full permissions.
For example, to grant the flair and mail permissions to the moderator
invite, try:
For example, to grant the ``flair``` and ``mail``` permissions to
the moderator invite, try:
.. 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:
.. 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
2 changes: 1 addition & 1 deletion praw/models/reddit/wikipage.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _fetch(self):
def edit(self, content, reason=None, **other_settings):
"""Edit this WikiPage's contents.
:param content: The updated markdown content of the page.
:param content: The updated Markdown content of the page.
:param reason: (Optional) The reason for the revision.
:param other_settings: Additional keyword arguments to pass.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
name=PACKAGE_NAME,
author="Bryce Boe",
author_email="bbzbryce@gmail.com",
python_requires=">=3.4",
python_requires=">=3.5",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand Down

0 comments on commit 6eaddb5

Please sign in to comment.