Show More
@@ -1,79 +1,79 b'' | |||||
1 | #!/usr/bin/env python |
|
1 | #!/usr/bin/env python | |
2 | """Script to auto-generate our API docs. |
|
2 | """Script to auto-generate our API docs. | |
3 | """ |
|
3 | """ | |
4 | # stdlib imports |
|
4 | # stdlib imports | |
5 | import os |
|
5 | import os | |
6 | import sys |
|
6 | import sys | |
7 |
|
7 | |||
8 | # local imports |
|
8 | # local imports | |
9 | sys.path.append(os.path.abspath('sphinxext')) |
|
9 | sys.path.append(os.path.abspath('sphinxext')) | |
10 | from apigen import ApiDocWriter |
|
10 | from apigen import ApiDocWriter | |
11 |
|
11 | |||
12 | #***************************************************************************** |
|
12 | #***************************************************************************** | |
13 | if __name__ == '__main__': |
|
13 | if __name__ == '__main__': | |
14 | pjoin = os.path.join |
|
14 | pjoin = os.path.join | |
15 | package = 'IPython' |
|
15 | package = 'IPython' | |
16 | outdir = pjoin('source','api','generated') |
|
16 | outdir = pjoin('source','api','generated') | |
17 | docwriter = ApiDocWriter(package,rst_extension='.txt') |
|
17 | docwriter = ApiDocWriter(package,rst_extension='.txt') | |
18 | # You have to escape the . here because . is a special char for regexps. |
|
18 | # You have to escape the . here because . is a special char for regexps. | |
19 | # You must do make clean if you change this! |
|
19 | # You must do make clean if you change this! | |
20 | docwriter.package_skip_patterns += [r'\.fixes$', |
|
20 | docwriter.package_skip_patterns += [r'\.fixes$', | |
21 | r'\.external$', |
|
21 | r'\.external$', | |
22 | r'\.extensions', |
|
22 | r'\.extensions', | |
23 | r'\.kernel\.config', |
|
23 | r'\.kernel\.config', | |
24 | r'\.attic', |
|
24 | r'\.attic', | |
25 | r'\.quarantine', |
|
25 | r'\.quarantine', | |
26 | r'\.deathrow', |
|
26 | r'\.deathrow', | |
27 | r'\.config\.default', |
|
27 | r'\.config\.default', | |
28 | r'\.config\.profile', |
|
28 | r'\.config\.profile', | |
29 | r'\.frontend', |
|
29 | r'\.frontend', | |
30 | r'\.gui', |
|
30 | r'\.gui', | |
31 | # For now, the zmq code has |
|
31 | # For now, the zmq code has | |
32 | # unconditional top-level code so it's |
|
32 | # unconditional top-level code so it's | |
33 | # not import safe. This needs fixing |
|
33 | # not import safe. This needs fixing | |
34 | # soon. |
|
34 | # soon. | |
35 | r'\.zmq', |
|
35 | r'\.zmq', | |
36 | ] |
|
36 | ] | |
37 |
|
37 | |||
38 | docwriter.module_skip_patterns += [ r'\.core\.fakemodule', |
|
38 | docwriter.module_skip_patterns += [ r'\.core\.fakemodule', | |
39 |
|
39 | |||
40 | # XXX These need fixing, disabling for |
|
40 | # XXX These need fixing, disabling for | |
41 | # now but we need to figure out why |
|
41 | # now but we need to figure out why | |
42 | # they are breaking. Error from sphinx |
|
42 | # they are breaking. Error from sphinx | |
43 | # for each group copied below |
|
43 | # for each group copied below | |
44 |
|
44 | |||
45 | # AttributeError: __abstractmethods__ |
|
45 | # AttributeError: __abstractmethods__ | |
46 |
r'\.co |
|
46 | r'\.config\.configurable', | |
47 | r'\.utils\.traitlets', |
|
47 | r'\.utils\.traitlets', | |
48 |
|
48 | |||
49 | # AttributeError: __provides__ |
|
49 | # AttributeError: __provides__ | |
50 | r'\.kernel\.clusterdir', |
|
50 | r'\.kernel\.clusterdir', | |
51 | r'\.kernel\.configobjfactory', |
|
51 | r'\.kernel\.configobjfactory', | |
52 | r'\.kernel\.fcutil', |
|
52 | r'\.kernel\.fcutil', | |
53 | r'\.kernel\.ipcontrollerapp', |
|
53 | r'\.kernel\.ipcontrollerapp', | |
54 | r'\.kernel\.launcher', |
|
54 | r'\.kernel\.launcher', | |
55 | r'\.kernel\.task', |
|
55 | r'\.kernel\.task', | |
56 | r'\.kernel\.winhpcjob', |
|
56 | r'\.kernel\.winhpcjob', | |
57 | r'\.testing\.util', |
|
57 | r'\.testing\.util', | |
58 |
|
58 | |||
59 | # Keeping these disabled is OK |
|
59 | # Keeping these disabled is OK | |
60 | r'\.cocoa', |
|
60 | r'\.cocoa', | |
61 | r'\.ipdoctest', |
|
61 | r'\.ipdoctest', | |
62 | r'\.Gnuplot', |
|
62 | r'\.Gnuplot', | |
63 | r'\.frontend\.process\.winprocess', |
|
63 | r'\.frontend\.process\.winprocess', | |
64 | r'\.Shell', |
|
64 | r'\.Shell', | |
65 | ] |
|
65 | ] | |
66 |
|
66 | |||
67 | # If we don't have pexpect, we can't load irunner, so skip any code that |
|
67 | # If we don't have pexpect, we can't load irunner, so skip any code that | |
68 | # depends on it |
|
68 | # depends on it | |
69 | try: |
|
69 | try: | |
70 | import pexpect |
|
70 | import pexpect | |
71 | except ImportError: |
|
71 | except ImportError: | |
72 | docwriter.module_skip_patterns += [r'\.lib\.irunner', |
|
72 | docwriter.module_skip_patterns += [r'\.lib\.irunner', | |
73 | r'\.testing\.mkdoctests'] |
|
73 | r'\.testing\.mkdoctests'] | |
74 | # Now, generate the outputs |
|
74 | # Now, generate the outputs | |
75 | docwriter.write_api_docs(outdir) |
|
75 | docwriter.write_api_docs(outdir) | |
76 | docwriter.write_index(outdir, 'gen', |
|
76 | docwriter.write_index(outdir, 'gen', | |
77 | relative_to = pjoin('source','api') |
|
77 | relative_to = pjoin('source','api') | |
78 | ) |
|
78 | ) | |
79 | print '%d files written' % len(docwriter.written_modules) |
|
79 | print '%d files written' % len(docwriter.written_modules) |
General Comments 0
You need to be logged in to leave comments.
Login now