##// 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 __all__ = ['editor', 'fix_error_editor', 'result_display',
56 __all__ = ['editor', 'fix_error_editor', 'result_display',
57 'input_prefilter', 'shutdown_hook', 'late_startup_hook',
57 'input_prefilter', 'shutdown_hook', 'late_startup_hook',
58 'generate_prompt', 'generate_output_prompt','shell_hook',
58 'generate_prompt', 'generate_output_prompt','shell_hook',
59 'show_in_pager']
59 'show_in_pager','pre_prompt_hook']
60
60
61 pformat = PrettyPrinter().pformat
61 pformat = PrettyPrinter().pformat
62
62
@@ -227,8 +227,13 b' def show_in_pager(self,s):'
227 # raising TryNext here will use the default paging functionality
227 # raising TryNext here will use the default paging functionality
228 raise ipapi.TryNext
228 raise ipapi.TryNext
229
229
230 def pre_command_hook(self,cmd):
230 def pre_prompt_hook(self):
231 """" Executed before starting to execute a command """
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 return None
237 return None
233
238
234 def post_command_hook(self,cmd):
239 def post_command_hook(self,cmd):
@@ -1746,6 +1746,7 b' want to merge them back into the new files.""" % locals()'
1746 # exit_now is set by a call to %Exit or %Quit
1746 # exit_now is set by a call to %Exit or %Quit
1747
1747
1748 while not self.exit_now:
1748 while not self.exit_now:
1749 self.hooks.pre_prompt_hook()
1749 if more:
1750 if more:
1750 try:
1751 try:
1751 prompt = self.hooks.generate_prompt(True)
1752 prompt = self.hooks.generate_prompt(True)
General Comments 0
You need to be logged in to leave comments. Login now