Package: django-auth-ldap / 2.0.0-2

docs-use_local_intersphinx_mapping.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From: Michael Fladischer <fladi@debian.org>
Date: Thu, 8 Oct 2015 08:49:54 -0700
Subject: 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
---
 docs/conf.py | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/docs/conf.py b/docs/conf.py
index b6e2d59..689ebe5 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -12,6 +12,7 @@
 
 import os
 import sys
+import django
 
 sys.path.insert(0, os.path.abspath("ext"))
 
@@ -39,6 +40,37 @@ release = "2.0.0"
 # ones.
 extensions = ["sphinx.ext.intersphinx", "daldocs"]
 
+
+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{v}/html/objects.inv'.format(v=map(str, sys.version_info[:2]))
+    )
+)
+intersphinx_mapping.update(
+    check_object_path(
+        'django',
+        'https://docs.djangoproject.com/en/{v}/'.format(v='.'.join(map(str, django.VERSION[:2]))),
+        '/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']