terminal IPython with newapp #485

Merged
merged 7 commits into from Jun 10, 2011

Conversation

Projects
None yet
3 participants
Owner

minrk commented May 30, 2011

terminal IPython now uses the new BaseIPythonApplication class

Contributor

ddale commented May 30, 2011

Hey Min,

Does IPython/config/profile/default/ipython_config.py in this pull request represent the official way that the terminal app will be configured in ipython-0.11? I'm thinking specifically of "app.extensions" vs the previous c.Global.extensions, I'm documenting how to enable a custom completer for h5py-1.4, which will be released soon. Will "app.extensions" also apply to ipython-qtconsole?

Owner

minrk commented May 30, 2011

It should be, though it might change a bit after review.
The 'app.extensions' refers to 'c.IPythonApp.extensions', which is set at the top of the config file, so you can't rely on it being there in a custom config.
Since the QtConsole doesn't have an App yet, I'm not certain. If it's a subclass of IPythonApp, then it will inherit the config, but if it's not then it will need to be set by the qt app's name to affect it. I'm looking at the qt code now, to see what the Apps should look like, and I'm not sure yet. It's a bit peculiar, because there will be two Apps - one for the Kernel and one for the frontend.

IPython/core/interactiveshell.py
@@ -238,7 +239,9 @@ class InteractiveShell(SingletonConfigurable, Magic):
"""
)
colors = CaselessStrEnum(('NoColor','LightBG','Linux'),
- default_value=get_default_colors(), config=True)
+ default_value=get_default_colors(), config=True,
+ help="Set the color scheme (NoColor, Linux, and LightBG)."
@takluyver

takluyver Jun 2, 2011

Owner

Should this be 'or' rather than 'and'?

IPython/core/magic.py
- for (f, src, dst) in to_install:
- shutil.copy(src, dst)
- print " %s" % f
+ print "Installing profiles to: %s [overwrite=%s]"(ipython_dir,overwrite)
@takluyver

takluyver Jun 2, 2011

Owner

I think you're missing a % operator after the string.

IPython/frontend/terminal/interactiveshell.py
+ help="""
+ Set to confirm when you try to exit IPython with an EOF (Control-D
+ in Unix, Control-Z/Enter in Windows). By typing 'exit', 'quit' or
+ '%%Exit', you can force a direct exit without any confirmation.""",
@takluyver

takluyver Jun 2, 2011

Owner

We got rid of %Exit as a magic function. exit, exit(), quit and quit() are now the options (although we probably don't need to list them all).

IPython/frontend/terminal/ipapp.py
+addflag('confirm-exit', 'TerminalInteractiveShell.confirm_exit',
+ """Set to confirm when you try to exit IPython with an EOF (Control-D
+ in Unix, Control-Z/Enter in Windows). By typing 'exit', 'quit' or
+ '%%Exit', you can force a direct exit without any confirmation.""",
@takluyver

takluyver Jun 2, 2011

Owner

As above.

IPython/frontend/terminal/ipapp.py
+ use it). deep_reload() forces a full reload of modules whose code may
+ have changed, which the default reload() function does not. When
+ deep_reload is off, IPython will use the normal reload(), but
+ deep_reload will still be available as dreload(). This fea- ture is off
@takluyver

takluyver Jun 2, 2011

Owner

I think we can lose the hyphen.

Owner

minrk commented Jun 2, 2011

@takluyver Thanks for catching the helpstring bits. Since I didn't write a single one of those, and just copied them from the existing ipapp, it's a good thing they all show up in the diff or we would never have noticed them!

Owner

takluyver commented Jun 2, 2011

You're welcome. I'd guessed they were copy pasted, but it seems like a good time to catch small things.

minrk added some commits May 28, 2011

@minrk minrk merged commit abf93be into ipython:newapp Jun 10, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment