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

Method f

IPython/lib/display.py:512–543  ·  view source on GitHub ↗
(dirname, fnames, included_suffixes=None)

Source from the content-addressed store, hash-verified

510 and fname will be substituted for the second
511 """
512 def f(dirname, fnames, included_suffixes=None):
513 result = []
514 # begin by figuring out which filenames, if any,
515 # are going to be displayed
516 display_fnames = []
517 for fname in fnames:
518 if (isfile(join(dirname,fname)) and
519 (included_suffixes is None or
520 splitext(fname)[1] in included_suffixes)):
521 display_fnames.append(fname)
522
523 if len(display_fnames) == 0:
524 # if there are no filenames to display, don't print anything
525 # (not even the directory name)
526 pass
527 else:
528 # otherwise print the formatted directory name followed by
529 # the formatted filenames
530 dirname_output_line = dirname_output_format % dirname
531 result.append(dirname_output_line)
532 for fname in display_fnames:
533 fp = fp_format % (dirname,fname)
534 if fp_cleaner is not None:
535 fp = fp_cleaner(fp)
536 try:
537 # output can include both a filepath and a filename...
538 fname_output_line = fname_output_format % (fp, fname)
539 except TypeError:
540 # ... or just a single filepath
541 fname_output_line = fname_output_format % fname
542 result.append(fname_output_line)
543 return result
544 return f
545
546 def _get_notebook_display_formatter(self,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected