##// END OF EJS Templates
Fix broken links on install/index.rst...
Fix broken links on install/index.rst Currently the links in the section summary on the index.rst/index.html file are broken. Can be reproduced by going to http://ipython.readthedocs.io/en/stable/install/index.html and clicking on *installing IPython itself*, or *kernels for Jupyter* links. Specific changes ---------------- * Added a reference label to the `install.rst` file * Modified links from external link format to Sphinx arbitrary location cross-referencing format in the `index.rst` file Testing ------- Changes have been tested with a local sphinx build through the supplied makefile and specific links touched are fixed. Tested a few possibly overlapping links (Jupyter:install for instance) and they seem to be unaffected by the change.

File last commit:

r22613:b7f74ca8
r22679:367c6fe3
Show More
__init__.py
48 lines | 1.0 KiB | text/x-python | PythonLexer
Thomas Kluyver
Write & borrow some inputhooks for prompt_toolkit
r21934 import importlib
import os
aliases = {
Thomas Kluyver
Add prompt_toolkit input hooks for wx
r21941 'qt4': 'qt',
Thomas Kluyver
Better error message for unknown input hook...
r22118 'gtk2': 'gtk',
Thomas Kluyver
Write & borrow some inputhooks for prompt_toolkit
r21934 }
Thomas Kluyver
Better error message for unknown input hook...
r22118 backends = [
'qt', 'qt4', 'qt5',
'gtk', 'gtk2', 'gtk3',
'tk',
'wx',
'pyglet', 'glut',
Min RK
Add OS X input hook...
r22159 'osx',
Thomas Kluyver
Better error message for unknown input hook...
r22118 ]
Thomas Kluyver
Update docs and add registration interface for inputhooks
r22613 registered = {}
def register(name, inputhook):
"""Register the function *inputhook* as an event loop integration."""
registered[name] = inputhook
Thomas Kluyver
Better error message for unknown input hook...
r22118 class UnknownBackend(KeyError):
def __init__(self, name):
self.name = name
def __str__(self):
return ("No event loop integration for {!r}. "
"Supported event loops are: {}").format(self.name,
Thomas Kluyver
Update docs and add registration interface for inputhooks
r22613 ', '.join(backends + sorted(registered)))
Thomas Kluyver
Better error message for unknown input hook...
r22118
Thomas Kluyver
Write & borrow some inputhooks for prompt_toolkit
r21934 def get_inputhook_func(gui):
Thomas Kluyver
Update docs and add registration interface for inputhooks
r22613 if gui in registered:
return registered[gui]
Thomas Kluyver
Better error message for unknown input hook...
r22118 if gui not in backends:
raise UnknownBackend(gui)
Thomas Kluyver
Write & borrow some inputhooks for prompt_toolkit
r21934 if gui in aliases:
return get_inputhook_func(aliases[gui])
if gui == 'qt5':
os.environ['QT_API'] = 'pyqt5'
Thomas Kluyver
Better error message for unknown input hook...
r22118 gui = 'qt'
Thomas Kluyver
Write & borrow some inputhooks for prompt_toolkit
r21934
mod = importlib.import_module('IPython.terminal.pt_inputhooks.'+gui)
return mod.inputhook