Show More
@@ -2,7 +2,7 b'' | |||||
2 | """ |
|
2 | """ | |
3 | Classes for handling input/output prompts. |
|
3 | Classes for handling input/output prompts. | |
4 |
|
4 | |||
5 |
$Id: Prompts.py 1 |
|
5 | $Id: Prompts.py 1303 2006-05-17 03:39:29Z fperez $""" | |
6 |
|
6 | |||
7 | #***************************************************************************** |
|
7 | #***************************************************************************** | |
8 | # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu> |
|
8 | # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu> | |
@@ -23,7 +23,6 b' import os' | |||||
23 | import socket |
|
23 | import socket | |
24 | import sys |
|
24 | import sys | |
25 | import time |
|
25 | import time | |
26 | from pprint import pprint,pformat |
|
|||
27 |
|
26 | |||
28 | # IPython's own |
|
27 | # IPython's own | |
29 | from IPython import ColorANSI |
|
28 | from IPython import ColorANSI |
@@ -32,7 +32,7 b" ip.set_hook('editor', calljed)" | |||||
32 | You can then enable the functionality by doing 'import myiphooks' |
|
32 | You can then enable the functionality by doing 'import myiphooks' | |
33 | somewhere in your configuration files or ipython command line. |
|
33 | somewhere in your configuration files or ipython command line. | |
34 |
|
34 | |||
35 |
$Id: hooks.py 1 |
|
35 | $Id: hooks.py 1303 2006-05-17 03:39:29Z fperez $""" | |
36 |
|
36 | |||
37 | #***************************************************************************** |
|
37 | #***************************************************************************** | |
38 | # Copyright (C) 2005 Fernando Perez. <fperez@colorado.edu> |
|
38 | # Copyright (C) 2005 Fernando Perez. <fperez@colorado.edu> | |
@@ -49,13 +49,15 b' __version__ = Release.version' | |||||
49 |
|
49 | |||
50 | import os,bisect |
|
50 | import os,bisect | |
51 | from genutils import Term |
|
51 | from genutils import Term | |
52 |
from pprint import |
|
52 | from pprint import PrettyPrinter | |
53 |
|
53 | |||
54 | # List here all the default hooks. For now it's just the editor functions |
|
54 | # List here all the default hooks. For now it's just the editor functions | |
55 | # but over time we'll move here all the public API for user-accessible things. |
|
55 | # but over time we'll move here all the public API for user-accessible things. | |
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 |
|
58 | |||
|
59 | pformat = PrettyPrinter().pformat | |||
|
60 | ||||
59 | def editor(self,filename, linenum=None): |
|
61 | def editor(self,filename, linenum=None): | |
60 | """Open the default editor at the given filename and linenumber. |
|
62 | """Open the default editor at the given filename and linenumber. | |
61 |
|
63 | |||
@@ -157,8 +159,11 b' def result_display(self,arg):' | |||||
157 | Term.cout.write('\n') |
|
159 | Term.cout.write('\n') | |
158 | print >>Term.cout, out |
|
160 | print >>Term.cout, out | |
159 | else: |
|
161 | else: | |
160 | print >>Term.cout, arg |
|
162 | # By default, the interactive prompt uses repr() to display results, | |
161 | # the default display hook doesn't manipulate the value to put in history |
|
163 | # so we should honor this. Users who'd rather use a different | |
|
164 | # mechanism can easily override this hook. | |||
|
165 | print >>Term.cout, repr(arg) | |||
|
166 | # the default display hook doesn't manipulate the value to put in history | |||
162 | return None |
|
167 | return None | |
163 |
|
168 | |||
164 | def input_prefilter(self,line): |
|
169 | def input_prefilter(self,line): |
@@ -1,8 +1,14 b'' | |||||
|
1 | 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu> | |||
|
2 | ||||
|
3 | * IPython/hooks.py (result_display): Fix the fact that our display | |||
|
4 | hook was using str() instead of repr(), as the default python | |||
|
5 | console does. This had gone unnoticed b/c it only happened if | |||
|
6 | %Pprint was off, but the inconsistency was there. | |||
|
7 | ||||
1 | 2006-05-15 Ville Vainio <vivainio@gmail.com> |
|
8 | 2006-05-15 Ville Vainio <vivainio@gmail.com> | |
2 |
|
9 | |||
3 | * Oinspect.py: Only show docstring for nonexisting/binary files |
|
10 | * Oinspect.py: Only show docstring for nonexisting/binary files | |
4 | when doing object??, closing ticket #62 |
|
11 | when doing object??, closing ticket #62 | |
5 |
|
||||
6 |
|
12 | |||
7 | 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu> |
|
13 | 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu> | |
8 |
|
14 |
General Comments 0
You need to be logged in to leave comments.
Login now