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

Method _get_notebook_display_formatter

IPython/lib/display.py:546–569  ·  view source on GitHub ↗

generate function to use for notebook formatting

(self,
                                        spacer="  ")

Source from the content-addressed store, hash-verified

544 return f
545
546 def _get_notebook_display_formatter(self,
547 spacer="  "):
548 """ generate function to use for notebook formatting
549 """
550 dirname_output_format = \
551 self.result_html_prefix + "%s/" + self.result_html_suffix
552 fname_output_format = \
553 self.result_html_prefix + spacer + self.html_link_str + self.result_html_suffix
554 fp_format = self.url_prefix + '%s/%s'
555 if sep == "\\":
556 # Working on a platform where the path separator is "\", so
557 # must convert these to "/" for generating a URI
558 def fp_cleaner(fp):
559 # Replace all occurrences of backslash ("\") with a forward
560 # slash ("/") - this is necessary on windows when a path is
561 # provided as input, but we must link to a URI
562 return fp.replace('\\','/')
563 else:
564 fp_cleaner = None
565
566 return self._get_display_formatter(dirname_output_format,
567 fname_output_format,
568 fp_format,
569 fp_cleaner)
570
571 def _get_terminal_display_formatter(self,
572 spacer=" "):

Callers 1

__init__Method · 0.95

Calls 1

Tested by

no test coverage detected