[Python-modules-commits] [django-auth-ldap] 02/03: use local objects.inv where possible

Michael Fladischer fladi at moszumanska.debian.org
Sun Jul 30 17:47:17 UTC 2017


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

fladi pushed a commit to branch patch-queue/debian/master
in repository django-auth-ldap.

commit 8d713809b05a2a5f61d807c1da93ccecaa72ca71
Author: Michael Fladischer <fladi at debian.org>
Date:   Thu Oct 8 08:49:54 2015 -0700

    use local objects.inv where possible
    
     Upstream uses intersphinx mappings that fetch the objects.inv for python and
     python-django by HTTP from a remote host. Using the local objects.inv from
     python and kombu enables the package to build without network connection.
    Last-Update: 2013-11-26
    Forwarded: not-needed
    
    Patch-Name: docs-use_local_intersphinx_mapping.patch
    
    Gbp-Pq: Name docs-use_local_intersphinx_mapping.patch
---
 docs/source/conf.py | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/docs/source/conf.py b/docs/source/conf.py
index 7649568..b2de920 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -29,12 +29,23 @@ extensions = [
     'daldocs',
 ]
 
-intersphinx_mapping = {
-    'python': ('http://docs.python.org/', None),
-    'django': ('https://docs.djangoproject.com/en/dev/',
-               'https://docs.djangoproject.com/en/dev/_objects/'),
-    'pythonldap': ('http://python-ldap.org/doc/html/', 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('django',
+                                             'https://docs.djangoproject.com/en/dev/',
+                                             '/usr/share/doc/python-django-doc/html/objects.inv'))
+intersphinx_mapping.update(check_object_path('pythonldap',
+                                             'http://python-ldap.org/doc/html/',
+                                             ''))
 
 # 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/django-auth-ldap.git



More information about the Python-modules-commits mailing list