Skip to content

Commit

Permalink
add qtconsole as subapp of terminal ipapp
Browse files Browse the repository at this point in the history
Now 'ipython qtconsole' will behave the same as 'ipython-qtconsole'
  • Loading branch information
minrk committed Jun 10, 2011
1 parent 9c14773 commit f744a3c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion IPython/frontend/terminal/ipapp.py
Expand Up @@ -206,9 +206,16 @@ class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp):
# command_line_loader = IPAppConfigLoader
default_config_file_name = default_config_file_name
crash_handler_class = IPAppCrashHandler

flags = Dict(flags)
aliases = Dict(aliases)
classes = [InteractiveShellApp, TerminalInteractiveShell, ProfileDir, PlainTextFormatter]
subcommands = Dict(dict(
qtconsole=('IPython.frontend.qt.console.ipythonqt.IPythonQtConsoleApp',
"""Launch the IPython QtConsole. Also launched as ipython-qtconsole"""
)
))

# *do* autocreate requested profile
auto_create=Bool(True)
copy_config_files=Bool(True)
Expand Down Expand Up @@ -259,9 +266,11 @@ def _file_to_run_changed(self, name, old, new):
def initialize(self, argv=None):
"""Do actions after construct, but before starting the app."""
super(TerminalIPythonApp, self).initialize(argv)
if self.subapp is not None:
# don't bother initializing further, starting subapp
return
if not self.ignore_old_config:
check_for_old_config(self.ipython_dir)

# print self.extra_args
if self.extra_args:
self.file_to_run = self.extra_args[0]
Expand Down Expand Up @@ -322,6 +331,8 @@ def init_gui_pylab(self):
self.shell.showtraceback()

def start(self):
if self.subapp is not None:
return self.subapp.start()
# perform any prexec steps:
if self.interact:
self.log.debug("Starting IPython's mainloop...")
Expand Down

0 comments on commit f744a3c

Please sign in to comment.