##// END OF EJS Templates
Connect storing output in database to DisplayHook.log_output
Thomas Kluyver -
Show More
@@ -277,10 +277,14 b' class DisplayHook(Configurable):'
277 self.shell.user_ns.update(to_main)
277 self.shell.user_ns.update(to_main)
278 self.shell.user_ns['_oh'][self.prompt_count] = result
278 self.shell.user_ns['_oh'][self.prompt_count] = result
279
279
280 def log_output(self, result):
280 def log_output(self, format_dict):
281 """Log the output."""
281 """Log the output."""
282 if self.shell.logger.log_output:
282 if self.shell.logger.log_output:
283 self.shell.logger.log_write(repr(result), 'output')
283 self.shell.logger.log_write(format_dict['text/plain'], 'output')
284 # Write output to the database. Does nothing unless history
285 # output logging is enabled.
286 self.shell.history_manager.store_output(self.prompt_count,
287 format_dict['text/plain'])
284
288
285 def finish_displayhook(self):
289 def finish_displayhook(self):
286 """Finish up all displayhook activities."""
290 """Finish up all displayhook activities."""
@@ -300,7 +304,7 b' class DisplayHook(Configurable):'
300 format_dict = self.compute_format_data(result)
304 format_dict = self.compute_format_data(result)
301 self.write_format_data(format_dict)
305 self.write_format_data(format_dict)
302 self.update_user_ns(result)
306 self.update_user_ns(result)
303 self.log_output(result)
307 self.log_output(format_dict)
304 self.finish_displayhook()
308 self.finish_displayhook()
305
309
306 def flush(self):
310 def flush(self):
General Comments 0
You need to be logged in to leave comments. Login now