MCPcopy Create free account
hub / github.com/ipython/ipython / parse_command_line

Method parse_command_line

IPython/terminal/ipapp.py:289–303  ·  view source on GitHub ↗

override to allow old '-pylab' flag with deprecation warning

(self, argv=None)

Source from the content-addressed store, hash-verified

287 something_to_run=Bool(False)
288
289 def parse_command_line(self, argv=None):
290 """override to allow old '-pylab' flag with deprecation warning"""
291
292 argv = sys.argv[1:] if argv is None else argv
293
294 if '-pylab' in argv:
295 # deprecated `-pylab` given,
296 # warn and transform into current syntax
297 argv = argv[:] # copy, don't clobber
298 idx = argv.index('-pylab')
299 warnings.warn("`-pylab` flag has been deprecated.\n"
300 " Use `--matplotlib <backend>` and import pylab manually.")
301 argv[idx] = '--pylab'
302
303 return super(TerminalIPythonApp, self).parse_command_line(argv)
304
305 @catch_config_error
306 def initialize(self, argv=None):

Callers

nothing calls this directly

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected