##// END OF EJS Templates
add pre_prompt_hook; run just before displaying the prompt (safe place to display stuff asynchronously...
Ville M. Vainio -
Show More
@@ -56,7 +56,7 b' from pprint import PrettyPrinter'
56 56 __all__ = ['editor', 'fix_error_editor', 'result_display',
57 57 'input_prefilter', 'shutdown_hook', 'late_startup_hook',
58 58 'generate_prompt', 'generate_output_prompt','shell_hook',
59 'show_in_pager']
59 'show_in_pager','pre_prompt_hook']
60 60
61 61 pformat = PrettyPrinter().pformat
62 62
@@ -227,8 +227,13 b' def show_in_pager(self,s):'
227 227 # raising TryNext here will use the default paging functionality
228 228 raise ipapi.TryNext
229 229
230 def pre_command_hook(self,cmd):
231 """" Executed before starting to execute a command """
230 def pre_prompt_hook(self):
231 """ Run before displaying the next prompt
232
233 Use this e.g. to display output from asynchronous operations (in order
234 to not mess up text entry)
235 """
236
232 237 return None
233 238
234 239 def post_command_hook(self,cmd):
@@ -1746,6 +1746,7 b' want to merge them back into the new files.""" % locals()'
1746 1746 # exit_now is set by a call to %Exit or %Quit
1747 1747
1748 1748 while not self.exit_now:
1749 self.hooks.pre_prompt_hook()
1749 1750 if more:
1750 1751 try:
1751 1752 prompt = self.hooks.generate_prompt(True)
General Comments 0
You need to be logged in to leave comments. Login now