From 7543328fe784c5c044f3c814ead271f89ecfb830 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 28 Jun 2019 01:43:04 -0400 Subject: [PATCH] Update Sphinx to 2.1.2 --- discord/abc.py | 58 +++++++++++++++++++-------------------- discord/asset.py | 7 ++++- docs/_static/style.css | 11 ++++++++ docs/api.rst | 40 +++++++++++++++------------ docs/conf.py | 2 +- docs/ext/commands/api.rst | 4 +-- setup.py | 4 +-- 7 files changed, 73 insertions(+), 53 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index 1d490cd46..e723b17af 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -490,7 +490,7 @@ class GuildChannel: Deletes the channel. - You must have :attr:`~.Permissions.manage_channels` permission to use this. + You must have :attr:`~Permissions.manage_channels` permission to use this. Parameters ----------- @@ -500,11 +500,11 @@ class GuildChannel: Raises ------- - :exc:`~discord.Forbidden` + ~discord.Forbidden You do not have proper permissions to delete the channel. - :exc:`~discord.NotFound` + ~discord.NotFound The channel was not found or was already deleted. - :exc:`~discord.HTTPException` + ~discord.HTTPException Deleting the channel failed. """ await self._state.http.delete_channel(self.id, reason=reason) @@ -527,7 +527,7 @@ class GuildChannel: If the ``overwrite`` parameter is ``None``, then the permission overwrites are deleted. - You must have the :attr:`~.Permissions.manage_roles` permission to use this. + You must have the :attr:`~Permissions.manage_roles` permission to use this. Examples ---------- @@ -562,13 +562,13 @@ class GuildChannel: Raises ------- - :exc:`~discord.Forbidden` + ~discord.Forbidden You do not have permissions to edit channel specific permissions. - :exc:`~discord.HTTPException` + ~discord.HTTPException Editing channel specific permissions failed. - :exc:`~discord.NotFound` + ~discord.NotFound The role or member being edited is not part of the guild. - :exc:`~discord.InvalidArgument` + ~discord.InvalidArgument The overwrite parameter invalid or the target type was not :class:`~discord.Role` or :class:`~discord.Member`. """ @@ -636,9 +636,9 @@ class GuildChannel: Raises ------- - :exc:`~discord.Forbidden` + ~discord.Forbidden You do not have the proper permissions to create this channel. - :exc:`~discord.HTTPException` + ~discord.HTTPException Creating the channel failed. """ raise NotImplementedError @@ -648,7 +648,7 @@ class GuildChannel: Creates an instant invite. - You must have the :attr:`~.Permissions.create_instant_invite` permission to + You must have the :attr:`~Permissions.create_instant_invite` permission to do this. Parameters @@ -671,7 +671,7 @@ class GuildChannel: Raises ------- - :exc:`~discord.HTTPException` + ~discord.HTTPException Invite creation failed. Returns @@ -688,13 +688,13 @@ class GuildChannel: Returns a list of all active instant invites from this channel. - You must have :attr:`~.Permissions.manage_guild` to get this information. + You must have :attr:`~Permissions.manage_guild` to get this information. Raises ------- - :exc:`~discord.Forbidden` + ~discord.Forbidden You do not have proper permissions to get the information. - :exc:`~discord.HTTPException` + ~discord.HTTPException An error occurred while fetching the information. Returns @@ -774,11 +774,11 @@ class Messageable(metaclass=abc.ABCMeta): Raises -------- - :exc:`~discord.HTTPException` + ~discord.HTTPException Sending the message failed. - :exc:`~discord.Forbidden` + ~discord.Forbidden You do not have the proper permissions to send the message. - :exc:`~discord.InvalidArgument` + ~discord.InvalidArgument The ``files`` list is not of the appropriate size or you specified both ``file`` and ``files``. @@ -871,11 +871,11 @@ class Messageable(metaclass=abc.ABCMeta): Raises -------- - :exc:`~discord.NotFound` + ~discord.NotFound The specified message was not found. - :exc:`~discord.Forbidden` + ~discord.Forbidden You do not have the permissions required to get a message. - :exc:`~discord.HTTPException` + ~discord.HTTPException Retrieving the message failed. Returns @@ -901,7 +901,7 @@ class Messageable(metaclass=abc.ABCMeta): Raises ------- - :exc:`~discord.HTTPException` + ~discord.HTTPException Retrieving the pinned messages failed. Returns @@ -918,7 +918,7 @@ class Messageable(metaclass=abc.ABCMeta): def history(self, *, limit=100, before=None, after=None, around=None, oldest_first=None): """Returns an :class:`~discord.AsyncIterator` that enables receiving the destination's message history. - You must have :attr:`~.Permissions.read_message_history` permissions to use this. + You must have :attr:`~Permissions.read_message_history` permissions to use this. Examples --------- @@ -960,9 +960,9 @@ class Messageable(metaclass=abc.ABCMeta): Raises ------ - :exc:`~discord.Forbidden` + ~discord.Forbidden You do not have permissions to get channel message history. - :exc:`~discord.HTTPException` + ~discord.HTTPException The request to get message history failed. Yields @@ -1008,11 +1008,11 @@ class Connectable(metaclass=abc.ABCMeta): Raises ------- - :exc:`asyncio.TimeoutError` + asyncio.TimeoutError Could not connect to the voice channel in time. - :exc:`~discord.ClientException` + ~discord.ClientException You are already connected to a voice channel. - :exc:`~discord.opus.OpusNotLoaded` + ~discord.opus.OpusNotLoaded The opus library has not been loaded. Returns diff --git a/discord/asset.py b/discord/asset.py index af5a48001..1d2ebbaa5 100644 --- a/discord/asset.py +++ b/discord/asset.py @@ -206,7 +206,12 @@ class Asset: Raises ------ - Same as :meth:`read`. + DiscordException + There was no valid URL or internal connection state. + HTTPException + Downloading the asset failed. + NotFound + The asset was deleted. Returns -------- diff --git a/docs/_static/style.css b/docs/_static/style.css index 81166de45..48dbac12d 100644 --- a/docs/_static/style.css +++ b/docs/_static/style.css @@ -291,6 +291,17 @@ dl.field-list > dt { font-weight: bold; } +/* remove flex from field lists */ +dl.field-list { + display: block; +} + +/* internal references are forced to bold for some reason */ +a.reference.internal > strong { + font-weight: unset; + font-family: monospace; +} + div.danger, div.error { background-color: #ffe4e4; border: 1px solid #f66; diff --git a/docs/api.rst b/docs/api.rst index ac9c489cc..c80bc3044 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1562,14 +1562,16 @@ Certain utilities make working with async iterators easier, detailed below. Iterates over the contents of the async iterator. - .. comethod:: next() + .. method:: next() + :async: |coro| Advances the iterator by one, if possible. If no more items are found then this raises :exc:`NoMoreItems`. - .. comethod:: get(**attrs) + .. method:: get(**attrs) + :async: |coro| @@ -1579,7 +1581,8 @@ Certain utilities make working with async iterators easier, detailed below. msg = await channel.history().get(author__name='Dave') - .. comethod:: find(predicate) + .. method:: find(predicate) + :async: |coro| @@ -1598,7 +1601,8 @@ Certain utilities make working with async iterators easier, detailed below. :param predicate: The predicate to use. Could be a |coroutine_link|_. :return: The first element that returns ``True`` for the predicate or ``None``. - .. comethod:: flatten() + .. method:: flatten() + :async: |coro| @@ -2009,10 +2013,10 @@ module, others which are not. :members: :exclude-members: history, typing - .. autocomethod:: discord.abc.Messageable.history + .. automethod:: discord.abc.Messageable.history :async-for: - .. autocomethod:: discord.abc.Messageable.typing + .. automethod:: discord.abc.Messageable.typing :async-with: .. autoclass:: discord.abc.Connectable @@ -2065,10 +2069,10 @@ User :inherited-members: :exclude-members: history, typing - .. autocomethod:: history + .. automethod:: history :async-for: - .. autocomethod:: typing + .. automethod:: typing :async-with: Attachment @@ -2096,7 +2100,7 @@ Reaction :members: :exclude-members: users - .. autocomethod:: users + .. automethod:: users :async-for: CallMessage @@ -2118,7 +2122,7 @@ Guild :members: :exclude-members: audit_logs - .. autocomethod:: audit_logs + .. automethod:: audit_logs :async-for: Member @@ -2129,10 +2133,10 @@ Member :inherited-members: :exclude-members: history, typing - .. autocomethod:: history + .. automethod:: history :async-for: - .. autocomethod:: typing + .. automethod:: typing :async-with: Spotify @@ -2173,10 +2177,10 @@ TextChannel :inherited-members: :exclude-members: history, typing - .. autocomethod:: history + .. automethod:: history :async-for: - .. autocomethod:: typing + .. automethod:: typing :async-with: VoiceChannel @@ -2201,10 +2205,10 @@ DMChannel :inherited-members: :exclude-members: history, typing - .. autocomethod:: history + .. automethod:: history :async-for: - .. autocomethod:: typing + .. automethod:: typing :async-with: GroupChannel @@ -2215,10 +2219,10 @@ GroupChannel :inherited-members: :exclude-members: history, typing - .. autocomethod:: history + .. automethod:: history :async-for: - .. autocomethod:: typing + .. automethod:: typing :async-with: PartialInviteGuild diff --git a/docs/conf.py b/docs/conf.py index 67b888335..5f0e7592b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -35,7 +35,7 @@ extensions = [ 'sphinx.ext.extlinks', 'sphinx.ext.intersphinx', 'sphinx.ext.napoleon', - 'sphinxcontrib.asyncio', + 'sphinxcontrib_trio', 'details', 'exception_hierarchy' ] diff --git a/docs/ext/commands/api.rst b/docs/ext/commands/api.rst index a33c31bc5..71efb2b52 100644 --- a/docs/ext/commands/api.rst +++ b/docs/ext/commands/api.rst @@ -150,10 +150,10 @@ Context :inherited-members: :exclude-members: history, typing - .. autocomethod:: discord.ext.commands.Context.history + .. automethod:: discord.ext.commands.Context.history :async-for: - .. autocomethod:: discord.ext.commands.Context.typing + .. automethod:: discord.ext.commands.Context.typing :async-with: .. _ext_commands_api_converters: diff --git a/setup.py b/setup.py index 5fa386acd..55116a63a 100644 --- a/setup.py +++ b/setup.py @@ -36,8 +36,8 @@ with open('README.rst') as f: extras_require = { 'voice': ['PyNaCl==1.3.0'], 'docs': [ - 'sphinx==1.7.4', - 'sphinxcontrib-asyncio', + 'sphinx==2.1.2', + 'sphinxcontrib_trio', 'sphinxcontrib-websupport', ] }