diff options
author | Adrian Bunk <bunk@stusta.de> | 2020-06-20 11:41:27 +0300 |
---|---|---|
committer | Andrej Shadura <andrewsh@debian.org> | 2020-06-20 16:53:48 +0200 |
commit | 63c88237b01330c4e2735e6171bb58a7347e0d07 (patch) | |
tree | a858ef86a37a2b6f311354ae92385b84c9db26b2 | |
parent | e3c43c7c9d73f7dcd19a9807ac630472457fce23 (diff) |
Revert "Link to GitHub in the docs"HEADarchive/debian/0.8.0-2master
This reverts commit 51327215ccbe542eafaa621285c24f658d696a41.
It accessed the internet during the build.
Gbp-Pq: Name 0001-Revert-Link-to-GitHub-in-the-docs.patch
-rw-r--r-- | docs/conf.py | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/docs/conf.py b/docs/conf.py index 4e6a44d..4b9eeed 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -29,7 +29,7 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.intersphinx', 'sphinx.ext.doctest', - 'sphinx.ext.linkcode'] + 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -90,45 +90,6 @@ pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] -linkcode_base_url = "https://github.com/selectel/pyte/tree/" - -def resolve_tag(): - from urllib.request import urlopen - from urllib.error import HTTPError - try: - urlopen(linkcode_base_url + release) - except HTTPError: - return "master" - else: - return release - - -tag = resolve_tag() - - -# Resolve function for the linkcode extension. -def linkcode_resolve(domain, info): - def find_source(): - # try to find the file and line number, based on code from numpy: - # https://github.com/numpy/numpy/blob/master/doc/source/conf.py#L286 - obj = sys.modules[info['module']] - for part in info['fullname'].split('.'): - obj = getattr(obj, part) - - import inspect - import os - import pyte - fn = inspect.getsourcefile(obj) - fn = os.path.relpath(fn, os.path.dirname(pyte.__file__)) - source, lineno = inspect.getsourcelines(obj) - return fn, lineno, lineno + len(source) - 1 - - try: - filename = 'pyte/%s#L%d-L%d' % find_source() - except Exception: - return None # Failed to resolve source or line numbers. - - return linkcode_base_url + "%s/%s" % (tag, filename) # -- Options for HTML output --------------------------------------------------- |