[Python-modules-commits] [python-django-treebeard] 04/11: Make intersphinx use local copies of objects.inv files.

Michael Fladischer fladi at moszumanska.debian.org
Tue Nov 29 09:31:37 UTC 2016


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch master
in repository python-django-treebeard.

commit d06055e0a28b5ae2381cbe368a7a4b3c8b6da0e0
Author: Michael Fladischer <fladi at debian.org>
Date:   Wed Dec 30 20:43:47 2015 +0100

    Make intersphinx use local copies of objects.inv files.
---
 docs/source/conf.py | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/docs/source/conf.py b/docs/source/conf.py
index a999d36..6c3e0f3 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -297,7 +297,24 @@ texinfo_documents = [
 # If true, do not generate a @detailmenu in the "Top" node's menu.
 #texinfo_no_detailmenu = False
 
-intersphinx_mapping = {
-    'django': ('https://docs.djangoproject.com/en/stable/', 'https://docs.djangoproject.com/en/stable/_objects/'),
-    'python': ('https://docs.python.org/3.5', 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',
+        'https://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(
+        'django',
+        'https://docs.djangoproject.com/en/' + django.get_version() + '/',
+        '/usr/share/doc/python-django-doc/html/objects.inv'
+    )
+)
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-django-treebeard.git



More information about the Python-modules-commits mailing list