##// END OF EJS Templates
Better implementation of widget _repr_ style display logic.
Jonathan Frederic -
Show More
@@ -241,6 +241,9 class DisplayHook(Configurable):
241 241 """
242 242 self.check_for_underscore()
243 243 if result is not None and not self.quiet():
244 # If _ipython_display_ is defined, use that to display this object. If
245 # it returns NotImplemented, use the _repr_ logic (default).
246 if not hasattr(result, '_ipython_display_') or result._ipython_display_() == NotImplemented:
244 247 self.start_displayhook()
245 248 self.write_output_prompt()
246 249 format_dict, md_dict = self.compute_format_data(result)
@@ -149,9 +149,6 class DisplayFormatter(Configurable):
149 149 format_dict = {}
150 150 md_dict = {}
151 151
152 # If _ipython_display_ is defined, use that to display this object. If
153 # it returns NotImplemented, use the _repr_ logic (default).
154 if not hasattr(obj, '_ipython_display_') or obj._ipython_display_(**kwargs) == NotImplemented:
155 152 for format_type, formatter in self.formatters.items():
156 153 if include and format_type not in include:
157 154 continue
General Comments 0
You need to be logged in to leave comments. Login now