From 6065f6b54a931e11ebeaac0cbbc0aa541f1378d7 Mon Sep 17 00:00:00 2001 From: Danny Hermes Date: Tue, 4 Aug 2015 10:31:17 -0700 Subject: [PATCH] Updating authors in Sphinx config. H/T: http://stackoverflow.com/a/21517579 --- docs/conf.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index f4bac42a91f8..f4bca7d6cfdd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,8 +11,10 @@ # All configuration values have a default; values that are commented out # serve to show the default. +from email import message_from_string +import os from pkg_resources import get_distribution -import sys, os +import sys import urllib # If extensions (or modules to document with autodoc) are in another directory, @@ -56,7 +58,8 @@ # built documents. # # The short X.Y version. -release = os.getenv('SPHINX_RELEASE', get_distribution('gcloud').version) +distro = get_distribution('gcloud') +release = os.getenv('SPHINX_RELEASE', distro.version) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -197,11 +200,13 @@ #'preamble': '', } +metadata = distro.get_metadata(distro.PKG_INFO) +author = message_from_string(metadata).get('Author') # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'gcloud.tex', u'gCloud Documentation', - u'JJ Geewax', 'manual'), + author, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -231,7 +236,7 @@ # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'gcloud', u'gCloud Documentation', - [u'JJ Geewax'], 1) + [author], 1) ] # If true, show URL addresses after external links. @@ -245,7 +250,7 @@ # dir menu entry, description, category) texinfo_documents = [ ('index', 'gcloud', u'gCloud Documentation', - u'JJ Geewax', 'gcloud', 'Python API for Google Cloud.', + author, 'gcloud', 'Python API for Google Cloud.', 'Miscellaneous'), ]