summaryrefslogtreecommitdiffstats
path: root/doc/conf.py
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2013-01-10 13:55:57 -0600
committerSol Jerome <sol.jerome@gmail.com>2013-01-10 13:55:57 -0600
commit850540d3b4b01dcb379b638cee815fed7a84a83f (patch)
tree88151a43094a16f53f120e88d85ecbc1db4099b3 /doc/conf.py
parent443d884625f41894465ee9f6550becba7888f3ac (diff)
downloadbcfg2-850540d3b4b01dcb379b638cee815fed7a84a83f.tar.gz
bcfg2-850540d3b4b01dcb379b638cee815fed7a84a83f.tar.bz2
bcfg2-850540d3b4b01dcb379b638cee815fed7a84a83f.zip
doc: Use local object inventory files for sphinx
Use the local object inventory files to prevent sphinx-build from downloading them during build. This should allow the packages to be built in network-disabled build environments. Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'doc/conf.py')
-rw-r--r--doc/conf.py27
1 files changed, 22 insertions, 5 deletions
diff --git a/doc/conf.py b/doc/conf.py
index 0b88ddf2f..5073b7225 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -333,16 +333,33 @@ def setup(app):
# Python only started using sphinx in 2.6, so we won't have docs for
# 2.4 or 2.5. These are in reverse order, since sphinx seems to look
# in the last mapping first.
+
+def check_object_path(key, url, path):
+ if os.path.isfile(path):
+ return {key: (url, path)}
+ return {}
+
+intersphinx_mapping = {}
+intersphinx_mapping.update(\
+ check_object_path('mock',
+ 'http://www.voidspace.org.uk/python/mock',
+ '/usr/share/doc/python-mock-doc/html/objects.inv'))
+intersphinx_mapping.update(\
+ check_object_path('cherrypy',
+ 'http://docs.cherrypy.org/stable',
+ 'intersphinx/cherrypy/objects.inv'))
+
versions = ["3.2", "2.7", "2.6"]
cur_version = '.'.join(str(v) for v in sys.version_info[0:2])
-intersphinx_mapping = \
- dict(mock=('http://www.voidspace.org.uk/python/mock', None),
- cherrypy=('http://docs.cherrypy.org/stable', None))
for pyver in versions:
if pyver == cur_version:
key = 'py'
else:
key = 'py' + pyver.replace(".", "")
- intersphinx_mapping[key] = ('http://docs.python.org/%s' % pyver,
- None)
+ intersphinx_mapping.update(\
+ check_object_path(key,
+ 'http://docs.python.org/',
+ '/usr/share/doc/python'
+ + '.'.join([str(x) for x in sys.version_info[0:2]])
+ + '/html/objects.inv'))