[Python-modules-commits] [python-django-treebeard] 10/17: Make intersphinx use local copies of objects.inv files.
Michael Fladischer
fladi at moszumanska.debian.org
Sat Jan 2 18:39:23 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 25be55710dc9aac26bbeecff4a898fa00fdf1647
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/conf.py | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/docs/conf.py b/docs/conf.py
index a869995..4bed276 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -53,10 +53,25 @@ latex_documents = [(
'django-treebeard Documentation',
'Gustavo Picon',
'manual')]
-intersphinx_mapping = {
- 'python': ('http://docs.python.org/3', None),
- 'django': (
- 'https://docs.djangoproject.com/en/1.7/',
- 'https://docs.djangoproject.com/en/1.7/_objects/'
- ),
-}
+
+
+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(
+ '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