Skip to content

Commit

Permalink
Clean up docs before docstrfmt is ran
Browse files Browse the repository at this point in the history
Signed-off-by: LilSpazJoekp <15524072+LilSpazJoekp@users.noreply.github.com>
  • Loading branch information
LilSpazJoekp committed Dec 19, 2020
1 parent a7426a3 commit 5894f61
Show file tree
Hide file tree
Showing 24 changed files with 110 additions and 84 deletions.
12 changes: 6 additions & 6 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Maintainers
- Joel Payne <lilspazjoekp@gmail.com> `@LilSpazJoekp <https://github.com/lilspazjoekp>`_


PRAW Author
===========

- Bryce Boe <bbzbryce@gmail.com> `@bboe <https://github.com/bboe>`_


Documentation Contributors
==========================

Expand All @@ -20,12 +26,6 @@ Documentation Contributors
<!-- - Add "Name <email (optional)> and github profile link" above this line. -->


PRAW Author
===========

- Bryce Boe <bbzbryce@gmail.com> `@bboe <https://github.com/bboe>`_


Logo Creator
============

Expand Down
1 change: 1 addition & 0 deletions asyncpraw/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class APIException(PRAWException):
"""Old class preserved for alias purposes.
.. deprecated:: 7.0
Class :class:`.APIException` has been deprecated in favor of
:class:`.RedditAPIException`. This class will be removed in Async PRAW 8.0.
"""
Expand Down
3 changes: 2 additions & 1 deletion asyncpraw/models/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def info(self, ids: List[str]) -> AsyncGenerator[LiveThread, None]:
.. note::
This method doesn't support IDs for live updates.
.. warning:
.. warning::
Unlike :meth:`.Reddit.info`, the output of this method
may not reflect the order of input.
Expand Down
2 changes: 1 addition & 1 deletion asyncpraw/models/inbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def mentions(
r"""Return a :class:`.ListingGenerator` for mentions.
A mention is :class:`.Comment` in which the authorized redditor is
named in its body like ``/u/redditor_name``.
named in its body like ``u/redditor_name``.
Additional keyword arguments are passed in the initialization of
:class:`.ListingGenerator`.
Expand Down
2 changes: 1 addition & 1 deletion asyncpraw/models/listing/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ListingGenerator(AsyncPRAWBase, AsyncIterator):
.. warning:: This class should not be directly utilized. Instead you will
find a number of methods that return instances of the class:
http://asyncpraw.readthedocs.io/en/latest/search.html?q=ListingGenerator
https://asyncpraw.readthedocs.io/en/latest/search.html?q=ListingGenerator
"""

Expand Down
4 changes: 2 additions & 2 deletions asyncpraw/models/listing/mixins/redditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def comments(self) -> SubListing:
r"""Provide an instance of :class:`.SubListing` for comment access.
For example, to output the first line of all new comments by
``/u/spez`` try:
``u/spez`` try:
.. code-block:: python
Expand All @@ -52,7 +52,7 @@ def submissions(self) -> SubListing:
"""Provide an instance of :class:`.SubListing` for submission access.
For example, to output the title's of top 100 of all time submissions
for ``/u/spez`` try:
for ``u/spez`` try:
.. code-block:: python
Expand Down
2 changes: 1 addition & 1 deletion asyncpraw/models/listing/mixins/subreddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def comments(self) -> CommentHelper:
"""Provide an instance of :class:`.CommentHelper`.
For example, to output the author of the 25 most recent comments of
``/r/redditdev`` execute:
``r/redditdev`` execute:
.. code-block:: python
Expand Down
1 change: 1 addition & 0 deletions asyncpraw/models/reddit/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ async def __call__(self) -> List[Rule]:
:returns: A list of instances of :class:`.Rule`.
.. deprecated:: 7.1
Use the iterator by removing the call to :class:`.SubredditRules`.
For example, in order to use the iterator:
Expand Down
10 changes: 5 additions & 5 deletions asyncpraw/models/reddit/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ async def add_button_widget(
Each button is either a text button or an image button. A text
button looks like this:
.. code-block:: none
.. code-block::
{
"kind": "text",
Expand All @@ -453,7 +453,7 @@ async def add_button_widget(
An image button looks like this:
.. code-block:: none
.. code-block::
{
"kind": "image",
Expand All @@ -470,7 +470,7 @@ async def add_button_widget(
be one of two types: text or image. A text ``hoverState`` looks
like this:
.. code-block:: none
.. code-block::
{
"kind": "text",
Expand All @@ -482,7 +482,7 @@ async def add_button_widget(
An image ``hoverState`` looks like this:
.. code-block:: none
.. code-block::
{
"kind": "image",
Expand Down Expand Up @@ -795,7 +795,7 @@ async def add_menu(self, data, **other_settings):
:param data: A ``list`` of ``dict``\ s describing menu contents, as
specified in `Reddit docs`_. As of this writing, the format is:
.. code-block:: none
.. code-block::
[
{
Expand Down
6 changes: 3 additions & 3 deletions asyncpraw/models/reddit/wikipage.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async def update(
:param other_settings: Additional keyword arguments to pass.
:returns: The updated WikiPage settings.
To set the wikipage ``praw_test`` in ``/r/test`` to mod only and
To set the wikipage ``praw_test`` in ``r/test`` to mod only and
disable it from showing in the page list, try:
.. code-block:: python
Expand Down Expand Up @@ -253,7 +253,7 @@ async def edit(
async def revision(self, revision: str):
"""Return a specific version of this page by revision ID.
To view revision ``[ID]`` of ``"praw_test"`` in ``/r/test``:
To view revision ``[ID]`` of ``"praw_test"`` in ``r/test``:
.. code-block:: python
Expand All @@ -274,7 +274,7 @@ def revisions(
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-block:: python
Expand Down
3 changes: 2 additions & 1 deletion asyncpraw/reddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def read_only(self, value: bool) -> None:
"""Set or unset the use of the ReadOnlyAuthorizer.
:raises: :class:`ClientException` when attempting to unset ``read_only``
and only the ReadOnlyAuthorizer is available.
and only the ReadOnlyAuthorizer is available.
"""
if value:
Expand All @@ -92,6 +92,7 @@ def validate_on_submit(self) -> bool:
"""Get validate_on_submit.
.. deprecated:: 7.0
If property :attr:`.validate_on_submit` is set to False, the
behavior is deprecated by Reddit. This attribute will be removed
around May-June 2020.
Expand Down
2 changes: 1 addition & 1 deletion docs/code_overview/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Exceptions in Async PRAW

In addition to exceptions under the ``asyncpraw.exceptions`` namespace shown below,
exceptions might be raised that inherit from
``asyncprawcore.PrawcoreException``. Please see the following resource for
``asyncprawcore.AsyncPrawcoreException``. Please see the following resource for
information on those exceptions:
https://github.com/praw-dev/asyncprawcore/blob/master/asyncprawcore/exceptions.py

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/lmgtfy_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

async def main():
reddit = asyncpraw.Reddit(
user_agent="LMGTFY (by /u/USERNAME)",
user_agent="LMGTFY (by u/USERNAME)",
client_id="CLIENT_ID",
client_secret="CLIENT_SECRET",
username="USERNAME",
Expand Down
12 changes: 6 additions & 6 deletions docs/getting_started/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ is as simple as:
reddit = asyncpraw.Reddit(client_id="SI8pN3DSbt0zor",
client_secret="xaxkj7HNh8kwg8e5t4m6KvSrbTI",
password="1guiwevlfo00esyy",
user_agent="testscript by /u/fakebot3",
user_agent="testscript by u/fakebot3",
username="fakebot3")
To verify that you are authenticated as the correct user run:
Expand Down Expand Up @@ -86,7 +86,7 @@ A 2FA token can be used by joining it to the password with a colon:
reddit = asyncpraw.Reddit(client_id="SI8pN3DSbt0zor",
client_secret="xaxkj7HNh8kwg8e5t4m6KvSrbTI",
password='1guiwevlfo00esyy:955413',
user_agent="testscript by /u/fakebot3",
user_agent="testscript by u/fakebot3",
username="fakebot3")
However, for such an app there is little benefit to using 2FA. The token
Expand All @@ -109,9 +109,9 @@ A **code flow** application is useful for two primary purposes:
accounts.
* You have a personal-use script application and you either want to

* limit the access one of your Async PRAW-based programs has to Reddit
* avoid the hassle of 2FA (described above)
* not pass your username and password to Async PRAW (and thus not keep it in memory)
* limit the access one of your Async PRAW-based programs has to Reddit
* avoid the hassle of 2FA (described above)
* not pass your username and password to Async PRAW (and thus not keep it in memory)

When registering your application you must provide a valid redirect URI. If you
are running a website you will want to enter the appropriate callback URL and
Expand All @@ -137,7 +137,7 @@ URL. You can do that as follows:
reddit = asyncpraw.Reddit(client_id="SI8pN3DSbt0zor",
client_secret="xaxkj7HNh8kwg8e5t4m6KvSrbTI",
redirect_uri="http://localhost:8080",
user_agent="testscript by /u/fakebot3")
user_agent="testscript by u/fakebot3")
print(reddit.auth.url(["identity"], "...", "permanent"))
The above will output an authorization URL for a permanent token that has only
Expand Down
10 changes: 5 additions & 5 deletions docs/getting_started/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Using an HTTP or HTTPS proxy with Async PRAW
--------------------------------------------

Async PRAW internally relies upon the `aiohttp <https://docs.aiohttp.org/>`_
package to handle HTTP requests. Aiohttp supports use of ``HTTP_PROXY`` and
package to handle HTTP requests. aiohttp supports use of ``HTTP_PROXY`` and
``HTTPS_PROXY`` environment variables in order to proxy HTTP and HTTPS requests
respectively [`ref
<https://docs.aiohttp.org/en/stable/client_advanced.html?highlight=proxy#proxy-support>`_].
Expand Down Expand Up @@ -61,7 +61,7 @@ aiohttp and configuring Async PRAW like so:
client_secret="xaxkj7HNh8kwg8e5t4m6KvSrbTI",
password="1guiwevlfo00esyy",
requestor_kwargs={"session": session}, # pass Session
user_agent="testscript by /u/fakebot3",
user_agent="testscript by u/fakebot3",
username="fakebot3")
Expand All @@ -75,8 +75,8 @@ configure a `ClientSession
Async PRAW.

For example, some networks use self-signed SSL certificates when connecting
to HTTPS sites. By default, this would raise an exception in Aiohttp. To
use a self-signed SSL certificate without an exception from Aiohttp, first
to HTTPS sites. By default, this would raise an exception in aiohttp. To
use a self-signed SSL certificate without an exception from aiohttp, first
export the certificate as a ``.pem`` file. Then configure Async PRAW like so:

.. code-block:: python
Expand All @@ -95,7 +95,7 @@ export the certificate as a ``.pem`` file. Then configure Async PRAW like so:
client_secret="xaxkj7HNh8kwg8e5t4m6KvSrbTI",
password="1guiwevlfo00esyy",
requestor_kwargs={"session": session}, # pass Session
user_agent="testscript by /u/fakebot3",
user_agent="testscript by u/fakebot3",
username="fakebot3")
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started/configuration/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Basic Configuration Options
:user_agent: (Required) A unique description of your application. The following
format is recommended according to `Reddit's API Rules
<https://github.com/reddit/reddit/wiki/API#rules>`_:
``<platform>:<app ID>:<version string> (by /u/<reddit
``<platform>:<app ID>:<version string> (by u/<reddit
username>)``.

.. _oauth_options:
Expand Down
4 changes: 2 additions & 2 deletions docs/getting_started/configuration/prawini.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ individual variables, for example:
bot_name=MyBot
bot_version=1.2.3
bot_author=MyUser
user_agent=script:%(bot_name)s:v%(bot_version)s (by /u/%(bot_author)s)
user_agent=script:%(bot_name)s:v%(bot_version)s (by u/%(bot_author)s)
This uses basic interpolation thus :class:`.Reddit` need to be initialized as
follows:
Expand All @@ -147,7 +147,7 @@ follows:
reddit = asyncpraw.Reddit("bot1", config_interpolation="basic")
Then the value of ``reddit.config.user_agent`` will be
``script:MyBot:v1.2.3 (by /u/MyUser)``.
``script:MyBot:v1.2.3 (by u/MyUser)``.

See `Interpolation of values
<https://docs.python.org/3/library/configparser.html#interpolation-of-values>`_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ without using the ``bot3`` site, we would initialize :class:`.Reddit` as:
reddit = asyncpraw.Reddit(client_id="SI8pN3DSbt0zor",
client_secret="xaxkj7HNh8kwg8e5t4m6KvSrbTI",
password="1guiwevlfo00esyy",
user_agent="testscript by /u/fakebot3",
user_agent="testscript by u/fakebot3",
username="fakebot3")
22 changes: 11 additions & 11 deletions docs/getting_started/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ Q: How can I refresh a comment/subreddit/submission?

A: There is two ways to do this:

* Directly calling the constructors will refresh the value:
* Directly calling the constructors will refresh the value:

.. code-block:: python
.. code-block:: python
await reddit.comment(id=comment.id)
await reddit.subreddit(display_name=subreddit.display_name)
await reddit.submission(id=submission.id)
await reddit.comment(id=comment.id)
await reddit.subreddit(display_name=subreddit.display_name)
await reddit.submission(id=submission.id)
* Calling :meth:`~.RedditBase.load`:
* Calling :meth:`~.RedditBase.load`:

.. code-block:: python
.. code-block:: python
await comment.load()
await subreddit.load()
await submission.load()
await comment.load()
await subreddit.load()
await submission.load()
.. _faq2:

Expand Down Expand Up @@ -49,7 +49,7 @@ Q: Help, I keep on getting redirected to ``/r/subreddit/login/``!

Q2: I keep on getting this exception:

.. code-block:: none
.. code-block::
asyncprawcore.exceptions.Redirect: Redirect to /r/subreddit/login/ (You may be trying to perform a non-read-only action via a read-only instance.)
Expand Down
Loading

0 comments on commit 5894f61

Please sign in to comment.