1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-04 16:07:57 +03:00

Fix release in sphinx docs

This commit is contained in:
Guillaume Ayoub 2016-04-05 06:37:19 +02:00
parent d04058f201
commit 043f118829

View File

@ -11,7 +11,9 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os, re
import codecs
import re
from os import path
# 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
@ -49,10 +51,10 @@ copyright = u'2011-2014, Simon Sapin and contributors, see AUTHORs'
# built documents.
#
# The full version, including alpha/beta/rc tags.
release = re.search("VERSION = '([^']+)'",
open(os.path.join(os.path.dirname(__file__), os.pardir,
'weasyprint', '__init__.py')).read().strip()
).group(1)
release = re.search("VERSION = '([^']+)'", codecs.open(
path.join(path.dirname(__file__), 'weasyprint', '__init__.py'),
encoding="utf-8",
).read().strip()).group(1)
# The short X.Y version.
version = '.'.join(release.split('.')[:2])