Document exceptions and change conf.py version detection.

This commit is contained in:
Rapptz
2015-08-28 17:24:35 -04:00
parent abc32f5b5d
commit e60777e68b
3 changed files with 25 additions and 4 deletions

View File

@ -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.