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

Method make_filename

IPython/core/magics/code.py:383–394  ·  view source on GitHub ↗

Make a filename from the given args

(arg)

Source from the content-addressed store, hash-verified

381 """Utility method used by magic_edit to find what to edit."""
382
383 def make_filename(arg):
384 "Make a filename from the given args"
385 try:
386 filename = get_py_filename(arg)
387 except IOError:
388 # If it ends with .py but doesn't already exist, assume we want
389 # a new file.
390 if arg.endswith('.py'):
391 filename = arg
392 else:
393 filename = None
394 return filename
395
396 # Set a few locals from the options for convenience:
397 opts_prev = 'p' in opts

Callers

nothing calls this directly

Calls 1

get_py_filenameFunction · 0.90

Tested by

no test coverage detected