##// END OF EJS Templates
Define flags in application that's going to use them.
Fernando Perez -
Show More
@@ -50,9 +50,9 from .handlers import (LoginHandler, LogoutHandler,
50 50 MainKernelHandler, KernelHandler, KernelActionHandler, IOPubHandler,
51 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 56 from IPython.core.application import BaseIPythonApplication
57 57 from IPython.core.profiledir import ProfileDir
58 58 from IPython.lib.kernel import swallow_argv
@@ -157,12 +157,15 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 165 # the flags that are specific to the frontend
163 166 # these must be scrubbed before being passed to the kernel,
164 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 170 aliases = dict(ipkernel_aliases)
168 171
@@ -23,20 +23,11 import glob
23 23
24 24 from tornado import web
25 25
26 from IPython.config.application import boolean_flag
27 26 from IPython.config.configurable import LoggingConfigurable
28 27 from IPython.nbformat import current
29 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 31 # Classes
41 32 #-----------------------------------------------------------------------------
42 33
General Comments 0
You need to be logged in to leave comments. Login now