##// END OF EJS Templates
Remove generation of unnecessary generated.rst file
klonuo -
Show More
@@ -1,35 +1,28 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2
2
3 from os.path import join, dirname, abspath
3 from os.path import join, dirname, abspath
4
4
5 from IPython.terminal.ipapp import TerminalIPythonApp
5 from IPython.terminal.ipapp import TerminalIPythonApp
6 from ipykernel.kernelapp import IPKernelApp
6 from ipykernel.kernelapp import IPKernelApp
7
7
8 here = abspath(dirname(__file__))
8 here = abspath(dirname(__file__))
9 options = join(here, 'source', 'config', 'options')
9 options = join(here, 'source', 'config', 'options')
10 generated = join(options, 'generated.rst')
11
10
12 def write_doc(name, title, app, preamble=None):
11 def write_doc(name, title, app, preamble=None):
13 filename = '%s.rst' % name
12 filename = '%s.rst' % name
14 with open(join(options, filename), 'w') as f:
13 with open(join(options, filename), 'w') as f:
15 f.write(title + '\n')
14 f.write(title + '\n')
16 f.write(('=' * len(title)) + '\n')
15 f.write(('=' * len(title)) + '\n')
17 f.write('\n')
16 f.write('\n')
18 if preamble is not None:
17 if preamble is not None:
19 f.write(preamble + '\n\n')
18 f.write(preamble + '\n\n')
20 f.write(app.document_config_options())
19 f.write(app.document_config_options())
21 with open(generated, 'a') as f:
22 f.write(filename + '\n')
23
20
24
21
25 if __name__ == '__main__':
22 if __name__ == '__main__':
26 # create empty file
27 with open(generated, 'w'):
28 pass
29
23
30 write_doc('terminal', 'Terminal IPython options', TerminalIPythonApp())
24 write_doc('terminal', 'Terminal IPython options', TerminalIPythonApp())
31 write_doc('kernel', 'IPython kernel options', IPKernelApp(),
25 write_doc('kernel', 'IPython kernel options', IPKernelApp(),
32 preamble=("These options can be used in :file:`ipython_kernel_config.py`. "
26 preamble=("These options can be used in :file:`ipython_kernel_config.py`. "
33 "The kernel also respects any options in `ipython_config.py`"),
27 "The kernel also respects any options in `ipython_config.py`"),
34 )
28 )
35
General Comments 0
You need to be logged in to leave comments. Login now