[Python-modules-commits] [pytest] 04/06: Use local intersphinx mappings

Sebastian Ramacher sramacher at moszumanska.debian.org
Sun Aug 21 13:25:23 UTC 2016


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

sramacher pushed a commit to branch master
in repository pytest.

commit a0bc8e33f115ff84080616b2d2cd9c77307db384
Author: Sebastian Ramacher <sramacher at debian.org>
Date:   Thu Jul 14 23:01:01 2016 +0200

    Use local intersphinx mappings
    
    Patch-Name: intersphinx.patch
---
 doc/en/conf.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/doc/en/conf.py b/doc/en/conf.py
index aca0442..f0eab9c 100644
--- a/doc/en/conf.py
+++ b/doc/en/conf.py
@@ -312,11 +312,18 @@ texinfo_documents = [
 ]
 
 
-# Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'python': ('http://docs.python.org/', None),
-#                       'lib': ("http://docs.python.org/2.7library/", None),
-                    }
+def check_object_path(key, url, path):
+    if os.path.isfile(path):
+        return {key: (url, path)}
+    return {}
 
+# Example configuration for intersphinx: refer to the Python standard library.
+intersphinx_mapping = {}
+intersphinx_mapping.update(
+    check_object_path('python',
+                      'http://docs.python.org/',
+                      '/usr/share/doc/python%d.%d/html/objects.inv' % \
+                       sys.version_info[:2]))
 
 def setup(app):
     #from sphinx.ext.autodoc import cut_lines

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pytest.git



More information about the Python-modules-commits mailing list