# Add --script flag as shorthand for notebook save_script option. #1168

Merged
merged 4 commits into from Dec 18, 2011

None yet

### 3 participants

IPython member

Also expand the section of the docs dealing with notebook imports.

added some commits Dec 17, 2011
 fperez Add --script flag as shorthand for the script autosave notebook option. 38ef72e fperez Update nb docs on --script flag and notebook import practices. 8ac6b0c
and 1 other commented on an outdated diff Dec 17, 2011
IPython/frontend/html/notebook/notebookmanager.py
 @@ -40,10 +47,12 @@ class NotebookManager(LoggingConfigurable): """) save_script = Bool(False, config=True, - help="""Also save notebooks as a Python script. + help="""Automaticall create a Python script when saving the notebook.
 takluyver Dec 17, 2011 Automatically - it's missing the y fperez Dec 17, 2011 Thanks, fixed!
and 1 other commented on an outdated diff Dec 17, 2011
IPython/frontend/html/notebook/notebookmanager.py
 #----------------------------------------------------------------------------- +manager_flags =boolean_flag('script', 'NotebookManager.save_script',
 takluyver Dec 17, 2011 I'm not so familiar with our command line parsing, but it looks odd that we're assigning a single ...flag item to a plural ...flags name. Should it be wrapped in a container of some sort? fperez Dec 17, 2011 That object is actually a dict that contains two flags, '--script', and '--no-script'
 fperez Fix typo in help string 0d62fc2
and 1 other commented on an outdated diff Dec 18, 2011
IPython/frontend/html/notebook/notebookapp.py
 # the flags that are specific to the frontend # these must be scrubbed before being passed to the kernel, # or it will raise an error on unrecognized flags -notebook_flags = ['no-browser', 'no-mathjax', 'read-only'] +notebook_flags = ['no-browser', 'no-mathjax', 'read-only', 'script']
 minrk Dec 18, 2011 need to include 'no-script' in notebook_flags, so it won't be relayed to kernel fperez Dec 18, 2011 Fixing it now.
IPython member

Typically we have defined flags in the same file as the application that uses them, but I don't actually see anything wrong with doing it this way.

IPython member

OK, I'll move it over for consistency's sake. Not having done it before, I did what seemed most obvious immediately, but I think it's better to keep a consistent pattern.

 fperez Define flags in application that's going to use them. 031cdc5
IPython member

Pushed, let me know how it looks and we'll merge when ready. Thanks for the review!

IPython member

thanks, looks good. Go ahead and merge.

IPython member

Great, thanks. Merging now.

merged commit e953107 into ipython:master Dec 18, 2011
to join this conversation on GitHub. Already have an account? Sign in to comment