##// END OF EJS Templates
Define flags in application that's going to use them.
Fernando Perez -
Show More
@@ -50,9 +50,9 b' from .handlers import (LoginHandler, LogoutHandler,'
50 MainKernelHandler, KernelHandler, KernelActionHandler, IOPubHandler,
50 MainKernelHandler, KernelHandler, KernelActionHandler, IOPubHandler,
51 ShellHandler, NotebookRootHandler, NotebookHandler, RSTHandler
51 ShellHandler, NotebookRootHandler, NotebookHandler, RSTHandler
52 )
52 )
53 from .notebookmanager import NotebookManager, manager_flags
53 from .notebookmanager import NotebookManager
54
54
55 from IPython.config.application import catch_config_error
55 from IPython.config.application import catch_config_error, boolean_flag
56 from IPython.core.application import BaseIPythonApplication
56 from IPython.core.application import BaseIPythonApplication
57 from IPython.core.profiledir import ProfileDir
57 from IPython.core.profiledir import ProfileDir
58 from IPython.lib.kernel import swallow_argv
58 from IPython.lib.kernel import swallow_argv
@@ -157,12 +157,15 b" flags['read-only'] = ("
157 """
157 """
158 )
158 )
159
159
160 flags.update(manager_flags)
160 # Add notebook manager flags
161 flags.update(boolean_flag('script', 'NotebookManager.save_script',
162 'Auto-save a .py script everytime the .ipynb notebook is saved',
163 'Do not auto-save .py scripts for every notebook'))
161
164
162 # the flags that are specific to the frontend
165 # the flags that are specific to the frontend
163 # these must be scrubbed before being passed to the kernel,
166 # these must be scrubbed before being passed to the kernel,
164 # or it will raise an error on unrecognized flags
167 # or it will raise an error on unrecognized flags
165 notebook_flags = ['no-browser', 'no-mathjax', 'read-only', 'script']
168 notebook_flags = ['no-browser', 'no-mathjax', 'read-only', 'script', 'no-script']
166
169
167 aliases = dict(ipkernel_aliases)
170 aliases = dict(ipkernel_aliases)
168
171
@@ -23,20 +23,11 b' import glob'
23
23
24 from tornado import web
24 from tornado import web
25
25
26 from IPython.config.application import boolean_flag
27 from IPython.config.configurable import LoggingConfigurable
26 from IPython.config.configurable import LoggingConfigurable
28 from IPython.nbformat import current
27 from IPython.nbformat import current
29 from IPython.utils.traitlets import Unicode, List, Dict, Bool
28 from IPython.utils.traitlets import Unicode, List, Dict, Bool
30
29
31 #-----------------------------------------------------------------------------
30 #-----------------------------------------------------------------------------
32 # Aliases and Flags
33 #-----------------------------------------------------------------------------
34
35 manager_flags =boolean_flag('script', 'NotebookManager.save_script',
36 'Auto-save a .py script everytime the .ipynb notebook is saved',
37 'Do not auto-save .py scripts for every notebook')
38
39 #-----------------------------------------------------------------------------
40 # Classes
31 # Classes
41 #-----------------------------------------------------------------------------
32 #-----------------------------------------------------------------------------
42
33
General Comments 0
You need to be logged in to leave comments. Login now