From e60777e68b113b1f39f13c92c4a4d5b0ce0b406d Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 28 Aug 2015 17:24:35 -0400 Subject: [PATCH] Document exceptions and change conf.py version detection. --- discord/__init__.py | 4 ++-- docs/api.rst | 16 ++++++++++++++++ docs/conf.py | 9 +++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/discord/__init__.py b/discord/__init__.py index ed28db0c7..07d7ea12c 100644 --- a/discord/__init__.py +++ b/discord/__init__.py @@ -15,8 +15,8 @@ __title__ = 'discord' __author__ = 'Rapptz' __license__ = 'MIT' __copyright__ = 'Copyright 2015 Rapptz' -__version__ = '0.4.0' -__build__ = 0x004000 +__version__ = '0.4.1' +__build__ = 0x004010 from .client import Client from .user import User diff --git a/docs/api.rst b/docs/api.rst index ce911fbe6..d6a9c2c4b 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -108,3 +108,19 @@ Some classes are just there to be data containers, this lists them. It should be .. autoclass:: PrivateChannel :members: + +Exceptions +------------ + +The following exceptions are thrown by the library. + + +.. autoclass:: InvalidEventName + :members: + +.. autoclass:: InvalidDestination + :members: + +.. autoclass:: GatewayNotFound + :members: + diff --git a/docs/conf.py b/docs/conf.py index 4932b961d..ab3aab2c1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,6 +14,7 @@ import sys import os +import re # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -53,9 +54,13 @@ copyright = u'2015, Rapptz' # built documents. # # The short X.Y version. -version = '0.4.0' + +version = '' +with open('../discord/__init__.py') as f: + version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1) + # The full version, including alpha/beta/rc tags. -release = '0.4.0' +release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.