[Python-modules-commits] [django-polymorphic] 12/15: use local objects.inv where possible

Michael Fladischer fladi at moszumanska.debian.org
Sun Sep 18 16:24:49 UTC 2016


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

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

commit 6d7069f0973de77dcb318cd72775f704fb71a616
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date:   Sun Aug 21 13:17:22 2016 +0200

    use local objects.inv where possible
    
    Upstream uses intersphinx mappings that fetch the objects.inv for python django
    through HTTP from a remote host. Using the local objects.inv from python and
    django enables the package to build without network connection.
---
 docs/conf.py | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index 6bada59..a5bb377 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -249,8 +249,17 @@ texinfo_documents = [
 #texinfo_show_urls = 'footnote'
 
 
-# Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {
-    #'http://docs.python.org/': None,
-    'https://docs.djangoproject.com/en/dev': 'https://docs.djangoproject.com/en/dev/_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/dev',
+                                             '/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/django-polymorphic.git



More information about the Python-modules-commits mailing list