File: offline_intersphinx.patch

package info (click to toggle)
patroni 4.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,704 kB
  • sloc: python: 29,743; sh: 573; makefile: 29
file content (23 lines) | stat: -rw-r--r-- 944 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Index: patroni/docs/conf.py
===================================================================
--- patroni.orig/docs/conf.py
+++ patroni/docs/conf.py
@@ -236,7 +236,17 @@ epub_exclude_files = ['search.html']
 
 
 # Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'python': ('https://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/',
+                                            '/usr/share/doc/python'
+                                              + '.'.join([str(x) for x in sys.version_info[0:2]])
+                                              + '/html/objects.inv'))
 
 
 # Remove these pages from index, references, toc trees, etc.