From 9deb7796a584c4fecc7c275c9567f594c9da0f1f Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 8 Dec 2015 16:22:01 -0500 Subject: [PATCH] Documentation fixes for opus bindings. --- discord/opus.py | 36 ++++++++++++++++++++++-------------- docs/api.rst | 1 + 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/discord/opus.py b/discord/opus.py index a49d93410..68c6a3ec4 100644 --- a/discord/opus.py +++ b/discord/opus.py @@ -80,25 +80,33 @@ def load_opus(name): """Loads the libopus shared library for use with voice. If this function is not called then the library uses the function - ``ctypes.util.find_library`` and then loads that one if available. + `ctypes.util.find_library ` and then loads that one + if available. + + .. find_library: https://docs.python.org/3.5/library/ctypes.html#finding-shared-libraries Not loading a library leads to voice not working. This function propagates the exceptions thrown. - .. warning:: - - The bitness of the library must match the bitness of your python - interpreter. If the library is 64-bit then your python interpreter - must be 64-bit as well. Usually if there's a mismatch in bitness then - the load will throw an exception. - - .. note:: - - On Windows, the .dll extension is not necessary. However, on Linux - the full extension is required to load the library, e.g. ``libopus.so.1``. - - :param name: The filename of the shared library. + Warning + -------- + The bitness of the library must match the bitness of your python + interpreter. If the library is 64-bit then your python interpreter + must be 64-bit as well. Usually if there's a mismatch in bitness then + the load will throw an exception. + + Note + ---- + On Windows, the .dll extension is not necessary. However, on Linux + the full extension is required to load the library, e.g. ``libopus.so.1``. + On Linux however, `find_library`_ will usually find the library automatically + without you having to call this. + + Parameters + ---------- + name: str + The filename of the shared library. """ global _lib _lib = libopus_loader(name) diff --git a/docs/api.rst b/docs/api.rst index 42277cca3..e503e703c 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -457,3 +457,4 @@ The following exceptions are thrown by the library. .. autoexception:: GatewayNotFound +.. autoexception:: OpusError