##// END OF EJS Templates
Backport PR #2384: Adapt inline backend to changes in matplotlib...
Backport PR #2384: Adapt inline backend to changes in matplotlib Matplotlib recently merged https://github.com/matplotlib/matplotlib/pull/1125 that makes it simpler to use objective oriented figure creation by automatically creating the right canvas for the backend. To solve that all backends must provide a backend_xxx.FigureCanvas. This is obviosly missing from the inline backend. The change is needed to make the inline backend work with mpl's 1.2.x branch which is due to released soon. Simply setting the default canvas equal to a Agg canvas appears to work for both svg and png figures but I'm not sure weather that is the right approach. Should the canvas depend on the figure format and provide a svg canvas for a svg figure? (Note that before this change to matplotlib the canvas from a plt.figure call seams to be a agg type in all cases) Edit: I made the pull request against 0.13.1 since it would be good to have this in the stable branch for when mpl is released. Just let me know and I can rebase it against master

File last commit:

r5266:f62e8ff2
r8562:7d16877a
Show More
autogen_api.py
63 lines | 2.8 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.
"""
# stdlib imports
import os
import sys
# local imports
sys.path.append(os.path.abspath('sphinxext'))
from apigen import ApiDocWriter
#*****************************************************************************
if __name__ == '__main__':
pjoin = os.path.join
package = 'IPython'
outdir = pjoin('source','api','generated')
docwriter = ApiDocWriter(package,rst_extension='.txt')
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!
Fernando Perez
Update docs for automatic API building.
r1850 docwriter.package_skip_patterns += [r'\.fixes$',
Brian Granger
Cleanup of docs....
r2275 r'\.external$',
Brian Granger
Renaming Extensions=>extensions in code and imports.
r2064 r'\.extensions',
Brian Granger
Cleanup of docs....
r2275 r'\.kernel\.config',
Fernando Perez
Update docs for automatic API building.
r1850 r'\.attic',
Brian Granger
General work on inputhook and the docs....
r2197 r'\.quarantine',
Brian Granger
Cleanup of docs....
r2275 r'\.deathrow',
r'\.config\.default',
r'\.config\.profile',
r'\.frontend',
Fernando Perez
Major overhaul of the messaging documentation.
r2735 r'\.gui',
MinRK
update autogen_api.py...
r4130 r'\.kernel',
Fernando Perez
Major overhaul of the messaging documentation.
r2735 # For now, the zmq code has
# unconditional top-level code so it's
# not import safe. This needs fixing
r'\.zmq',
Fernando Perez
Update docs for automatic API building.
r1850 ]
Fernando Perez
Small fixes so the docs build....
r2404
Brian Granger
Cleanup of docs....
r2275 docwriter.module_skip_patterns += [ r'\.core\.fakemodule',
Fernando Perez
Add iptest to autodoc exclusion list (was pulling Qt in)
r5266 r'\.testing\.iptest',
Fernando Perez
Small fixes so the docs build....
r2404 # Keeping these disabled is OK
MinRK
update autogen_api.py...
r4130 r'\.parallel\.controller\.mongodb',
r'\.lib\.inputhookwx',
r'\.lib\.inputhookgtk',
Fernando Perez
Update docs for automatic API building.
r1850 r'\.cocoa',
r'\.ipdoctest',
r'\.Gnuplot',
Brian Granger
Cleanup of docs....
r2275 r'\.frontend\.process\.winprocess',
Fernando Perez
Several small fixes during code review with Brian....
r2339 r'\.Shell',
Fernando Perez
Update docs for automatic API building.
r1850 ]
Fernando Perez
Generate docs correctly if pexpect is not available....
r2568
# If we don't have pexpect, we can't load irunner, so skip any code that
# depends on it
try:
import pexpect
except ImportError:
docwriter.module_skip_patterns += [r'\.lib\.irunner',
r'\.testing\.mkdoctests']
# Now, generate the outputs
Fernando Perez
Update docs for automatic API building.
r1850 docwriter.write_api_docs(outdir)
docwriter.write_index(outdir, 'gen',
relative_to = pjoin('source','api')
)
print '%d files written' % len(docwriter.written_modules)