File: 0001-Use-local-objects.inv-where-possible.patch

package info (click to toggle)
python-django-extra-views 0.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 352 kB
  • sloc: python: 1,371; makefile: 141
file content (34 lines) | stat: -rw-r--r-- 998 bytes parent folder | 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
From: Michael Fladischer <FladischerMichael@fladi.at>
Date: Thu, 16 Mar 2017 11:17:23 +0100
Subject: Use local objects.inv where possible.

---
 docs/conf.py | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/docs/conf.py b/docs/conf.py
index 01bf0f0..4dcf10b 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -247,4 +247,20 @@ texinfo_documents = [
 
 
 # Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'http://docs.python.org/': 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/{v}/'.format(
+            v='.'.join(map(str, sys.version_info[:2]))
+        ),
+        '/usr/share/doc/python{v}/html/objects.inv'.format(
+            v='.'.join(map(str, sys.version_info[:2]))
+        )
+    )
+)