##// END OF EJS Templates
Cleanup -pylab handling with faster logic.
Fernando Perez -
Show More
@@ -158,8 +158,8 b" flags['quick']=("
158
158
159 flags['i'] = (
159 flags['i'] = (
160 {'TerminalIPythonApp' : {'force_interact' : True}},
160 {'TerminalIPythonApp' : {'force_interact' : True}},
161 """also works as '-i'
161 """If running code from the command line, become interactive afterwards.
162 If running code from the command line, become interactive afterwards."""
162 Note: can also be given simply as '-i.'"""
163 )
163 )
164 flags['pylab'] = (
164 flags['pylab'] = (
165 {'TerminalIPythonApp' : {'pylab' : 'auto'}},
165 {'TerminalIPythonApp' : {'pylab' : 'auto'}},
@@ -180,7 +180,6 b' aliases.update(dict('
180 # Main classes and functions
180 # Main classes and functions
181 #-----------------------------------------------------------------------------
181 #-----------------------------------------------------------------------------
182
182
183
184 class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp):
183 class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp):
185 name = u'ipython'
184 name = u'ipython'
186 description = usage.cl_usage
185 description = usage.cl_usage
@@ -190,7 +189,8 b' class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp):'
190
189
191 flags = Dict(flags)
190 flags = Dict(flags)
192 aliases = Dict(aliases)
191 aliases = Dict(aliases)
193 classes = [InteractiveShellApp, TerminalInteractiveShell, ProfileDir, PlainTextFormatter]
192 classes = [InteractiveShellApp, TerminalInteractiveShell, ProfileDir,
193 PlainTextFormatter]
194 subcommands = Dict(dict(
194 subcommands = Dict(dict(
195 qtconsole=('IPython.frontend.qt.console.qtconsoleapp.IPythonQtConsoleApp',
195 qtconsole=('IPython.frontend.qt.console.qtconsoleapp.IPythonQtConsoleApp',
196 """Launch the IPython Qt Console."""
196 """Launch the IPython Qt Console."""
@@ -247,17 +247,14 b' class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp):'
247
247
248 def parse_command_line(self, argv=None):
248 def parse_command_line(self, argv=None):
249 """override to allow old '-pylab' flag with deprecation warning"""
249 """override to allow old '-pylab' flag with deprecation warning"""
250
250 argv = sys.argv[1:] if argv is None else argv
251 argv = sys.argv[1:] if argv is None else argv
251
252
252 try:
253 if '-pylab' in argv:
253 idx = argv.index('-pylab')
254 except ValueError:
255 # `-pylab` not given, proceed as normal
256 pass
257 else:
258 # deprecated `-pylab` given,
254 # deprecated `-pylab` given,
259 # warn and transform into current syntax
255 # warn and transform into current syntax
260 argv = list(argv) # copy, don't clobber
256 argv = argv[:] # copy, don't clobber
257 idx = argv.index('-pylab')
261 warn.warn("`-pylab` flag has been deprecated.\n"
258 warn.warn("`-pylab` flag has been deprecated.\n"
262 " Use `--pylab` instead, or `--pylab=foo` to specify a backend.")
259 " Use `--pylab` instead, or `--pylab=foo` to specify a backend.")
263 sub = '--pylab'
260 sub = '--pylab'
General Comments 0
You need to be logged in to leave comments. Login now