##// END OF EJS Templates
generate_output_prompt hook
vivainio -
Show More
@@ -2,7 +2,7 b''
2 2 """
3 3 Classes for handling input/output prompts.
4 4
5 $Id: Prompts.py 1303 2006-05-17 03:39:29Z fperez $"""
5 $Id: Prompts.py 1366 2006-06-15 19:45:50Z vivainio $"""
6 6
7 7 #*****************************************************************************
8 8 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
@@ -379,6 +379,7 b' class Prompt2(BasePrompt):'
379 379 self.col_p = Colors.out_prompt
380 380 self.col_num = Colors.out_number
381 381
382
382 383 #-----------------------------------------------------------------------------
383 384 class CachedOutput:
384 385 """Class for printing output from calculations while keeping a cache of
@@ -500,8 +501,9 b' class CachedOutput:'
500 501 return
501 502 # don't use print, puts an extra space
502 503 cout_write(self.output_sep)
504 outprompt = self.shell.hooks.generate_output_prompt()
503 505 if self.do_full_cache:
504 cout_write(str(self.prompt_out))
506 cout_write(outprompt)
505 507
506 508 if isinstance(arg,Macro):
507 509 print 'Executing Macro...'
@@ -583,3 +585,4 b' class CachedOutput:'
583 585 self.user_ns.update({'_':None,'__':None, '___':None})
584 586 import gc
585 587 gc.collect() # xxx needed?
588
@@ -32,7 +32,7 b" ip.set_hook('editor', calljed)"
32 32 You can then enable the functionality by doing 'import myiphooks'
33 33 somewhere in your configuration files or ipython command line.
34 34
35 $Id: hooks.py 1365 2006-06-15 19:11:26Z vivainio $"""
35 $Id: hooks.py 1366 2006-06-15 19:45:50Z vivainio $"""
36 36
37 37 #*****************************************************************************
38 38 # Copyright (C) 2005 Fernando Perez. <fperez@colorado.edu>
@@ -55,7 +55,7 b' from pprint import PrettyPrinter'
55 55 # but over time we'll move here all the public API for user-accessible things.
56 56 __all__ = ['editor', 'fix_error_editor', 'result_display',
57 57 'input_prefilter', 'shutdown_hook', 'late_startup_hook',
58 'generate_prompt' ]
58 'generate_prompt', 'generate_output_prompt' ]
59 59
60 60 pformat = PrettyPrinter().pformat
61 61
@@ -203,4 +203,8 b' def generate_prompt(self, is_continuation):'
203 203 return str(ip.IP.outputcache.prompt2)
204 204 return str(ip.IP.outputcache.prompt1)
205 205
206 def generate_output_prompt(self):
207 ip = self.api
208 return str(ip.IP.outputcache.prompt_out)
209
206 210 No newline at end of file
@@ -5,6 +5,9 b''
5 5 assigning "magic" strings to prompt_in1 and prompt_in2. The old
6 6 way still works (it's invoked by the default hook), of course.
7 7
8 * Prompts.py: added generate_output_prompt hook for altering output
9 prompt
10
8 11 * Release.py: Changed version string to 0.7.3.svn.
9 12
10 13 2006-06-15 Walter Doerwald <walter@livinglogic.de>
General Comments 0
You need to be logged in to leave comments. Login now