[Python-modules-commits] [mockldap] 03/07: use local objects.inv where possible
Michael Fladischer
fladi at moszumanska.debian.org
Sun Mar 19 07:10:50 UTC 2017
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch experimental
in repository mockldap.
commit 840a906c0d2cccb62f0db94c248dfc8483898608
Author: Michael Fladischer <fladi at debian.org>
Date: Thu Oct 8 09:52:32 2015 -0700
use local objects.inv where possible
Upstream uses intersphinx mappings that fetch the objects.inv for python and
python-mock by HTTP from a remote host. Using the local objects.inv from
python and python-mock enables the package to build without network connection.
Last-Update: 2013-12-03
Forwarded: not-needed
Patch-Name: docs-use_local_intersphinx_mapping.patch
---
docs/source/conf.py | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 094559d..24df8ec 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -32,11 +32,23 @@ extensions = [
'sphinx.ext.viewcode',
]
-intersphinx_mapping = {
- 'python': ('http://docs.python.org/2/', 'http://docs.python.org/2/objects.inv'),
- 'ldap': ('http://python-ldap.org/doc/html/', None),
- 'mock': ('http://www.voidspace.org.uk/python/mock/', None),
-}
+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('python',
+ 'http://docs.python.org/',
+ '/usr/share/doc/python'
+ + '.'.join([str(x) for x in sys.version_info[0:2]])
+ + '/html/objects.inv'))
+intersphinx_mapping.update(check_object_path('ldap',
+ 'http://python-ldap.org/doc/html/',
+ ''))
+intersphinx_mapping.update(check_object_path('mock',
+ 'http://www.voidspace.org.uk/python/mock/',
+ '/usr/share/doc/python-mock-doc/html/objects.inv'))
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/mockldap.git
More information about the Python-modules-commits
mailing list