##// END OF EJS Templates
Shaperilio/qtgui fixes (#13957)...
Shaperilio/qtgui fixes (#13957) I started using the released version of my `PySide6`-enabling changes and noted some problems. In this PR, I fix those, and also overall improve the feedback to the user when a GUI event loop is hooked in: - Report which event loop is running when using `%gui <some GUI>`; e.g. `%gui qt` will show `Installed qt6 event loop hook.` - Report when the event loop is disabled; i.e. `%gui` will show `GUI event loop hook disabled.` if an event loop hook was installed, or `No event loop hook running.` if nothing was installed. - Requesting a second event loop will give the message `Shell is already running a gui event loop for <some GUI>. Call with no arguments to disable current loop.` - Requesting a different version of Qt, i.e. `%gui qt6` followed by `%gui` followed by `%gui qt5` will show `Cannot switch Qt versions for this session; will use qt6.` followed by `Installed qt6 event loop hook.` (Fixes / improves #13864)

File last commit:

r27139:919f313f
r28163:88d1fedc merge
Show More
autogen_api.py
80 lines | 2.9 KiB | text/x-python | PythonLexer
Fernando Perez
Update docs for automatic API building.
r1850 #!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
Min RK
abspath fixes for autogen scripts
r21590
Fernando Perez
Update docs for automatic API building.
r1850 import os
import sys
Min RK
abspath fixes for autogen scripts
r21590 pjoin = os.path.join
here = os.path.abspath(os.path.dirname(__file__))
sys.path.append(pjoin(os.path.abspath(here), 'sphinxext'))
Fernando Perez
Update docs for automatic API building.
r1850 from apigen import ApiDocWriter
Min RK
abspath fixes for autogen scripts
r21590 source = pjoin(here, 'source')
Fernando Perez
Update docs for automatic API building.
r1850 #*****************************************************************************
if __name__ == '__main__':
package = 'IPython'
Min RK
abspath fixes for autogen scripts
r21590 outdir = pjoin(source, 'api', 'generated')
Paul Ivanov
update indexes to use .rst, remove .txt refs
r11730 docwriter = ApiDocWriter(package,rst_extension='.rst')
Brian Granger
Cleanup of docs....
r2275 # You have to escape the . here because . is a special char for regexps.
# You must do make clean if you change this!
Thomas Kluyver
Update API doc skip patterns
r13586 docwriter.package_skip_patterns += [r'\.external$',
# Extensions are documented elsewhere.
Brian Granger
Renaming Extensions=>extensions in code and imports.
r2064 r'\.extensions',
Thomas Kluyver
Exclude magics package from API docs
r18299 # Magics are documented separately
r'\.core\.magics',
Thomas Kluyver
Fix up generated API docs
r21577 # This isn't API
r'\.sphinxext',
# Shims
r'\.kernel',
klonuo
Skip pt_inputhooks
r22482 r'\.terminal\.pt_inputhooks',
Fernando Perez
Update docs for automatic API building.
r1850 ]
Fernando Perez
Small fixes so the docs build....
r2404
Thomas Kluyver
Update API doc skip patterns
r13586 # The inputhook* modules often cause problems on import, such as trying to
# load incompatible Qt bindings. It's easiest to leave them all out. The
Nikita Kniazev
darker
r27139 docwriter.module_skip_patterns += [
r"\.lib\.inputhook.+",
r"\.ipdoctest",
r"\.testing\.plugin",
# Backwards compat import for lib.lexers
r"\.nbconvert\.utils\.lexers",
# We document this manually.
r"\.utils\.py3compat",
# These are exposed in display
r"\.core\.display",
r"\.lib\.display",
# Shims
r"\.config",
r"\.consoleapp",
r"\.frontend$",
r"\.html",
r"\.nbconvert",
r"\.nbformat",
r"\.parallel",
r"\.qt",
# this is deprecated.
r"\.utils\.version",
# Private APIs (there should be a lot more here)
r"\.terminal\.ptutils",
]
Thomas Kluyver
Fix up generated API docs
r21577 # main API is in the inputhook module, which is documented.
Thomas Kluyver
Add option to generate API docs based on __all__
r17120
# These modules import functions and classes from other places to expose
# them as part of the public API. They must have __all__ defined. The
# non-API modules they import from should be excluded by the skip patterns
# above.
docwriter.names_from__all__.update({
Thomas Kluyver
Document IPython.display API correctly
r17121 'IPython.display',
Thomas Kluyver
Add option to generate API docs based on __all__
r17120 })
Fernando Perez
Generate docs correctly if pexpect is not available....
r2568
# Now, generate the outputs
Fernando Perez
Update docs for automatic API building.
r1850 docwriter.write_api_docs(outdir)
Paul Ivanov
fix api docs post txt -> rst rename
r11758 # Write index with .txt extension - we can include it, but Sphinx won't try
Thomas Kluyver
Miscellaneous docs fixes
r9244 # to compile it
Paul Ivanov
fix api docs post txt -> rst rename
r11758 docwriter.write_index(outdir, 'gen.txt',
Min RK
abspath fixes for autogen scripts
r21590 relative_to = pjoin(source, 'api')
Fernando Perez
Update docs for automatic API building.
r1850 )
MinRK
Python 3 print functions...
r11213 print ('%d files written' % len(docwriter.written_modules))