MCPcopy Index your code
hub / github.com/ipython/ipython / make_filename

Method make_filename

IPython/core/magics/code.py:411–422  ·  view source on GitHub ↗

Make a filename from the given args

(arg)

Source from the content-addressed store, hash-verified

409 """Utility method used by magic_edit to find what to edit."""
410
411 def make_filename(arg):
412 "Make a filename from the given args"
413 try:
414 filename = get_py_filename(arg)
415 except IOError:
416 # If it ends with .py but doesn't already exist, assume we want
417 # a new file.
418 if arg.endswith('.py'):
419 filename = arg
420 else:
421 filename = None
422 return filename
423
424 # Set a few locals from the options for convenience:
425 opts_prev = 'p' in opts

Callers

nothing calls this directly

Calls 1

get_py_filenameFunction · 0.90

Tested by

no test coverage detected