##// END OF EJS Templates
hist -t default, omit last empty line in input_hist_raw on multiline statements, old changelog entries
vivainio -
Show More
@@ -1,228 +1,233 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 """ History related magics and functionality """
3 """ History related magics and functionality """
4
4
5 import fnmatch
5 import fnmatch
6
6
7 def magic_history(self, parameter_s = ''):
7 def magic_history(self, parameter_s = ''):
8 """Print input history (_i<n> variables), with most recent last.
8 """Print input history (_i<n> variables), with most recent last.
9
9
10 %history -> print at most 40 inputs (some may be multi-line)\\
10 %history -> print at most 40 inputs (some may be multi-line)\\
11 %history n -> print at most n inputs\\
11 %history n -> print at most n inputs\\
12 %history n1 n2 -> print inputs between n1 and n2 (n2 not included)\\
12 %history n1 n2 -> print inputs between n1 and n2 (n2 not included)\\
13
13
14 Each input's number <n> is shown, and is accessible as the
14 Each input's number <n> is shown, and is accessible as the
15 automatically generated variable _i<n>. Multi-line statements are
15 automatically generated variable _i<n>. Multi-line statements are
16 printed starting at a new line for easy copy/paste.
16 printed starting at a new line for easy copy/paste.
17
17
18
18
19 Options:
19 Options:
20
20
21 -n: do NOT print line numbers. This is useful if you want to get a
21 -n: do NOT print line numbers. This is useful if you want to get a
22 printout of many lines which can be directly pasted into a text
22 printout of many lines which can be directly pasted into a text
23 editor.
23 editor.
24
24
25 This feature is only available if numbered prompts are in use.
25 This feature is only available if numbered prompts are in use.
26
26
27 -t: print the 'translated' history, as IPython understands it. IPython
27 -t: (default) print the 'translated' history, as IPython understands it.
28 filters your input and converts it all into valid Python source before
28 IPython filters your input and converts it all into valid Python source
29 executing it (things like magics or aliases are turned into function
29 before executing it (things like magics or aliases are turned into
30 calls, for example). With this option, you'll see the native history
30 function calls, for example). With this option, you'll see the native
31 instead of the user-entered version: '%cd /' will be seen as
31 history instead of the user-entered version: '%cd /' will be seen as
32 '_ip.magic("%cd /")' instead of '%cd /'.
32 '_ip.magic("%cd /")' instead of '%cd /'.
33
33
34 -r: print the 'raw' history, i.e. the actual commands you typed.
35
34 -g: treat the arg as a pattern to grep for in (full) history.
36 -g: treat the arg as a pattern to grep for in (full) history.
35 This includes the "shadow history" (almost all commands ever written).
37 This includes the "shadow history" (almost all commands ever written).
36 Use '%hist -g' to show full shadow history (may be very long).
38 Use '%hist -g' to show full shadow history (may be very long).
37 In shadow history, every index nuwber starts with 0.
39 In shadow history, every index nuwber starts with 0.
38
40
39
41
40 """
42 """
41
43
42 ip = self.api
44 ip = self.api
43 shell = self.shell
45 shell = self.shell
44 if not shell.outputcache.do_full_cache:
46 if not shell.outputcache.do_full_cache:
45 print 'This feature is only available if numbered prompts are in use.'
47 print 'This feature is only available if numbered prompts are in use.'
46 return
48 return
47 opts,args = self.parse_options(parameter_s,'gnts',mode='list')
49 opts,args = self.parse_options(parameter_s,'gntsr',mode='list')
48
50
49 if not opts.has_key('t'):
51 if opts.has_key('t'):
52 input_hist = shell.input_hist
53 elif opts.has_key('r'):
50 input_hist = shell.input_hist_raw
54 input_hist = shell.input_hist_raw
51 else:
55 else:
52 input_hist = shell.input_hist
56 input_hist = shell.input_hist
53
57
58
54 default_length = 40
59 default_length = 40
55 pattern = None
60 pattern = None
56 if opts.has_key('g'):
61 if opts.has_key('g'):
57 init = 1
62 init = 1
58 final = len(input_hist)
63 final = len(input_hist)
59 parts = parameter_s.split(None,1)
64 parts = parameter_s.split(None,1)
60 if len(parts) == 1:
65 if len(parts) == 1:
61 parts += '*'
66 parts += '*'
62 head, pattern = parts
67 head, pattern = parts
63 pattern = "*" + pattern + "*"
68 pattern = "*" + pattern + "*"
64 elif len(args) == 0:
69 elif len(args) == 0:
65 final = len(input_hist)
70 final = len(input_hist)
66 init = max(1,final-default_length)
71 init = max(1,final-default_length)
67 elif len(args) == 1:
72 elif len(args) == 1:
68 final = len(input_hist)
73 final = len(input_hist)
69 init = max(1,final-int(args[0]))
74 init = max(1,final-int(args[0]))
70 elif len(args) == 2:
75 elif len(args) == 2:
71 init,final = map(int,args)
76 init,final = map(int,args)
72 else:
77 else:
73 warn('%hist takes 0, 1 or 2 arguments separated by spaces.')
78 warn('%hist takes 0, 1 or 2 arguments separated by spaces.')
74 print self.magic_hist.__doc__
79 print self.magic_hist.__doc__
75 return
80 return
76 width = len(str(final))
81 width = len(str(final))
77 line_sep = ['','\n']
82 line_sep = ['','\n']
78 print_nums = not opts.has_key('n')
83 print_nums = not opts.has_key('n')
79
84
80 found = False
85 found = False
81 if pattern is not None:
86 if pattern is not None:
82 sh = ip.IP.shadowhist.all()
87 sh = ip.IP.shadowhist.all()
83 for idx, s in sh:
88 for idx, s in sh:
84 if fnmatch.fnmatch(s, pattern):
89 if fnmatch.fnmatch(s, pattern):
85 print "0%d: %s" %(idx, s)
90 print "0%d: %s" %(idx, s)
86 found = True
91 found = True
87
92
88 if found:
93 if found:
89 print "==="
94 print "==="
90 print "^shadow history ends, fetch by %rep <number> (must start with 0)"
95 print "^shadow history ends, fetch by %rep <number> (must start with 0)"
91 print "=== start of normal history ==="
96 print "=== start of normal history ==="
92
97
93 for in_num in range(init,final):
98 for in_num in range(init,final):
94 inline = input_hist[in_num]
99 inline = input_hist[in_num]
95 if pattern is not None and not fnmatch.fnmatch(inline, pattern):
100 if pattern is not None and not fnmatch.fnmatch(inline, pattern):
96 continue
101 continue
97
102
98 multiline = int(inline.count('\n') > 1)
103 multiline = int(inline.count('\n') > 1)
99 if print_nums:
104 if print_nums:
100 print '%s:%s' % (str(in_num).ljust(width),line_sep[multiline]),
105 print '%s:%s' % (str(in_num).ljust(width),line_sep[multiline]),
101 print inline,
106 print inline,
102
107
103
108
104
109
105 def magic_hist(self, parameter_s=''):
110 def magic_hist(self, parameter_s=''):
106 """Alternate name for %history."""
111 """Alternate name for %history."""
107 return self.magic_history(parameter_s)
112 return self.magic_history(parameter_s)
108
113
109
114
110
115
111 def rep_f(self, arg):
116 def rep_f(self, arg):
112 r""" Repeat a command, or get command to input line for editing
117 r""" Repeat a command, or get command to input line for editing
113
118
114 - %rep (no arguments):
119 - %rep (no arguments):
115
120
116 Place a string version of last input to the next input prompt. Allows you
121 Place a string version of last input to the next input prompt. Allows you
117 to create elaborate command lines without using copy-paste::
122 to create elaborate command lines without using copy-paste::
118
123
119 $ l = ["hei", "vaan"]
124 $ l = ["hei", "vaan"]
120 $ "".join(l)
125 $ "".join(l)
121 ==> heivaan
126 ==> heivaan
122 $ %rep
127 $ %rep
123 $ heivaan_ <== cursor blinking
128 $ heivaan_ <== cursor blinking
124
129
125 %rep 45
130 %rep 45
126
131
127 Place history line 45 to next input prompt. Use %hist to find out the number.
132 Place history line 45 to next input prompt. Use %hist to find out the number.
128
133
129 %rep 1-4 6-7 3
134 %rep 1-4 6-7 3
130
135
131 Repeat the specified lines immediately. Input slice syntax is the same as
136 Repeat the specified lines immediately. Input slice syntax is the same as
132 in %macro and %save.
137 in %macro and %save.
133
138
134 %rep foo
139 %rep foo
135
140
136 Place the most recent line that has the substring "foo" to next input.
141 Place the most recent line that has the substring "foo" to next input.
137 (e.g. 'svn ci -m foobar').
142 (e.g. 'svn ci -m foobar').
138
143
139 """
144 """
140
145
141
146
142 opts,args = self.parse_options(arg,'',mode='list')
147 opts,args = self.parse_options(arg,'',mode='list')
143 ip = self.api
148 ip = self.api
144 if not args:
149 if not args:
145 ip.set_next_input(str(ip.user_ns["_"]))
150 ip.set_next_input(str(ip.user_ns["_"]))
146 return
151 return
147
152
148 if len(args) == 1 and not '-' in args[0]:
153 if len(args) == 1 and not '-' in args[0]:
149 arg = args[0]
154 arg = args[0]
150 if len(arg) > 1 and arg.startswith('0'):
155 if len(arg) > 1 and arg.startswith('0'):
151 # get from shadow hist
156 # get from shadow hist
152 num = int(arg[1:])
157 num = int(arg[1:])
153 line = self.shadowhist.get(num)
158 line = self.shadowhist.get(num)
154 ip.set_next_input(str(line))
159 ip.set_next_input(str(line))
155 return
160 return
156 try:
161 try:
157 num = int(args[0])
162 num = int(args[0])
158 ip.set_next_input(str(ip.IP.input_hist_raw[num]).rstrip())
163 ip.set_next_input(str(ip.IP.input_hist_raw[num]).rstrip())
159 return
164 return
160 except ValueError:
165 except ValueError:
161 pass
166 pass
162
167
163 for h in reversed(self.shell.input_hist_raw):
168 for h in reversed(self.shell.input_hist_raw):
164 if 'rep' in h:
169 if 'rep' in h:
165 continue
170 continue
166 if fnmatch.fnmatch(h,'*' + arg + '*'):
171 if fnmatch.fnmatch(h,'*' + arg + '*'):
167 ip.set_next_input(str(h).rstrip())
172 ip.set_next_input(str(h).rstrip())
168 return
173 return
169
174
170
175
171 lines = self.extract_input_slices(args, True)
176 lines = self.extract_input_slices(args, True)
172 print "lines",lines
177 print "lines",lines
173 ip.runlines(lines)
178 ip.runlines(lines)
174
179
175
180
176 _sentinel = object()
181 _sentinel = object()
177
182
178 class ShadowHist:
183 class ShadowHist:
179 def __init__(self,db):
184 def __init__(self,db):
180 # cmd => idx mapping
185 # cmd => idx mapping
181 self.curidx = 0
186 self.curidx = 0
182 self.db = db
187 self.db = db
183
188
184 def inc_idx(self):
189 def inc_idx(self):
185 idx = self.db.get('shadowhist_idx', 1)
190 idx = self.db.get('shadowhist_idx', 1)
186 self.db['shadowhist_idx'] = idx + 1
191 self.db['shadowhist_idx'] = idx + 1
187 return idx
192 return idx
188
193
189 def add(self, ent):
194 def add(self, ent):
190 old = self.db.hget('shadowhist', ent, _sentinel)
195 old = self.db.hget('shadowhist', ent, _sentinel)
191 if old is not _sentinel:
196 if old is not _sentinel:
192 return
197 return
193 newidx = self.inc_idx()
198 newidx = self.inc_idx()
194 #print "new",newidx # dbg
199 #print "new",newidx # dbg
195 self.db.hset('shadowhist',ent, newidx)
200 self.db.hset('shadowhist',ent, newidx)
196
201
197 def all(self):
202 def all(self):
198 d = self.db.hdict('shadowhist')
203 d = self.db.hdict('shadowhist')
199 items = [(i,s) for (s,i) in d.items()]
204 items = [(i,s) for (s,i) in d.items()]
200 items.sort()
205 items.sort()
201 return items
206 return items
202
207
203 def get(self, idx):
208 def get(self, idx):
204 all = self.all()
209 all = self.all()
205
210
206 for k, v in all:
211 for k, v in all:
207 #print k,v
212 #print k,v
208 if k == idx:
213 if k == idx:
209 return v
214 return v
210
215
211 def test_shist():
216 def test_shist():
212 from IPython.Extensions import pickleshare
217 from IPython.Extensions import pickleshare
213 db = pickleshare.PickleShareDB('~/shist')
218 db = pickleshare.PickleShareDB('~/shist')
214 s = ShadowHist(db)
219 s = ShadowHist(db)
215 s.add('hello')
220 s.add('hello')
216 s.add('world')
221 s.add('world')
217 s.add('hello')
222 s.add('hello')
218 s.add('hello')
223 s.add('hello')
219 s.add('karhu')
224 s.add('karhu')
220 print "all",s.all()
225 print "all",s.all()
221 print s.get(2)
226 print s.get(2)
222
227
223 def init_ipython(ip):
228 def init_ipython(ip):
224 ip.expose_magic("rep",rep_f)
229 ip.expose_magic("rep",rep_f)
225 ip.expose_magic("hist",magic_hist)
230 ip.expose_magic("hist",magic_hist)
226 ip.expose_magic("history",magic_history)
231 ip.expose_magic("history",magic_history)
227
232
228 #test_shist()
233 #test_shist()
@@ -1,2519 +1,2519 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 IPython -- An enhanced Interactive Python
3 IPython -- An enhanced Interactive Python
4
4
5 Requires Python 2.3 or newer.
5 Requires Python 2.3 or newer.
6
6
7 This file contains all the classes and helper functions specific to IPython.
7 This file contains all the classes and helper functions specific to IPython.
8
8
9 $Id: iplib.py 2646 2007-08-20 16:28:48Z vivainio $
9 $Id: iplib.py 2652 2007-08-22 17:25:24Z vivainio $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
15 #
15 #
16 # Distributed under the terms of the BSD License. The full license is in
16 # Distributed under the terms of the BSD License. The full license is in
17 # the file COPYING, distributed as part of this software.
17 # the file COPYING, distributed as part of this software.
18 #
18 #
19 # Note: this code originally subclassed code.InteractiveConsole from the
19 # Note: this code originally subclassed code.InteractiveConsole from the
20 # Python standard library. Over time, all of that class has been copied
20 # Python standard library. Over time, all of that class has been copied
21 # verbatim here for modifications which could not be accomplished by
21 # verbatim here for modifications which could not be accomplished by
22 # subclassing. At this point, there are no dependencies at all on the code
22 # subclassing. At this point, there are no dependencies at all on the code
23 # module anymore (it is not even imported). The Python License (sec. 2)
23 # module anymore (it is not even imported). The Python License (sec. 2)
24 # allows for this, but it's always nice to acknowledge credit where credit is
24 # allows for this, but it's always nice to acknowledge credit where credit is
25 # due.
25 # due.
26 #*****************************************************************************
26 #*****************************************************************************
27
27
28 #****************************************************************************
28 #****************************************************************************
29 # Modules and globals
29 # Modules and globals
30
30
31 from IPython import Release
31 from IPython import Release
32 __author__ = '%s <%s>\n%s <%s>' % \
32 __author__ = '%s <%s>\n%s <%s>' % \
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
34 __license__ = Release.license
34 __license__ = Release.license
35 __version__ = Release.version
35 __version__ = Release.version
36
36
37 # Python standard modules
37 # Python standard modules
38 import __main__
38 import __main__
39 import __builtin__
39 import __builtin__
40 import StringIO
40 import StringIO
41 import bdb
41 import bdb
42 import cPickle as pickle
42 import cPickle as pickle
43 import codeop
43 import codeop
44 import doctest
44 import doctest
45 import exceptions
45 import exceptions
46 import glob
46 import glob
47 import inspect
47 import inspect
48 import keyword
48 import keyword
49 import new
49 import new
50 import os
50 import os
51 import pydoc
51 import pydoc
52 import re
52 import re
53 import shutil
53 import shutil
54 import string
54 import string
55 import sys
55 import sys
56 import tempfile
56 import tempfile
57 import traceback
57 import traceback
58 import types
58 import types
59 import pickleshare
59 import pickleshare
60 from sets import Set
60 from sets import Set
61 from pprint import pprint, pformat
61 from pprint import pprint, pformat
62
62
63 # IPython's own modules
63 # IPython's own modules
64 #import IPython
64 #import IPython
65 from IPython import Debugger,OInspect,PyColorize,ultraTB
65 from IPython import Debugger,OInspect,PyColorize,ultraTB
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
67 from IPython.FakeModule import FakeModule
67 from IPython.FakeModule import FakeModule
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
69 from IPython.Logger import Logger
69 from IPython.Logger import Logger
70 from IPython.Magic import Magic
70 from IPython.Magic import Magic
71 from IPython.Prompts import CachedOutput
71 from IPython.Prompts import CachedOutput
72 from IPython.ipstruct import Struct
72 from IPython.ipstruct import Struct
73 from IPython.background_jobs import BackgroundJobManager
73 from IPython.background_jobs import BackgroundJobManager
74 from IPython.usage import cmd_line_usage,interactive_usage
74 from IPython.usage import cmd_line_usage,interactive_usage
75 from IPython.genutils import *
75 from IPython.genutils import *
76 from IPython.strdispatch import StrDispatch
76 from IPython.strdispatch import StrDispatch
77 import IPython.ipapi
77 import IPython.ipapi
78 import IPython.history
78 import IPython.history
79 import IPython.prefilter as prefilter
79 import IPython.prefilter as prefilter
80 import IPython.shadowns
80 import IPython.shadowns
81 # Globals
81 # Globals
82
82
83 # store the builtin raw_input globally, and use this always, in case user code
83 # store the builtin raw_input globally, and use this always, in case user code
84 # overwrites it (like wx.py.PyShell does)
84 # overwrites it (like wx.py.PyShell does)
85 raw_input_original = raw_input
85 raw_input_original = raw_input
86
86
87 # compiled regexps for autoindent management
87 # compiled regexps for autoindent management
88 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
88 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
89
89
90
90
91 #****************************************************************************
91 #****************************************************************************
92 # Some utility function definitions
92 # Some utility function definitions
93
93
94 ini_spaces_re = re.compile(r'^(\s+)')
94 ini_spaces_re = re.compile(r'^(\s+)')
95
95
96 def num_ini_spaces(strng):
96 def num_ini_spaces(strng):
97 """Return the number of initial spaces in a string"""
97 """Return the number of initial spaces in a string"""
98
98
99 ini_spaces = ini_spaces_re.match(strng)
99 ini_spaces = ini_spaces_re.match(strng)
100 if ini_spaces:
100 if ini_spaces:
101 return ini_spaces.end()
101 return ini_spaces.end()
102 else:
102 else:
103 return 0
103 return 0
104
104
105 def softspace(file, newvalue):
105 def softspace(file, newvalue):
106 """Copied from code.py, to remove the dependency"""
106 """Copied from code.py, to remove the dependency"""
107
107
108 oldvalue = 0
108 oldvalue = 0
109 try:
109 try:
110 oldvalue = file.softspace
110 oldvalue = file.softspace
111 except AttributeError:
111 except AttributeError:
112 pass
112 pass
113 try:
113 try:
114 file.softspace = newvalue
114 file.softspace = newvalue
115 except (AttributeError, TypeError):
115 except (AttributeError, TypeError):
116 # "attribute-less object" or "read-only attributes"
116 # "attribute-less object" or "read-only attributes"
117 pass
117 pass
118 return oldvalue
118 return oldvalue
119
119
120
120
121 #****************************************************************************
121 #****************************************************************************
122 # Local use exceptions
122 # Local use exceptions
123 class SpaceInInput(exceptions.Exception): pass
123 class SpaceInInput(exceptions.Exception): pass
124
124
125
125
126 #****************************************************************************
126 #****************************************************************************
127 # Local use classes
127 # Local use classes
128 class Bunch: pass
128 class Bunch: pass
129
129
130 class Undefined: pass
130 class Undefined: pass
131
131
132 class Quitter(object):
132 class Quitter(object):
133 """Simple class to handle exit, similar to Python 2.5's.
133 """Simple class to handle exit, similar to Python 2.5's.
134
134
135 It handles exiting in an ipython-safe manner, which the one in Python 2.5
135 It handles exiting in an ipython-safe manner, which the one in Python 2.5
136 doesn't do (obviously, since it doesn't know about ipython)."""
136 doesn't do (obviously, since it doesn't know about ipython)."""
137
137
138 def __init__(self,shell,name):
138 def __init__(self,shell,name):
139 self.shell = shell
139 self.shell = shell
140 self.name = name
140 self.name = name
141
141
142 def __repr__(self):
142 def __repr__(self):
143 return 'Type %s() to exit.' % self.name
143 return 'Type %s() to exit.' % self.name
144 __str__ = __repr__
144 __str__ = __repr__
145
145
146 def __call__(self):
146 def __call__(self):
147 self.shell.exit()
147 self.shell.exit()
148
148
149 class InputList(list):
149 class InputList(list):
150 """Class to store user input.
150 """Class to store user input.
151
151
152 It's basically a list, but slices return a string instead of a list, thus
152 It's basically a list, but slices return a string instead of a list, thus
153 allowing things like (assuming 'In' is an instance):
153 allowing things like (assuming 'In' is an instance):
154
154
155 exec In[4:7]
155 exec In[4:7]
156
156
157 or
157 or
158
158
159 exec In[5:9] + In[14] + In[21:25]"""
159 exec In[5:9] + In[14] + In[21:25]"""
160
160
161 def __getslice__(self,i,j):
161 def __getslice__(self,i,j):
162 return ''.join(list.__getslice__(self,i,j))
162 return ''.join(list.__getslice__(self,i,j))
163
163
164 class SyntaxTB(ultraTB.ListTB):
164 class SyntaxTB(ultraTB.ListTB):
165 """Extension which holds some state: the last exception value"""
165 """Extension which holds some state: the last exception value"""
166
166
167 def __init__(self,color_scheme = 'NoColor'):
167 def __init__(self,color_scheme = 'NoColor'):
168 ultraTB.ListTB.__init__(self,color_scheme)
168 ultraTB.ListTB.__init__(self,color_scheme)
169 self.last_syntax_error = None
169 self.last_syntax_error = None
170
170
171 def __call__(self, etype, value, elist):
171 def __call__(self, etype, value, elist):
172 self.last_syntax_error = value
172 self.last_syntax_error = value
173 ultraTB.ListTB.__call__(self,etype,value,elist)
173 ultraTB.ListTB.__call__(self,etype,value,elist)
174
174
175 def clear_err_state(self):
175 def clear_err_state(self):
176 """Return the current error state and clear it"""
176 """Return the current error state and clear it"""
177 e = self.last_syntax_error
177 e = self.last_syntax_error
178 self.last_syntax_error = None
178 self.last_syntax_error = None
179 return e
179 return e
180
180
181 #****************************************************************************
181 #****************************************************************************
182 # Main IPython class
182 # Main IPython class
183
183
184 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
184 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
185 # until a full rewrite is made. I've cleaned all cross-class uses of
185 # until a full rewrite is made. I've cleaned all cross-class uses of
186 # attributes and methods, but too much user code out there relies on the
186 # attributes and methods, but too much user code out there relies on the
187 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
187 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
188 #
188 #
189 # But at least now, all the pieces have been separated and we could, in
189 # But at least now, all the pieces have been separated and we could, in
190 # principle, stop using the mixin. This will ease the transition to the
190 # principle, stop using the mixin. This will ease the transition to the
191 # chainsaw branch.
191 # chainsaw branch.
192
192
193 # For reference, the following is the list of 'self.foo' uses in the Magic
193 # For reference, the following is the list of 'self.foo' uses in the Magic
194 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
194 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
195 # class, to prevent clashes.
195 # class, to prevent clashes.
196
196
197 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
197 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
198 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
198 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
199 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
199 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
200 # 'self.value']
200 # 'self.value']
201
201
202 class InteractiveShell(object,Magic):
202 class InteractiveShell(object,Magic):
203 """An enhanced console for Python."""
203 """An enhanced console for Python."""
204
204
205 # class attribute to indicate whether the class supports threads or not.
205 # class attribute to indicate whether the class supports threads or not.
206 # Subclasses with thread support should override this as needed.
206 # Subclasses with thread support should override this as needed.
207 isthreaded = False
207 isthreaded = False
208
208
209 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
209 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
210 user_ns = None,user_global_ns=None,banner2='',
210 user_ns = None,user_global_ns=None,banner2='',
211 custom_exceptions=((),None),embedded=False):
211 custom_exceptions=((),None),embedded=False):
212
212
213 # log system
213 # log system
214 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
214 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
215
215
216 # some minimal strict typechecks. For some core data structures, I
216 # some minimal strict typechecks. For some core data structures, I
217 # want actual basic python types, not just anything that looks like
217 # want actual basic python types, not just anything that looks like
218 # one. This is especially true for namespaces.
218 # one. This is especially true for namespaces.
219 for ns in (user_ns,user_global_ns):
219 for ns in (user_ns,user_global_ns):
220 if ns is not None and type(ns) != types.DictType:
220 if ns is not None and type(ns) != types.DictType:
221 raise TypeError,'namespace must be a dictionary'
221 raise TypeError,'namespace must be a dictionary'
222
222
223 # Job manager (for jobs run as background threads)
223 # Job manager (for jobs run as background threads)
224 self.jobs = BackgroundJobManager()
224 self.jobs = BackgroundJobManager()
225
225
226 # Store the actual shell's name
226 # Store the actual shell's name
227 self.name = name
227 self.name = name
228
228
229 # We need to know whether the instance is meant for embedding, since
229 # We need to know whether the instance is meant for embedding, since
230 # global/local namespaces need to be handled differently in that case
230 # global/local namespaces need to be handled differently in that case
231 self.embedded = embedded
231 self.embedded = embedded
232 if embedded:
232 if embedded:
233 # Control variable so users can, from within the embedded instance,
233 # Control variable so users can, from within the embedded instance,
234 # permanently deactivate it.
234 # permanently deactivate it.
235 self.embedded_active = True
235 self.embedded_active = True
236
236
237 # command compiler
237 # command compiler
238 self.compile = codeop.CommandCompiler()
238 self.compile = codeop.CommandCompiler()
239
239
240 # User input buffer
240 # User input buffer
241 self.buffer = []
241 self.buffer = []
242
242
243 # Default name given in compilation of code
243 # Default name given in compilation of code
244 self.filename = '<ipython console>'
244 self.filename = '<ipython console>'
245
245
246 # Install our own quitter instead of the builtins. For python2.3-2.4,
246 # Install our own quitter instead of the builtins. For python2.3-2.4,
247 # this brings in behavior like 2.5, and for 2.5 it's identical.
247 # this brings in behavior like 2.5, and for 2.5 it's identical.
248 __builtin__.exit = Quitter(self,'exit')
248 __builtin__.exit = Quitter(self,'exit')
249 __builtin__.quit = Quitter(self,'quit')
249 __builtin__.quit = Quitter(self,'quit')
250
250
251 # Make an empty namespace, which extension writers can rely on both
251 # Make an empty namespace, which extension writers can rely on both
252 # existing and NEVER being used by ipython itself. This gives them a
252 # existing and NEVER being used by ipython itself. This gives them a
253 # convenient location for storing additional information and state
253 # convenient location for storing additional information and state
254 # their extensions may require, without fear of collisions with other
254 # their extensions may require, without fear of collisions with other
255 # ipython names that may develop later.
255 # ipython names that may develop later.
256 self.meta = Struct()
256 self.meta = Struct()
257
257
258 # Create the namespace where the user will operate. user_ns is
258 # Create the namespace where the user will operate. user_ns is
259 # normally the only one used, and it is passed to the exec calls as
259 # normally the only one used, and it is passed to the exec calls as
260 # the locals argument. But we do carry a user_global_ns namespace
260 # the locals argument. But we do carry a user_global_ns namespace
261 # given as the exec 'globals' argument, This is useful in embedding
261 # given as the exec 'globals' argument, This is useful in embedding
262 # situations where the ipython shell opens in a context where the
262 # situations where the ipython shell opens in a context where the
263 # distinction between locals and globals is meaningful.
263 # distinction between locals and globals is meaningful.
264
264
265 # FIXME. For some strange reason, __builtins__ is showing up at user
265 # FIXME. For some strange reason, __builtins__ is showing up at user
266 # level as a dict instead of a module. This is a manual fix, but I
266 # level as a dict instead of a module. This is a manual fix, but I
267 # should really track down where the problem is coming from. Alex
267 # should really track down where the problem is coming from. Alex
268 # Schmolck reported this problem first.
268 # Schmolck reported this problem first.
269
269
270 # A useful post by Alex Martelli on this topic:
270 # A useful post by Alex Martelli on this topic:
271 # Re: inconsistent value from __builtins__
271 # Re: inconsistent value from __builtins__
272 # Von: Alex Martelli <aleaxit@yahoo.com>
272 # Von: Alex Martelli <aleaxit@yahoo.com>
273 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
273 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
274 # Gruppen: comp.lang.python
274 # Gruppen: comp.lang.python
275
275
276 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
276 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
277 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
277 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
278 # > <type 'dict'>
278 # > <type 'dict'>
279 # > >>> print type(__builtins__)
279 # > >>> print type(__builtins__)
280 # > <type 'module'>
280 # > <type 'module'>
281 # > Is this difference in return value intentional?
281 # > Is this difference in return value intentional?
282
282
283 # Well, it's documented that '__builtins__' can be either a dictionary
283 # Well, it's documented that '__builtins__' can be either a dictionary
284 # or a module, and it's been that way for a long time. Whether it's
284 # or a module, and it's been that way for a long time. Whether it's
285 # intentional (or sensible), I don't know. In any case, the idea is
285 # intentional (or sensible), I don't know. In any case, the idea is
286 # that if you need to access the built-in namespace directly, you
286 # that if you need to access the built-in namespace directly, you
287 # should start with "import __builtin__" (note, no 's') which will
287 # should start with "import __builtin__" (note, no 's') which will
288 # definitely give you a module. Yeah, it's somewhat confusing:-(.
288 # definitely give you a module. Yeah, it's somewhat confusing:-(.
289
289
290 # These routines return properly built dicts as needed by the rest of
290 # These routines return properly built dicts as needed by the rest of
291 # the code, and can also be used by extension writers to generate
291 # the code, and can also be used by extension writers to generate
292 # properly initialized namespaces.
292 # properly initialized namespaces.
293 user_ns = IPython.ipapi.make_user_ns(user_ns)
293 user_ns = IPython.ipapi.make_user_ns(user_ns)
294 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
294 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
295
295
296 # Assign namespaces
296 # Assign namespaces
297 # This is the namespace where all normal user variables live
297 # This is the namespace where all normal user variables live
298 self.user_ns = user_ns
298 self.user_ns = user_ns
299 # Embedded instances require a separate namespace for globals.
299 # Embedded instances require a separate namespace for globals.
300 # Normally this one is unused by non-embedded instances.
300 # Normally this one is unused by non-embedded instances.
301 self.user_global_ns = user_global_ns
301 self.user_global_ns = user_global_ns
302 # A namespace to keep track of internal data structures to prevent
302 # A namespace to keep track of internal data structures to prevent
303 # them from cluttering user-visible stuff. Will be updated later
303 # them from cluttering user-visible stuff. Will be updated later
304 self.internal_ns = {}
304 self.internal_ns = {}
305
305
306 # Namespace of system aliases. Each entry in the alias
306 # Namespace of system aliases. Each entry in the alias
307 # table must be a 2-tuple of the form (N,name), where N is the number
307 # table must be a 2-tuple of the form (N,name), where N is the number
308 # of positional arguments of the alias.
308 # of positional arguments of the alias.
309 self.alias_table = {}
309 self.alias_table = {}
310
310
311 # A table holding all the namespaces IPython deals with, so that
311 # A table holding all the namespaces IPython deals with, so that
312 # introspection facilities can search easily.
312 # introspection facilities can search easily.
313 self.ns_table = {'user':user_ns,
313 self.ns_table = {'user':user_ns,
314 'user_global':user_global_ns,
314 'user_global':user_global_ns,
315 'alias':self.alias_table,
315 'alias':self.alias_table,
316 'internal':self.internal_ns,
316 'internal':self.internal_ns,
317 'builtin':__builtin__.__dict__
317 'builtin':__builtin__.__dict__
318 }
318 }
319
319
320 # The user namespace MUST have a pointer to the shell itself.
320 # The user namespace MUST have a pointer to the shell itself.
321 self.user_ns[name] = self
321 self.user_ns[name] = self
322
322
323 # We need to insert into sys.modules something that looks like a
323 # We need to insert into sys.modules something that looks like a
324 # module but which accesses the IPython namespace, for shelve and
324 # module but which accesses the IPython namespace, for shelve and
325 # pickle to work interactively. Normally they rely on getting
325 # pickle to work interactively. Normally they rely on getting
326 # everything out of __main__, but for embedding purposes each IPython
326 # everything out of __main__, but for embedding purposes each IPython
327 # instance has its own private namespace, so we can't go shoving
327 # instance has its own private namespace, so we can't go shoving
328 # everything into __main__.
328 # everything into __main__.
329
329
330 # note, however, that we should only do this for non-embedded
330 # note, however, that we should only do this for non-embedded
331 # ipythons, which really mimic the __main__.__dict__ with their own
331 # ipythons, which really mimic the __main__.__dict__ with their own
332 # namespace. Embedded instances, on the other hand, should not do
332 # namespace. Embedded instances, on the other hand, should not do
333 # this because they need to manage the user local/global namespaces
333 # this because they need to manage the user local/global namespaces
334 # only, but they live within a 'normal' __main__ (meaning, they
334 # only, but they live within a 'normal' __main__ (meaning, they
335 # shouldn't overtake the execution environment of the script they're
335 # shouldn't overtake the execution environment of the script they're
336 # embedded in).
336 # embedded in).
337
337
338 if not embedded:
338 if not embedded:
339 try:
339 try:
340 main_name = self.user_ns['__name__']
340 main_name = self.user_ns['__name__']
341 except KeyError:
341 except KeyError:
342 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
342 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
343 else:
343 else:
344 #print "pickle hack in place" # dbg
344 #print "pickle hack in place" # dbg
345 #print 'main_name:',main_name # dbg
345 #print 'main_name:',main_name # dbg
346 sys.modules[main_name] = FakeModule(self.user_ns)
346 sys.modules[main_name] = FakeModule(self.user_ns)
347
347
348 # List of input with multi-line handling.
348 # List of input with multi-line handling.
349 # Fill its zero entry, user counter starts at 1
349 # Fill its zero entry, user counter starts at 1
350 self.input_hist = InputList(['\n'])
350 self.input_hist = InputList(['\n'])
351 # This one will hold the 'raw' input history, without any
351 # This one will hold the 'raw' input history, without any
352 # pre-processing. This will allow users to retrieve the input just as
352 # pre-processing. This will allow users to retrieve the input just as
353 # it was exactly typed in by the user, with %hist -r.
353 # it was exactly typed in by the user, with %hist -r.
354 self.input_hist_raw = InputList(['\n'])
354 self.input_hist_raw = InputList(['\n'])
355
355
356 # list of visited directories
356 # list of visited directories
357 try:
357 try:
358 self.dir_hist = [os.getcwd()]
358 self.dir_hist = [os.getcwd()]
359 except OSError:
359 except OSError:
360 self.dir_hist = []
360 self.dir_hist = []
361
361
362 # dict of output history
362 # dict of output history
363 self.output_hist = {}
363 self.output_hist = {}
364
364
365 # Get system encoding at startup time. Certain terminals (like Emacs
365 # Get system encoding at startup time. Certain terminals (like Emacs
366 # under Win32 have it set to None, and we need to have a known valid
366 # under Win32 have it set to None, and we need to have a known valid
367 # encoding to use in the raw_input() method
367 # encoding to use in the raw_input() method
368 self.stdin_encoding = sys.stdin.encoding or 'ascii'
368 self.stdin_encoding = sys.stdin.encoding or 'ascii'
369
369
370 # dict of things NOT to alias (keywords, builtins and some magics)
370 # dict of things NOT to alias (keywords, builtins and some magics)
371 no_alias = {}
371 no_alias = {}
372 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
372 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
373 for key in keyword.kwlist + no_alias_magics:
373 for key in keyword.kwlist + no_alias_magics:
374 no_alias[key] = 1
374 no_alias[key] = 1
375 no_alias.update(__builtin__.__dict__)
375 no_alias.update(__builtin__.__dict__)
376 self.no_alias = no_alias
376 self.no_alias = no_alias
377
377
378 # make global variables for user access to these
378 # make global variables for user access to these
379 self.user_ns['_ih'] = self.input_hist
379 self.user_ns['_ih'] = self.input_hist
380 self.user_ns['_oh'] = self.output_hist
380 self.user_ns['_oh'] = self.output_hist
381 self.user_ns['_dh'] = self.dir_hist
381 self.user_ns['_dh'] = self.dir_hist
382
382
383 # user aliases to input and output histories
383 # user aliases to input and output histories
384 self.user_ns['In'] = self.input_hist
384 self.user_ns['In'] = self.input_hist
385 self.user_ns['Out'] = self.output_hist
385 self.user_ns['Out'] = self.output_hist
386
386
387 self.user_ns['_sh'] = IPython.shadowns
387 self.user_ns['_sh'] = IPython.shadowns
388 # Object variable to store code object waiting execution. This is
388 # Object variable to store code object waiting execution. This is
389 # used mainly by the multithreaded shells, but it can come in handy in
389 # used mainly by the multithreaded shells, but it can come in handy in
390 # other situations. No need to use a Queue here, since it's a single
390 # other situations. No need to use a Queue here, since it's a single
391 # item which gets cleared once run.
391 # item which gets cleared once run.
392 self.code_to_run = None
392 self.code_to_run = None
393
393
394 # escapes for automatic behavior on the command line
394 # escapes for automatic behavior on the command line
395 self.ESC_SHELL = '!'
395 self.ESC_SHELL = '!'
396 self.ESC_SH_CAP = '!!'
396 self.ESC_SH_CAP = '!!'
397 self.ESC_HELP = '?'
397 self.ESC_HELP = '?'
398 self.ESC_MAGIC = '%'
398 self.ESC_MAGIC = '%'
399 self.ESC_QUOTE = ','
399 self.ESC_QUOTE = ','
400 self.ESC_QUOTE2 = ';'
400 self.ESC_QUOTE2 = ';'
401 self.ESC_PAREN = '/'
401 self.ESC_PAREN = '/'
402
402
403 # And their associated handlers
403 # And their associated handlers
404 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
404 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
405 self.ESC_QUOTE : self.handle_auto,
405 self.ESC_QUOTE : self.handle_auto,
406 self.ESC_QUOTE2 : self.handle_auto,
406 self.ESC_QUOTE2 : self.handle_auto,
407 self.ESC_MAGIC : self.handle_magic,
407 self.ESC_MAGIC : self.handle_magic,
408 self.ESC_HELP : self.handle_help,
408 self.ESC_HELP : self.handle_help,
409 self.ESC_SHELL : self.handle_shell_escape,
409 self.ESC_SHELL : self.handle_shell_escape,
410 self.ESC_SH_CAP : self.handle_shell_escape,
410 self.ESC_SH_CAP : self.handle_shell_escape,
411 }
411 }
412
412
413 # class initializations
413 # class initializations
414 Magic.__init__(self,self)
414 Magic.__init__(self,self)
415
415
416 # Python source parser/formatter for syntax highlighting
416 # Python source parser/formatter for syntax highlighting
417 pyformat = PyColorize.Parser().format
417 pyformat = PyColorize.Parser().format
418 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
418 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
419
419
420 # hooks holds pointers used for user-side customizations
420 # hooks holds pointers used for user-side customizations
421 self.hooks = Struct()
421 self.hooks = Struct()
422
422
423 self.strdispatchers = {}
423 self.strdispatchers = {}
424
424
425 # Set all default hooks, defined in the IPython.hooks module.
425 # Set all default hooks, defined in the IPython.hooks module.
426 hooks = IPython.hooks
426 hooks = IPython.hooks
427 for hook_name in hooks.__all__:
427 for hook_name in hooks.__all__:
428 # default hooks have priority 100, i.e. low; user hooks should have
428 # default hooks have priority 100, i.e. low; user hooks should have
429 # 0-100 priority
429 # 0-100 priority
430 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
430 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
431 #print "bound hook",hook_name
431 #print "bound hook",hook_name
432
432
433 # Flag to mark unconditional exit
433 # Flag to mark unconditional exit
434 self.exit_now = False
434 self.exit_now = False
435
435
436 self.usage_min = """\
436 self.usage_min = """\
437 An enhanced console for Python.
437 An enhanced console for Python.
438 Some of its features are:
438 Some of its features are:
439 - Readline support if the readline library is present.
439 - Readline support if the readline library is present.
440 - Tab completion in the local namespace.
440 - Tab completion in the local namespace.
441 - Logging of input, see command-line options.
441 - Logging of input, see command-line options.
442 - System shell escape via ! , eg !ls.
442 - System shell escape via ! , eg !ls.
443 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
443 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
444 - Keeps track of locally defined variables via %who, %whos.
444 - Keeps track of locally defined variables via %who, %whos.
445 - Show object information with a ? eg ?x or x? (use ?? for more info).
445 - Show object information with a ? eg ?x or x? (use ?? for more info).
446 """
446 """
447 if usage: self.usage = usage
447 if usage: self.usage = usage
448 else: self.usage = self.usage_min
448 else: self.usage = self.usage_min
449
449
450 # Storage
450 # Storage
451 self.rc = rc # This will hold all configuration information
451 self.rc = rc # This will hold all configuration information
452 self.pager = 'less'
452 self.pager = 'less'
453 # temporary files used for various purposes. Deleted at exit.
453 # temporary files used for various purposes. Deleted at exit.
454 self.tempfiles = []
454 self.tempfiles = []
455
455
456 # Keep track of readline usage (later set by init_readline)
456 # Keep track of readline usage (later set by init_readline)
457 self.has_readline = False
457 self.has_readline = False
458
458
459 # template for logfile headers. It gets resolved at runtime by the
459 # template for logfile headers. It gets resolved at runtime by the
460 # logstart method.
460 # logstart method.
461 self.loghead_tpl = \
461 self.loghead_tpl = \
462 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
462 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
463 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
463 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
464 #log# opts = %s
464 #log# opts = %s
465 #log# args = %s
465 #log# args = %s
466 #log# It is safe to make manual edits below here.
466 #log# It is safe to make manual edits below here.
467 #log#-----------------------------------------------------------------------
467 #log#-----------------------------------------------------------------------
468 """
468 """
469 # for pushd/popd management
469 # for pushd/popd management
470 try:
470 try:
471 self.home_dir = get_home_dir()
471 self.home_dir = get_home_dir()
472 except HomeDirError,msg:
472 except HomeDirError,msg:
473 fatal(msg)
473 fatal(msg)
474
474
475 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
475 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
476
476
477 # Functions to call the underlying shell.
477 # Functions to call the underlying shell.
478
478
479 # The first is similar to os.system, but it doesn't return a value,
479 # The first is similar to os.system, but it doesn't return a value,
480 # and it allows interpolation of variables in the user's namespace.
480 # and it allows interpolation of variables in the user's namespace.
481 self.system = lambda cmd: \
481 self.system = lambda cmd: \
482 shell(self.var_expand(cmd,depth=2),
482 shell(self.var_expand(cmd,depth=2),
483 header=self.rc.system_header,
483 header=self.rc.system_header,
484 verbose=self.rc.system_verbose)
484 verbose=self.rc.system_verbose)
485
485
486 # These are for getoutput and getoutputerror:
486 # These are for getoutput and getoutputerror:
487 self.getoutput = lambda cmd: \
487 self.getoutput = lambda cmd: \
488 getoutput(self.var_expand(cmd,depth=2),
488 getoutput(self.var_expand(cmd,depth=2),
489 header=self.rc.system_header,
489 header=self.rc.system_header,
490 verbose=self.rc.system_verbose)
490 verbose=self.rc.system_verbose)
491
491
492 self.getoutputerror = lambda cmd: \
492 self.getoutputerror = lambda cmd: \
493 getoutputerror(self.var_expand(cmd,depth=2),
493 getoutputerror(self.var_expand(cmd,depth=2),
494 header=self.rc.system_header,
494 header=self.rc.system_header,
495 verbose=self.rc.system_verbose)
495 verbose=self.rc.system_verbose)
496
496
497
497
498 # keep track of where we started running (mainly for crash post-mortem)
498 # keep track of where we started running (mainly for crash post-mortem)
499 self.starting_dir = os.getcwd()
499 self.starting_dir = os.getcwd()
500
500
501 # Various switches which can be set
501 # Various switches which can be set
502 self.CACHELENGTH = 5000 # this is cheap, it's just text
502 self.CACHELENGTH = 5000 # this is cheap, it's just text
503 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
503 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
504 self.banner2 = banner2
504 self.banner2 = banner2
505
505
506 # TraceBack handlers:
506 # TraceBack handlers:
507
507
508 # Syntax error handler.
508 # Syntax error handler.
509 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
509 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
510
510
511 # The interactive one is initialized with an offset, meaning we always
511 # The interactive one is initialized with an offset, meaning we always
512 # want to remove the topmost item in the traceback, which is our own
512 # want to remove the topmost item in the traceback, which is our own
513 # internal code. Valid modes: ['Plain','Context','Verbose']
513 # internal code. Valid modes: ['Plain','Context','Verbose']
514 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
514 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
515 color_scheme='NoColor',
515 color_scheme='NoColor',
516 tb_offset = 1)
516 tb_offset = 1)
517
517
518 # IPython itself shouldn't crash. This will produce a detailed
518 # IPython itself shouldn't crash. This will produce a detailed
519 # post-mortem if it does. But we only install the crash handler for
519 # post-mortem if it does. But we only install the crash handler for
520 # non-threaded shells, the threaded ones use a normal verbose reporter
520 # non-threaded shells, the threaded ones use a normal verbose reporter
521 # and lose the crash handler. This is because exceptions in the main
521 # and lose the crash handler. This is because exceptions in the main
522 # thread (such as in GUI code) propagate directly to sys.excepthook,
522 # thread (such as in GUI code) propagate directly to sys.excepthook,
523 # and there's no point in printing crash dumps for every user exception.
523 # and there's no point in printing crash dumps for every user exception.
524 if self.isthreaded:
524 if self.isthreaded:
525 ipCrashHandler = ultraTB.FormattedTB()
525 ipCrashHandler = ultraTB.FormattedTB()
526 else:
526 else:
527 from IPython import CrashHandler
527 from IPython import CrashHandler
528 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
528 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
529 self.set_crash_handler(ipCrashHandler)
529 self.set_crash_handler(ipCrashHandler)
530
530
531 # and add any custom exception handlers the user may have specified
531 # and add any custom exception handlers the user may have specified
532 self.set_custom_exc(*custom_exceptions)
532 self.set_custom_exc(*custom_exceptions)
533
533
534 # indentation management
534 # indentation management
535 self.autoindent = False
535 self.autoindent = False
536 self.indent_current_nsp = 0
536 self.indent_current_nsp = 0
537
537
538 # Make some aliases automatically
538 # Make some aliases automatically
539 # Prepare list of shell aliases to auto-define
539 # Prepare list of shell aliases to auto-define
540 if os.name == 'posix':
540 if os.name == 'posix':
541 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
541 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
542 'mv mv -i','rm rm -i','cp cp -i',
542 'mv mv -i','rm rm -i','cp cp -i',
543 'cat cat','less less','clear clear',
543 'cat cat','less less','clear clear',
544 # a better ls
544 # a better ls
545 'ls ls -F',
545 'ls ls -F',
546 # long ls
546 # long ls
547 'll ls -lF')
547 'll ls -lF')
548 # Extra ls aliases with color, which need special treatment on BSD
548 # Extra ls aliases with color, which need special treatment on BSD
549 # variants
549 # variants
550 ls_extra = ( # color ls
550 ls_extra = ( # color ls
551 'lc ls -F -o --color',
551 'lc ls -F -o --color',
552 # ls normal files only
552 # ls normal files only
553 'lf ls -F -o --color %l | grep ^-',
553 'lf ls -F -o --color %l | grep ^-',
554 # ls symbolic links
554 # ls symbolic links
555 'lk ls -F -o --color %l | grep ^l',
555 'lk ls -F -o --color %l | grep ^l',
556 # directories or links to directories,
556 # directories or links to directories,
557 'ldir ls -F -o --color %l | grep /$',
557 'ldir ls -F -o --color %l | grep /$',
558 # things which are executable
558 # things which are executable
559 'lx ls -F -o --color %l | grep ^-..x',
559 'lx ls -F -o --color %l | grep ^-..x',
560 )
560 )
561 # The BSDs don't ship GNU ls, so they don't understand the
561 # The BSDs don't ship GNU ls, so they don't understand the
562 # --color switch out of the box
562 # --color switch out of the box
563 if 'bsd' in sys.platform:
563 if 'bsd' in sys.platform:
564 ls_extra = ( # ls normal files only
564 ls_extra = ( # ls normal files only
565 'lf ls -lF | grep ^-',
565 'lf ls -lF | grep ^-',
566 # ls symbolic links
566 # ls symbolic links
567 'lk ls -lF | grep ^l',
567 'lk ls -lF | grep ^l',
568 # directories or links to directories,
568 # directories or links to directories,
569 'ldir ls -lF | grep /$',
569 'ldir ls -lF | grep /$',
570 # things which are executable
570 # things which are executable
571 'lx ls -lF | grep ^-..x',
571 'lx ls -lF | grep ^-..x',
572 )
572 )
573 auto_alias = auto_alias + ls_extra
573 auto_alias = auto_alias + ls_extra
574 elif os.name in ['nt','dos']:
574 elif os.name in ['nt','dos']:
575 auto_alias = ('dir dir /on', 'ls dir /on',
575 auto_alias = ('dir dir /on', 'ls dir /on',
576 'ddir dir /ad /on', 'ldir dir /ad /on',
576 'ddir dir /ad /on', 'ldir dir /ad /on',
577 'mkdir mkdir','rmdir rmdir','echo echo',
577 'mkdir mkdir','rmdir rmdir','echo echo',
578 'ren ren','cls cls','copy copy')
578 'ren ren','cls cls','copy copy')
579 else:
579 else:
580 auto_alias = ()
580 auto_alias = ()
581 self.auto_alias = [s.split(None,1) for s in auto_alias]
581 self.auto_alias = [s.split(None,1) for s in auto_alias]
582
582
583 # Produce a public API instance
583 # Produce a public API instance
584 self.api = IPython.ipapi.IPApi(self)
584 self.api = IPython.ipapi.IPApi(self)
585
585
586 # Call the actual (public) initializer
586 # Call the actual (public) initializer
587 self.init_auto_alias()
587 self.init_auto_alias()
588
588
589 # track which builtins we add, so we can clean up later
589 # track which builtins we add, so we can clean up later
590 self.builtins_added = {}
590 self.builtins_added = {}
591 # This method will add the necessary builtins for operation, but
591 # This method will add the necessary builtins for operation, but
592 # tracking what it did via the builtins_added dict.
592 # tracking what it did via the builtins_added dict.
593 self.add_builtins()
593 self.add_builtins()
594
594
595 # end __init__
595 # end __init__
596
596
597 def var_expand(self,cmd,depth=0):
597 def var_expand(self,cmd,depth=0):
598 """Expand python variables in a string.
598 """Expand python variables in a string.
599
599
600 The depth argument indicates how many frames above the caller should
600 The depth argument indicates how many frames above the caller should
601 be walked to look for the local namespace where to expand variables.
601 be walked to look for the local namespace where to expand variables.
602
602
603 The global namespace for expansion is always the user's interactive
603 The global namespace for expansion is always the user's interactive
604 namespace.
604 namespace.
605 """
605 """
606
606
607 return str(ItplNS(cmd.replace('#','\#'),
607 return str(ItplNS(cmd.replace('#','\#'),
608 self.user_ns, # globals
608 self.user_ns, # globals
609 # Skip our own frame in searching for locals:
609 # Skip our own frame in searching for locals:
610 sys._getframe(depth+1).f_locals # locals
610 sys._getframe(depth+1).f_locals # locals
611 ))
611 ))
612
612
613 def pre_config_initialization(self):
613 def pre_config_initialization(self):
614 """Pre-configuration init method
614 """Pre-configuration init method
615
615
616 This is called before the configuration files are processed to
616 This is called before the configuration files are processed to
617 prepare the services the config files might need.
617 prepare the services the config files might need.
618
618
619 self.rc already has reasonable default values at this point.
619 self.rc already has reasonable default values at this point.
620 """
620 """
621 rc = self.rc
621 rc = self.rc
622 try:
622 try:
623 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
623 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
624 except exceptions.UnicodeDecodeError:
624 except exceptions.UnicodeDecodeError:
625 print "Your ipythondir can't be decoded to unicode!"
625 print "Your ipythondir can't be decoded to unicode!"
626 print "Please set HOME environment variable to something that"
626 print "Please set HOME environment variable to something that"
627 print r"only has ASCII characters, e.g. c:\home"
627 print r"only has ASCII characters, e.g. c:\home"
628 print "Now it is",rc.ipythondir
628 print "Now it is",rc.ipythondir
629 sys.exit()
629 sys.exit()
630 self.shadowhist = IPython.history.ShadowHist(self.db)
630 self.shadowhist = IPython.history.ShadowHist(self.db)
631
631
632
632
633 def post_config_initialization(self):
633 def post_config_initialization(self):
634 """Post configuration init method
634 """Post configuration init method
635
635
636 This is called after the configuration files have been processed to
636 This is called after the configuration files have been processed to
637 'finalize' the initialization."""
637 'finalize' the initialization."""
638
638
639 rc = self.rc
639 rc = self.rc
640
640
641 # Object inspector
641 # Object inspector
642 self.inspector = OInspect.Inspector(OInspect.InspectColors,
642 self.inspector = OInspect.Inspector(OInspect.InspectColors,
643 PyColorize.ANSICodeColors,
643 PyColorize.ANSICodeColors,
644 'NoColor',
644 'NoColor',
645 rc.object_info_string_level)
645 rc.object_info_string_level)
646
646
647 self.rl_next_input = None
647 self.rl_next_input = None
648 self.rl_do_indent = False
648 self.rl_do_indent = False
649 # Load readline proper
649 # Load readline proper
650 if rc.readline:
650 if rc.readline:
651 self.init_readline()
651 self.init_readline()
652
652
653
653
654 # local shortcut, this is used a LOT
654 # local shortcut, this is used a LOT
655 self.log = self.logger.log
655 self.log = self.logger.log
656
656
657 # Initialize cache, set in/out prompts and printing system
657 # Initialize cache, set in/out prompts and printing system
658 self.outputcache = CachedOutput(self,
658 self.outputcache = CachedOutput(self,
659 rc.cache_size,
659 rc.cache_size,
660 rc.pprint,
660 rc.pprint,
661 input_sep = rc.separate_in,
661 input_sep = rc.separate_in,
662 output_sep = rc.separate_out,
662 output_sep = rc.separate_out,
663 output_sep2 = rc.separate_out2,
663 output_sep2 = rc.separate_out2,
664 ps1 = rc.prompt_in1,
664 ps1 = rc.prompt_in1,
665 ps2 = rc.prompt_in2,
665 ps2 = rc.prompt_in2,
666 ps_out = rc.prompt_out,
666 ps_out = rc.prompt_out,
667 pad_left = rc.prompts_pad_left)
667 pad_left = rc.prompts_pad_left)
668
668
669 # user may have over-ridden the default print hook:
669 # user may have over-ridden the default print hook:
670 try:
670 try:
671 self.outputcache.__class__.display = self.hooks.display
671 self.outputcache.__class__.display = self.hooks.display
672 except AttributeError:
672 except AttributeError:
673 pass
673 pass
674
674
675 # I don't like assigning globally to sys, because it means when
675 # I don't like assigning globally to sys, because it means when
676 # embedding instances, each embedded instance overrides the previous
676 # embedding instances, each embedded instance overrides the previous
677 # choice. But sys.displayhook seems to be called internally by exec,
677 # choice. But sys.displayhook seems to be called internally by exec,
678 # so I don't see a way around it. We first save the original and then
678 # so I don't see a way around it. We first save the original and then
679 # overwrite it.
679 # overwrite it.
680 self.sys_displayhook = sys.displayhook
680 self.sys_displayhook = sys.displayhook
681 sys.displayhook = self.outputcache
681 sys.displayhook = self.outputcache
682
682
683 # Monkeypatch doctest so that its core test runner method is protected
683 # Monkeypatch doctest so that its core test runner method is protected
684 # from IPython's modified displayhook. Doctest expects the default
684 # from IPython's modified displayhook. Doctest expects the default
685 # displayhook behavior deep down, so our modification breaks it
685 # displayhook behavior deep down, so our modification breaks it
686 # completely. For this reason, a hard monkeypatch seems like a
686 # completely. For this reason, a hard monkeypatch seems like a
687 # reasonable solution rather than asking users to manually use a
687 # reasonable solution rather than asking users to manually use a
688 # different doctest runner when under IPython.
688 # different doctest runner when under IPython.
689 doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run)
689 doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run)
690
690
691 # Set user colors (don't do it in the constructor above so that it
691 # Set user colors (don't do it in the constructor above so that it
692 # doesn't crash if colors option is invalid)
692 # doesn't crash if colors option is invalid)
693 self.magic_colors(rc.colors)
693 self.magic_colors(rc.colors)
694
694
695 # Set calling of pdb on exceptions
695 # Set calling of pdb on exceptions
696 self.call_pdb = rc.pdb
696 self.call_pdb = rc.pdb
697
697
698 # Load user aliases
698 # Load user aliases
699 for alias in rc.alias:
699 for alias in rc.alias:
700 self.magic_alias(alias)
700 self.magic_alias(alias)
701 self.hooks.late_startup_hook()
701 self.hooks.late_startup_hook()
702
702
703 batchrun = False
703 batchrun = False
704 for batchfile in [path(arg) for arg in self.rc.args
704 for batchfile in [path(arg) for arg in self.rc.args
705 if arg.lower().endswith('.ipy')]:
705 if arg.lower().endswith('.ipy')]:
706 if not batchfile.isfile():
706 if not batchfile.isfile():
707 print "No such batch file:", batchfile
707 print "No such batch file:", batchfile
708 continue
708 continue
709 self.api.runlines(batchfile.text())
709 self.api.runlines(batchfile.text())
710 batchrun = True
710 batchrun = True
711 if batchrun:
711 if batchrun:
712 self.exit_now = True
712 self.exit_now = True
713
713
714 def add_builtins(self):
714 def add_builtins(self):
715 """Store ipython references into the builtin namespace.
715 """Store ipython references into the builtin namespace.
716
716
717 Some parts of ipython operate via builtins injected here, which hold a
717 Some parts of ipython operate via builtins injected here, which hold a
718 reference to IPython itself."""
718 reference to IPython itself."""
719
719
720 # TODO: deprecate all except _ip; 'jobs' should be installed
720 # TODO: deprecate all except _ip; 'jobs' should be installed
721 # by an extension and the rest are under _ip, ipalias is redundant
721 # by an extension and the rest are under _ip, ipalias is redundant
722 builtins_new = dict(__IPYTHON__ = self,
722 builtins_new = dict(__IPYTHON__ = self,
723 ip_set_hook = self.set_hook,
723 ip_set_hook = self.set_hook,
724 jobs = self.jobs,
724 jobs = self.jobs,
725 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
725 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
726 ipalias = wrap_deprecated(self.ipalias),
726 ipalias = wrap_deprecated(self.ipalias),
727 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
727 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
728 _ip = self.api
728 _ip = self.api
729 )
729 )
730 for biname,bival in builtins_new.items():
730 for biname,bival in builtins_new.items():
731 try:
731 try:
732 # store the orignal value so we can restore it
732 # store the orignal value so we can restore it
733 self.builtins_added[biname] = __builtin__.__dict__[biname]
733 self.builtins_added[biname] = __builtin__.__dict__[biname]
734 except KeyError:
734 except KeyError:
735 # or mark that it wasn't defined, and we'll just delete it at
735 # or mark that it wasn't defined, and we'll just delete it at
736 # cleanup
736 # cleanup
737 self.builtins_added[biname] = Undefined
737 self.builtins_added[biname] = Undefined
738 __builtin__.__dict__[biname] = bival
738 __builtin__.__dict__[biname] = bival
739
739
740 # Keep in the builtins a flag for when IPython is active. We set it
740 # Keep in the builtins a flag for when IPython is active. We set it
741 # with setdefault so that multiple nested IPythons don't clobber one
741 # with setdefault so that multiple nested IPythons don't clobber one
742 # another. Each will increase its value by one upon being activated,
742 # another. Each will increase its value by one upon being activated,
743 # which also gives us a way to determine the nesting level.
743 # which also gives us a way to determine the nesting level.
744 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
744 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
745
745
746 def clean_builtins(self):
746 def clean_builtins(self):
747 """Remove any builtins which might have been added by add_builtins, or
747 """Remove any builtins which might have been added by add_builtins, or
748 restore overwritten ones to their previous values."""
748 restore overwritten ones to their previous values."""
749 for biname,bival in self.builtins_added.items():
749 for biname,bival in self.builtins_added.items():
750 if bival is Undefined:
750 if bival is Undefined:
751 del __builtin__.__dict__[biname]
751 del __builtin__.__dict__[biname]
752 else:
752 else:
753 __builtin__.__dict__[biname] = bival
753 __builtin__.__dict__[biname] = bival
754 self.builtins_added.clear()
754 self.builtins_added.clear()
755
755
756 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
756 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
757 """set_hook(name,hook) -> sets an internal IPython hook.
757 """set_hook(name,hook) -> sets an internal IPython hook.
758
758
759 IPython exposes some of its internal API as user-modifiable hooks. By
759 IPython exposes some of its internal API as user-modifiable hooks. By
760 adding your function to one of these hooks, you can modify IPython's
760 adding your function to one of these hooks, you can modify IPython's
761 behavior to call at runtime your own routines."""
761 behavior to call at runtime your own routines."""
762
762
763 # At some point in the future, this should validate the hook before it
763 # At some point in the future, this should validate the hook before it
764 # accepts it. Probably at least check that the hook takes the number
764 # accepts it. Probably at least check that the hook takes the number
765 # of args it's supposed to.
765 # of args it's supposed to.
766
766
767 f = new.instancemethod(hook,self,self.__class__)
767 f = new.instancemethod(hook,self,self.__class__)
768
768
769 # check if the hook is for strdispatcher first
769 # check if the hook is for strdispatcher first
770 if str_key is not None:
770 if str_key is not None:
771 sdp = self.strdispatchers.get(name, StrDispatch())
771 sdp = self.strdispatchers.get(name, StrDispatch())
772 sdp.add_s(str_key, f, priority )
772 sdp.add_s(str_key, f, priority )
773 self.strdispatchers[name] = sdp
773 self.strdispatchers[name] = sdp
774 return
774 return
775 if re_key is not None:
775 if re_key is not None:
776 sdp = self.strdispatchers.get(name, StrDispatch())
776 sdp = self.strdispatchers.get(name, StrDispatch())
777 sdp.add_re(re.compile(re_key), f, priority )
777 sdp.add_re(re.compile(re_key), f, priority )
778 self.strdispatchers[name] = sdp
778 self.strdispatchers[name] = sdp
779 return
779 return
780
780
781 dp = getattr(self.hooks, name, None)
781 dp = getattr(self.hooks, name, None)
782 if name not in IPython.hooks.__all__:
782 if name not in IPython.hooks.__all__:
783 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
783 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
784 if not dp:
784 if not dp:
785 dp = IPython.hooks.CommandChainDispatcher()
785 dp = IPython.hooks.CommandChainDispatcher()
786
786
787 try:
787 try:
788 dp.add(f,priority)
788 dp.add(f,priority)
789 except AttributeError:
789 except AttributeError:
790 # it was not commandchain, plain old func - replace
790 # it was not commandchain, plain old func - replace
791 dp = f
791 dp = f
792
792
793 setattr(self.hooks,name, dp)
793 setattr(self.hooks,name, dp)
794
794
795
795
796 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
796 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
797
797
798 def set_crash_handler(self,crashHandler):
798 def set_crash_handler(self,crashHandler):
799 """Set the IPython crash handler.
799 """Set the IPython crash handler.
800
800
801 This must be a callable with a signature suitable for use as
801 This must be a callable with a signature suitable for use as
802 sys.excepthook."""
802 sys.excepthook."""
803
803
804 # Install the given crash handler as the Python exception hook
804 # Install the given crash handler as the Python exception hook
805 sys.excepthook = crashHandler
805 sys.excepthook = crashHandler
806
806
807 # The instance will store a pointer to this, so that runtime code
807 # The instance will store a pointer to this, so that runtime code
808 # (such as magics) can access it. This is because during the
808 # (such as magics) can access it. This is because during the
809 # read-eval loop, it gets temporarily overwritten (to deal with GUI
809 # read-eval loop, it gets temporarily overwritten (to deal with GUI
810 # frameworks).
810 # frameworks).
811 self.sys_excepthook = sys.excepthook
811 self.sys_excepthook = sys.excepthook
812
812
813
813
814 def set_custom_exc(self,exc_tuple,handler):
814 def set_custom_exc(self,exc_tuple,handler):
815 """set_custom_exc(exc_tuple,handler)
815 """set_custom_exc(exc_tuple,handler)
816
816
817 Set a custom exception handler, which will be called if any of the
817 Set a custom exception handler, which will be called if any of the
818 exceptions in exc_tuple occur in the mainloop (specifically, in the
818 exceptions in exc_tuple occur in the mainloop (specifically, in the
819 runcode() method.
819 runcode() method.
820
820
821 Inputs:
821 Inputs:
822
822
823 - exc_tuple: a *tuple* of valid exceptions to call the defined
823 - exc_tuple: a *tuple* of valid exceptions to call the defined
824 handler for. It is very important that you use a tuple, and NOT A
824 handler for. It is very important that you use a tuple, and NOT A
825 LIST here, because of the way Python's except statement works. If
825 LIST here, because of the way Python's except statement works. If
826 you only want to trap a single exception, use a singleton tuple:
826 you only want to trap a single exception, use a singleton tuple:
827
827
828 exc_tuple == (MyCustomException,)
828 exc_tuple == (MyCustomException,)
829
829
830 - handler: this must be defined as a function with the following
830 - handler: this must be defined as a function with the following
831 basic interface: def my_handler(self,etype,value,tb).
831 basic interface: def my_handler(self,etype,value,tb).
832
832
833 This will be made into an instance method (via new.instancemethod)
833 This will be made into an instance method (via new.instancemethod)
834 of IPython itself, and it will be called if any of the exceptions
834 of IPython itself, and it will be called if any of the exceptions
835 listed in the exc_tuple are caught. If the handler is None, an
835 listed in the exc_tuple are caught. If the handler is None, an
836 internal basic one is used, which just prints basic info.
836 internal basic one is used, which just prints basic info.
837
837
838 WARNING: by putting in your own exception handler into IPython's main
838 WARNING: by putting in your own exception handler into IPython's main
839 execution loop, you run a very good chance of nasty crashes. This
839 execution loop, you run a very good chance of nasty crashes. This
840 facility should only be used if you really know what you are doing."""
840 facility should only be used if you really know what you are doing."""
841
841
842 assert type(exc_tuple)==type(()) , \
842 assert type(exc_tuple)==type(()) , \
843 "The custom exceptions must be given AS A TUPLE."
843 "The custom exceptions must be given AS A TUPLE."
844
844
845 def dummy_handler(self,etype,value,tb):
845 def dummy_handler(self,etype,value,tb):
846 print '*** Simple custom exception handler ***'
846 print '*** Simple custom exception handler ***'
847 print 'Exception type :',etype
847 print 'Exception type :',etype
848 print 'Exception value:',value
848 print 'Exception value:',value
849 print 'Traceback :',tb
849 print 'Traceback :',tb
850 print 'Source code :','\n'.join(self.buffer)
850 print 'Source code :','\n'.join(self.buffer)
851
851
852 if handler is None: handler = dummy_handler
852 if handler is None: handler = dummy_handler
853
853
854 self.CustomTB = new.instancemethod(handler,self,self.__class__)
854 self.CustomTB = new.instancemethod(handler,self,self.__class__)
855 self.custom_exceptions = exc_tuple
855 self.custom_exceptions = exc_tuple
856
856
857 def set_custom_completer(self,completer,pos=0):
857 def set_custom_completer(self,completer,pos=0):
858 """set_custom_completer(completer,pos=0)
858 """set_custom_completer(completer,pos=0)
859
859
860 Adds a new custom completer function.
860 Adds a new custom completer function.
861
861
862 The position argument (defaults to 0) is the index in the completers
862 The position argument (defaults to 0) is the index in the completers
863 list where you want the completer to be inserted."""
863 list where you want the completer to be inserted."""
864
864
865 newcomp = new.instancemethod(completer,self.Completer,
865 newcomp = new.instancemethod(completer,self.Completer,
866 self.Completer.__class__)
866 self.Completer.__class__)
867 self.Completer.matchers.insert(pos,newcomp)
867 self.Completer.matchers.insert(pos,newcomp)
868
868
869 def set_completer(self):
869 def set_completer(self):
870 """reset readline's completer to be our own."""
870 """reset readline's completer to be our own."""
871 self.readline.set_completer(self.Completer.complete)
871 self.readline.set_completer(self.Completer.complete)
872
872
873 def _get_call_pdb(self):
873 def _get_call_pdb(self):
874 return self._call_pdb
874 return self._call_pdb
875
875
876 def _set_call_pdb(self,val):
876 def _set_call_pdb(self,val):
877
877
878 if val not in (0,1,False,True):
878 if val not in (0,1,False,True):
879 raise ValueError,'new call_pdb value must be boolean'
879 raise ValueError,'new call_pdb value must be boolean'
880
880
881 # store value in instance
881 # store value in instance
882 self._call_pdb = val
882 self._call_pdb = val
883
883
884 # notify the actual exception handlers
884 # notify the actual exception handlers
885 self.InteractiveTB.call_pdb = val
885 self.InteractiveTB.call_pdb = val
886 if self.isthreaded:
886 if self.isthreaded:
887 try:
887 try:
888 self.sys_excepthook.call_pdb = val
888 self.sys_excepthook.call_pdb = val
889 except:
889 except:
890 warn('Failed to activate pdb for threaded exception handler')
890 warn('Failed to activate pdb for threaded exception handler')
891
891
892 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
892 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
893 'Control auto-activation of pdb at exceptions')
893 'Control auto-activation of pdb at exceptions')
894
894
895
895
896 # These special functions get installed in the builtin namespace, to
896 # These special functions get installed in the builtin namespace, to
897 # provide programmatic (pure python) access to magics, aliases and system
897 # provide programmatic (pure python) access to magics, aliases and system
898 # calls. This is important for logging, user scripting, and more.
898 # calls. This is important for logging, user scripting, and more.
899
899
900 # We are basically exposing, via normal python functions, the three
900 # We are basically exposing, via normal python functions, the three
901 # mechanisms in which ipython offers special call modes (magics for
901 # mechanisms in which ipython offers special call modes (magics for
902 # internal control, aliases for direct system access via pre-selected
902 # internal control, aliases for direct system access via pre-selected
903 # names, and !cmd for calling arbitrary system commands).
903 # names, and !cmd for calling arbitrary system commands).
904
904
905 def ipmagic(self,arg_s):
905 def ipmagic(self,arg_s):
906 """Call a magic function by name.
906 """Call a magic function by name.
907
907
908 Input: a string containing the name of the magic function to call and any
908 Input: a string containing the name of the magic function to call and any
909 additional arguments to be passed to the magic.
909 additional arguments to be passed to the magic.
910
910
911 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
911 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
912 prompt:
912 prompt:
913
913
914 In[1]: %name -opt foo bar
914 In[1]: %name -opt foo bar
915
915
916 To call a magic without arguments, simply use ipmagic('name').
916 To call a magic without arguments, simply use ipmagic('name').
917
917
918 This provides a proper Python function to call IPython's magics in any
918 This provides a proper Python function to call IPython's magics in any
919 valid Python code you can type at the interpreter, including loops and
919 valid Python code you can type at the interpreter, including loops and
920 compound statements. It is added by IPython to the Python builtin
920 compound statements. It is added by IPython to the Python builtin
921 namespace upon initialization."""
921 namespace upon initialization."""
922
922
923 args = arg_s.split(' ',1)
923 args = arg_s.split(' ',1)
924 magic_name = args[0]
924 magic_name = args[0]
925 magic_name = magic_name.lstrip(self.ESC_MAGIC)
925 magic_name = magic_name.lstrip(self.ESC_MAGIC)
926
926
927 try:
927 try:
928 magic_args = args[1]
928 magic_args = args[1]
929 except IndexError:
929 except IndexError:
930 magic_args = ''
930 magic_args = ''
931 fn = getattr(self,'magic_'+magic_name,None)
931 fn = getattr(self,'magic_'+magic_name,None)
932 if fn is None:
932 if fn is None:
933 error("Magic function `%s` not found." % magic_name)
933 error("Magic function `%s` not found." % magic_name)
934 else:
934 else:
935 magic_args = self.var_expand(magic_args,1)
935 magic_args = self.var_expand(magic_args,1)
936 return fn(magic_args)
936 return fn(magic_args)
937
937
938 def ipalias(self,arg_s):
938 def ipalias(self,arg_s):
939 """Call an alias by name.
939 """Call an alias by name.
940
940
941 Input: a string containing the name of the alias to call and any
941 Input: a string containing the name of the alias to call and any
942 additional arguments to be passed to the magic.
942 additional arguments to be passed to the magic.
943
943
944 ipalias('name -opt foo bar') is equivalent to typing at the ipython
944 ipalias('name -opt foo bar') is equivalent to typing at the ipython
945 prompt:
945 prompt:
946
946
947 In[1]: name -opt foo bar
947 In[1]: name -opt foo bar
948
948
949 To call an alias without arguments, simply use ipalias('name').
949 To call an alias without arguments, simply use ipalias('name').
950
950
951 This provides a proper Python function to call IPython's aliases in any
951 This provides a proper Python function to call IPython's aliases in any
952 valid Python code you can type at the interpreter, including loops and
952 valid Python code you can type at the interpreter, including loops and
953 compound statements. It is added by IPython to the Python builtin
953 compound statements. It is added by IPython to the Python builtin
954 namespace upon initialization."""
954 namespace upon initialization."""
955
955
956 args = arg_s.split(' ',1)
956 args = arg_s.split(' ',1)
957 alias_name = args[0]
957 alias_name = args[0]
958 try:
958 try:
959 alias_args = args[1]
959 alias_args = args[1]
960 except IndexError:
960 except IndexError:
961 alias_args = ''
961 alias_args = ''
962 if alias_name in self.alias_table:
962 if alias_name in self.alias_table:
963 self.call_alias(alias_name,alias_args)
963 self.call_alias(alias_name,alias_args)
964 else:
964 else:
965 error("Alias `%s` not found." % alias_name)
965 error("Alias `%s` not found." % alias_name)
966
966
967 def ipsystem(self,arg_s):
967 def ipsystem(self,arg_s):
968 """Make a system call, using IPython."""
968 """Make a system call, using IPython."""
969
969
970 self.system(arg_s)
970 self.system(arg_s)
971
971
972 def complete(self,text):
972 def complete(self,text):
973 """Return a sorted list of all possible completions on text.
973 """Return a sorted list of all possible completions on text.
974
974
975 Inputs:
975 Inputs:
976
976
977 - text: a string of text to be completed on.
977 - text: a string of text to be completed on.
978
978
979 This is a wrapper around the completion mechanism, similar to what
979 This is a wrapper around the completion mechanism, similar to what
980 readline does at the command line when the TAB key is hit. By
980 readline does at the command line when the TAB key is hit. By
981 exposing it as a method, it can be used by other non-readline
981 exposing it as a method, it can be used by other non-readline
982 environments (such as GUIs) for text completion.
982 environments (such as GUIs) for text completion.
983
983
984 Simple usage example:
984 Simple usage example:
985
985
986 In [1]: x = 'hello'
986 In [1]: x = 'hello'
987
987
988 In [2]: __IP.complete('x.l')
988 In [2]: __IP.complete('x.l')
989 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
989 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
990
990
991 complete = self.Completer.complete
991 complete = self.Completer.complete
992 state = 0
992 state = 0
993 # use a dict so we get unique keys, since ipyhton's multiple
993 # use a dict so we get unique keys, since ipyhton's multiple
994 # completers can return duplicates. When we make 2.4 a requirement,
994 # completers can return duplicates. When we make 2.4 a requirement,
995 # start using sets instead, which are faster.
995 # start using sets instead, which are faster.
996 comps = {}
996 comps = {}
997 while True:
997 while True:
998 newcomp = complete(text,state,line_buffer=text)
998 newcomp = complete(text,state,line_buffer=text)
999 if newcomp is None:
999 if newcomp is None:
1000 break
1000 break
1001 comps[newcomp] = 1
1001 comps[newcomp] = 1
1002 state += 1
1002 state += 1
1003 outcomps = comps.keys()
1003 outcomps = comps.keys()
1004 outcomps.sort()
1004 outcomps.sort()
1005 return outcomps
1005 return outcomps
1006
1006
1007 def set_completer_frame(self, frame=None):
1007 def set_completer_frame(self, frame=None):
1008 if frame:
1008 if frame:
1009 self.Completer.namespace = frame.f_locals
1009 self.Completer.namespace = frame.f_locals
1010 self.Completer.global_namespace = frame.f_globals
1010 self.Completer.global_namespace = frame.f_globals
1011 else:
1011 else:
1012 self.Completer.namespace = self.user_ns
1012 self.Completer.namespace = self.user_ns
1013 self.Completer.global_namespace = self.user_global_ns
1013 self.Completer.global_namespace = self.user_global_ns
1014
1014
1015 def init_auto_alias(self):
1015 def init_auto_alias(self):
1016 """Define some aliases automatically.
1016 """Define some aliases automatically.
1017
1017
1018 These are ALL parameter-less aliases"""
1018 These are ALL parameter-less aliases"""
1019
1019
1020 for alias,cmd in self.auto_alias:
1020 for alias,cmd in self.auto_alias:
1021 self.getapi().defalias(alias,cmd)
1021 self.getapi().defalias(alias,cmd)
1022
1022
1023
1023
1024 def alias_table_validate(self,verbose=0):
1024 def alias_table_validate(self,verbose=0):
1025 """Update information about the alias table.
1025 """Update information about the alias table.
1026
1026
1027 In particular, make sure no Python keywords/builtins are in it."""
1027 In particular, make sure no Python keywords/builtins are in it."""
1028
1028
1029 no_alias = self.no_alias
1029 no_alias = self.no_alias
1030 for k in self.alias_table.keys():
1030 for k in self.alias_table.keys():
1031 if k in no_alias:
1031 if k in no_alias:
1032 del self.alias_table[k]
1032 del self.alias_table[k]
1033 if verbose:
1033 if verbose:
1034 print ("Deleting alias <%s>, it's a Python "
1034 print ("Deleting alias <%s>, it's a Python "
1035 "keyword or builtin." % k)
1035 "keyword or builtin." % k)
1036
1036
1037 def set_autoindent(self,value=None):
1037 def set_autoindent(self,value=None):
1038 """Set the autoindent flag, checking for readline support.
1038 """Set the autoindent flag, checking for readline support.
1039
1039
1040 If called with no arguments, it acts as a toggle."""
1040 If called with no arguments, it acts as a toggle."""
1041
1041
1042 if not self.has_readline:
1042 if not self.has_readline:
1043 if os.name == 'posix':
1043 if os.name == 'posix':
1044 warn("The auto-indent feature requires the readline library")
1044 warn("The auto-indent feature requires the readline library")
1045 self.autoindent = 0
1045 self.autoindent = 0
1046 return
1046 return
1047 if value is None:
1047 if value is None:
1048 self.autoindent = not self.autoindent
1048 self.autoindent = not self.autoindent
1049 else:
1049 else:
1050 self.autoindent = value
1050 self.autoindent = value
1051
1051
1052 def rc_set_toggle(self,rc_field,value=None):
1052 def rc_set_toggle(self,rc_field,value=None):
1053 """Set or toggle a field in IPython's rc config. structure.
1053 """Set or toggle a field in IPython's rc config. structure.
1054
1054
1055 If called with no arguments, it acts as a toggle.
1055 If called with no arguments, it acts as a toggle.
1056
1056
1057 If called with a non-existent field, the resulting AttributeError
1057 If called with a non-existent field, the resulting AttributeError
1058 exception will propagate out."""
1058 exception will propagate out."""
1059
1059
1060 rc_val = getattr(self.rc,rc_field)
1060 rc_val = getattr(self.rc,rc_field)
1061 if value is None:
1061 if value is None:
1062 value = not rc_val
1062 value = not rc_val
1063 setattr(self.rc,rc_field,value)
1063 setattr(self.rc,rc_field,value)
1064
1064
1065 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1065 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1066 """Install the user configuration directory.
1066 """Install the user configuration directory.
1067
1067
1068 Can be called when running for the first time or to upgrade the user's
1068 Can be called when running for the first time or to upgrade the user's
1069 .ipython/ directory with the mode parameter. Valid modes are 'install'
1069 .ipython/ directory with the mode parameter. Valid modes are 'install'
1070 and 'upgrade'."""
1070 and 'upgrade'."""
1071
1071
1072 def wait():
1072 def wait():
1073 try:
1073 try:
1074 raw_input("Please press <RETURN> to start IPython.")
1074 raw_input("Please press <RETURN> to start IPython.")
1075 except EOFError:
1075 except EOFError:
1076 print >> Term.cout
1076 print >> Term.cout
1077 print '*'*70
1077 print '*'*70
1078
1078
1079 cwd = os.getcwd() # remember where we started
1079 cwd = os.getcwd() # remember where we started
1080 glb = glob.glob
1080 glb = glob.glob
1081 print '*'*70
1081 print '*'*70
1082 if mode == 'install':
1082 if mode == 'install':
1083 print \
1083 print \
1084 """Welcome to IPython. I will try to create a personal configuration directory
1084 """Welcome to IPython. I will try to create a personal configuration directory
1085 where you can customize many aspects of IPython's functionality in:\n"""
1085 where you can customize many aspects of IPython's functionality in:\n"""
1086 else:
1086 else:
1087 print 'I am going to upgrade your configuration in:'
1087 print 'I am going to upgrade your configuration in:'
1088
1088
1089 print ipythondir
1089 print ipythondir
1090
1090
1091 rcdirend = os.path.join('IPython','UserConfig')
1091 rcdirend = os.path.join('IPython','UserConfig')
1092 cfg = lambda d: os.path.join(d,rcdirend)
1092 cfg = lambda d: os.path.join(d,rcdirend)
1093 try:
1093 try:
1094 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1094 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1095 except IOError:
1095 except IOError:
1096 warning = """
1096 warning = """
1097 Installation error. IPython's directory was not found.
1097 Installation error. IPython's directory was not found.
1098
1098
1099 Check the following:
1099 Check the following:
1100
1100
1101 The ipython/IPython directory should be in a directory belonging to your
1101 The ipython/IPython directory should be in a directory belonging to your
1102 PYTHONPATH environment variable (that is, it should be in a directory
1102 PYTHONPATH environment variable (that is, it should be in a directory
1103 belonging to sys.path). You can copy it explicitly there or just link to it.
1103 belonging to sys.path). You can copy it explicitly there or just link to it.
1104
1104
1105 IPython will proceed with builtin defaults.
1105 IPython will proceed with builtin defaults.
1106 """
1106 """
1107 warn(warning)
1107 warn(warning)
1108 wait()
1108 wait()
1109 return
1109 return
1110
1110
1111 if mode == 'install':
1111 if mode == 'install':
1112 try:
1112 try:
1113 shutil.copytree(rcdir,ipythondir)
1113 shutil.copytree(rcdir,ipythondir)
1114 os.chdir(ipythondir)
1114 os.chdir(ipythondir)
1115 rc_files = glb("ipythonrc*")
1115 rc_files = glb("ipythonrc*")
1116 for rc_file in rc_files:
1116 for rc_file in rc_files:
1117 os.rename(rc_file,rc_file+rc_suffix)
1117 os.rename(rc_file,rc_file+rc_suffix)
1118 except:
1118 except:
1119 warning = """
1119 warning = """
1120
1120
1121 There was a problem with the installation:
1121 There was a problem with the installation:
1122 %s
1122 %s
1123 Try to correct it or contact the developers if you think it's a bug.
1123 Try to correct it or contact the developers if you think it's a bug.
1124 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1124 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1125 warn(warning)
1125 warn(warning)
1126 wait()
1126 wait()
1127 return
1127 return
1128
1128
1129 elif mode == 'upgrade':
1129 elif mode == 'upgrade':
1130 try:
1130 try:
1131 os.chdir(ipythondir)
1131 os.chdir(ipythondir)
1132 except:
1132 except:
1133 print """
1133 print """
1134 Can not upgrade: changing to directory %s failed. Details:
1134 Can not upgrade: changing to directory %s failed. Details:
1135 %s
1135 %s
1136 """ % (ipythondir,sys.exc_info()[1])
1136 """ % (ipythondir,sys.exc_info()[1])
1137 wait()
1137 wait()
1138 return
1138 return
1139 else:
1139 else:
1140 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1140 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1141 for new_full_path in sources:
1141 for new_full_path in sources:
1142 new_filename = os.path.basename(new_full_path)
1142 new_filename = os.path.basename(new_full_path)
1143 if new_filename.startswith('ipythonrc'):
1143 if new_filename.startswith('ipythonrc'):
1144 new_filename = new_filename + rc_suffix
1144 new_filename = new_filename + rc_suffix
1145 # The config directory should only contain files, skip any
1145 # The config directory should only contain files, skip any
1146 # directories which may be there (like CVS)
1146 # directories which may be there (like CVS)
1147 if os.path.isdir(new_full_path):
1147 if os.path.isdir(new_full_path):
1148 continue
1148 continue
1149 if os.path.exists(new_filename):
1149 if os.path.exists(new_filename):
1150 old_file = new_filename+'.old'
1150 old_file = new_filename+'.old'
1151 if os.path.exists(old_file):
1151 if os.path.exists(old_file):
1152 os.remove(old_file)
1152 os.remove(old_file)
1153 os.rename(new_filename,old_file)
1153 os.rename(new_filename,old_file)
1154 shutil.copy(new_full_path,new_filename)
1154 shutil.copy(new_full_path,new_filename)
1155 else:
1155 else:
1156 raise ValueError,'unrecognized mode for install:',`mode`
1156 raise ValueError,'unrecognized mode for install:',`mode`
1157
1157
1158 # Fix line-endings to those native to each platform in the config
1158 # Fix line-endings to those native to each platform in the config
1159 # directory.
1159 # directory.
1160 try:
1160 try:
1161 os.chdir(ipythondir)
1161 os.chdir(ipythondir)
1162 except:
1162 except:
1163 print """
1163 print """
1164 Problem: changing to directory %s failed.
1164 Problem: changing to directory %s failed.
1165 Details:
1165 Details:
1166 %s
1166 %s
1167
1167
1168 Some configuration files may have incorrect line endings. This should not
1168 Some configuration files may have incorrect line endings. This should not
1169 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1169 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1170 wait()
1170 wait()
1171 else:
1171 else:
1172 for fname in glb('ipythonrc*'):
1172 for fname in glb('ipythonrc*'):
1173 try:
1173 try:
1174 native_line_ends(fname,backup=0)
1174 native_line_ends(fname,backup=0)
1175 except IOError:
1175 except IOError:
1176 pass
1176 pass
1177
1177
1178 if mode == 'install':
1178 if mode == 'install':
1179 print """
1179 print """
1180 Successful installation!
1180 Successful installation!
1181
1181
1182 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1182 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1183 IPython manual (there are both HTML and PDF versions supplied with the
1183 IPython manual (there are both HTML and PDF versions supplied with the
1184 distribution) to make sure that your system environment is properly configured
1184 distribution) to make sure that your system environment is properly configured
1185 to take advantage of IPython's features.
1185 to take advantage of IPython's features.
1186
1186
1187 Important note: the configuration system has changed! The old system is
1187 Important note: the configuration system has changed! The old system is
1188 still in place, but its setting may be partly overridden by the settings in
1188 still in place, but its setting may be partly overridden by the settings in
1189 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1189 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1190 if some of the new settings bother you.
1190 if some of the new settings bother you.
1191
1191
1192 """
1192 """
1193 else:
1193 else:
1194 print """
1194 print """
1195 Successful upgrade!
1195 Successful upgrade!
1196
1196
1197 All files in your directory:
1197 All files in your directory:
1198 %(ipythondir)s
1198 %(ipythondir)s
1199 which would have been overwritten by the upgrade were backed up with a .old
1199 which would have been overwritten by the upgrade were backed up with a .old
1200 extension. If you had made particular customizations in those files you may
1200 extension. If you had made particular customizations in those files you may
1201 want to merge them back into the new files.""" % locals()
1201 want to merge them back into the new files.""" % locals()
1202 wait()
1202 wait()
1203 os.chdir(cwd)
1203 os.chdir(cwd)
1204 # end user_setup()
1204 # end user_setup()
1205
1205
1206 def atexit_operations(self):
1206 def atexit_operations(self):
1207 """This will be executed at the time of exit.
1207 """This will be executed at the time of exit.
1208
1208
1209 Saving of persistent data should be performed here. """
1209 Saving of persistent data should be performed here. """
1210
1210
1211 #print '*** IPython exit cleanup ***' # dbg
1211 #print '*** IPython exit cleanup ***' # dbg
1212 # input history
1212 # input history
1213 self.savehist()
1213 self.savehist()
1214
1214
1215 # Cleanup all tempfiles left around
1215 # Cleanup all tempfiles left around
1216 for tfile in self.tempfiles:
1216 for tfile in self.tempfiles:
1217 try:
1217 try:
1218 os.unlink(tfile)
1218 os.unlink(tfile)
1219 except OSError:
1219 except OSError:
1220 pass
1220 pass
1221
1221
1222 self.hooks.shutdown_hook()
1222 self.hooks.shutdown_hook()
1223
1223
1224 def savehist(self):
1224 def savehist(self):
1225 """Save input history to a file (via readline library)."""
1225 """Save input history to a file (via readline library)."""
1226 try:
1226 try:
1227 self.readline.write_history_file(self.histfile)
1227 self.readline.write_history_file(self.histfile)
1228 except:
1228 except:
1229 print 'Unable to save IPython command history to file: ' + \
1229 print 'Unable to save IPython command history to file: ' + \
1230 `self.histfile`
1230 `self.histfile`
1231
1231
1232 def reloadhist(self):
1232 def reloadhist(self):
1233 """Reload the input history from disk file."""
1233 """Reload the input history from disk file."""
1234
1234
1235 if self.has_readline:
1235 if self.has_readline:
1236 self.readline.clear_history()
1236 self.readline.clear_history()
1237 self.readline.read_history_file(self.shell.histfile)
1237 self.readline.read_history_file(self.shell.histfile)
1238
1238
1239 def history_saving_wrapper(self, func):
1239 def history_saving_wrapper(self, func):
1240 """ Wrap func for readline history saving
1240 """ Wrap func for readline history saving
1241
1241
1242 Convert func into callable that saves & restores
1242 Convert func into callable that saves & restores
1243 history around the call """
1243 history around the call """
1244
1244
1245 if not self.has_readline:
1245 if not self.has_readline:
1246 return func
1246 return func
1247
1247
1248 def wrapper():
1248 def wrapper():
1249 self.savehist()
1249 self.savehist()
1250 try:
1250 try:
1251 func()
1251 func()
1252 finally:
1252 finally:
1253 readline.read_history_file(self.histfile)
1253 readline.read_history_file(self.histfile)
1254 return wrapper
1254 return wrapper
1255
1255
1256
1256
1257 def pre_readline(self):
1257 def pre_readline(self):
1258 """readline hook to be used at the start of each line.
1258 """readline hook to be used at the start of each line.
1259
1259
1260 Currently it handles auto-indent only."""
1260 Currently it handles auto-indent only."""
1261
1261
1262 #debugx('self.indent_current_nsp','pre_readline:')
1262 #debugx('self.indent_current_nsp','pre_readline:')
1263
1263
1264 if self.rl_do_indent:
1264 if self.rl_do_indent:
1265 self.readline.insert_text(self.indent_current_str())
1265 self.readline.insert_text(self.indent_current_str())
1266 if self.rl_next_input is not None:
1266 if self.rl_next_input is not None:
1267 self.readline.insert_text(self.rl_next_input)
1267 self.readline.insert_text(self.rl_next_input)
1268 self.rl_next_input = None
1268 self.rl_next_input = None
1269
1269
1270 def init_readline(self):
1270 def init_readline(self):
1271 """Command history completion/saving/reloading."""
1271 """Command history completion/saving/reloading."""
1272
1272
1273
1273
1274 import IPython.rlineimpl as readline
1274 import IPython.rlineimpl as readline
1275
1275
1276 if not readline.have_readline:
1276 if not readline.have_readline:
1277 self.has_readline = 0
1277 self.has_readline = 0
1278 self.readline = None
1278 self.readline = None
1279 # no point in bugging windows users with this every time:
1279 # no point in bugging windows users with this every time:
1280 warn('Readline services not available on this platform.')
1280 warn('Readline services not available on this platform.')
1281 else:
1281 else:
1282 sys.modules['readline'] = readline
1282 sys.modules['readline'] = readline
1283 import atexit
1283 import atexit
1284 from IPython.completer import IPCompleter
1284 from IPython.completer import IPCompleter
1285 self.Completer = IPCompleter(self,
1285 self.Completer = IPCompleter(self,
1286 self.user_ns,
1286 self.user_ns,
1287 self.user_global_ns,
1287 self.user_global_ns,
1288 self.rc.readline_omit__names,
1288 self.rc.readline_omit__names,
1289 self.alias_table)
1289 self.alias_table)
1290 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1290 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1291 self.strdispatchers['complete_command'] = sdisp
1291 self.strdispatchers['complete_command'] = sdisp
1292 self.Completer.custom_completers = sdisp
1292 self.Completer.custom_completers = sdisp
1293 # Platform-specific configuration
1293 # Platform-specific configuration
1294 if os.name == 'nt':
1294 if os.name == 'nt':
1295 self.readline_startup_hook = readline.set_pre_input_hook
1295 self.readline_startup_hook = readline.set_pre_input_hook
1296 else:
1296 else:
1297 self.readline_startup_hook = readline.set_startup_hook
1297 self.readline_startup_hook = readline.set_startup_hook
1298
1298
1299 # Load user's initrc file (readline config)
1299 # Load user's initrc file (readline config)
1300 inputrc_name = os.environ.get('INPUTRC')
1300 inputrc_name = os.environ.get('INPUTRC')
1301 if inputrc_name is None:
1301 if inputrc_name is None:
1302 home_dir = get_home_dir()
1302 home_dir = get_home_dir()
1303 if home_dir is not None:
1303 if home_dir is not None:
1304 inputrc_name = os.path.join(home_dir,'.inputrc')
1304 inputrc_name = os.path.join(home_dir,'.inputrc')
1305 if os.path.isfile(inputrc_name):
1305 if os.path.isfile(inputrc_name):
1306 try:
1306 try:
1307 readline.read_init_file(inputrc_name)
1307 readline.read_init_file(inputrc_name)
1308 except:
1308 except:
1309 warn('Problems reading readline initialization file <%s>'
1309 warn('Problems reading readline initialization file <%s>'
1310 % inputrc_name)
1310 % inputrc_name)
1311
1311
1312 self.has_readline = 1
1312 self.has_readline = 1
1313 self.readline = readline
1313 self.readline = readline
1314 # save this in sys so embedded copies can restore it properly
1314 # save this in sys so embedded copies can restore it properly
1315 sys.ipcompleter = self.Completer.complete
1315 sys.ipcompleter = self.Completer.complete
1316 self.set_completer()
1316 self.set_completer()
1317
1317
1318 # Configure readline according to user's prefs
1318 # Configure readline according to user's prefs
1319 for rlcommand in self.rc.readline_parse_and_bind:
1319 for rlcommand in self.rc.readline_parse_and_bind:
1320 readline.parse_and_bind(rlcommand)
1320 readline.parse_and_bind(rlcommand)
1321
1321
1322 # remove some chars from the delimiters list
1322 # remove some chars from the delimiters list
1323 delims = readline.get_completer_delims()
1323 delims = readline.get_completer_delims()
1324 delims = delims.translate(string._idmap,
1324 delims = delims.translate(string._idmap,
1325 self.rc.readline_remove_delims)
1325 self.rc.readline_remove_delims)
1326 readline.set_completer_delims(delims)
1326 readline.set_completer_delims(delims)
1327 # otherwise we end up with a monster history after a while:
1327 # otherwise we end up with a monster history after a while:
1328 readline.set_history_length(1000)
1328 readline.set_history_length(1000)
1329 try:
1329 try:
1330 #print '*** Reading readline history' # dbg
1330 #print '*** Reading readline history' # dbg
1331 readline.read_history_file(self.histfile)
1331 readline.read_history_file(self.histfile)
1332 except IOError:
1332 except IOError:
1333 pass # It doesn't exist yet.
1333 pass # It doesn't exist yet.
1334
1334
1335 atexit.register(self.atexit_operations)
1335 atexit.register(self.atexit_operations)
1336 del atexit
1336 del atexit
1337
1337
1338 # Configure auto-indent for all platforms
1338 # Configure auto-indent for all platforms
1339 self.set_autoindent(self.rc.autoindent)
1339 self.set_autoindent(self.rc.autoindent)
1340
1340
1341 def ask_yes_no(self,prompt,default=True):
1341 def ask_yes_no(self,prompt,default=True):
1342 if self.rc.quiet:
1342 if self.rc.quiet:
1343 return True
1343 return True
1344 return ask_yes_no(prompt,default)
1344 return ask_yes_no(prompt,default)
1345
1345
1346 def _should_recompile(self,e):
1346 def _should_recompile(self,e):
1347 """Utility routine for edit_syntax_error"""
1347 """Utility routine for edit_syntax_error"""
1348
1348
1349 if e.filename in ('<ipython console>','<input>','<string>',
1349 if e.filename in ('<ipython console>','<input>','<string>',
1350 '<console>','<BackgroundJob compilation>',
1350 '<console>','<BackgroundJob compilation>',
1351 None):
1351 None):
1352
1352
1353 return False
1353 return False
1354 try:
1354 try:
1355 if (self.rc.autoedit_syntax and
1355 if (self.rc.autoedit_syntax and
1356 not self.ask_yes_no('Return to editor to correct syntax error? '
1356 not self.ask_yes_no('Return to editor to correct syntax error? '
1357 '[Y/n] ','y')):
1357 '[Y/n] ','y')):
1358 return False
1358 return False
1359 except EOFError:
1359 except EOFError:
1360 return False
1360 return False
1361
1361
1362 def int0(x):
1362 def int0(x):
1363 try:
1363 try:
1364 return int(x)
1364 return int(x)
1365 except TypeError:
1365 except TypeError:
1366 return 0
1366 return 0
1367 # always pass integer line and offset values to editor hook
1367 # always pass integer line and offset values to editor hook
1368 self.hooks.fix_error_editor(e.filename,
1368 self.hooks.fix_error_editor(e.filename,
1369 int0(e.lineno),int0(e.offset),e.msg)
1369 int0(e.lineno),int0(e.offset),e.msg)
1370 return True
1370 return True
1371
1371
1372 def edit_syntax_error(self):
1372 def edit_syntax_error(self):
1373 """The bottom half of the syntax error handler called in the main loop.
1373 """The bottom half of the syntax error handler called in the main loop.
1374
1374
1375 Loop until syntax error is fixed or user cancels.
1375 Loop until syntax error is fixed or user cancels.
1376 """
1376 """
1377
1377
1378 while self.SyntaxTB.last_syntax_error:
1378 while self.SyntaxTB.last_syntax_error:
1379 # copy and clear last_syntax_error
1379 # copy and clear last_syntax_error
1380 err = self.SyntaxTB.clear_err_state()
1380 err = self.SyntaxTB.clear_err_state()
1381 if not self._should_recompile(err):
1381 if not self._should_recompile(err):
1382 return
1382 return
1383 try:
1383 try:
1384 # may set last_syntax_error again if a SyntaxError is raised
1384 # may set last_syntax_error again if a SyntaxError is raised
1385 self.safe_execfile(err.filename,self.user_ns)
1385 self.safe_execfile(err.filename,self.user_ns)
1386 except:
1386 except:
1387 self.showtraceback()
1387 self.showtraceback()
1388 else:
1388 else:
1389 try:
1389 try:
1390 f = file(err.filename)
1390 f = file(err.filename)
1391 try:
1391 try:
1392 sys.displayhook(f.read())
1392 sys.displayhook(f.read())
1393 finally:
1393 finally:
1394 f.close()
1394 f.close()
1395 except:
1395 except:
1396 self.showtraceback()
1396 self.showtraceback()
1397
1397
1398 def showsyntaxerror(self, filename=None):
1398 def showsyntaxerror(self, filename=None):
1399 """Display the syntax error that just occurred.
1399 """Display the syntax error that just occurred.
1400
1400
1401 This doesn't display a stack trace because there isn't one.
1401 This doesn't display a stack trace because there isn't one.
1402
1402
1403 If a filename is given, it is stuffed in the exception instead
1403 If a filename is given, it is stuffed in the exception instead
1404 of what was there before (because Python's parser always uses
1404 of what was there before (because Python's parser always uses
1405 "<string>" when reading from a string).
1405 "<string>" when reading from a string).
1406 """
1406 """
1407 etype, value, last_traceback = sys.exc_info()
1407 etype, value, last_traceback = sys.exc_info()
1408
1408
1409 # See note about these variables in showtraceback() below
1409 # See note about these variables in showtraceback() below
1410 sys.last_type = etype
1410 sys.last_type = etype
1411 sys.last_value = value
1411 sys.last_value = value
1412 sys.last_traceback = last_traceback
1412 sys.last_traceback = last_traceback
1413
1413
1414 if filename and etype is SyntaxError:
1414 if filename and etype is SyntaxError:
1415 # Work hard to stuff the correct filename in the exception
1415 # Work hard to stuff the correct filename in the exception
1416 try:
1416 try:
1417 msg, (dummy_filename, lineno, offset, line) = value
1417 msg, (dummy_filename, lineno, offset, line) = value
1418 except:
1418 except:
1419 # Not the format we expect; leave it alone
1419 # Not the format we expect; leave it alone
1420 pass
1420 pass
1421 else:
1421 else:
1422 # Stuff in the right filename
1422 # Stuff in the right filename
1423 try:
1423 try:
1424 # Assume SyntaxError is a class exception
1424 # Assume SyntaxError is a class exception
1425 value = SyntaxError(msg, (filename, lineno, offset, line))
1425 value = SyntaxError(msg, (filename, lineno, offset, line))
1426 except:
1426 except:
1427 # If that failed, assume SyntaxError is a string
1427 # If that failed, assume SyntaxError is a string
1428 value = msg, (filename, lineno, offset, line)
1428 value = msg, (filename, lineno, offset, line)
1429 self.SyntaxTB(etype,value,[])
1429 self.SyntaxTB(etype,value,[])
1430
1430
1431 def debugger(self,force=False):
1431 def debugger(self,force=False):
1432 """Call the pydb/pdb debugger.
1432 """Call the pydb/pdb debugger.
1433
1433
1434 Keywords:
1434 Keywords:
1435
1435
1436 - force(False): by default, this routine checks the instance call_pdb
1436 - force(False): by default, this routine checks the instance call_pdb
1437 flag and does not actually invoke the debugger if the flag is false.
1437 flag and does not actually invoke the debugger if the flag is false.
1438 The 'force' option forces the debugger to activate even if the flag
1438 The 'force' option forces the debugger to activate even if the flag
1439 is false.
1439 is false.
1440 """
1440 """
1441
1441
1442 if not (force or self.call_pdb):
1442 if not (force or self.call_pdb):
1443 return
1443 return
1444
1444
1445 if not hasattr(sys,'last_traceback'):
1445 if not hasattr(sys,'last_traceback'):
1446 error('No traceback has been produced, nothing to debug.')
1446 error('No traceback has been produced, nothing to debug.')
1447 return
1447 return
1448
1448
1449 # use pydb if available
1449 # use pydb if available
1450 if Debugger.has_pydb:
1450 if Debugger.has_pydb:
1451 from pydb import pm
1451 from pydb import pm
1452 else:
1452 else:
1453 # fallback to our internal debugger
1453 # fallback to our internal debugger
1454 pm = lambda : self.InteractiveTB.debugger(force=True)
1454 pm = lambda : self.InteractiveTB.debugger(force=True)
1455 self.history_saving_wrapper(pm)()
1455 self.history_saving_wrapper(pm)()
1456
1456
1457 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1457 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1458 """Display the exception that just occurred.
1458 """Display the exception that just occurred.
1459
1459
1460 If nothing is known about the exception, this is the method which
1460 If nothing is known about the exception, this is the method which
1461 should be used throughout the code for presenting user tracebacks,
1461 should be used throughout the code for presenting user tracebacks,
1462 rather than directly invoking the InteractiveTB object.
1462 rather than directly invoking the InteractiveTB object.
1463
1463
1464 A specific showsyntaxerror() also exists, but this method can take
1464 A specific showsyntaxerror() also exists, but this method can take
1465 care of calling it if needed, so unless you are explicitly catching a
1465 care of calling it if needed, so unless you are explicitly catching a
1466 SyntaxError exception, don't try to analyze the stack manually and
1466 SyntaxError exception, don't try to analyze the stack manually and
1467 simply call this method."""
1467 simply call this method."""
1468
1468
1469
1469
1470 # Though this won't be called by syntax errors in the input line,
1470 # Though this won't be called by syntax errors in the input line,
1471 # there may be SyntaxError cases whith imported code.
1471 # there may be SyntaxError cases whith imported code.
1472
1472
1473
1473
1474 if exc_tuple is None:
1474 if exc_tuple is None:
1475 etype, value, tb = sys.exc_info()
1475 etype, value, tb = sys.exc_info()
1476 else:
1476 else:
1477 etype, value, tb = exc_tuple
1477 etype, value, tb = exc_tuple
1478
1478
1479 if etype is SyntaxError:
1479 if etype is SyntaxError:
1480 self.showsyntaxerror(filename)
1480 self.showsyntaxerror(filename)
1481 else:
1481 else:
1482 # WARNING: these variables are somewhat deprecated and not
1482 # WARNING: these variables are somewhat deprecated and not
1483 # necessarily safe to use in a threaded environment, but tools
1483 # necessarily safe to use in a threaded environment, but tools
1484 # like pdb depend on their existence, so let's set them. If we
1484 # like pdb depend on their existence, so let's set them. If we
1485 # find problems in the field, we'll need to revisit their use.
1485 # find problems in the field, we'll need to revisit their use.
1486 sys.last_type = etype
1486 sys.last_type = etype
1487 sys.last_value = value
1487 sys.last_value = value
1488 sys.last_traceback = tb
1488 sys.last_traceback = tb
1489
1489
1490 if etype in self.custom_exceptions:
1490 if etype in self.custom_exceptions:
1491 self.CustomTB(etype,value,tb)
1491 self.CustomTB(etype,value,tb)
1492 else:
1492 else:
1493 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1493 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1494 if self.InteractiveTB.call_pdb and self.has_readline:
1494 if self.InteractiveTB.call_pdb and self.has_readline:
1495 # pdb mucks up readline, fix it back
1495 # pdb mucks up readline, fix it back
1496 self.set_completer()
1496 self.set_completer()
1497
1497
1498
1498
1499 def mainloop(self,banner=None):
1499 def mainloop(self,banner=None):
1500 """Creates the local namespace and starts the mainloop.
1500 """Creates the local namespace and starts the mainloop.
1501
1501
1502 If an optional banner argument is given, it will override the
1502 If an optional banner argument is given, it will override the
1503 internally created default banner."""
1503 internally created default banner."""
1504
1504
1505 if self.rc.c: # Emulate Python's -c option
1505 if self.rc.c: # Emulate Python's -c option
1506 self.exec_init_cmd()
1506 self.exec_init_cmd()
1507 if banner is None:
1507 if banner is None:
1508 if not self.rc.banner:
1508 if not self.rc.banner:
1509 banner = ''
1509 banner = ''
1510 # banner is string? Use it directly!
1510 # banner is string? Use it directly!
1511 elif isinstance(self.rc.banner,basestring):
1511 elif isinstance(self.rc.banner,basestring):
1512 banner = self.rc.banner
1512 banner = self.rc.banner
1513 else:
1513 else:
1514 banner = self.BANNER+self.banner2
1514 banner = self.BANNER+self.banner2
1515
1515
1516 self.interact(banner)
1516 self.interact(banner)
1517
1517
1518 def exec_init_cmd(self):
1518 def exec_init_cmd(self):
1519 """Execute a command given at the command line.
1519 """Execute a command given at the command line.
1520
1520
1521 This emulates Python's -c option."""
1521 This emulates Python's -c option."""
1522
1522
1523 #sys.argv = ['-c']
1523 #sys.argv = ['-c']
1524 self.push(self.prefilter(self.rc.c, False))
1524 self.push(self.prefilter(self.rc.c, False))
1525 self.exit_now = True
1525 self.exit_now = True
1526
1526
1527 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1527 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1528 """Embeds IPython into a running python program.
1528 """Embeds IPython into a running python program.
1529
1529
1530 Input:
1530 Input:
1531
1531
1532 - header: An optional header message can be specified.
1532 - header: An optional header message can be specified.
1533
1533
1534 - local_ns, global_ns: working namespaces. If given as None, the
1534 - local_ns, global_ns: working namespaces. If given as None, the
1535 IPython-initialized one is updated with __main__.__dict__, so that
1535 IPython-initialized one is updated with __main__.__dict__, so that
1536 program variables become visible but user-specific configuration
1536 program variables become visible but user-specific configuration
1537 remains possible.
1537 remains possible.
1538
1538
1539 - stack_depth: specifies how many levels in the stack to go to
1539 - stack_depth: specifies how many levels in the stack to go to
1540 looking for namespaces (when local_ns and global_ns are None). This
1540 looking for namespaces (when local_ns and global_ns are None). This
1541 allows an intermediate caller to make sure that this function gets
1541 allows an intermediate caller to make sure that this function gets
1542 the namespace from the intended level in the stack. By default (0)
1542 the namespace from the intended level in the stack. By default (0)
1543 it will get its locals and globals from the immediate caller.
1543 it will get its locals and globals from the immediate caller.
1544
1544
1545 Warning: it's possible to use this in a program which is being run by
1545 Warning: it's possible to use this in a program which is being run by
1546 IPython itself (via %run), but some funny things will happen (a few
1546 IPython itself (via %run), but some funny things will happen (a few
1547 globals get overwritten). In the future this will be cleaned up, as
1547 globals get overwritten). In the future this will be cleaned up, as
1548 there is no fundamental reason why it can't work perfectly."""
1548 there is no fundamental reason why it can't work perfectly."""
1549
1549
1550 # Get locals and globals from caller
1550 # Get locals and globals from caller
1551 if local_ns is None or global_ns is None:
1551 if local_ns is None or global_ns is None:
1552 call_frame = sys._getframe(stack_depth).f_back
1552 call_frame = sys._getframe(stack_depth).f_back
1553
1553
1554 if local_ns is None:
1554 if local_ns is None:
1555 local_ns = call_frame.f_locals
1555 local_ns = call_frame.f_locals
1556 if global_ns is None:
1556 if global_ns is None:
1557 global_ns = call_frame.f_globals
1557 global_ns = call_frame.f_globals
1558
1558
1559 # Update namespaces and fire up interpreter
1559 # Update namespaces and fire up interpreter
1560
1560
1561 # The global one is easy, we can just throw it in
1561 # The global one is easy, we can just throw it in
1562 self.user_global_ns = global_ns
1562 self.user_global_ns = global_ns
1563
1563
1564 # but the user/local one is tricky: ipython needs it to store internal
1564 # but the user/local one is tricky: ipython needs it to store internal
1565 # data, but we also need the locals. We'll copy locals in the user
1565 # data, but we also need the locals. We'll copy locals in the user
1566 # one, but will track what got copied so we can delete them at exit.
1566 # one, but will track what got copied so we can delete them at exit.
1567 # This is so that a later embedded call doesn't see locals from a
1567 # This is so that a later embedded call doesn't see locals from a
1568 # previous call (which most likely existed in a separate scope).
1568 # previous call (which most likely existed in a separate scope).
1569 local_varnames = local_ns.keys()
1569 local_varnames = local_ns.keys()
1570 self.user_ns.update(local_ns)
1570 self.user_ns.update(local_ns)
1571
1571
1572 # Patch for global embedding to make sure that things don't overwrite
1572 # Patch for global embedding to make sure that things don't overwrite
1573 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1573 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1574 # FIXME. Test this a bit more carefully (the if.. is new)
1574 # FIXME. Test this a bit more carefully (the if.. is new)
1575 if local_ns is None and global_ns is None:
1575 if local_ns is None and global_ns is None:
1576 self.user_global_ns.update(__main__.__dict__)
1576 self.user_global_ns.update(__main__.__dict__)
1577
1577
1578 # make sure the tab-completer has the correct frame information, so it
1578 # make sure the tab-completer has the correct frame information, so it
1579 # actually completes using the frame's locals/globals
1579 # actually completes using the frame's locals/globals
1580 self.set_completer_frame()
1580 self.set_completer_frame()
1581
1581
1582 # before activating the interactive mode, we need to make sure that
1582 # before activating the interactive mode, we need to make sure that
1583 # all names in the builtin namespace needed by ipython point to
1583 # all names in the builtin namespace needed by ipython point to
1584 # ourselves, and not to other instances.
1584 # ourselves, and not to other instances.
1585 self.add_builtins()
1585 self.add_builtins()
1586
1586
1587 self.interact(header)
1587 self.interact(header)
1588
1588
1589 # now, purge out the user namespace from anything we might have added
1589 # now, purge out the user namespace from anything we might have added
1590 # from the caller's local namespace
1590 # from the caller's local namespace
1591 delvar = self.user_ns.pop
1591 delvar = self.user_ns.pop
1592 for var in local_varnames:
1592 for var in local_varnames:
1593 delvar(var,None)
1593 delvar(var,None)
1594 # and clean builtins we may have overridden
1594 # and clean builtins we may have overridden
1595 self.clean_builtins()
1595 self.clean_builtins()
1596
1596
1597 def interact(self, banner=None):
1597 def interact(self, banner=None):
1598 """Closely emulate the interactive Python console.
1598 """Closely emulate the interactive Python console.
1599
1599
1600 The optional banner argument specify the banner to print
1600 The optional banner argument specify the banner to print
1601 before the first interaction; by default it prints a banner
1601 before the first interaction; by default it prints a banner
1602 similar to the one printed by the real Python interpreter,
1602 similar to the one printed by the real Python interpreter,
1603 followed by the current class name in parentheses (so as not
1603 followed by the current class name in parentheses (so as not
1604 to confuse this with the real interpreter -- since it's so
1604 to confuse this with the real interpreter -- since it's so
1605 close!).
1605 close!).
1606
1606
1607 """
1607 """
1608
1608
1609 if self.exit_now:
1609 if self.exit_now:
1610 # batch run -> do not interact
1610 # batch run -> do not interact
1611 return
1611 return
1612 cprt = 'Type "copyright", "credits" or "license" for more information.'
1612 cprt = 'Type "copyright", "credits" or "license" for more information.'
1613 if banner is None:
1613 if banner is None:
1614 self.write("Python %s on %s\n%s\n(%s)\n" %
1614 self.write("Python %s on %s\n%s\n(%s)\n" %
1615 (sys.version, sys.platform, cprt,
1615 (sys.version, sys.platform, cprt,
1616 self.__class__.__name__))
1616 self.__class__.__name__))
1617 else:
1617 else:
1618 self.write(banner)
1618 self.write(banner)
1619
1619
1620 more = 0
1620 more = 0
1621
1621
1622 # Mark activity in the builtins
1622 # Mark activity in the builtins
1623 __builtin__.__dict__['__IPYTHON__active'] += 1
1623 __builtin__.__dict__['__IPYTHON__active'] += 1
1624
1624
1625 if self.has_readline:
1625 if self.has_readline:
1626 self.readline_startup_hook(self.pre_readline)
1626 self.readline_startup_hook(self.pre_readline)
1627 # exit_now is set by a call to %Exit or %Quit
1627 # exit_now is set by a call to %Exit or %Quit
1628
1628
1629 while not self.exit_now:
1629 while not self.exit_now:
1630 if more:
1630 if more:
1631 prompt = self.hooks.generate_prompt(True)
1631 prompt = self.hooks.generate_prompt(True)
1632 if self.autoindent:
1632 if self.autoindent:
1633 self.rl_do_indent = True
1633 self.rl_do_indent = True
1634
1634
1635 else:
1635 else:
1636 prompt = self.hooks.generate_prompt(False)
1636 prompt = self.hooks.generate_prompt(False)
1637 try:
1637 try:
1638 line = self.raw_input(prompt,more)
1638 line = self.raw_input(prompt,more)
1639 if self.exit_now:
1639 if self.exit_now:
1640 # quick exit on sys.std[in|out] close
1640 # quick exit on sys.std[in|out] close
1641 break
1641 break
1642 if self.autoindent:
1642 if self.autoindent:
1643 self.rl_do_indent = False
1643 self.rl_do_indent = False
1644
1644
1645 except KeyboardInterrupt:
1645 except KeyboardInterrupt:
1646 self.write('\nKeyboardInterrupt\n')
1646 self.write('\nKeyboardInterrupt\n')
1647 self.resetbuffer()
1647 self.resetbuffer()
1648 # keep cache in sync with the prompt counter:
1648 # keep cache in sync with the prompt counter:
1649 self.outputcache.prompt_count -= 1
1649 self.outputcache.prompt_count -= 1
1650
1650
1651 if self.autoindent:
1651 if self.autoindent:
1652 self.indent_current_nsp = 0
1652 self.indent_current_nsp = 0
1653 more = 0
1653 more = 0
1654 except EOFError:
1654 except EOFError:
1655 if self.autoindent:
1655 if self.autoindent:
1656 self.rl_do_indent = False
1656 self.rl_do_indent = False
1657 self.readline_startup_hook(None)
1657 self.readline_startup_hook(None)
1658 self.write('\n')
1658 self.write('\n')
1659 self.exit()
1659 self.exit()
1660 except bdb.BdbQuit:
1660 except bdb.BdbQuit:
1661 warn('The Python debugger has exited with a BdbQuit exception.\n'
1661 warn('The Python debugger has exited with a BdbQuit exception.\n'
1662 'Because of how pdb handles the stack, it is impossible\n'
1662 'Because of how pdb handles the stack, it is impossible\n'
1663 'for IPython to properly format this particular exception.\n'
1663 'for IPython to properly format this particular exception.\n'
1664 'IPython will resume normal operation.')
1664 'IPython will resume normal operation.')
1665 except:
1665 except:
1666 # exceptions here are VERY RARE, but they can be triggered
1666 # exceptions here are VERY RARE, but they can be triggered
1667 # asynchronously by signal handlers, for example.
1667 # asynchronously by signal handlers, for example.
1668 self.showtraceback()
1668 self.showtraceback()
1669 else:
1669 else:
1670 more = self.push(line)
1670 more = self.push(line)
1671 if (self.SyntaxTB.last_syntax_error and
1671 if (self.SyntaxTB.last_syntax_error and
1672 self.rc.autoedit_syntax):
1672 self.rc.autoedit_syntax):
1673 self.edit_syntax_error()
1673 self.edit_syntax_error()
1674
1674
1675 # We are off again...
1675 # We are off again...
1676 __builtin__.__dict__['__IPYTHON__active'] -= 1
1676 __builtin__.__dict__['__IPYTHON__active'] -= 1
1677
1677
1678 def excepthook(self, etype, value, tb):
1678 def excepthook(self, etype, value, tb):
1679 """One more defense for GUI apps that call sys.excepthook.
1679 """One more defense for GUI apps that call sys.excepthook.
1680
1680
1681 GUI frameworks like wxPython trap exceptions and call
1681 GUI frameworks like wxPython trap exceptions and call
1682 sys.excepthook themselves. I guess this is a feature that
1682 sys.excepthook themselves. I guess this is a feature that
1683 enables them to keep running after exceptions that would
1683 enables them to keep running after exceptions that would
1684 otherwise kill their mainloop. This is a bother for IPython
1684 otherwise kill their mainloop. This is a bother for IPython
1685 which excepts to catch all of the program exceptions with a try:
1685 which excepts to catch all of the program exceptions with a try:
1686 except: statement.
1686 except: statement.
1687
1687
1688 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1688 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1689 any app directly invokes sys.excepthook, it will look to the user like
1689 any app directly invokes sys.excepthook, it will look to the user like
1690 IPython crashed. In order to work around this, we can disable the
1690 IPython crashed. In order to work around this, we can disable the
1691 CrashHandler and replace it with this excepthook instead, which prints a
1691 CrashHandler and replace it with this excepthook instead, which prints a
1692 regular traceback using our InteractiveTB. In this fashion, apps which
1692 regular traceback using our InteractiveTB. In this fashion, apps which
1693 call sys.excepthook will generate a regular-looking exception from
1693 call sys.excepthook will generate a regular-looking exception from
1694 IPython, and the CrashHandler will only be triggered by real IPython
1694 IPython, and the CrashHandler will only be triggered by real IPython
1695 crashes.
1695 crashes.
1696
1696
1697 This hook should be used sparingly, only in places which are not likely
1697 This hook should be used sparingly, only in places which are not likely
1698 to be true IPython errors.
1698 to be true IPython errors.
1699 """
1699 """
1700 self.showtraceback((etype,value,tb),tb_offset=0)
1700 self.showtraceback((etype,value,tb),tb_offset=0)
1701
1701
1702 def expand_aliases(self,fn,rest):
1702 def expand_aliases(self,fn,rest):
1703 """ Expand multiple levels of aliases:
1703 """ Expand multiple levels of aliases:
1704
1704
1705 if:
1705 if:
1706
1706
1707 alias foo bar /tmp
1707 alias foo bar /tmp
1708 alias baz foo
1708 alias baz foo
1709
1709
1710 then:
1710 then:
1711
1711
1712 baz huhhahhei -> bar /tmp huhhahhei
1712 baz huhhahhei -> bar /tmp huhhahhei
1713
1713
1714 """
1714 """
1715 line = fn + " " + rest
1715 line = fn + " " + rest
1716
1716
1717 done = Set()
1717 done = Set()
1718 while 1:
1718 while 1:
1719 pre,fn,rest = prefilter.splitUserInput(line,
1719 pre,fn,rest = prefilter.splitUserInput(line,
1720 prefilter.shell_line_split)
1720 prefilter.shell_line_split)
1721 if fn in self.alias_table:
1721 if fn in self.alias_table:
1722 if fn in done:
1722 if fn in done:
1723 warn("Cyclic alias definition, repeated '%s'" % fn)
1723 warn("Cyclic alias definition, repeated '%s'" % fn)
1724 return ""
1724 return ""
1725 done.add(fn)
1725 done.add(fn)
1726
1726
1727 l2 = self.transform_alias(fn,rest)
1727 l2 = self.transform_alias(fn,rest)
1728 # dir -> dir
1728 # dir -> dir
1729 # print "alias",line, "->",l2 #dbg
1729 # print "alias",line, "->",l2 #dbg
1730 if l2 == line:
1730 if l2 == line:
1731 break
1731 break
1732 # ls -> ls -F should not recurse forever
1732 # ls -> ls -F should not recurse forever
1733 if l2.split(None,1)[0] == line.split(None,1)[0]:
1733 if l2.split(None,1)[0] == line.split(None,1)[0]:
1734 line = l2
1734 line = l2
1735 break
1735 break
1736
1736
1737 line=l2
1737 line=l2
1738
1738
1739
1739
1740 # print "al expand to",line #dbg
1740 # print "al expand to",line #dbg
1741 else:
1741 else:
1742 break
1742 break
1743
1743
1744 return line
1744 return line
1745
1745
1746 def transform_alias(self, alias,rest=''):
1746 def transform_alias(self, alias,rest=''):
1747 """ Transform alias to system command string.
1747 """ Transform alias to system command string.
1748 """
1748 """
1749 trg = self.alias_table[alias]
1749 trg = self.alias_table[alias]
1750
1750
1751 nargs,cmd = trg
1751 nargs,cmd = trg
1752 # print trg #dbg
1752 # print trg #dbg
1753 if ' ' in cmd and os.path.isfile(cmd):
1753 if ' ' in cmd and os.path.isfile(cmd):
1754 cmd = '"%s"' % cmd
1754 cmd = '"%s"' % cmd
1755
1755
1756 # Expand the %l special to be the user's input line
1756 # Expand the %l special to be the user's input line
1757 if cmd.find('%l') >= 0:
1757 if cmd.find('%l') >= 0:
1758 cmd = cmd.replace('%l',rest)
1758 cmd = cmd.replace('%l',rest)
1759 rest = ''
1759 rest = ''
1760 if nargs==0:
1760 if nargs==0:
1761 # Simple, argument-less aliases
1761 # Simple, argument-less aliases
1762 cmd = '%s %s' % (cmd,rest)
1762 cmd = '%s %s' % (cmd,rest)
1763 else:
1763 else:
1764 # Handle aliases with positional arguments
1764 # Handle aliases with positional arguments
1765 args = rest.split(None,nargs)
1765 args = rest.split(None,nargs)
1766 if len(args)< nargs:
1766 if len(args)< nargs:
1767 error('Alias <%s> requires %s arguments, %s given.' %
1767 error('Alias <%s> requires %s arguments, %s given.' %
1768 (alias,nargs,len(args)))
1768 (alias,nargs,len(args)))
1769 return None
1769 return None
1770 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1770 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1771 # Now call the macro, evaluating in the user's namespace
1771 # Now call the macro, evaluating in the user's namespace
1772 #print 'new command: <%r>' % cmd # dbg
1772 #print 'new command: <%r>' % cmd # dbg
1773 return cmd
1773 return cmd
1774
1774
1775 def call_alias(self,alias,rest=''):
1775 def call_alias(self,alias,rest=''):
1776 """Call an alias given its name and the rest of the line.
1776 """Call an alias given its name and the rest of the line.
1777
1777
1778 This is only used to provide backwards compatibility for users of
1778 This is only used to provide backwards compatibility for users of
1779 ipalias(), use of which is not recommended for anymore."""
1779 ipalias(), use of which is not recommended for anymore."""
1780
1780
1781 # Now call the macro, evaluating in the user's namespace
1781 # Now call the macro, evaluating in the user's namespace
1782 cmd = self.transform_alias(alias, rest)
1782 cmd = self.transform_alias(alias, rest)
1783 try:
1783 try:
1784 self.system(cmd)
1784 self.system(cmd)
1785 except:
1785 except:
1786 self.showtraceback()
1786 self.showtraceback()
1787
1787
1788 def indent_current_str(self):
1788 def indent_current_str(self):
1789 """return the current level of indentation as a string"""
1789 """return the current level of indentation as a string"""
1790 return self.indent_current_nsp * ' '
1790 return self.indent_current_nsp * ' '
1791
1791
1792 def autoindent_update(self,line):
1792 def autoindent_update(self,line):
1793 """Keep track of the indent level."""
1793 """Keep track of the indent level."""
1794
1794
1795 #debugx('line')
1795 #debugx('line')
1796 #debugx('self.indent_current_nsp')
1796 #debugx('self.indent_current_nsp')
1797 if self.autoindent:
1797 if self.autoindent:
1798 if line:
1798 if line:
1799 inisp = num_ini_spaces(line)
1799 inisp = num_ini_spaces(line)
1800 if inisp < self.indent_current_nsp:
1800 if inisp < self.indent_current_nsp:
1801 self.indent_current_nsp = inisp
1801 self.indent_current_nsp = inisp
1802
1802
1803 if line[-1] == ':':
1803 if line[-1] == ':':
1804 self.indent_current_nsp += 4
1804 self.indent_current_nsp += 4
1805 elif dedent_re.match(line):
1805 elif dedent_re.match(line):
1806 self.indent_current_nsp -= 4
1806 self.indent_current_nsp -= 4
1807 else:
1807 else:
1808 self.indent_current_nsp = 0
1808 self.indent_current_nsp = 0
1809 def runlines(self,lines):
1809 def runlines(self,lines):
1810 """Run a string of one or more lines of source.
1810 """Run a string of one or more lines of source.
1811
1811
1812 This method is capable of running a string containing multiple source
1812 This method is capable of running a string containing multiple source
1813 lines, as if they had been entered at the IPython prompt. Since it
1813 lines, as if they had been entered at the IPython prompt. Since it
1814 exposes IPython's processing machinery, the given strings can contain
1814 exposes IPython's processing machinery, the given strings can contain
1815 magic calls (%magic), special shell access (!cmd), etc."""
1815 magic calls (%magic), special shell access (!cmd), etc."""
1816
1816
1817 # We must start with a clean buffer, in case this is run from an
1817 # We must start with a clean buffer, in case this is run from an
1818 # interactive IPython session (via a magic, for example).
1818 # interactive IPython session (via a magic, for example).
1819 self.resetbuffer()
1819 self.resetbuffer()
1820 lines = lines.split('\n')
1820 lines = lines.split('\n')
1821 more = 0
1821 more = 0
1822
1822
1823 for line in lines:
1823 for line in lines:
1824 # skip blank lines so we don't mess up the prompt counter, but do
1824 # skip blank lines so we don't mess up the prompt counter, but do
1825 # NOT skip even a blank line if we are in a code block (more is
1825 # NOT skip even a blank line if we are in a code block (more is
1826 # true)
1826 # true)
1827
1827
1828
1828
1829 if line or more:
1829 if line or more:
1830 # push to raw history, so hist line numbers stay in sync
1830 # push to raw history, so hist line numbers stay in sync
1831 self.input_hist_raw.append("# " + line + "\n")
1831 self.input_hist_raw.append("# " + line + "\n")
1832 more = self.push(self.prefilter(line,more))
1832 more = self.push(self.prefilter(line,more))
1833 # IPython's runsource returns None if there was an error
1833 # IPython's runsource returns None if there was an error
1834 # compiling the code. This allows us to stop processing right
1834 # compiling the code. This allows us to stop processing right
1835 # away, so the user gets the error message at the right place.
1835 # away, so the user gets the error message at the right place.
1836 if more is None:
1836 if more is None:
1837 break
1837 break
1838 else:
1838 else:
1839 self.input_hist_raw.append("\n")
1839 self.input_hist_raw.append("\n")
1840 # final newline in case the input didn't have it, so that the code
1840 # final newline in case the input didn't have it, so that the code
1841 # actually does get executed
1841 # actually does get executed
1842 if more:
1842 if more:
1843 self.push('\n')
1843 self.push('\n')
1844
1844
1845 def runsource(self, source, filename='<input>', symbol='single'):
1845 def runsource(self, source, filename='<input>', symbol='single'):
1846 """Compile and run some source in the interpreter.
1846 """Compile and run some source in the interpreter.
1847
1847
1848 Arguments are as for compile_command().
1848 Arguments are as for compile_command().
1849
1849
1850 One several things can happen:
1850 One several things can happen:
1851
1851
1852 1) The input is incorrect; compile_command() raised an
1852 1) The input is incorrect; compile_command() raised an
1853 exception (SyntaxError or OverflowError). A syntax traceback
1853 exception (SyntaxError or OverflowError). A syntax traceback
1854 will be printed by calling the showsyntaxerror() method.
1854 will be printed by calling the showsyntaxerror() method.
1855
1855
1856 2) The input is incomplete, and more input is required;
1856 2) The input is incomplete, and more input is required;
1857 compile_command() returned None. Nothing happens.
1857 compile_command() returned None. Nothing happens.
1858
1858
1859 3) The input is complete; compile_command() returned a code
1859 3) The input is complete; compile_command() returned a code
1860 object. The code is executed by calling self.runcode() (which
1860 object. The code is executed by calling self.runcode() (which
1861 also handles run-time exceptions, except for SystemExit).
1861 also handles run-time exceptions, except for SystemExit).
1862
1862
1863 The return value is:
1863 The return value is:
1864
1864
1865 - True in case 2
1865 - True in case 2
1866
1866
1867 - False in the other cases, unless an exception is raised, where
1867 - False in the other cases, unless an exception is raised, where
1868 None is returned instead. This can be used by external callers to
1868 None is returned instead. This can be used by external callers to
1869 know whether to continue feeding input or not.
1869 know whether to continue feeding input or not.
1870
1870
1871 The return value can be used to decide whether to use sys.ps1 or
1871 The return value can be used to decide whether to use sys.ps1 or
1872 sys.ps2 to prompt the next line."""
1872 sys.ps2 to prompt the next line."""
1873
1873
1874 # if the source code has leading blanks, add 'if 1:\n' to it
1874 # if the source code has leading blanks, add 'if 1:\n' to it
1875 # this allows execution of indented pasted code. It is tempting
1875 # this allows execution of indented pasted code. It is tempting
1876 # to add '\n' at the end of source to run commands like ' a=1'
1876 # to add '\n' at the end of source to run commands like ' a=1'
1877 # directly, but this fails for more complicated scenarios
1877 # directly, but this fails for more complicated scenarios
1878 if source[:1] in [' ', '\t']:
1878 if source[:1] in [' ', '\t']:
1879 source = 'if 1:\n%s' % source
1879 source = 'if 1:\n%s' % source
1880
1880
1881 try:
1881 try:
1882 code = self.compile(source,filename,symbol)
1882 code = self.compile(source,filename,symbol)
1883 except (OverflowError, SyntaxError, ValueError):
1883 except (OverflowError, SyntaxError, ValueError):
1884 # Case 1
1884 # Case 1
1885 self.showsyntaxerror(filename)
1885 self.showsyntaxerror(filename)
1886 return None
1886 return None
1887
1887
1888 if code is None:
1888 if code is None:
1889 # Case 2
1889 # Case 2
1890 return True
1890 return True
1891
1891
1892 # Case 3
1892 # Case 3
1893 # We store the code object so that threaded shells and
1893 # We store the code object so that threaded shells and
1894 # custom exception handlers can access all this info if needed.
1894 # custom exception handlers can access all this info if needed.
1895 # The source corresponding to this can be obtained from the
1895 # The source corresponding to this can be obtained from the
1896 # buffer attribute as '\n'.join(self.buffer).
1896 # buffer attribute as '\n'.join(self.buffer).
1897 self.code_to_run = code
1897 self.code_to_run = code
1898 # now actually execute the code object
1898 # now actually execute the code object
1899 if self.runcode(code) == 0:
1899 if self.runcode(code) == 0:
1900 return False
1900 return False
1901 else:
1901 else:
1902 return None
1902 return None
1903
1903
1904 def runcode(self,code_obj):
1904 def runcode(self,code_obj):
1905 """Execute a code object.
1905 """Execute a code object.
1906
1906
1907 When an exception occurs, self.showtraceback() is called to display a
1907 When an exception occurs, self.showtraceback() is called to display a
1908 traceback.
1908 traceback.
1909
1909
1910 Return value: a flag indicating whether the code to be run completed
1910 Return value: a flag indicating whether the code to be run completed
1911 successfully:
1911 successfully:
1912
1912
1913 - 0: successful execution.
1913 - 0: successful execution.
1914 - 1: an error occurred.
1914 - 1: an error occurred.
1915 """
1915 """
1916
1916
1917 # Set our own excepthook in case the user code tries to call it
1917 # Set our own excepthook in case the user code tries to call it
1918 # directly, so that the IPython crash handler doesn't get triggered
1918 # directly, so that the IPython crash handler doesn't get triggered
1919 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1919 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1920
1920
1921 # we save the original sys.excepthook in the instance, in case config
1921 # we save the original sys.excepthook in the instance, in case config
1922 # code (such as magics) needs access to it.
1922 # code (such as magics) needs access to it.
1923 self.sys_excepthook = old_excepthook
1923 self.sys_excepthook = old_excepthook
1924 outflag = 1 # happens in more places, so it's easier as default
1924 outflag = 1 # happens in more places, so it's easier as default
1925 try:
1925 try:
1926 try:
1926 try:
1927 # Embedded instances require separate global/local namespaces
1927 # Embedded instances require separate global/local namespaces
1928 # so they can see both the surrounding (local) namespace and
1928 # so they can see both the surrounding (local) namespace and
1929 # the module-level globals when called inside another function.
1929 # the module-level globals when called inside another function.
1930 if self.embedded:
1930 if self.embedded:
1931 exec code_obj in self.user_global_ns, self.user_ns
1931 exec code_obj in self.user_global_ns, self.user_ns
1932 # Normal (non-embedded) instances should only have a single
1932 # Normal (non-embedded) instances should only have a single
1933 # namespace for user code execution, otherwise functions won't
1933 # namespace for user code execution, otherwise functions won't
1934 # see interactive top-level globals.
1934 # see interactive top-level globals.
1935 else:
1935 else:
1936 exec code_obj in self.user_ns
1936 exec code_obj in self.user_ns
1937 finally:
1937 finally:
1938 # Reset our crash handler in place
1938 # Reset our crash handler in place
1939 sys.excepthook = old_excepthook
1939 sys.excepthook = old_excepthook
1940 except SystemExit:
1940 except SystemExit:
1941 self.resetbuffer()
1941 self.resetbuffer()
1942 self.showtraceback()
1942 self.showtraceback()
1943 warn("Type %exit or %quit to exit IPython "
1943 warn("Type %exit or %quit to exit IPython "
1944 "(%Exit or %Quit do so unconditionally).",level=1)
1944 "(%Exit or %Quit do so unconditionally).",level=1)
1945 except self.custom_exceptions:
1945 except self.custom_exceptions:
1946 etype,value,tb = sys.exc_info()
1946 etype,value,tb = sys.exc_info()
1947 self.CustomTB(etype,value,tb)
1947 self.CustomTB(etype,value,tb)
1948 except:
1948 except:
1949 self.showtraceback()
1949 self.showtraceback()
1950 else:
1950 else:
1951 outflag = 0
1951 outflag = 0
1952 if softspace(sys.stdout, 0):
1952 if softspace(sys.stdout, 0):
1953 print
1953 print
1954 # Flush out code object which has been run (and source)
1954 # Flush out code object which has been run (and source)
1955 self.code_to_run = None
1955 self.code_to_run = None
1956 return outflag
1956 return outflag
1957
1957
1958 def push(self, line):
1958 def push(self, line):
1959 """Push a line to the interpreter.
1959 """Push a line to the interpreter.
1960
1960
1961 The line should not have a trailing newline; it may have
1961 The line should not have a trailing newline; it may have
1962 internal newlines. The line is appended to a buffer and the
1962 internal newlines. The line is appended to a buffer and the
1963 interpreter's runsource() method is called with the
1963 interpreter's runsource() method is called with the
1964 concatenated contents of the buffer as source. If this
1964 concatenated contents of the buffer as source. If this
1965 indicates that the command was executed or invalid, the buffer
1965 indicates that the command was executed or invalid, the buffer
1966 is reset; otherwise, the command is incomplete, and the buffer
1966 is reset; otherwise, the command is incomplete, and the buffer
1967 is left as it was after the line was appended. The return
1967 is left as it was after the line was appended. The return
1968 value is 1 if more input is required, 0 if the line was dealt
1968 value is 1 if more input is required, 0 if the line was dealt
1969 with in some way (this is the same as runsource()).
1969 with in some way (this is the same as runsource()).
1970 """
1970 """
1971
1971
1972 # autoindent management should be done here, and not in the
1972 # autoindent management should be done here, and not in the
1973 # interactive loop, since that one is only seen by keyboard input. We
1973 # interactive loop, since that one is only seen by keyboard input. We
1974 # need this done correctly even for code run via runlines (which uses
1974 # need this done correctly even for code run via runlines (which uses
1975 # push).
1975 # push).
1976
1976
1977 #print 'push line: <%s>' % line # dbg
1977 #print 'push line: <%s>' % line # dbg
1978 for subline in line.splitlines():
1978 for subline in line.splitlines():
1979 self.autoindent_update(subline)
1979 self.autoindent_update(subline)
1980 self.buffer.append(line)
1980 self.buffer.append(line)
1981 more = self.runsource('\n'.join(self.buffer), self.filename)
1981 more = self.runsource('\n'.join(self.buffer), self.filename)
1982 if not more:
1982 if not more:
1983 self.resetbuffer()
1983 self.resetbuffer()
1984 return more
1984 return more
1985
1985
1986 def split_user_input(self, line):
1986 def split_user_input(self, line):
1987 # This is really a hold-over to support ipapi and some extensions
1987 # This is really a hold-over to support ipapi and some extensions
1988 return prefilter.splitUserInput(line)
1988 return prefilter.splitUserInput(line)
1989
1989
1990 def resetbuffer(self):
1990 def resetbuffer(self):
1991 """Reset the input buffer."""
1991 """Reset the input buffer."""
1992 self.buffer[:] = []
1992 self.buffer[:] = []
1993
1993
1994 def raw_input(self,prompt='',continue_prompt=False):
1994 def raw_input(self,prompt='',continue_prompt=False):
1995 """Write a prompt and read a line.
1995 """Write a prompt and read a line.
1996
1996
1997 The returned line does not include the trailing newline.
1997 The returned line does not include the trailing newline.
1998 When the user enters the EOF key sequence, EOFError is raised.
1998 When the user enters the EOF key sequence, EOFError is raised.
1999
1999
2000 Optional inputs:
2000 Optional inputs:
2001
2001
2002 - prompt(''): a string to be printed to prompt the user.
2002 - prompt(''): a string to be printed to prompt the user.
2003
2003
2004 - continue_prompt(False): whether this line is the first one or a
2004 - continue_prompt(False): whether this line is the first one or a
2005 continuation in a sequence of inputs.
2005 continuation in a sequence of inputs.
2006 """
2006 """
2007
2007
2008 # Code run by the user may have modified the readline completer state.
2008 # Code run by the user may have modified the readline completer state.
2009 # We must ensure that our completer is back in place.
2009 # We must ensure that our completer is back in place.
2010 if self.has_readline:
2010 if self.has_readline:
2011 self.set_completer()
2011 self.set_completer()
2012
2012
2013 try:
2013 try:
2014 line = raw_input_original(prompt).decode(self.stdin_encoding)
2014 line = raw_input_original(prompt).decode(self.stdin_encoding)
2015 except ValueError:
2015 except ValueError:
2016 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2016 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2017 " or sys.stdout.close()!\nExiting IPython!")
2017 " or sys.stdout.close()!\nExiting IPython!")
2018 self.exit_now = True
2018 self.exit_now = True
2019 return ""
2019 return ""
2020
2020
2021 # Try to be reasonably smart about not re-indenting pasted input more
2021 # Try to be reasonably smart about not re-indenting pasted input more
2022 # than necessary. We do this by trimming out the auto-indent initial
2022 # than necessary. We do this by trimming out the auto-indent initial
2023 # spaces, if the user's actual input started itself with whitespace.
2023 # spaces, if the user's actual input started itself with whitespace.
2024 #debugx('self.buffer[-1]')
2024 #debugx('self.buffer[-1]')
2025
2025
2026 if self.autoindent:
2026 if self.autoindent:
2027 if num_ini_spaces(line) > self.indent_current_nsp:
2027 if num_ini_spaces(line) > self.indent_current_nsp:
2028 line = line[self.indent_current_nsp:]
2028 line = line[self.indent_current_nsp:]
2029 self.indent_current_nsp = 0
2029 self.indent_current_nsp = 0
2030
2030
2031 # store the unfiltered input before the user has any chance to modify
2031 # store the unfiltered input before the user has any chance to modify
2032 # it.
2032 # it.
2033 if line.strip():
2033 if line.strip():
2034 if continue_prompt:
2034 if continue_prompt:
2035 self.input_hist_raw[-1] += '%s\n' % line
2035 self.input_hist_raw[-1] += '%s\n' % line
2036 if self.has_readline: # and some config option is set?
2036 if self.has_readline: # and some config option is set?
2037 try:
2037 try:
2038 histlen = self.readline.get_current_history_length()
2038 histlen = self.readline.get_current_history_length()
2039 newhist = self.input_hist_raw[-1].rstrip()
2039 newhist = self.input_hist_raw[-1].rstrip()
2040 self.readline.remove_history_item(histlen-1)
2040 self.readline.remove_history_item(histlen-1)
2041 self.readline.replace_history_item(histlen-2,newhist)
2041 self.readline.replace_history_item(histlen-2,newhist)
2042 except AttributeError:
2042 except AttributeError:
2043 pass # re{move,place}_history_item are new in 2.4.
2043 pass # re{move,place}_history_item are new in 2.4.
2044 else:
2044 else:
2045 self.input_hist_raw.append('%s\n' % line)
2045 self.input_hist_raw.append('%s\n' % line)
2046 # only entries starting at first column go to shadow history
2046 # only entries starting at first column go to shadow history
2047 if line.lstrip() == line:
2047 if line.lstrip() == line:
2048 self.shadowhist.add(line.strip())
2048 self.shadowhist.add(line.strip())
2049 else:
2049 elif not continue_prompt:
2050 self.input_hist_raw.append('\n')
2050 self.input_hist_raw.append('\n')
2051 try:
2051 try:
2052 lineout = self.prefilter(line,continue_prompt)
2052 lineout = self.prefilter(line,continue_prompt)
2053 except:
2053 except:
2054 # blanket except, in case a user-defined prefilter crashes, so it
2054 # blanket except, in case a user-defined prefilter crashes, so it
2055 # can't take all of ipython with it.
2055 # can't take all of ipython with it.
2056 self.showtraceback()
2056 self.showtraceback()
2057 return ''
2057 return ''
2058 else:
2058 else:
2059 return lineout
2059 return lineout
2060
2060
2061 def _prefilter(self, line, continue_prompt):
2061 def _prefilter(self, line, continue_prompt):
2062 """Calls different preprocessors, depending on the form of line."""
2062 """Calls different preprocessors, depending on the form of line."""
2063
2063
2064 # All handlers *must* return a value, even if it's blank ('').
2064 # All handlers *must* return a value, even if it's blank ('').
2065
2065
2066 # Lines are NOT logged here. Handlers should process the line as
2066 # Lines are NOT logged here. Handlers should process the line as
2067 # needed, update the cache AND log it (so that the input cache array
2067 # needed, update the cache AND log it (so that the input cache array
2068 # stays synced).
2068 # stays synced).
2069
2069
2070 #.....................................................................
2070 #.....................................................................
2071 # Code begins
2071 # Code begins
2072
2072
2073 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2073 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2074
2074
2075 # save the line away in case we crash, so the post-mortem handler can
2075 # save the line away in case we crash, so the post-mortem handler can
2076 # record it
2076 # record it
2077 self._last_input_line = line
2077 self._last_input_line = line
2078
2078
2079 #print '***line: <%s>' % line # dbg
2079 #print '***line: <%s>' % line # dbg
2080
2080
2081 if not line:
2081 if not line:
2082 # Return immediately on purely empty lines, so that if the user
2082 # Return immediately on purely empty lines, so that if the user
2083 # previously typed some whitespace that started a continuation
2083 # previously typed some whitespace that started a continuation
2084 # prompt, he can break out of that loop with just an empty line.
2084 # prompt, he can break out of that loop with just an empty line.
2085 # This is how the default python prompt works.
2085 # This is how the default python prompt works.
2086
2086
2087 # Only return if the accumulated input buffer was just whitespace!
2087 # Only return if the accumulated input buffer was just whitespace!
2088 if ''.join(self.buffer).isspace():
2088 if ''.join(self.buffer).isspace():
2089 self.buffer[:] = []
2089 self.buffer[:] = []
2090 return ''
2090 return ''
2091
2091
2092 line_info = prefilter.LineInfo(line, continue_prompt)
2092 line_info = prefilter.LineInfo(line, continue_prompt)
2093
2093
2094 # the input history needs to track even empty lines
2094 # the input history needs to track even empty lines
2095 stripped = line.strip()
2095 stripped = line.strip()
2096
2096
2097 if not stripped:
2097 if not stripped:
2098 if not continue_prompt:
2098 if not continue_prompt:
2099 self.outputcache.prompt_count -= 1
2099 self.outputcache.prompt_count -= 1
2100 return self.handle_normal(line_info)
2100 return self.handle_normal(line_info)
2101
2101
2102 # print '***cont',continue_prompt # dbg
2102 # print '***cont',continue_prompt # dbg
2103 # special handlers are only allowed for single line statements
2103 # special handlers are only allowed for single line statements
2104 if continue_prompt and not self.rc.multi_line_specials:
2104 if continue_prompt and not self.rc.multi_line_specials:
2105 return self.handle_normal(line_info)
2105 return self.handle_normal(line_info)
2106
2106
2107
2107
2108 # See whether any pre-existing handler can take care of it
2108 # See whether any pre-existing handler can take care of it
2109 rewritten = self.hooks.input_prefilter(stripped)
2109 rewritten = self.hooks.input_prefilter(stripped)
2110 if rewritten != stripped: # ok, some prefilter did something
2110 if rewritten != stripped: # ok, some prefilter did something
2111 rewritten = line_info.pre + rewritten # add indentation
2111 rewritten = line_info.pre + rewritten # add indentation
2112 return self.handle_normal(prefilter.LineInfo(rewritten,
2112 return self.handle_normal(prefilter.LineInfo(rewritten,
2113 continue_prompt))
2113 continue_prompt))
2114
2114
2115 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2115 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2116
2116
2117 return prefilter.prefilter(line_info, self)
2117 return prefilter.prefilter(line_info, self)
2118
2118
2119
2119
2120 def _prefilter_dumb(self, line, continue_prompt):
2120 def _prefilter_dumb(self, line, continue_prompt):
2121 """simple prefilter function, for debugging"""
2121 """simple prefilter function, for debugging"""
2122 return self.handle_normal(line,continue_prompt)
2122 return self.handle_normal(line,continue_prompt)
2123
2123
2124
2124
2125 def multiline_prefilter(self, line, continue_prompt):
2125 def multiline_prefilter(self, line, continue_prompt):
2126 """ Run _prefilter for each line of input
2126 """ Run _prefilter for each line of input
2127
2127
2128 Covers cases where there are multiple lines in the user entry,
2128 Covers cases where there are multiple lines in the user entry,
2129 which is the case when the user goes back to a multiline history
2129 which is the case when the user goes back to a multiline history
2130 entry and presses enter.
2130 entry and presses enter.
2131
2131
2132 """
2132 """
2133 out = []
2133 out = []
2134 for l in line.rstrip('\n').split('\n'):
2134 for l in line.rstrip('\n').split('\n'):
2135 out.append(self._prefilter(l, continue_prompt))
2135 out.append(self._prefilter(l, continue_prompt))
2136 return '\n'.join(out)
2136 return '\n'.join(out)
2137
2137
2138 # Set the default prefilter() function (this can be user-overridden)
2138 # Set the default prefilter() function (this can be user-overridden)
2139 prefilter = multiline_prefilter
2139 prefilter = multiline_prefilter
2140
2140
2141 def handle_normal(self,line_info):
2141 def handle_normal(self,line_info):
2142 """Handle normal input lines. Use as a template for handlers."""
2142 """Handle normal input lines. Use as a template for handlers."""
2143
2143
2144 # With autoindent on, we need some way to exit the input loop, and I
2144 # With autoindent on, we need some way to exit the input loop, and I
2145 # don't want to force the user to have to backspace all the way to
2145 # don't want to force the user to have to backspace all the way to
2146 # clear the line. The rule will be in this case, that either two
2146 # clear the line. The rule will be in this case, that either two
2147 # lines of pure whitespace in a row, or a line of pure whitespace but
2147 # lines of pure whitespace in a row, or a line of pure whitespace but
2148 # of a size different to the indent level, will exit the input loop.
2148 # of a size different to the indent level, will exit the input loop.
2149 line = line_info.line
2149 line = line_info.line
2150 continue_prompt = line_info.continue_prompt
2150 continue_prompt = line_info.continue_prompt
2151
2151
2152 if (continue_prompt and self.autoindent and line.isspace() and
2152 if (continue_prompt and self.autoindent and line.isspace() and
2153 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2153 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2154 (self.buffer[-1]).isspace() )):
2154 (self.buffer[-1]).isspace() )):
2155 line = ''
2155 line = ''
2156
2156
2157 self.log(line,line,continue_prompt)
2157 self.log(line,line,continue_prompt)
2158 return line
2158 return line
2159
2159
2160 def handle_alias(self,line_info):
2160 def handle_alias(self,line_info):
2161 """Handle alias input lines. """
2161 """Handle alias input lines. """
2162 tgt = self.alias_table[line_info.iFun]
2162 tgt = self.alias_table[line_info.iFun]
2163 # print "=>",tgt #dbg
2163 # print "=>",tgt #dbg
2164 if callable(tgt):
2164 if callable(tgt):
2165 line_out = "_sh." + line_info.iFun + '(r"""' + line_info.line + '""")'
2165 line_out = "_sh." + line_info.iFun + '(r"""' + line_info.line + '""")'
2166 else:
2166 else:
2167 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2167 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2168
2168
2169 # pre is needed, because it carries the leading whitespace. Otherwise
2169 # pre is needed, because it carries the leading whitespace. Otherwise
2170 # aliases won't work in indented sections.
2170 # aliases won't work in indented sections.
2171 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2171 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2172 make_quoted_expr( transformed ))
2172 make_quoted_expr( transformed ))
2173
2173
2174 self.log(line_info.line,line_out,line_info.continue_prompt)
2174 self.log(line_info.line,line_out,line_info.continue_prompt)
2175 #print 'line out:',line_out # dbg
2175 #print 'line out:',line_out # dbg
2176 return line_out
2176 return line_out
2177
2177
2178 def handle_shell_escape(self, line_info):
2178 def handle_shell_escape(self, line_info):
2179 """Execute the line in a shell, empty return value"""
2179 """Execute the line in a shell, empty return value"""
2180 #print 'line in :', `line` # dbg
2180 #print 'line in :', `line` # dbg
2181 line = line_info.line
2181 line = line_info.line
2182 if line.lstrip().startswith('!!'):
2182 if line.lstrip().startswith('!!'):
2183 # rewrite LineInfo's line, iFun and theRest to properly hold the
2183 # rewrite LineInfo's line, iFun and theRest to properly hold the
2184 # call to %sx and the actual command to be executed, so
2184 # call to %sx and the actual command to be executed, so
2185 # handle_magic can work correctly. Note that this works even if
2185 # handle_magic can work correctly. Note that this works even if
2186 # the line is indented, so it handles multi_line_specials
2186 # the line is indented, so it handles multi_line_specials
2187 # properly.
2187 # properly.
2188 new_rest = line.lstrip()[2:]
2188 new_rest = line.lstrip()[2:]
2189 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2189 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2190 line_info.iFun = 'sx'
2190 line_info.iFun = 'sx'
2191 line_info.theRest = new_rest
2191 line_info.theRest = new_rest
2192 return self.handle_magic(line_info)
2192 return self.handle_magic(line_info)
2193 else:
2193 else:
2194 cmd = line.lstrip().lstrip('!')
2194 cmd = line.lstrip().lstrip('!')
2195 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2195 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2196 make_quoted_expr(cmd))
2196 make_quoted_expr(cmd))
2197 # update cache/log and return
2197 # update cache/log and return
2198 self.log(line,line_out,line_info.continue_prompt)
2198 self.log(line,line_out,line_info.continue_prompt)
2199 return line_out
2199 return line_out
2200
2200
2201 def handle_magic(self, line_info):
2201 def handle_magic(self, line_info):
2202 """Execute magic functions."""
2202 """Execute magic functions."""
2203 iFun = line_info.iFun
2203 iFun = line_info.iFun
2204 theRest = line_info.theRest
2204 theRest = line_info.theRest
2205 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2205 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2206 make_quoted_expr(iFun + " " + theRest))
2206 make_quoted_expr(iFun + " " + theRest))
2207 self.log(line_info.line,cmd,line_info.continue_prompt)
2207 self.log(line_info.line,cmd,line_info.continue_prompt)
2208 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2208 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2209 return cmd
2209 return cmd
2210
2210
2211 def handle_auto(self, line_info):
2211 def handle_auto(self, line_info):
2212 """Hande lines which can be auto-executed, quoting if requested."""
2212 """Hande lines which can be auto-executed, quoting if requested."""
2213
2213
2214 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2214 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2215 line = line_info.line
2215 line = line_info.line
2216 iFun = line_info.iFun
2216 iFun = line_info.iFun
2217 theRest = line_info.theRest
2217 theRest = line_info.theRest
2218 pre = line_info.pre
2218 pre = line_info.pre
2219 continue_prompt = line_info.continue_prompt
2219 continue_prompt = line_info.continue_prompt
2220 obj = line_info.ofind(self)['obj']
2220 obj = line_info.ofind(self)['obj']
2221
2221
2222 # This should only be active for single-line input!
2222 # This should only be active for single-line input!
2223 if continue_prompt:
2223 if continue_prompt:
2224 self.log(line,line,continue_prompt)
2224 self.log(line,line,continue_prompt)
2225 return line
2225 return line
2226
2226
2227 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2227 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2228 auto_rewrite = True
2228 auto_rewrite = True
2229
2229
2230 if pre == self.ESC_QUOTE:
2230 if pre == self.ESC_QUOTE:
2231 # Auto-quote splitting on whitespace
2231 # Auto-quote splitting on whitespace
2232 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2232 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2233 elif pre == self.ESC_QUOTE2:
2233 elif pre == self.ESC_QUOTE2:
2234 # Auto-quote whole string
2234 # Auto-quote whole string
2235 newcmd = '%s("%s")' % (iFun,theRest)
2235 newcmd = '%s("%s")' % (iFun,theRest)
2236 elif pre == self.ESC_PAREN:
2236 elif pre == self.ESC_PAREN:
2237 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2237 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2238 else:
2238 else:
2239 # Auto-paren.
2239 # Auto-paren.
2240 # We only apply it to argument-less calls if the autocall
2240 # We only apply it to argument-less calls if the autocall
2241 # parameter is set to 2. We only need to check that autocall is <
2241 # parameter is set to 2. We only need to check that autocall is <
2242 # 2, since this function isn't called unless it's at least 1.
2242 # 2, since this function isn't called unless it's at least 1.
2243 if not theRest and (self.rc.autocall < 2) and not force_auto:
2243 if not theRest and (self.rc.autocall < 2) and not force_auto:
2244 newcmd = '%s %s' % (iFun,theRest)
2244 newcmd = '%s %s' % (iFun,theRest)
2245 auto_rewrite = False
2245 auto_rewrite = False
2246 else:
2246 else:
2247 if not force_auto and theRest.startswith('['):
2247 if not force_auto and theRest.startswith('['):
2248 if hasattr(obj,'__getitem__'):
2248 if hasattr(obj,'__getitem__'):
2249 # Don't autocall in this case: item access for an object
2249 # Don't autocall in this case: item access for an object
2250 # which is BOTH callable and implements __getitem__.
2250 # which is BOTH callable and implements __getitem__.
2251 newcmd = '%s %s' % (iFun,theRest)
2251 newcmd = '%s %s' % (iFun,theRest)
2252 auto_rewrite = False
2252 auto_rewrite = False
2253 else:
2253 else:
2254 # if the object doesn't support [] access, go ahead and
2254 # if the object doesn't support [] access, go ahead and
2255 # autocall
2255 # autocall
2256 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2256 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2257 elif theRest.endswith(';'):
2257 elif theRest.endswith(';'):
2258 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2258 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2259 else:
2259 else:
2260 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2260 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2261
2261
2262 if auto_rewrite:
2262 if auto_rewrite:
2263 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2263 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2264
2264
2265 try:
2265 try:
2266 # plain ascii works better w/ pyreadline, on some machines, so
2266 # plain ascii works better w/ pyreadline, on some machines, so
2267 # we use it and only print uncolored rewrite if we have unicode
2267 # we use it and only print uncolored rewrite if we have unicode
2268 rw = str(rw)
2268 rw = str(rw)
2269 print >>Term.cout, rw
2269 print >>Term.cout, rw
2270 except UnicodeEncodeError:
2270 except UnicodeEncodeError:
2271 print "-------------->" + newcmd
2271 print "-------------->" + newcmd
2272
2272
2273 # log what is now valid Python, not the actual user input (without the
2273 # log what is now valid Python, not the actual user input (without the
2274 # final newline)
2274 # final newline)
2275 self.log(line,newcmd,continue_prompt)
2275 self.log(line,newcmd,continue_prompt)
2276 return newcmd
2276 return newcmd
2277
2277
2278 def handle_help(self, line_info):
2278 def handle_help(self, line_info):
2279 """Try to get some help for the object.
2279 """Try to get some help for the object.
2280
2280
2281 obj? or ?obj -> basic information.
2281 obj? or ?obj -> basic information.
2282 obj?? or ??obj -> more details.
2282 obj?? or ??obj -> more details.
2283 """
2283 """
2284
2284
2285 line = line_info.line
2285 line = line_info.line
2286 # We need to make sure that we don't process lines which would be
2286 # We need to make sure that we don't process lines which would be
2287 # otherwise valid python, such as "x=1 # what?"
2287 # otherwise valid python, such as "x=1 # what?"
2288 try:
2288 try:
2289 codeop.compile_command(line)
2289 codeop.compile_command(line)
2290 except SyntaxError:
2290 except SyntaxError:
2291 # We should only handle as help stuff which is NOT valid syntax
2291 # We should only handle as help stuff which is NOT valid syntax
2292 if line[0]==self.ESC_HELP:
2292 if line[0]==self.ESC_HELP:
2293 line = line[1:]
2293 line = line[1:]
2294 elif line[-1]==self.ESC_HELP:
2294 elif line[-1]==self.ESC_HELP:
2295 line = line[:-1]
2295 line = line[:-1]
2296 self.log(line,'#?'+line,line_info.continue_prompt)
2296 self.log(line,'#?'+line,line_info.continue_prompt)
2297 if line:
2297 if line:
2298 #print 'line:<%r>' % line # dbg
2298 #print 'line:<%r>' % line # dbg
2299 self.magic_pinfo(line)
2299 self.magic_pinfo(line)
2300 else:
2300 else:
2301 page(self.usage,screen_lines=self.rc.screen_length)
2301 page(self.usage,screen_lines=self.rc.screen_length)
2302 return '' # Empty string is needed here!
2302 return '' # Empty string is needed here!
2303 except:
2303 except:
2304 # Pass any other exceptions through to the normal handler
2304 # Pass any other exceptions through to the normal handler
2305 return self.handle_normal(line_info)
2305 return self.handle_normal(line_info)
2306 else:
2306 else:
2307 # If the code compiles ok, we should handle it normally
2307 # If the code compiles ok, we should handle it normally
2308 return self.handle_normal(line_info)
2308 return self.handle_normal(line_info)
2309
2309
2310 def getapi(self):
2310 def getapi(self):
2311 """ Get an IPApi object for this shell instance
2311 """ Get an IPApi object for this shell instance
2312
2312
2313 Getting an IPApi object is always preferable to accessing the shell
2313 Getting an IPApi object is always preferable to accessing the shell
2314 directly, but this holds true especially for extensions.
2314 directly, but this holds true especially for extensions.
2315
2315
2316 It should always be possible to implement an extension with IPApi
2316 It should always be possible to implement an extension with IPApi
2317 alone. If not, contact maintainer to request an addition.
2317 alone. If not, contact maintainer to request an addition.
2318
2318
2319 """
2319 """
2320 return self.api
2320 return self.api
2321
2321
2322 def handle_emacs(self, line_info):
2322 def handle_emacs(self, line_info):
2323 """Handle input lines marked by python-mode."""
2323 """Handle input lines marked by python-mode."""
2324
2324
2325 # Currently, nothing is done. Later more functionality can be added
2325 # Currently, nothing is done. Later more functionality can be added
2326 # here if needed.
2326 # here if needed.
2327
2327
2328 # The input cache shouldn't be updated
2328 # The input cache shouldn't be updated
2329 return line_info.line
2329 return line_info.line
2330
2330
2331
2331
2332 def mktempfile(self,data=None):
2332 def mktempfile(self,data=None):
2333 """Make a new tempfile and return its filename.
2333 """Make a new tempfile and return its filename.
2334
2334
2335 This makes a call to tempfile.mktemp, but it registers the created
2335 This makes a call to tempfile.mktemp, but it registers the created
2336 filename internally so ipython cleans it up at exit time.
2336 filename internally so ipython cleans it up at exit time.
2337
2337
2338 Optional inputs:
2338 Optional inputs:
2339
2339
2340 - data(None): if data is given, it gets written out to the temp file
2340 - data(None): if data is given, it gets written out to the temp file
2341 immediately, and the file is closed again."""
2341 immediately, and the file is closed again."""
2342
2342
2343 filename = tempfile.mktemp('.py','ipython_edit_')
2343 filename = tempfile.mktemp('.py','ipython_edit_')
2344 self.tempfiles.append(filename)
2344 self.tempfiles.append(filename)
2345
2345
2346 if data:
2346 if data:
2347 tmp_file = open(filename,'w')
2347 tmp_file = open(filename,'w')
2348 tmp_file.write(data)
2348 tmp_file.write(data)
2349 tmp_file.close()
2349 tmp_file.close()
2350 return filename
2350 return filename
2351
2351
2352 def write(self,data):
2352 def write(self,data):
2353 """Write a string to the default output"""
2353 """Write a string to the default output"""
2354 Term.cout.write(data)
2354 Term.cout.write(data)
2355
2355
2356 def write_err(self,data):
2356 def write_err(self,data):
2357 """Write a string to the default error output"""
2357 """Write a string to the default error output"""
2358 Term.cerr.write(data)
2358 Term.cerr.write(data)
2359
2359
2360 def exit(self):
2360 def exit(self):
2361 """Handle interactive exit.
2361 """Handle interactive exit.
2362
2362
2363 This method sets the exit_now attribute."""
2363 This method sets the exit_now attribute."""
2364
2364
2365 if self.rc.confirm_exit:
2365 if self.rc.confirm_exit:
2366 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2366 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2367 self.exit_now = True
2367 self.exit_now = True
2368 else:
2368 else:
2369 self.exit_now = True
2369 self.exit_now = True
2370
2370
2371 def safe_execfile(self,fname,*where,**kw):
2371 def safe_execfile(self,fname,*where,**kw):
2372 """A safe version of the builtin execfile().
2372 """A safe version of the builtin execfile().
2373
2373
2374 This version will never throw an exception, and knows how to handle
2374 This version will never throw an exception, and knows how to handle
2375 ipython logs as well."""
2375 ipython logs as well."""
2376
2376
2377 def syspath_cleanup():
2377 def syspath_cleanup():
2378 """Internal cleanup routine for sys.path."""
2378 """Internal cleanup routine for sys.path."""
2379 if add_dname:
2379 if add_dname:
2380 try:
2380 try:
2381 sys.path.remove(dname)
2381 sys.path.remove(dname)
2382 except ValueError:
2382 except ValueError:
2383 # For some reason the user has already removed it, ignore.
2383 # For some reason the user has already removed it, ignore.
2384 pass
2384 pass
2385
2385
2386 fname = os.path.expanduser(fname)
2386 fname = os.path.expanduser(fname)
2387
2387
2388 # Find things also in current directory. This is needed to mimic the
2388 # Find things also in current directory. This is needed to mimic the
2389 # behavior of running a script from the system command line, where
2389 # behavior of running a script from the system command line, where
2390 # Python inserts the script's directory into sys.path
2390 # Python inserts the script's directory into sys.path
2391 dname = os.path.dirname(os.path.abspath(fname))
2391 dname = os.path.dirname(os.path.abspath(fname))
2392 add_dname = False
2392 add_dname = False
2393 if dname not in sys.path:
2393 if dname not in sys.path:
2394 sys.path.insert(0,dname)
2394 sys.path.insert(0,dname)
2395 add_dname = True
2395 add_dname = True
2396
2396
2397 try:
2397 try:
2398 xfile = open(fname)
2398 xfile = open(fname)
2399 except:
2399 except:
2400 print >> Term.cerr, \
2400 print >> Term.cerr, \
2401 'Could not open file <%s> for safe execution.' % fname
2401 'Could not open file <%s> for safe execution.' % fname
2402 syspath_cleanup()
2402 syspath_cleanup()
2403 return None
2403 return None
2404
2404
2405 kw.setdefault('islog',0)
2405 kw.setdefault('islog',0)
2406 kw.setdefault('quiet',1)
2406 kw.setdefault('quiet',1)
2407 kw.setdefault('exit_ignore',0)
2407 kw.setdefault('exit_ignore',0)
2408 first = xfile.readline()
2408 first = xfile.readline()
2409 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2409 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2410 xfile.close()
2410 xfile.close()
2411 # line by line execution
2411 # line by line execution
2412 if first.startswith(loghead) or kw['islog']:
2412 if first.startswith(loghead) or kw['islog']:
2413 print 'Loading log file <%s> one line at a time...' % fname
2413 print 'Loading log file <%s> one line at a time...' % fname
2414 if kw['quiet']:
2414 if kw['quiet']:
2415 stdout_save = sys.stdout
2415 stdout_save = sys.stdout
2416 sys.stdout = StringIO.StringIO()
2416 sys.stdout = StringIO.StringIO()
2417 try:
2417 try:
2418 globs,locs = where[0:2]
2418 globs,locs = where[0:2]
2419 except:
2419 except:
2420 try:
2420 try:
2421 globs = locs = where[0]
2421 globs = locs = where[0]
2422 except:
2422 except:
2423 globs = locs = globals()
2423 globs = locs = globals()
2424 badblocks = []
2424 badblocks = []
2425
2425
2426 # we also need to identify indented blocks of code when replaying
2426 # we also need to identify indented blocks of code when replaying
2427 # logs and put them together before passing them to an exec
2427 # logs and put them together before passing them to an exec
2428 # statement. This takes a bit of regexp and look-ahead work in the
2428 # statement. This takes a bit of regexp and look-ahead work in the
2429 # file. It's easiest if we swallow the whole thing in memory
2429 # file. It's easiest if we swallow the whole thing in memory
2430 # first, and manually walk through the lines list moving the
2430 # first, and manually walk through the lines list moving the
2431 # counter ourselves.
2431 # counter ourselves.
2432 indent_re = re.compile('\s+\S')
2432 indent_re = re.compile('\s+\S')
2433 xfile = open(fname)
2433 xfile = open(fname)
2434 filelines = xfile.readlines()
2434 filelines = xfile.readlines()
2435 xfile.close()
2435 xfile.close()
2436 nlines = len(filelines)
2436 nlines = len(filelines)
2437 lnum = 0
2437 lnum = 0
2438 while lnum < nlines:
2438 while lnum < nlines:
2439 line = filelines[lnum]
2439 line = filelines[lnum]
2440 lnum += 1
2440 lnum += 1
2441 # don't re-insert logger status info into cache
2441 # don't re-insert logger status info into cache
2442 if line.startswith('#log#'):
2442 if line.startswith('#log#'):
2443 continue
2443 continue
2444 else:
2444 else:
2445 # build a block of code (maybe a single line) for execution
2445 # build a block of code (maybe a single line) for execution
2446 block = line
2446 block = line
2447 try:
2447 try:
2448 next = filelines[lnum] # lnum has already incremented
2448 next = filelines[lnum] # lnum has already incremented
2449 except:
2449 except:
2450 next = None
2450 next = None
2451 while next and indent_re.match(next):
2451 while next and indent_re.match(next):
2452 block += next
2452 block += next
2453 lnum += 1
2453 lnum += 1
2454 try:
2454 try:
2455 next = filelines[lnum]
2455 next = filelines[lnum]
2456 except:
2456 except:
2457 next = None
2457 next = None
2458 # now execute the block of one or more lines
2458 # now execute the block of one or more lines
2459 try:
2459 try:
2460 exec block in globs,locs
2460 exec block in globs,locs
2461 except SystemExit:
2461 except SystemExit:
2462 pass
2462 pass
2463 except:
2463 except:
2464 badblocks.append(block.rstrip())
2464 badblocks.append(block.rstrip())
2465 if kw['quiet']: # restore stdout
2465 if kw['quiet']: # restore stdout
2466 sys.stdout.close()
2466 sys.stdout.close()
2467 sys.stdout = stdout_save
2467 sys.stdout = stdout_save
2468 print 'Finished replaying log file <%s>' % fname
2468 print 'Finished replaying log file <%s>' % fname
2469 if badblocks:
2469 if badblocks:
2470 print >> sys.stderr, ('\nThe following lines/blocks in file '
2470 print >> sys.stderr, ('\nThe following lines/blocks in file '
2471 '<%s> reported errors:' % fname)
2471 '<%s> reported errors:' % fname)
2472
2472
2473 for badline in badblocks:
2473 for badline in badblocks:
2474 print >> sys.stderr, badline
2474 print >> sys.stderr, badline
2475 else: # regular file execution
2475 else: # regular file execution
2476 try:
2476 try:
2477 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2477 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2478 # Work around a bug in Python for Windows. The bug was
2478 # Work around a bug in Python for Windows. The bug was
2479 # fixed in in Python 2.5 r54159 and 54158, but that's still
2479 # fixed in in Python 2.5 r54159 and 54158, but that's still
2480 # SVN Python as of March/07. For details, see:
2480 # SVN Python as of March/07. For details, see:
2481 # http://projects.scipy.org/ipython/ipython/ticket/123
2481 # http://projects.scipy.org/ipython/ipython/ticket/123
2482 try:
2482 try:
2483 globs,locs = where[0:2]
2483 globs,locs = where[0:2]
2484 except:
2484 except:
2485 try:
2485 try:
2486 globs = locs = where[0]
2486 globs = locs = where[0]
2487 except:
2487 except:
2488 globs = locs = globals()
2488 globs = locs = globals()
2489 exec file(fname) in globs,locs
2489 exec file(fname) in globs,locs
2490 else:
2490 else:
2491 execfile(fname,*where)
2491 execfile(fname,*where)
2492 except SyntaxError:
2492 except SyntaxError:
2493 self.showsyntaxerror()
2493 self.showsyntaxerror()
2494 warn('Failure executing file: <%s>' % fname)
2494 warn('Failure executing file: <%s>' % fname)
2495 except SystemExit,status:
2495 except SystemExit,status:
2496 # Code that correctly sets the exit status flag to success (0)
2496 # Code that correctly sets the exit status flag to success (0)
2497 # shouldn't be bothered with a traceback. Note that a plain
2497 # shouldn't be bothered with a traceback. Note that a plain
2498 # sys.exit() does NOT set the message to 0 (it's empty) so that
2498 # sys.exit() does NOT set the message to 0 (it's empty) so that
2499 # will still get a traceback. Note that the structure of the
2499 # will still get a traceback. Note that the structure of the
2500 # SystemExit exception changed between Python 2.4 and 2.5, so
2500 # SystemExit exception changed between Python 2.4 and 2.5, so
2501 # the checks must be done in a version-dependent way.
2501 # the checks must be done in a version-dependent way.
2502 show = False
2502 show = False
2503
2503
2504 if sys.version_info[:2] > (2,5):
2504 if sys.version_info[:2] > (2,5):
2505 if status.message!=0 and not kw['exit_ignore']:
2505 if status.message!=0 and not kw['exit_ignore']:
2506 show = True
2506 show = True
2507 else:
2507 else:
2508 if status.code and not kw['exit_ignore']:
2508 if status.code and not kw['exit_ignore']:
2509 show = True
2509 show = True
2510 if show:
2510 if show:
2511 self.showtraceback()
2511 self.showtraceback()
2512 warn('Failure executing file: <%s>' % fname)
2512 warn('Failure executing file: <%s>' % fname)
2513 except:
2513 except:
2514 self.showtraceback()
2514 self.showtraceback()
2515 warn('Failure executing file: <%s>' % fname)
2515 warn('Failure executing file: <%s>' % fname)
2516
2516
2517 syspath_cleanup()
2517 syspath_cleanup()
2518
2518
2519 #************************* end of file <iplib.py> *****************************
2519 #************************* end of file <iplib.py> *****************************
@@ -1,7008 +1,7032 b''
1 2007-08-22 Ville Vainio <vivainio@gmail.com>
2
3 * iplib.py: no extra empty (last) line in raw hist w/ multiline
4 statements
5
6 2007-08-21 Ville Vainio <vivainio@gmail.com>
7
8 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
9 (for backwards compatibility)
10
11 * history.py: switch back to %hist -t from %hist -r as default.
12 At least until raw history is fixed for good.
13
14 2007-08-20 Ville Vainio <vivainio@gmail.com>
15
16 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
17 locate alias redeclarations etc. Also, avoid handling
18 _ip.IP.alias_table directly, prefer using _ip.defalias.
19
20
21 2007-08-15 Ville Vainio <vivainio@gmail.com>
22
23 * prefilter.py: ! is now always served first
24
1 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
25 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
2
26
3 * IPython/iplib.py (safe_execfile): fix the SystemExit
27 * IPython/iplib.py (safe_execfile): fix the SystemExit
4 auto-suppression code to work in Python2.4 (the internal structure
28 auto-suppression code to work in Python2.4 (the internal structure
5 of that exception changed and I'd only tested the code with 2.5).
29 of that exception changed and I'd only tested the code with 2.5).
6 Bug reported by a SciPy attendee.
30 Bug reported by a SciPy attendee.
7
31
8 2007-08-13 Ville Vainio <vivainio@gmail.com>
32 2007-08-13 Ville Vainio <vivainio@gmail.com>
9
33
10 * prefilter.py: reverted !c:/bin/foo fix, made % in
34 * prefilter.py: reverted !c:/bin/foo fix, made % in
11 multiline specials work again
35 multiline specials work again
12
36
13 2007-08-13 Ville Vainio <vivainio@gmail.com>
37 2007-08-13 Ville Vainio <vivainio@gmail.com>
14
38
15 * prefilter.py: Take more care to special-case !, so that
39 * prefilter.py: Take more care to special-case !, so that
16 !c:/bin/foo.exe works.
40 !c:/bin/foo.exe works.
17
41
18 * setup.py: if we are building eggs, strip all docs and
42 * setup.py: if we are building eggs, strip all docs and
19 examples (it doesn't make sense to bytecompile examples,
43 examples (it doesn't make sense to bytecompile examples,
20 and docs would be in an awkward place anyway).
44 and docs would be in an awkward place anyway).
21
45
22 * Ryan Krauss' patch fixes start menu shortcuts when IPython
46 * Ryan Krauss' patch fixes start menu shortcuts when IPython
23 is installed into a directory that has spaces in the name.
47 is installed into a directory that has spaces in the name.
24
48
25 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
49 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
26
50
27 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
51 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
28 doctest profile and %doctest_mode, so they actually generate the
52 doctest profile and %doctest_mode, so they actually generate the
29 blank lines needed by doctest to separate individual tests.
53 blank lines needed by doctest to separate individual tests.
30
54
31 * IPython/iplib.py (safe_execfile): modify so that running code
55 * IPython/iplib.py (safe_execfile): modify so that running code
32 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
56 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
33 doesn't get a printed traceback. Any other value in sys.exit(),
57 doesn't get a printed traceback. Any other value in sys.exit(),
34 including the empty call, still generates a traceback. This
58 including the empty call, still generates a traceback. This
35 enables use of %run without having to pass '-e' for codes that
59 enables use of %run without having to pass '-e' for codes that
36 correctly set the exit status flag.
60 correctly set the exit status flag.
37
61
38 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
62 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
39
63
40 * IPython/iplib.py (InteractiveShell.post_config_initialization):
64 * IPython/iplib.py (InteractiveShell.post_config_initialization):
41 fix problems with doctests failing when run inside IPython due to
65 fix problems with doctests failing when run inside IPython due to
42 IPython's modifications of sys.displayhook.
66 IPython's modifications of sys.displayhook.
43
67
44 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
68 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
45
69
46 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
70 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
47 a string with names.
71 a string with names.
48
72
49 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
73 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
50
74
51 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
75 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
52 magic to toggle on/off the doctest pasting support without having
76 magic to toggle on/off the doctest pasting support without having
53 to leave a session to switch to a separate profile.
77 to leave a session to switch to a separate profile.
54
78
55 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
79 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
56
80
57 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
81 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
58 introduce a blank line between inputs, to conform to doctest
82 introduce a blank line between inputs, to conform to doctest
59 requirements.
83 requirements.
60
84
61 * IPython/OInspect.py (Inspector.pinfo): fix another part where
85 * IPython/OInspect.py (Inspector.pinfo): fix another part where
62 auto-generated docstrings for new-style classes were showing up.
86 auto-generated docstrings for new-style classes were showing up.
63
87
64 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
88 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
65
89
66 * api_changes: Add new file to track backward-incompatible
90 * api_changes: Add new file to track backward-incompatible
67 user-visible changes.
91 user-visible changes.
68
92
69 2007-08-06 Ville Vainio <vivainio@gmail.com>
93 2007-08-06 Ville Vainio <vivainio@gmail.com>
70
94
71 * ipmaker.py: fix bug where user_config_ns didn't exist at all
95 * ipmaker.py: fix bug where user_config_ns didn't exist at all
72 before all the config files were handled.
96 before all the config files were handled.
73
97
74 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
98 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
75
99
76 * IPython/irunner.py (RunnerFactory): Add new factory class for
100 * IPython/irunner.py (RunnerFactory): Add new factory class for
77 creating reusable runners based on filenames.
101 creating reusable runners based on filenames.
78
102
79 * IPython/Extensions/ipy_profile_doctest.py: New profile for
103 * IPython/Extensions/ipy_profile_doctest.py: New profile for
80 doctest support. It sets prompts/exceptions as similar to
104 doctest support. It sets prompts/exceptions as similar to
81 standard Python as possible, so that ipython sessions in this
105 standard Python as possible, so that ipython sessions in this
82 profile can be easily pasted as doctests with minimal
106 profile can be easily pasted as doctests with minimal
83 modifications. It also enables pasting of doctests from external
107 modifications. It also enables pasting of doctests from external
84 sources (even if they have leading whitespace), so that you can
108 sources (even if they have leading whitespace), so that you can
85 rerun doctests from existing sources.
109 rerun doctests from existing sources.
86
110
87 * IPython/iplib.py (_prefilter): fix a buglet where after entering
111 * IPython/iplib.py (_prefilter): fix a buglet where after entering
88 some whitespace, the prompt would become a continuation prompt
112 some whitespace, the prompt would become a continuation prompt
89 with no way of exiting it other than Ctrl-C. This fix brings us
113 with no way of exiting it other than Ctrl-C. This fix brings us
90 into conformity with how the default python prompt works.
114 into conformity with how the default python prompt works.
91
115
92 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
116 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
93 Add support for pasting not only lines that start with '>>>', but
117 Add support for pasting not only lines that start with '>>>', but
94 also with ' >>>'. That is, arbitrary whitespace can now precede
118 also with ' >>>'. That is, arbitrary whitespace can now precede
95 the prompts. This makes the system useful for pasting doctests
119 the prompts. This makes the system useful for pasting doctests
96 from docstrings back into a normal session.
120 from docstrings back into a normal session.
97
121
98 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
122 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
99
123
100 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
124 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
101 r1357, which had killed multiple invocations of an embedded
125 r1357, which had killed multiple invocations of an embedded
102 ipython (this means that example-embed has been broken for over 1
126 ipython (this means that example-embed has been broken for over 1
103 year!!!). Rather than possibly breaking the batch stuff for which
127 year!!!). Rather than possibly breaking the batch stuff for which
104 the code in iplib.py/interact was introduced, I worked around the
128 the code in iplib.py/interact was introduced, I worked around the
105 problem in the embedding class in Shell.py. We really need a
129 problem in the embedding class in Shell.py. We really need a
106 bloody test suite for this code, I'm sick of finding stuff that
130 bloody test suite for this code, I'm sick of finding stuff that
107 used to work breaking left and right every time I use an old
131 used to work breaking left and right every time I use an old
108 feature I hadn't touched in a few months.
132 feature I hadn't touched in a few months.
109 (kill_embedded): Add a new magic that only shows up in embedded
133 (kill_embedded): Add a new magic that only shows up in embedded
110 mode, to allow users to permanently deactivate an embedded instance.
134 mode, to allow users to permanently deactivate an embedded instance.
111
135
112 2007-08-01 Ville Vainio <vivainio@gmail.com>
136 2007-08-01 Ville Vainio <vivainio@gmail.com>
113
137
114 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
138 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
115 history gets out of sync on runlines (e.g. when running macros).
139 history gets out of sync on runlines (e.g. when running macros).
116
140
117 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
141 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
118
142
119 * IPython/Magic.py (magic_colors): fix win32-related error message
143 * IPython/Magic.py (magic_colors): fix win32-related error message
120 that could appear under *nix when readline was missing. Patch by
144 that could appear under *nix when readline was missing. Patch by
121 Scott Jackson, closes #175.
145 Scott Jackson, closes #175.
122
146
123 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
147 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
124
148
125 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
149 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
126 completer that it traits-aware, so that traits objects don't show
150 completer that it traits-aware, so that traits objects don't show
127 all of their internal attributes all the time.
151 all of their internal attributes all the time.
128
152
129 * IPython/genutils.py (dir2): moved this code from inside
153 * IPython/genutils.py (dir2): moved this code from inside
130 completer.py to expose it publicly, so I could use it in the
154 completer.py to expose it publicly, so I could use it in the
131 wildcards bugfix.
155 wildcards bugfix.
132
156
133 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
157 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
134 Stefan with Traits.
158 Stefan with Traits.
135
159
136 * IPython/completer.py (Completer.attr_matches): change internal
160 * IPython/completer.py (Completer.attr_matches): change internal
137 var name from 'object' to 'obj', since 'object' is now a builtin
161 var name from 'object' to 'obj', since 'object' is now a builtin
138 and this can lead to weird bugs if reusing this code elsewhere.
162 and this can lead to weird bugs if reusing this code elsewhere.
139
163
140 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
164 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
141
165
142 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
166 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
143 'foo?' and update the code to prevent printing of default
167 'foo?' and update the code to prevent printing of default
144 docstrings that started appearing after I added support for
168 docstrings that started appearing after I added support for
145 new-style classes. The approach I'm using isn't ideal (I just
169 new-style classes. The approach I'm using isn't ideal (I just
146 special-case those strings) but I'm not sure how to more robustly
170 special-case those strings) but I'm not sure how to more robustly
147 differentiate between truly user-written strings and Python's
171 differentiate between truly user-written strings and Python's
148 automatic ones.
172 automatic ones.
149
173
150 2007-07-09 Ville Vainio <vivainio@gmail.com>
174 2007-07-09 Ville Vainio <vivainio@gmail.com>
151
175
152 * completer.py: Applied Matthew Neeley's patch:
176 * completer.py: Applied Matthew Neeley's patch:
153 Dynamic attributes from trait_names and _getAttributeNames are added
177 Dynamic attributes from trait_names and _getAttributeNames are added
154 to the list of tab completions, but when this happens, the attribute
178 to the list of tab completions, but when this happens, the attribute
155 list is turned into a set, so the attributes are unordered when
179 list is turned into a set, so the attributes are unordered when
156 printed, which makes it hard to find the right completion. This patch
180 printed, which makes it hard to find the right completion. This patch
157 turns this set back into a list and sort it.
181 turns this set back into a list and sort it.
158
182
159 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
183 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
160
184
161 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
185 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
162 classes in various inspector functions.
186 classes in various inspector functions.
163
187
164 2007-06-28 Ville Vainio <vivainio@gmail.com>
188 2007-06-28 Ville Vainio <vivainio@gmail.com>
165
189
166 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
190 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
167 Implement "shadow" namespace, and callable aliases that reside there.
191 Implement "shadow" namespace, and callable aliases that reside there.
168 Use them by:
192 Use them by:
169
193
170 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
194 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
171
195
172 foo hello world
196 foo hello world
173 (gets translated to:)
197 (gets translated to:)
174 _sh.foo(r"""hello world""")
198 _sh.foo(r"""hello world""")
175
199
176 In practice, this kind of alias can take the role of a magic function
200 In practice, this kind of alias can take the role of a magic function
177
201
178 * New generic inspect_object, called on obj? and obj??
202 * New generic inspect_object, called on obj? and obj??
179
203
180 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
204 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
181
205
182 * IPython/ultraTB.py (findsource): fix a problem with
206 * IPython/ultraTB.py (findsource): fix a problem with
183 inspect.getfile that can cause crashes during traceback construction.
207 inspect.getfile that can cause crashes during traceback construction.
184
208
185 2007-06-14 Ville Vainio <vivainio@gmail.com>
209 2007-06-14 Ville Vainio <vivainio@gmail.com>
186
210
187 * iplib.py (handle_auto): Try to use ascii for printing "--->"
211 * iplib.py (handle_auto): Try to use ascii for printing "--->"
188 autocall rewrite indication, becausesometimes unicode fails to print
212 autocall rewrite indication, becausesometimes unicode fails to print
189 properly (and you get ' - - - '). Use plain uncoloured ---> for
213 properly (and you get ' - - - '). Use plain uncoloured ---> for
190 unicode.
214 unicode.
191
215
192 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
216 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
193
217
194 . pickleshare 'hash' commands (hget, hset, hcompress,
218 . pickleshare 'hash' commands (hget, hset, hcompress,
195 hdict) for efficient shadow history storage.
219 hdict) for efficient shadow history storage.
196
220
197 2007-06-13 Ville Vainio <vivainio@gmail.com>
221 2007-06-13 Ville Vainio <vivainio@gmail.com>
198
222
199 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
223 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
200 Added kw arg 'interactive', tell whether vars should be visible
224 Added kw arg 'interactive', tell whether vars should be visible
201 with %whos.
225 with %whos.
202
226
203 2007-06-11 Ville Vainio <vivainio@gmail.com>
227 2007-06-11 Ville Vainio <vivainio@gmail.com>
204
228
205 * pspersistence.py, Magic.py, iplib.py: directory history now saved
229 * pspersistence.py, Magic.py, iplib.py: directory history now saved
206 to db
230 to db
207
231
208 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
232 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
209 Also, it exits IPython immediately after evaluating the command (just like
233 Also, it exits IPython immediately after evaluating the command (just like
210 std python)
234 std python)
211
235
212 2007-06-05 Walter Doerwald <walter@livinglogic.de>
236 2007-06-05 Walter Doerwald <walter@livinglogic.de>
213
237
214 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
238 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
215 Python string and captures the output. (Idea and original patch by
239 Python string and captures the output. (Idea and original patch by
216 StοΏ½fan van der Walt)
240 StοΏ½fan van der Walt)
217
241
218 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
242 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
219
243
220 * IPython/ultraTB.py (VerboseTB.text): update printing of
244 * IPython/ultraTB.py (VerboseTB.text): update printing of
221 exception types for Python 2.5 (now all exceptions in the stdlib
245 exception types for Python 2.5 (now all exceptions in the stdlib
222 are new-style classes).
246 are new-style classes).
223
247
224 2007-05-31 Walter Doerwald <walter@livinglogic.de>
248 2007-05-31 Walter Doerwald <walter@livinglogic.de>
225
249
226 * IPython/Extensions/igrid.py: Add new commands refresh and
250 * IPython/Extensions/igrid.py: Add new commands refresh and
227 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
251 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
228 the iterator once (refresh) or after every x seconds (refresh_timer).
252 the iterator once (refresh) or after every x seconds (refresh_timer).
229 Add a working implementation of "searchexpression", where the text
253 Add a working implementation of "searchexpression", where the text
230 entered is not the text to search for, but an expression that must
254 entered is not the text to search for, but an expression that must
231 be true. Added display of shortcuts to the menu. Added commands "pickinput"
255 be true. Added display of shortcuts to the menu. Added commands "pickinput"
232 and "pickinputattr" that put the object or attribute under the cursor
256 and "pickinputattr" that put the object or attribute under the cursor
233 in the input line. Split the statusbar to be able to display the currently
257 in the input line. Split the statusbar to be able to display the currently
234 active refresh interval. (Patch by Nik Tautenhahn)
258 active refresh interval. (Patch by Nik Tautenhahn)
235
259
236 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
260 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
237
261
238 * fixing set_term_title to use ctypes as default
262 * fixing set_term_title to use ctypes as default
239
263
240 * fixing set_term_title fallback to work when curent dir
264 * fixing set_term_title fallback to work when curent dir
241 is on a windows network share
265 is on a windows network share
242
266
243 2007-05-28 Ville Vainio <vivainio@gmail.com>
267 2007-05-28 Ville Vainio <vivainio@gmail.com>
244
268
245 * %cpaste: strip + with > from left (diffs).
269 * %cpaste: strip + with > from left (diffs).
246
270
247 * iplib.py: Fix crash when readline not installed
271 * iplib.py: Fix crash when readline not installed
248
272
249 2007-05-26 Ville Vainio <vivainio@gmail.com>
273 2007-05-26 Ville Vainio <vivainio@gmail.com>
250
274
251 * generics.py: intruduce easy to extend result_display generic
275 * generics.py: intruduce easy to extend result_display generic
252 function (using simplegeneric.py).
276 function (using simplegeneric.py).
253
277
254 * Fixed the append functionality of %set.
278 * Fixed the append functionality of %set.
255
279
256 2007-05-25 Ville Vainio <vivainio@gmail.com>
280 2007-05-25 Ville Vainio <vivainio@gmail.com>
257
281
258 * New magic: %rep (fetch / run old commands from history)
282 * New magic: %rep (fetch / run old commands from history)
259
283
260 * New extension: mglob (%mglob magic), for powerful glob / find /filter
284 * New extension: mglob (%mglob magic), for powerful glob / find /filter
261 like functionality
285 like functionality
262
286
263 % maghistory.py: %hist -g PATTERM greps the history for pattern
287 % maghistory.py: %hist -g PATTERM greps the history for pattern
264
288
265 2007-05-24 Walter Doerwald <walter@livinglogic.de>
289 2007-05-24 Walter Doerwald <walter@livinglogic.de>
266
290
267 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
291 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
268 browse the IPython input history
292 browse the IPython input history
269
293
270 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
294 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
271 (mapped to "i") can be used to put the object under the curser in the input
295 (mapped to "i") can be used to put the object under the curser in the input
272 line. pickinputattr (mapped to "I") does the same for the attribute under
296 line. pickinputattr (mapped to "I") does the same for the attribute under
273 the cursor.
297 the cursor.
274
298
275 2007-05-24 Ville Vainio <vivainio@gmail.com>
299 2007-05-24 Ville Vainio <vivainio@gmail.com>
276
300
277 * Grand magic cleansing (changeset [2380]):
301 * Grand magic cleansing (changeset [2380]):
278
302
279 * Introduce ipy_legacy.py where the following magics were
303 * Introduce ipy_legacy.py where the following magics were
280 moved:
304 moved:
281
305
282 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
306 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
283
307
284 If you need them, either use default profile or "import ipy_legacy"
308 If you need them, either use default profile or "import ipy_legacy"
285 in your ipy_user_conf.py
309 in your ipy_user_conf.py
286
310
287 * Move sh and scipy profile to Extensions from UserConfig. this implies
311 * Move sh and scipy profile to Extensions from UserConfig. this implies
288 you should not edit them, but you don't need to run %upgrade when
312 you should not edit them, but you don't need to run %upgrade when
289 upgrading IPython anymore.
313 upgrading IPython anymore.
290
314
291 * %hist/%history now operates in "raw" mode by default. To get the old
315 * %hist/%history now operates in "raw" mode by default. To get the old
292 behaviour, run '%hist -n' (native mode).
316 behaviour, run '%hist -n' (native mode).
293
317
294 * split ipy_stock_completers.py to ipy_stock_completers.py and
318 * split ipy_stock_completers.py to ipy_stock_completers.py and
295 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
319 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
296 installed as default.
320 installed as default.
297
321
298 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
322 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
299 handling.
323 handling.
300
324
301 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
325 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
302 input if readline is available.
326 input if readline is available.
303
327
304 2007-05-23 Ville Vainio <vivainio@gmail.com>
328 2007-05-23 Ville Vainio <vivainio@gmail.com>
305
329
306 * macro.py: %store uses __getstate__ properly
330 * macro.py: %store uses __getstate__ properly
307
331
308 * exesetup.py: added new setup script for creating
332 * exesetup.py: added new setup script for creating
309 standalone IPython executables with py2exe (i.e.
333 standalone IPython executables with py2exe (i.e.
310 no python installation required).
334 no python installation required).
311
335
312 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
336 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
313 its place.
337 its place.
314
338
315 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
339 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
316
340
317 2007-05-21 Ville Vainio <vivainio@gmail.com>
341 2007-05-21 Ville Vainio <vivainio@gmail.com>
318
342
319 * platutil_win32.py (set_term_title): handle
343 * platutil_win32.py (set_term_title): handle
320 failure of 'title' system call properly.
344 failure of 'title' system call properly.
321
345
322 2007-05-17 Walter Doerwald <walter@livinglogic.de>
346 2007-05-17 Walter Doerwald <walter@livinglogic.de>
323
347
324 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
348 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
325 (Bug detected by Paul Mueller).
349 (Bug detected by Paul Mueller).
326
350
327 2007-05-16 Ville Vainio <vivainio@gmail.com>
351 2007-05-16 Ville Vainio <vivainio@gmail.com>
328
352
329 * ipy_profile_sci.py, ipython_win_post_install.py: Create
353 * ipy_profile_sci.py, ipython_win_post_install.py: Create
330 new "sci" profile, effectively a modern version of the old
354 new "sci" profile, effectively a modern version of the old
331 "scipy" profile (which is now slated for deprecation).
355 "scipy" profile (which is now slated for deprecation).
332
356
333 2007-05-15 Ville Vainio <vivainio@gmail.com>
357 2007-05-15 Ville Vainio <vivainio@gmail.com>
334
358
335 * pycolorize.py, pycolor.1: Paul Mueller's patches that
359 * pycolorize.py, pycolor.1: Paul Mueller's patches that
336 make pycolorize read input from stdin when run without arguments.
360 make pycolorize read input from stdin when run without arguments.
337
361
338 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
362 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
339
363
340 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
364 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
341 it in sh profile (instead of ipy_system_conf.py).
365 it in sh profile (instead of ipy_system_conf.py).
342
366
343 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
367 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
344 aliases are now lower case on windows (MyCommand.exe => mycommand).
368 aliases are now lower case on windows (MyCommand.exe => mycommand).
345
369
346 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
370 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
347 Macros are now callable objects that inherit from ipapi.IPyAutocall,
371 Macros are now callable objects that inherit from ipapi.IPyAutocall,
348 i.e. get autocalled regardless of system autocall setting.
372 i.e. get autocalled regardless of system autocall setting.
349
373
350 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
374 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
351
375
352 * IPython/rlineimpl.py: check for clear_history in readline and
376 * IPython/rlineimpl.py: check for clear_history in readline and
353 make it a dummy no-op if not available. This function isn't
377 make it a dummy no-op if not available. This function isn't
354 guaranteed to be in the API and appeared in Python 2.4, so we need
378 guaranteed to be in the API and appeared in Python 2.4, so we need
355 to check it ourselves. Also, clean up this file quite a bit.
379 to check it ourselves. Also, clean up this file quite a bit.
356
380
357 * ipython.1: update man page and full manual with information
381 * ipython.1: update man page and full manual with information
358 about threads (remove outdated warning). Closes #151.
382 about threads (remove outdated warning). Closes #151.
359
383
360 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
384 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
361
385
362 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
386 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
363 in trunk (note that this made it into the 0.8.1 release already,
387 in trunk (note that this made it into the 0.8.1 release already,
364 but the changelogs didn't get coordinated). Many thanks to Gael
388 but the changelogs didn't get coordinated). Many thanks to Gael
365 Varoquaux <gael.varoquaux-AT-normalesup.org>
389 Varoquaux <gael.varoquaux-AT-normalesup.org>
366
390
367 2007-05-09 *** Released version 0.8.1
391 2007-05-09 *** Released version 0.8.1
368
392
369 2007-05-10 Walter Doerwald <walter@livinglogic.de>
393 2007-05-10 Walter Doerwald <walter@livinglogic.de>
370
394
371 * IPython/Extensions/igrid.py: Incorporate html help into
395 * IPython/Extensions/igrid.py: Incorporate html help into
372 the module, so we don't have to search for the file.
396 the module, so we don't have to search for the file.
373
397
374 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
398 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
375
399
376 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
400 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
377
401
378 2007-04-30 Ville Vainio <vivainio@gmail.com>
402 2007-04-30 Ville Vainio <vivainio@gmail.com>
379
403
380 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
404 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
381 user has illegal (non-ascii) home directory name
405 user has illegal (non-ascii) home directory name
382
406
383 2007-04-27 Ville Vainio <vivainio@gmail.com>
407 2007-04-27 Ville Vainio <vivainio@gmail.com>
384
408
385 * platutils_win32.py: implement set_term_title for windows
409 * platutils_win32.py: implement set_term_title for windows
386
410
387 * Update version number
411 * Update version number
388
412
389 * ipy_profile_sh.py: more informative prompt (2 dir levels)
413 * ipy_profile_sh.py: more informative prompt (2 dir levels)
390
414
391 2007-04-26 Walter Doerwald <walter@livinglogic.de>
415 2007-04-26 Walter Doerwald <walter@livinglogic.de>
392
416
393 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
417 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
394 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
418 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
395 bug discovered by Ville).
419 bug discovered by Ville).
396
420
397 2007-04-26 Ville Vainio <vivainio@gmail.com>
421 2007-04-26 Ville Vainio <vivainio@gmail.com>
398
422
399 * Extensions/ipy_completers.py: Olivier's module completer now
423 * Extensions/ipy_completers.py: Olivier's module completer now
400 saves the list of root modules if it takes > 4 secs on the first run.
424 saves the list of root modules if it takes > 4 secs on the first run.
401
425
402 * Magic.py (%rehashx): %rehashx now clears the completer cache
426 * Magic.py (%rehashx): %rehashx now clears the completer cache
403
427
404
428
405 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
429 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
406
430
407 * ipython.el: fix incorrect color scheme, reported by Stefan.
431 * ipython.el: fix incorrect color scheme, reported by Stefan.
408 Closes #149.
432 Closes #149.
409
433
410 * IPython/PyColorize.py (Parser.format2): fix state-handling
434 * IPython/PyColorize.py (Parser.format2): fix state-handling
411 logic. I still don't like how that code handles state, but at
435 logic. I still don't like how that code handles state, but at
412 least now it should be correct, if inelegant. Closes #146.
436 least now it should be correct, if inelegant. Closes #146.
413
437
414 2007-04-25 Ville Vainio <vivainio@gmail.com>
438 2007-04-25 Ville Vainio <vivainio@gmail.com>
415
439
416 * Extensions/ipy_which.py: added extension for %which magic, works
440 * Extensions/ipy_which.py: added extension for %which magic, works
417 a lot like unix 'which' but also finds and expands aliases, and
441 a lot like unix 'which' but also finds and expands aliases, and
418 allows wildcards.
442 allows wildcards.
419
443
420 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
444 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
421 as opposed to returning nothing.
445 as opposed to returning nothing.
422
446
423 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
447 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
424 ipy_stock_completers on default profile, do import on sh profile.
448 ipy_stock_completers on default profile, do import on sh profile.
425
449
426 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
450 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
427
451
428 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
452 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
429 like ipython.py foo.py which raised a IndexError.
453 like ipython.py foo.py which raised a IndexError.
430
454
431 2007-04-21 Ville Vainio <vivainio@gmail.com>
455 2007-04-21 Ville Vainio <vivainio@gmail.com>
432
456
433 * Extensions/ipy_extutil.py: added extension to manage other ipython
457 * Extensions/ipy_extutil.py: added extension to manage other ipython
434 extensions. Now only supports 'ls' == list extensions.
458 extensions. Now only supports 'ls' == list extensions.
435
459
436 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
460 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
437
461
438 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
462 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
439 would prevent use of the exception system outside of a running
463 would prevent use of the exception system outside of a running
440 IPython instance.
464 IPython instance.
441
465
442 2007-04-20 Ville Vainio <vivainio@gmail.com>
466 2007-04-20 Ville Vainio <vivainio@gmail.com>
443
467
444 * Extensions/ipy_render.py: added extension for easy
468 * Extensions/ipy_render.py: added extension for easy
445 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
469 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
446 'Iptl' template notation,
470 'Iptl' template notation,
447
471
448 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
472 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
449 safer & faster 'import' completer.
473 safer & faster 'import' completer.
450
474
451 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
475 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
452 and _ip.defalias(name, command).
476 and _ip.defalias(name, command).
453
477
454 * Extensions/ipy_exportdb.py: New extension for exporting all the
478 * Extensions/ipy_exportdb.py: New extension for exporting all the
455 %store'd data in a portable format (normal ipapi calls like
479 %store'd data in a portable format (normal ipapi calls like
456 defmacro() etc.)
480 defmacro() etc.)
457
481
458 2007-04-19 Ville Vainio <vivainio@gmail.com>
482 2007-04-19 Ville Vainio <vivainio@gmail.com>
459
483
460 * upgrade_dir.py: skip junk files like *.pyc
484 * upgrade_dir.py: skip junk files like *.pyc
461
485
462 * Release.py: version number to 0.8.1
486 * Release.py: version number to 0.8.1
463
487
464 2007-04-18 Ville Vainio <vivainio@gmail.com>
488 2007-04-18 Ville Vainio <vivainio@gmail.com>
465
489
466 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
490 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
467 and later on win32.
491 and later on win32.
468
492
469 2007-04-16 Ville Vainio <vivainio@gmail.com>
493 2007-04-16 Ville Vainio <vivainio@gmail.com>
470
494
471 * iplib.py (showtraceback): Do not crash when running w/o readline.
495 * iplib.py (showtraceback): Do not crash when running w/o readline.
472
496
473 2007-04-12 Walter Doerwald <walter@livinglogic.de>
497 2007-04-12 Walter Doerwald <walter@livinglogic.de>
474
498
475 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
499 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
476 sorted (case sensitive with files and dirs mixed).
500 sorted (case sensitive with files and dirs mixed).
477
501
478 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
502 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
479
503
480 * IPython/Release.py (version): Open trunk for 0.8.1 development.
504 * IPython/Release.py (version): Open trunk for 0.8.1 development.
481
505
482 2007-04-10 *** Released version 0.8.0
506 2007-04-10 *** Released version 0.8.0
483
507
484 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
508 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
485
509
486 * Tag 0.8.0 for release.
510 * Tag 0.8.0 for release.
487
511
488 * IPython/iplib.py (reloadhist): add API function to cleanly
512 * IPython/iplib.py (reloadhist): add API function to cleanly
489 reload the readline history, which was growing inappropriately on
513 reload the readline history, which was growing inappropriately on
490 every %run call.
514 every %run call.
491
515
492 * win32_manual_post_install.py (run): apply last part of Nicolas
516 * win32_manual_post_install.py (run): apply last part of Nicolas
493 Pernetty's patch (I'd accidentally applied it in a different
517 Pernetty's patch (I'd accidentally applied it in a different
494 directory and this particular file didn't get patched).
518 directory and this particular file didn't get patched).
495
519
496 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
520 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
497
521
498 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
522 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
499 find the main thread id and use the proper API call. Thanks to
523 find the main thread id and use the proper API call. Thanks to
500 Stefan for the fix.
524 Stefan for the fix.
501
525
502 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
526 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
503 unit tests to reflect fixed ticket #52, and add more tests sent by
527 unit tests to reflect fixed ticket #52, and add more tests sent by
504 him.
528 him.
505
529
506 * IPython/iplib.py (raw_input): restore the readline completer
530 * IPython/iplib.py (raw_input): restore the readline completer
507 state on every input, in case third-party code messed it up.
531 state on every input, in case third-party code messed it up.
508 (_prefilter): revert recent addition of early-escape checks which
532 (_prefilter): revert recent addition of early-escape checks which
509 prevent many valid alias calls from working.
533 prevent many valid alias calls from working.
510
534
511 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
535 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
512 flag for sigint handler so we don't run a full signal() call on
536 flag for sigint handler so we don't run a full signal() call on
513 each runcode access.
537 each runcode access.
514
538
515 * IPython/Magic.py (magic_whos): small improvement to diagnostic
539 * IPython/Magic.py (magic_whos): small improvement to diagnostic
516 message.
540 message.
517
541
518 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
542 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
519
543
520 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
544 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
521 asynchronous exceptions working, i.e., Ctrl-C can actually
545 asynchronous exceptions working, i.e., Ctrl-C can actually
522 interrupt long-running code in the multithreaded shells.
546 interrupt long-running code in the multithreaded shells.
523
547
524 This is using Tomer Filiba's great ctypes-based trick:
548 This is using Tomer Filiba's great ctypes-based trick:
525 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
549 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
526 this in the past, but hadn't been able to make it work before. So
550 this in the past, but hadn't been able to make it work before. So
527 far it looks like it's actually running, but this needs more
551 far it looks like it's actually running, but this needs more
528 testing. If it really works, I'll be *very* happy, and we'll owe
552 testing. If it really works, I'll be *very* happy, and we'll owe
529 a huge thank you to Tomer. My current implementation is ugly,
553 a huge thank you to Tomer. My current implementation is ugly,
530 hackish and uses nasty globals, but I don't want to try and clean
554 hackish and uses nasty globals, but I don't want to try and clean
531 anything up until we know if it actually works.
555 anything up until we know if it actually works.
532
556
533 NOTE: this feature needs ctypes to work. ctypes is included in
557 NOTE: this feature needs ctypes to work. ctypes is included in
534 Python2.5, but 2.4 users will need to manually install it. This
558 Python2.5, but 2.4 users will need to manually install it. This
535 feature makes multi-threaded shells so much more usable that it's
559 feature makes multi-threaded shells so much more usable that it's
536 a minor price to pay (ctypes is very easy to install, already a
560 a minor price to pay (ctypes is very easy to install, already a
537 requirement for win32 and available in major linux distros).
561 requirement for win32 and available in major linux distros).
538
562
539 2007-04-04 Ville Vainio <vivainio@gmail.com>
563 2007-04-04 Ville Vainio <vivainio@gmail.com>
540
564
541 * Extensions/ipy_completers.py, ipy_stock_completers.py:
565 * Extensions/ipy_completers.py, ipy_stock_completers.py:
542 Moved implementations of 'bundled' completers to ipy_completers.py,
566 Moved implementations of 'bundled' completers to ipy_completers.py,
543 they are only enabled in ipy_stock_completers.py.
567 they are only enabled in ipy_stock_completers.py.
544
568
545 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
569 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
546
570
547 * IPython/PyColorize.py (Parser.format2): Fix identation of
571 * IPython/PyColorize.py (Parser.format2): Fix identation of
548 colorzied output and return early if color scheme is NoColor, to
572 colorzied output and return early if color scheme is NoColor, to
549 avoid unnecessary and expensive tokenization. Closes #131.
573 avoid unnecessary and expensive tokenization. Closes #131.
550
574
551 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
575 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
552
576
553 * IPython/Debugger.py: disable the use of pydb version 1.17. It
577 * IPython/Debugger.py: disable the use of pydb version 1.17. It
554 has a critical bug (a missing import that makes post-mortem not
578 has a critical bug (a missing import that makes post-mortem not
555 work at all). Unfortunately as of this time, this is the version
579 work at all). Unfortunately as of this time, this is the version
556 shipped with Ubuntu Edgy, so quite a few people have this one. I
580 shipped with Ubuntu Edgy, so quite a few people have this one. I
557 hope Edgy will update to a more recent package.
581 hope Edgy will update to a more recent package.
558
582
559 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
583 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
560
584
561 * IPython/iplib.py (_prefilter): close #52, second part of a patch
585 * IPython/iplib.py (_prefilter): close #52, second part of a patch
562 set by Stefan (only the first part had been applied before).
586 set by Stefan (only the first part had been applied before).
563
587
564 * IPython/Extensions/ipy_stock_completers.py (module_completer):
588 * IPython/Extensions/ipy_stock_completers.py (module_completer):
565 remove usage of the dangerous pkgutil.walk_packages(). See
589 remove usage of the dangerous pkgutil.walk_packages(). See
566 details in comments left in the code.
590 details in comments left in the code.
567
591
568 * IPython/Magic.py (magic_whos): add support for numpy arrays
592 * IPython/Magic.py (magic_whos): add support for numpy arrays
569 similar to what we had for Numeric.
593 similar to what we had for Numeric.
570
594
571 * IPython/completer.py (IPCompleter.complete): extend the
595 * IPython/completer.py (IPCompleter.complete): extend the
572 complete() call API to support completions by other mechanisms
596 complete() call API to support completions by other mechanisms
573 than readline. Closes #109.
597 than readline. Closes #109.
574
598
575 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
599 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
576 protect against a bug in Python's execfile(). Closes #123.
600 protect against a bug in Python's execfile(). Closes #123.
577
601
578 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
602 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
579
603
580 * IPython/iplib.py (split_user_input): ensure that when splitting
604 * IPython/iplib.py (split_user_input): ensure that when splitting
581 user input, the part that can be treated as a python name is pure
605 user input, the part that can be treated as a python name is pure
582 ascii (Python identifiers MUST be pure ascii). Part of the
606 ascii (Python identifiers MUST be pure ascii). Part of the
583 ongoing Unicode support work.
607 ongoing Unicode support work.
584
608
585 * IPython/Prompts.py (prompt_specials_color): Add \N for the
609 * IPython/Prompts.py (prompt_specials_color): Add \N for the
586 actual prompt number, without any coloring. This allows users to
610 actual prompt number, without any coloring. This allows users to
587 produce numbered prompts with their own colors. Added after a
611 produce numbered prompts with their own colors. Added after a
588 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
612 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
589
613
590 2007-03-31 Walter Doerwald <walter@livinglogic.de>
614 2007-03-31 Walter Doerwald <walter@livinglogic.de>
591
615
592 * IPython/Extensions/igrid.py: Map the return key
616 * IPython/Extensions/igrid.py: Map the return key
593 to enter() and shift-return to enterattr().
617 to enter() and shift-return to enterattr().
594
618
595 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
619 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
596
620
597 * IPython/Magic.py (magic_psearch): add unicode support by
621 * IPython/Magic.py (magic_psearch): add unicode support by
598 encoding to ascii the input, since this routine also only deals
622 encoding to ascii the input, since this routine also only deals
599 with valid Python names. Fixes a bug reported by Stefan.
623 with valid Python names. Fixes a bug reported by Stefan.
600
624
601 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
625 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
602
626
603 * IPython/Magic.py (_inspect): convert unicode input into ascii
627 * IPython/Magic.py (_inspect): convert unicode input into ascii
604 before trying to evaluate it as a Python identifier. This fixes a
628 before trying to evaluate it as a Python identifier. This fixes a
605 problem that the new unicode support had introduced when analyzing
629 problem that the new unicode support had introduced when analyzing
606 long definition lines for functions.
630 long definition lines for functions.
607
631
608 2007-03-24 Walter Doerwald <walter@livinglogic.de>
632 2007-03-24 Walter Doerwald <walter@livinglogic.de>
609
633
610 * IPython/Extensions/igrid.py: Fix picking. Using
634 * IPython/Extensions/igrid.py: Fix picking. Using
611 igrid with wxPython 2.6 and -wthread should work now.
635 igrid with wxPython 2.6 and -wthread should work now.
612 igrid.display() simply tries to create a frame without
636 igrid.display() simply tries to create a frame without
613 an application. Only if this fails an application is created.
637 an application. Only if this fails an application is created.
614
638
615 2007-03-23 Walter Doerwald <walter@livinglogic.de>
639 2007-03-23 Walter Doerwald <walter@livinglogic.de>
616
640
617 * IPython/Extensions/path.py: Updated to version 2.2.
641 * IPython/Extensions/path.py: Updated to version 2.2.
618
642
619 2007-03-23 Ville Vainio <vivainio@gmail.com>
643 2007-03-23 Ville Vainio <vivainio@gmail.com>
620
644
621 * iplib.py: recursive alias expansion now works better, so that
645 * iplib.py: recursive alias expansion now works better, so that
622 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
646 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
623 doesn't trip up the process, if 'd' has been aliased to 'ls'.
647 doesn't trip up the process, if 'd' has been aliased to 'ls'.
624
648
625 * Extensions/ipy_gnuglobal.py added, provides %global magic
649 * Extensions/ipy_gnuglobal.py added, provides %global magic
626 for users of http://www.gnu.org/software/global
650 for users of http://www.gnu.org/software/global
627
651
628 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
652 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
629 Closes #52. Patch by Stefan van der Walt.
653 Closes #52. Patch by Stefan van der Walt.
630
654
631 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
655 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
632
656
633 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
657 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
634 respect the __file__ attribute when using %run. Thanks to a bug
658 respect the __file__ attribute when using %run. Thanks to a bug
635 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
659 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
636
660
637 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
661 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
638
662
639 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
663 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
640 input. Patch sent by Stefan.
664 input. Patch sent by Stefan.
641
665
642 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
666 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
643 * IPython/Extensions/ipy_stock_completer.py
667 * IPython/Extensions/ipy_stock_completer.py
644 shlex_split, fix bug in shlex_split. len function
668 shlex_split, fix bug in shlex_split. len function
645 call was missing an if statement. Caused shlex_split to
669 call was missing an if statement. Caused shlex_split to
646 sometimes return "" as last element.
670 sometimes return "" as last element.
647
671
648 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
672 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
649
673
650 * IPython/completer.py
674 * IPython/completer.py
651 (IPCompleter.file_matches.single_dir_expand): fix a problem
675 (IPCompleter.file_matches.single_dir_expand): fix a problem
652 reported by Stefan, where directories containign a single subdir
676 reported by Stefan, where directories containign a single subdir
653 would be completed too early.
677 would be completed too early.
654
678
655 * IPython/Shell.py (_load_pylab): Make the execution of 'from
679 * IPython/Shell.py (_load_pylab): Make the execution of 'from
656 pylab import *' when -pylab is given be optional. A new flag,
680 pylab import *' when -pylab is given be optional. A new flag,
657 pylab_import_all controls this behavior, the default is True for
681 pylab_import_all controls this behavior, the default is True for
658 backwards compatibility.
682 backwards compatibility.
659
683
660 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
684 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
661 modified) R. Bernstein's patch for fully syntax highlighted
685 modified) R. Bernstein's patch for fully syntax highlighted
662 tracebacks. The functionality is also available under ultraTB for
686 tracebacks. The functionality is also available under ultraTB for
663 non-ipython users (someone using ultraTB but outside an ipython
687 non-ipython users (someone using ultraTB but outside an ipython
664 session). They can select the color scheme by setting the
688 session). They can select the color scheme by setting the
665 module-level global DEFAULT_SCHEME. The highlight functionality
689 module-level global DEFAULT_SCHEME. The highlight functionality
666 also works when debugging.
690 also works when debugging.
667
691
668 * IPython/genutils.py (IOStream.close): small patch by
692 * IPython/genutils.py (IOStream.close): small patch by
669 R. Bernstein for improved pydb support.
693 R. Bernstein for improved pydb support.
670
694
671 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
695 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
672 DaveS <davls@telus.net> to improve support of debugging under
696 DaveS <davls@telus.net> to improve support of debugging under
673 NTEmacs, including improved pydb behavior.
697 NTEmacs, including improved pydb behavior.
674
698
675 * IPython/Magic.py (magic_prun): Fix saving of profile info for
699 * IPython/Magic.py (magic_prun): Fix saving of profile info for
676 Python 2.5, where the stats object API changed a little. Thanks
700 Python 2.5, where the stats object API changed a little. Thanks
677 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
701 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
678
702
679 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
703 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
680 Pernetty's patch to improve support for (X)Emacs under Win32.
704 Pernetty's patch to improve support for (X)Emacs under Win32.
681
705
682 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
706 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
683
707
684 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
708 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
685 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
709 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
686 a report by Nik Tautenhahn.
710 a report by Nik Tautenhahn.
687
711
688 2007-03-16 Walter Doerwald <walter@livinglogic.de>
712 2007-03-16 Walter Doerwald <walter@livinglogic.de>
689
713
690 * setup.py: Add the igrid help files to the list of data files
714 * setup.py: Add the igrid help files to the list of data files
691 to be installed alongside igrid.
715 to be installed alongside igrid.
692 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
716 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
693 Show the input object of the igrid browser as the window tile.
717 Show the input object of the igrid browser as the window tile.
694 Show the object the cursor is on in the statusbar.
718 Show the object the cursor is on in the statusbar.
695
719
696 2007-03-15 Ville Vainio <vivainio@gmail.com>
720 2007-03-15 Ville Vainio <vivainio@gmail.com>
697
721
698 * Extensions/ipy_stock_completers.py: Fixed exception
722 * Extensions/ipy_stock_completers.py: Fixed exception
699 on mismatching quotes in %run completer. Patch by
723 on mismatching quotes in %run completer. Patch by
700 JοΏ½rgen Stenarson. Closes #127.
724 JοΏ½rgen Stenarson. Closes #127.
701
725
702 2007-03-14 Ville Vainio <vivainio@gmail.com>
726 2007-03-14 Ville Vainio <vivainio@gmail.com>
703
727
704 * Extensions/ext_rehashdir.py: Do not do auto_alias
728 * Extensions/ext_rehashdir.py: Do not do auto_alias
705 in %rehashdir, it clobbers %store'd aliases.
729 in %rehashdir, it clobbers %store'd aliases.
706
730
707 * UserConfig/ipy_profile_sh.py: envpersist.py extension
731 * UserConfig/ipy_profile_sh.py: envpersist.py extension
708 (beefed up %env) imported for sh profile.
732 (beefed up %env) imported for sh profile.
709
733
710 2007-03-10 Walter Doerwald <walter@livinglogic.de>
734 2007-03-10 Walter Doerwald <walter@livinglogic.de>
711
735
712 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
736 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
713 as the default browser.
737 as the default browser.
714 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
738 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
715 As igrid displays all attributes it ever encounters, fetch() (which has
739 As igrid displays all attributes it ever encounters, fetch() (which has
716 been renamed to _fetch()) doesn't have to recalculate the display attributes
740 been renamed to _fetch()) doesn't have to recalculate the display attributes
717 every time a new item is fetched. This should speed up scrolling.
741 every time a new item is fetched. This should speed up scrolling.
718
742
719 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
743 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
720
744
721 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
745 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
722 Schmolck's recently reported tab-completion bug (my previous one
746 Schmolck's recently reported tab-completion bug (my previous one
723 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
747 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
724
748
725 2007-03-09 Walter Doerwald <walter@livinglogic.de>
749 2007-03-09 Walter Doerwald <walter@livinglogic.de>
726
750
727 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
751 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
728 Close help window if exiting igrid.
752 Close help window if exiting igrid.
729
753
730 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
754 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
731
755
732 * IPython/Extensions/ipy_defaults.py: Check if readline is available
756 * IPython/Extensions/ipy_defaults.py: Check if readline is available
733 before calling functions from readline.
757 before calling functions from readline.
734
758
735 2007-03-02 Walter Doerwald <walter@livinglogic.de>
759 2007-03-02 Walter Doerwald <walter@livinglogic.de>
736
760
737 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
761 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
738 igrid is a wxPython-based display object for ipipe. If your system has
762 igrid is a wxPython-based display object for ipipe. If your system has
739 wx installed igrid will be the default display. Without wx ipipe falls
763 wx installed igrid will be the default display. Without wx ipipe falls
740 back to ibrowse (which needs curses). If no curses is installed ipipe
764 back to ibrowse (which needs curses). If no curses is installed ipipe
741 falls back to idump.
765 falls back to idump.
742
766
743 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
767 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
744
768
745 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
769 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
746 my changes from yesterday, they introduced bugs. Will reactivate
770 my changes from yesterday, they introduced bugs. Will reactivate
747 once I get a correct solution, which will be much easier thanks to
771 once I get a correct solution, which will be much easier thanks to
748 Dan Milstein's new prefilter test suite.
772 Dan Milstein's new prefilter test suite.
749
773
750 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
774 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
751
775
752 * IPython/iplib.py (split_user_input): fix input splitting so we
776 * IPython/iplib.py (split_user_input): fix input splitting so we
753 don't attempt attribute accesses on things that can't possibly be
777 don't attempt attribute accesses on things that can't possibly be
754 valid Python attributes. After a bug report by Alex Schmolck.
778 valid Python attributes. After a bug report by Alex Schmolck.
755 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
779 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
756 %magic with explicit % prefix.
780 %magic with explicit % prefix.
757
781
758 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
782 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
759
783
760 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
784 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
761 avoid a DeprecationWarning from GTK.
785 avoid a DeprecationWarning from GTK.
762
786
763 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
787 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
764
788
765 * IPython/genutils.py (clock): I modified clock() to return total
789 * IPython/genutils.py (clock): I modified clock() to return total
766 time, user+system. This is a more commonly needed metric. I also
790 time, user+system. This is a more commonly needed metric. I also
767 introduced the new clocku/clocks to get only user/system time if
791 introduced the new clocku/clocks to get only user/system time if
768 one wants those instead.
792 one wants those instead.
769
793
770 ***WARNING: API CHANGE*** clock() used to return only user time,
794 ***WARNING: API CHANGE*** clock() used to return only user time,
771 so if you want exactly the same results as before, use clocku
795 so if you want exactly the same results as before, use clocku
772 instead.
796 instead.
773
797
774 2007-02-22 Ville Vainio <vivainio@gmail.com>
798 2007-02-22 Ville Vainio <vivainio@gmail.com>
775
799
776 * IPython/Extensions/ipy_p4.py: Extension for improved
800 * IPython/Extensions/ipy_p4.py: Extension for improved
777 p4 (perforce version control system) experience.
801 p4 (perforce version control system) experience.
778 Adds %p4 magic with p4 command completion and
802 Adds %p4 magic with p4 command completion and
779 automatic -G argument (marshall output as python dict)
803 automatic -G argument (marshall output as python dict)
780
804
781 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
805 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
782
806
783 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
807 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
784 stop marks.
808 stop marks.
785 (ClearingMixin): a simple mixin to easily make a Demo class clear
809 (ClearingMixin): a simple mixin to easily make a Demo class clear
786 the screen in between blocks and have empty marquees. The
810 the screen in between blocks and have empty marquees. The
787 ClearDemo and ClearIPDemo classes that use it are included.
811 ClearDemo and ClearIPDemo classes that use it are included.
788
812
789 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
813 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
790
814
791 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
815 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
792 protect against exceptions at Python shutdown time. Patch
816 protect against exceptions at Python shutdown time. Patch
793 sumbmitted to upstream.
817 sumbmitted to upstream.
794
818
795 2007-02-14 Walter Doerwald <walter@livinglogic.de>
819 2007-02-14 Walter Doerwald <walter@livinglogic.de>
796
820
797 * IPython/Extensions/ibrowse.py: If entering the first object level
821 * IPython/Extensions/ibrowse.py: If entering the first object level
798 (i.e. the object for which the browser has been started) fails,
822 (i.e. the object for which the browser has been started) fails,
799 now the error is raised directly (aborting the browser) instead of
823 now the error is raised directly (aborting the browser) instead of
800 running into an empty levels list later.
824 running into an empty levels list later.
801
825
802 2007-02-03 Walter Doerwald <walter@livinglogic.de>
826 2007-02-03 Walter Doerwald <walter@livinglogic.de>
803
827
804 * IPython/Extensions/ipipe.py: Add an xrepr implementation
828 * IPython/Extensions/ipipe.py: Add an xrepr implementation
805 for the noitem object.
829 for the noitem object.
806
830
807 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
831 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
808
832
809 * IPython/completer.py (Completer.attr_matches): Fix small
833 * IPython/completer.py (Completer.attr_matches): Fix small
810 tab-completion bug with Enthought Traits objects with units.
834 tab-completion bug with Enthought Traits objects with units.
811 Thanks to a bug report by Tom Denniston
835 Thanks to a bug report by Tom Denniston
812 <tom.denniston-AT-alum.dartmouth.org>.
836 <tom.denniston-AT-alum.dartmouth.org>.
813
837
814 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
838 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
815
839
816 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
840 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
817 bug where only .ipy or .py would be completed. Once the first
841 bug where only .ipy or .py would be completed. Once the first
818 argument to %run has been given, all completions are valid because
842 argument to %run has been given, all completions are valid because
819 they are the arguments to the script, which may well be non-python
843 they are the arguments to the script, which may well be non-python
820 filenames.
844 filenames.
821
845
822 * IPython/irunner.py (InteractiveRunner.run_source): major updates
846 * IPython/irunner.py (InteractiveRunner.run_source): major updates
823 to irunner to allow it to correctly support real doctesting of
847 to irunner to allow it to correctly support real doctesting of
824 out-of-process ipython code.
848 out-of-process ipython code.
825
849
826 * IPython/Magic.py (magic_cd): Make the setting of the terminal
850 * IPython/Magic.py (magic_cd): Make the setting of the terminal
827 title an option (-noterm_title) because it completely breaks
851 title an option (-noterm_title) because it completely breaks
828 doctesting.
852 doctesting.
829
853
830 * IPython/demo.py: fix IPythonDemo class that was not actually working.
854 * IPython/demo.py: fix IPythonDemo class that was not actually working.
831
855
832 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
856 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
833
857
834 * IPython/irunner.py (main): fix small bug where extensions were
858 * IPython/irunner.py (main): fix small bug where extensions were
835 not being correctly recognized.
859 not being correctly recognized.
836
860
837 2007-01-23 Walter Doerwald <walter@livinglogic.de>
861 2007-01-23 Walter Doerwald <walter@livinglogic.de>
838
862
839 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
863 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
840 a string containing a single line yields the string itself as the
864 a string containing a single line yields the string itself as the
841 only item.
865 only item.
842
866
843 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
867 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
844 object if it's the same as the one on the last level (This avoids
868 object if it's the same as the one on the last level (This avoids
845 infinite recursion for one line strings).
869 infinite recursion for one line strings).
846
870
847 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
871 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
848
872
849 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
873 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
850 all output streams before printing tracebacks. This ensures that
874 all output streams before printing tracebacks. This ensures that
851 user output doesn't end up interleaved with traceback output.
875 user output doesn't end up interleaved with traceback output.
852
876
853 2007-01-10 Ville Vainio <vivainio@gmail.com>
877 2007-01-10 Ville Vainio <vivainio@gmail.com>
854
878
855 * Extensions/envpersist.py: Turbocharged %env that remembers
879 * Extensions/envpersist.py: Turbocharged %env that remembers
856 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
880 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
857 "%env VISUAL=jed".
881 "%env VISUAL=jed".
858
882
859 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
883 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
860
884
861 * IPython/iplib.py (showtraceback): ensure that we correctly call
885 * IPython/iplib.py (showtraceback): ensure that we correctly call
862 custom handlers in all cases (some with pdb were slipping through,
886 custom handlers in all cases (some with pdb were slipping through,
863 but I'm not exactly sure why).
887 but I'm not exactly sure why).
864
888
865 * IPython/Debugger.py (Tracer.__init__): added new class to
889 * IPython/Debugger.py (Tracer.__init__): added new class to
866 support set_trace-like usage of IPython's enhanced debugger.
890 support set_trace-like usage of IPython's enhanced debugger.
867
891
868 2006-12-24 Ville Vainio <vivainio@gmail.com>
892 2006-12-24 Ville Vainio <vivainio@gmail.com>
869
893
870 * ipmaker.py: more informative message when ipy_user_conf
894 * ipmaker.py: more informative message when ipy_user_conf
871 import fails (suggest running %upgrade).
895 import fails (suggest running %upgrade).
872
896
873 * tools/run_ipy_in_profiler.py: Utility to see where
897 * tools/run_ipy_in_profiler.py: Utility to see where
874 the time during IPython startup is spent.
898 the time during IPython startup is spent.
875
899
876 2006-12-20 Ville Vainio <vivainio@gmail.com>
900 2006-12-20 Ville Vainio <vivainio@gmail.com>
877
901
878 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
902 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
879
903
880 * ipapi.py: Add new ipapi method, expand_alias.
904 * ipapi.py: Add new ipapi method, expand_alias.
881
905
882 * Release.py: Bump up version to 0.7.4.svn
906 * Release.py: Bump up version to 0.7.4.svn
883
907
884 2006-12-17 Ville Vainio <vivainio@gmail.com>
908 2006-12-17 Ville Vainio <vivainio@gmail.com>
885
909
886 * Extensions/jobctrl.py: Fixed &cmd arg arg...
910 * Extensions/jobctrl.py: Fixed &cmd arg arg...
887 to work properly on posix too
911 to work properly on posix too
888
912
889 * Release.py: Update revnum (version is still just 0.7.3).
913 * Release.py: Update revnum (version is still just 0.7.3).
890
914
891 2006-12-15 Ville Vainio <vivainio@gmail.com>
915 2006-12-15 Ville Vainio <vivainio@gmail.com>
892
916
893 * scripts/ipython_win_post_install: create ipython.py in
917 * scripts/ipython_win_post_install: create ipython.py in
894 prefix + "/scripts".
918 prefix + "/scripts".
895
919
896 * Release.py: Update version to 0.7.3.
920 * Release.py: Update version to 0.7.3.
897
921
898 2006-12-14 Ville Vainio <vivainio@gmail.com>
922 2006-12-14 Ville Vainio <vivainio@gmail.com>
899
923
900 * scripts/ipython_win_post_install: Overwrite old shortcuts
924 * scripts/ipython_win_post_install: Overwrite old shortcuts
901 if they already exist
925 if they already exist
902
926
903 * Release.py: release 0.7.3rc2
927 * Release.py: release 0.7.3rc2
904
928
905 2006-12-13 Ville Vainio <vivainio@gmail.com>
929 2006-12-13 Ville Vainio <vivainio@gmail.com>
906
930
907 * Branch and update Release.py for 0.7.3rc1
931 * Branch and update Release.py for 0.7.3rc1
908
932
909 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
933 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
910
934
911 * IPython/Shell.py (IPShellWX): update for current WX naming
935 * IPython/Shell.py (IPShellWX): update for current WX naming
912 conventions, to avoid a deprecation warning with current WX
936 conventions, to avoid a deprecation warning with current WX
913 versions. Thanks to a report by Danny Shevitz.
937 versions. Thanks to a report by Danny Shevitz.
914
938
915 2006-12-12 Ville Vainio <vivainio@gmail.com>
939 2006-12-12 Ville Vainio <vivainio@gmail.com>
916
940
917 * ipmaker.py: apply david cournapeau's patch to make
941 * ipmaker.py: apply david cournapeau's patch to make
918 import_some work properly even when ipythonrc does
942 import_some work properly even when ipythonrc does
919 import_some on empty list (it was an old bug!).
943 import_some on empty list (it was an old bug!).
920
944
921 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
945 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
922 Add deprecation note to ipythonrc and a url to wiki
946 Add deprecation note to ipythonrc and a url to wiki
923 in ipy_user_conf.py
947 in ipy_user_conf.py
924
948
925
949
926 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
950 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
927 as if it was typed on IPython command prompt, i.e.
951 as if it was typed on IPython command prompt, i.e.
928 as IPython script.
952 as IPython script.
929
953
930 * example-magic.py, magic_grepl.py: remove outdated examples
954 * example-magic.py, magic_grepl.py: remove outdated examples
931
955
932 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
956 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
933
957
934 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
958 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
935 is called before any exception has occurred.
959 is called before any exception has occurred.
936
960
937 2006-12-08 Ville Vainio <vivainio@gmail.com>
961 2006-12-08 Ville Vainio <vivainio@gmail.com>
938
962
939 * Extensions/ipy_stock_completers.py: fix cd completer
963 * Extensions/ipy_stock_completers.py: fix cd completer
940 to translate /'s to \'s again.
964 to translate /'s to \'s again.
941
965
942 * completer.py: prevent traceback on file completions w/
966 * completer.py: prevent traceback on file completions w/
943 backslash.
967 backslash.
944
968
945 * Release.py: Update release number to 0.7.3b3 for release
969 * Release.py: Update release number to 0.7.3b3 for release
946
970
947 2006-12-07 Ville Vainio <vivainio@gmail.com>
971 2006-12-07 Ville Vainio <vivainio@gmail.com>
948
972
949 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
973 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
950 while executing external code. Provides more shell-like behaviour
974 while executing external code. Provides more shell-like behaviour
951 and overall better response to ctrl + C / ctrl + break.
975 and overall better response to ctrl + C / ctrl + break.
952
976
953 * tools/make_tarball.py: new script to create tarball straight from svn
977 * tools/make_tarball.py: new script to create tarball straight from svn
954 (setup.py sdist doesn't work on win32).
978 (setup.py sdist doesn't work on win32).
955
979
956 * Extensions/ipy_stock_completers.py: fix cd completer to give up
980 * Extensions/ipy_stock_completers.py: fix cd completer to give up
957 on dirnames with spaces and use the default completer instead.
981 on dirnames with spaces and use the default completer instead.
958
982
959 * Revision.py: Change version to 0.7.3b2 for release.
983 * Revision.py: Change version to 0.7.3b2 for release.
960
984
961 2006-12-05 Ville Vainio <vivainio@gmail.com>
985 2006-12-05 Ville Vainio <vivainio@gmail.com>
962
986
963 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
987 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
964 pydb patch 4 (rm debug printing, py 2.5 checking)
988 pydb patch 4 (rm debug printing, py 2.5 checking)
965
989
966 2006-11-30 Walter Doerwald <walter@livinglogic.de>
990 2006-11-30 Walter Doerwald <walter@livinglogic.de>
967 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
991 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
968 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
992 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
969 "refreshfind" (mapped to "R") does the same but tries to go back to the same
993 "refreshfind" (mapped to "R") does the same but tries to go back to the same
970 object the cursor was on before the refresh. The command "markrange" is
994 object the cursor was on before the refresh. The command "markrange" is
971 mapped to "%" now.
995 mapped to "%" now.
972 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
996 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
973
997
974 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
998 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
975
999
976 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1000 * IPython/Magic.py (magic_debug): new %debug magic to activate the
977 interactive debugger on the last traceback, without having to call
1001 interactive debugger on the last traceback, without having to call
978 %pdb and rerun your code. Made minor changes in various modules,
1002 %pdb and rerun your code. Made minor changes in various modules,
979 should automatically recognize pydb if available.
1003 should automatically recognize pydb if available.
980
1004
981 2006-11-28 Ville Vainio <vivainio@gmail.com>
1005 2006-11-28 Ville Vainio <vivainio@gmail.com>
982
1006
983 * completer.py: If the text start with !, show file completions
1007 * completer.py: If the text start with !, show file completions
984 properly. This helps when trying to complete command name
1008 properly. This helps when trying to complete command name
985 for shell escapes.
1009 for shell escapes.
986
1010
987 2006-11-27 Ville Vainio <vivainio@gmail.com>
1011 2006-11-27 Ville Vainio <vivainio@gmail.com>
988
1012
989 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1013 * ipy_stock_completers.py: bzr completer submitted by Stefan van
990 der Walt. Clean up svn and hg completers by using a common
1014 der Walt. Clean up svn and hg completers by using a common
991 vcs_completer.
1015 vcs_completer.
992
1016
993 2006-11-26 Ville Vainio <vivainio@gmail.com>
1017 2006-11-26 Ville Vainio <vivainio@gmail.com>
994
1018
995 * Remove ipconfig and %config; you should use _ip.options structure
1019 * Remove ipconfig and %config; you should use _ip.options structure
996 directly instead!
1020 directly instead!
997
1021
998 * genutils.py: add wrap_deprecated function for deprecating callables
1022 * genutils.py: add wrap_deprecated function for deprecating callables
999
1023
1000 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1024 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1001 _ip.system instead. ipalias is redundant.
1025 _ip.system instead. ipalias is redundant.
1002
1026
1003 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1027 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1004 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1028 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1005 explicit.
1029 explicit.
1006
1030
1007 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1031 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1008 completer. Try it by entering 'hg ' and pressing tab.
1032 completer. Try it by entering 'hg ' and pressing tab.
1009
1033
1010 * macro.py: Give Macro a useful __repr__ method
1034 * macro.py: Give Macro a useful __repr__ method
1011
1035
1012 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1036 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1013
1037
1014 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1038 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1015 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1039 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1016 we don't get a duplicate ipipe module, where registration of the xrepr
1040 we don't get a duplicate ipipe module, where registration of the xrepr
1017 implementation for Text is useless.
1041 implementation for Text is useless.
1018
1042
1019 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1043 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1020
1044
1021 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1045 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1022
1046
1023 2006-11-24 Ville Vainio <vivainio@gmail.com>
1047 2006-11-24 Ville Vainio <vivainio@gmail.com>
1024
1048
1025 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1049 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1026 try to use "cProfile" instead of the slower pure python
1050 try to use "cProfile" instead of the slower pure python
1027 "profile"
1051 "profile"
1028
1052
1029 2006-11-23 Ville Vainio <vivainio@gmail.com>
1053 2006-11-23 Ville Vainio <vivainio@gmail.com>
1030
1054
1031 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1055 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1032 Qt+IPython+Designer link in documentation.
1056 Qt+IPython+Designer link in documentation.
1033
1057
1034 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1058 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1035 correct Pdb object to %pydb.
1059 correct Pdb object to %pydb.
1036
1060
1037
1061
1038 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1062 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1039 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1063 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1040 generic xrepr(), otherwise the list implementation would kick in.
1064 generic xrepr(), otherwise the list implementation would kick in.
1041
1065
1042 2006-11-21 Ville Vainio <vivainio@gmail.com>
1066 2006-11-21 Ville Vainio <vivainio@gmail.com>
1043
1067
1044 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1068 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1045 with one from UserConfig.
1069 with one from UserConfig.
1046
1070
1047 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1071 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1048 it was missing which broke the sh profile.
1072 it was missing which broke the sh profile.
1049
1073
1050 * completer.py: file completer now uses explicit '/' instead
1074 * completer.py: file completer now uses explicit '/' instead
1051 of os.path.join, expansion of 'foo' was broken on win32
1075 of os.path.join, expansion of 'foo' was broken on win32
1052 if there was one directory with name 'foobar'.
1076 if there was one directory with name 'foobar'.
1053
1077
1054 * A bunch of patches from Kirill Smelkov:
1078 * A bunch of patches from Kirill Smelkov:
1055
1079
1056 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1080 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1057
1081
1058 * [patch 7/9] Implement %page -r (page in raw mode) -
1082 * [patch 7/9] Implement %page -r (page in raw mode) -
1059
1083
1060 * [patch 5/9] ScientificPython webpage has moved
1084 * [patch 5/9] ScientificPython webpage has moved
1061
1085
1062 * [patch 4/9] The manual mentions %ds, should be %dhist
1086 * [patch 4/9] The manual mentions %ds, should be %dhist
1063
1087
1064 * [patch 3/9] Kill old bits from %prun doc.
1088 * [patch 3/9] Kill old bits from %prun doc.
1065
1089
1066 * [patch 1/9] Fix typos here and there.
1090 * [patch 1/9] Fix typos here and there.
1067
1091
1068 2006-11-08 Ville Vainio <vivainio@gmail.com>
1092 2006-11-08 Ville Vainio <vivainio@gmail.com>
1069
1093
1070 * completer.py (attr_matches): catch all exceptions raised
1094 * completer.py (attr_matches): catch all exceptions raised
1071 by eval of expr with dots.
1095 by eval of expr with dots.
1072
1096
1073 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1097 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1074
1098
1075 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1099 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1076 input if it starts with whitespace. This allows you to paste
1100 input if it starts with whitespace. This allows you to paste
1077 indented input from any editor without manually having to type in
1101 indented input from any editor without manually having to type in
1078 the 'if 1:', which is convenient when working interactively.
1102 the 'if 1:', which is convenient when working interactively.
1079 Slightly modifed version of a patch by Bo Peng
1103 Slightly modifed version of a patch by Bo Peng
1080 <bpeng-AT-rice.edu>.
1104 <bpeng-AT-rice.edu>.
1081
1105
1082 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1106 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1083
1107
1084 * IPython/irunner.py (main): modified irunner so it automatically
1108 * IPython/irunner.py (main): modified irunner so it automatically
1085 recognizes the right runner to use based on the extension (.py for
1109 recognizes the right runner to use based on the extension (.py for
1086 python, .ipy for ipython and .sage for sage).
1110 python, .ipy for ipython and .sage for sage).
1087
1111
1088 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1112 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1089 visible in ipapi as ip.config(), to programatically control the
1113 visible in ipapi as ip.config(), to programatically control the
1090 internal rc object. There's an accompanying %config magic for
1114 internal rc object. There's an accompanying %config magic for
1091 interactive use, which has been enhanced to match the
1115 interactive use, which has been enhanced to match the
1092 funtionality in ipconfig.
1116 funtionality in ipconfig.
1093
1117
1094 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1118 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1095 so it's not just a toggle, it now takes an argument. Add support
1119 so it's not just a toggle, it now takes an argument. Add support
1096 for a customizable header when making system calls, as the new
1120 for a customizable header when making system calls, as the new
1097 system_header variable in the ipythonrc file.
1121 system_header variable in the ipythonrc file.
1098
1122
1099 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1123 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1100
1124
1101 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1125 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1102 generic functions (using Philip J. Eby's simplegeneric package).
1126 generic functions (using Philip J. Eby's simplegeneric package).
1103 This makes it possible to customize the display of third-party classes
1127 This makes it possible to customize the display of third-party classes
1104 without having to monkeypatch them. xiter() no longer supports a mode
1128 without having to monkeypatch them. xiter() no longer supports a mode
1105 argument and the XMode class has been removed. The same functionality can
1129 argument and the XMode class has been removed. The same functionality can
1106 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1130 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1107 One consequence of the switch to generic functions is that xrepr() and
1131 One consequence of the switch to generic functions is that xrepr() and
1108 xattrs() implementation must define the default value for the mode
1132 xattrs() implementation must define the default value for the mode
1109 argument themselves and xattrs() implementations must return real
1133 argument themselves and xattrs() implementations must return real
1110 descriptors.
1134 descriptors.
1111
1135
1112 * IPython/external: This new subpackage will contain all third-party
1136 * IPython/external: This new subpackage will contain all third-party
1113 packages that are bundled with IPython. (The first one is simplegeneric).
1137 packages that are bundled with IPython. (The first one is simplegeneric).
1114
1138
1115 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1139 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1116 directory which as been dropped in r1703.
1140 directory which as been dropped in r1703.
1117
1141
1118 * IPython/Extensions/ipipe.py (iless): Fixed.
1142 * IPython/Extensions/ipipe.py (iless): Fixed.
1119
1143
1120 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1144 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1121
1145
1122 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1146 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1123
1147
1124 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1148 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1125 handling in variable expansion so that shells and magics recognize
1149 handling in variable expansion so that shells and magics recognize
1126 function local scopes correctly. Bug reported by Brian.
1150 function local scopes correctly. Bug reported by Brian.
1127
1151
1128 * scripts/ipython: remove the very first entry in sys.path which
1152 * scripts/ipython: remove the very first entry in sys.path which
1129 Python auto-inserts for scripts, so that sys.path under IPython is
1153 Python auto-inserts for scripts, so that sys.path under IPython is
1130 as similar as possible to that under plain Python.
1154 as similar as possible to that under plain Python.
1131
1155
1132 * IPython/completer.py (IPCompleter.file_matches): Fix
1156 * IPython/completer.py (IPCompleter.file_matches): Fix
1133 tab-completion so that quotes are not closed unless the completion
1157 tab-completion so that quotes are not closed unless the completion
1134 is unambiguous. After a request by Stefan. Minor cleanups in
1158 is unambiguous. After a request by Stefan. Minor cleanups in
1135 ipy_stock_completers.
1159 ipy_stock_completers.
1136
1160
1137 2006-11-02 Ville Vainio <vivainio@gmail.com>
1161 2006-11-02 Ville Vainio <vivainio@gmail.com>
1138
1162
1139 * ipy_stock_completers.py: Add %run and %cd completers.
1163 * ipy_stock_completers.py: Add %run and %cd completers.
1140
1164
1141 * completer.py: Try running custom completer for both
1165 * completer.py: Try running custom completer for both
1142 "foo" and "%foo" if the command is just "foo". Ignore case
1166 "foo" and "%foo" if the command is just "foo". Ignore case
1143 when filtering possible completions.
1167 when filtering possible completions.
1144
1168
1145 * UserConfig/ipy_user_conf.py: install stock completers as default
1169 * UserConfig/ipy_user_conf.py: install stock completers as default
1146
1170
1147 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1171 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1148 simplified readline history save / restore through a wrapper
1172 simplified readline history save / restore through a wrapper
1149 function
1173 function
1150
1174
1151
1175
1152 2006-10-31 Ville Vainio <vivainio@gmail.com>
1176 2006-10-31 Ville Vainio <vivainio@gmail.com>
1153
1177
1154 * strdispatch.py, completer.py, ipy_stock_completers.py:
1178 * strdispatch.py, completer.py, ipy_stock_completers.py:
1155 Allow str_key ("command") in completer hooks. Implement
1179 Allow str_key ("command") in completer hooks. Implement
1156 trivial completer for 'import' (stdlib modules only). Rename
1180 trivial completer for 'import' (stdlib modules only). Rename
1157 ipy_linux_package_managers.py to ipy_stock_completers.py.
1181 ipy_linux_package_managers.py to ipy_stock_completers.py.
1158 SVN completer.
1182 SVN completer.
1159
1183
1160 * Extensions/ledit.py: %magic line editor for easily and
1184 * Extensions/ledit.py: %magic line editor for easily and
1161 incrementally manipulating lists of strings. The magic command
1185 incrementally manipulating lists of strings. The magic command
1162 name is %led.
1186 name is %led.
1163
1187
1164 2006-10-30 Ville Vainio <vivainio@gmail.com>
1188 2006-10-30 Ville Vainio <vivainio@gmail.com>
1165
1189
1166 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1190 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1167 Bernsteins's patches for pydb integration.
1191 Bernsteins's patches for pydb integration.
1168 http://bashdb.sourceforge.net/pydb/
1192 http://bashdb.sourceforge.net/pydb/
1169
1193
1170 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1194 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1171 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1195 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1172 custom completer hook to allow the users to implement their own
1196 custom completer hook to allow the users to implement their own
1173 completers. See ipy_linux_package_managers.py for example. The
1197 completers. See ipy_linux_package_managers.py for example. The
1174 hook name is 'complete_command'.
1198 hook name is 'complete_command'.
1175
1199
1176 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1200 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1177
1201
1178 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1202 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1179 Numeric leftovers.
1203 Numeric leftovers.
1180
1204
1181 * ipython.el (py-execute-region): apply Stefan's patch to fix
1205 * ipython.el (py-execute-region): apply Stefan's patch to fix
1182 garbled results if the python shell hasn't been previously started.
1206 garbled results if the python shell hasn't been previously started.
1183
1207
1184 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1208 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1185 pretty generic function and useful for other things.
1209 pretty generic function and useful for other things.
1186
1210
1187 * IPython/OInspect.py (getsource): Add customizable source
1211 * IPython/OInspect.py (getsource): Add customizable source
1188 extractor. After a request/patch form W. Stein (SAGE).
1212 extractor. After a request/patch form W. Stein (SAGE).
1189
1213
1190 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1214 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1191 window size to a more reasonable value from what pexpect does,
1215 window size to a more reasonable value from what pexpect does,
1192 since their choice causes wrapping bugs with long input lines.
1216 since their choice causes wrapping bugs with long input lines.
1193
1217
1194 2006-10-28 Ville Vainio <vivainio@gmail.com>
1218 2006-10-28 Ville Vainio <vivainio@gmail.com>
1195
1219
1196 * Magic.py (%run): Save and restore the readline history from
1220 * Magic.py (%run): Save and restore the readline history from
1197 file around %run commands to prevent side effects from
1221 file around %run commands to prevent side effects from
1198 %runned programs that might use readline (e.g. pydb).
1222 %runned programs that might use readline (e.g. pydb).
1199
1223
1200 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1224 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1201 invoking the pydb enhanced debugger.
1225 invoking the pydb enhanced debugger.
1202
1226
1203 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1227 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1204
1228
1205 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1229 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1206 call the base class method and propagate the return value to
1230 call the base class method and propagate the return value to
1207 ifile. This is now done by path itself.
1231 ifile. This is now done by path itself.
1208
1232
1209 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1233 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1210
1234
1211 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1235 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1212 api: set_crash_handler(), to expose the ability to change the
1236 api: set_crash_handler(), to expose the ability to change the
1213 internal crash handler.
1237 internal crash handler.
1214
1238
1215 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1239 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1216 the various parameters of the crash handler so that apps using
1240 the various parameters of the crash handler so that apps using
1217 IPython as their engine can customize crash handling. Ipmlemented
1241 IPython as their engine can customize crash handling. Ipmlemented
1218 at the request of SAGE.
1242 at the request of SAGE.
1219
1243
1220 2006-10-14 Ville Vainio <vivainio@gmail.com>
1244 2006-10-14 Ville Vainio <vivainio@gmail.com>
1221
1245
1222 * Magic.py, ipython.el: applied first "safe" part of Rocky
1246 * Magic.py, ipython.el: applied first "safe" part of Rocky
1223 Bernstein's patch set for pydb integration.
1247 Bernstein's patch set for pydb integration.
1224
1248
1225 * Magic.py (%unalias, %alias): %store'd aliases can now be
1249 * Magic.py (%unalias, %alias): %store'd aliases can now be
1226 removed with '%unalias'. %alias w/o args now shows most
1250 removed with '%unalias'. %alias w/o args now shows most
1227 interesting (stored / manually defined) aliases last
1251 interesting (stored / manually defined) aliases last
1228 where they catch the eye w/o scrolling.
1252 where they catch the eye w/o scrolling.
1229
1253
1230 * Magic.py (%rehashx), ext_rehashdir.py: files with
1254 * Magic.py (%rehashx), ext_rehashdir.py: files with
1231 'py' extension are always considered executable, even
1255 'py' extension are always considered executable, even
1232 when not in PATHEXT environment variable.
1256 when not in PATHEXT environment variable.
1233
1257
1234 2006-10-12 Ville Vainio <vivainio@gmail.com>
1258 2006-10-12 Ville Vainio <vivainio@gmail.com>
1235
1259
1236 * jobctrl.py: Add new "jobctrl" extension for spawning background
1260 * jobctrl.py: Add new "jobctrl" extension for spawning background
1237 processes with "&find /". 'import jobctrl' to try it out. Requires
1261 processes with "&find /". 'import jobctrl' to try it out. Requires
1238 'subprocess' module, standard in python 2.4+.
1262 'subprocess' module, standard in python 2.4+.
1239
1263
1240 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1264 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1241 so if foo -> bar and bar -> baz, then foo -> baz.
1265 so if foo -> bar and bar -> baz, then foo -> baz.
1242
1266
1243 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1267 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1244
1268
1245 * IPython/Magic.py (Magic.parse_options): add a new posix option
1269 * IPython/Magic.py (Magic.parse_options): add a new posix option
1246 to allow parsing of input args in magics that doesn't strip quotes
1270 to allow parsing of input args in magics that doesn't strip quotes
1247 (if posix=False). This also closes %timeit bug reported by
1271 (if posix=False). This also closes %timeit bug reported by
1248 Stefan.
1272 Stefan.
1249
1273
1250 2006-10-03 Ville Vainio <vivainio@gmail.com>
1274 2006-10-03 Ville Vainio <vivainio@gmail.com>
1251
1275
1252 * iplib.py (raw_input, interact): Return ValueError catching for
1276 * iplib.py (raw_input, interact): Return ValueError catching for
1253 raw_input. Fixes infinite loop for sys.stdin.close() or
1277 raw_input. Fixes infinite loop for sys.stdin.close() or
1254 sys.stdout.close().
1278 sys.stdout.close().
1255
1279
1256 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1280 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1257
1281
1258 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1282 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1259 to help in handling doctests. irunner is now pretty useful for
1283 to help in handling doctests. irunner is now pretty useful for
1260 running standalone scripts and simulate a full interactive session
1284 running standalone scripts and simulate a full interactive session
1261 in a format that can be then pasted as a doctest.
1285 in a format that can be then pasted as a doctest.
1262
1286
1263 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1287 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1264 on top of the default (useless) ones. This also fixes the nasty
1288 on top of the default (useless) ones. This also fixes the nasty
1265 way in which 2.5's Quitter() exits (reverted [1785]).
1289 way in which 2.5's Quitter() exits (reverted [1785]).
1266
1290
1267 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1291 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1268 2.5.
1292 2.5.
1269
1293
1270 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1294 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1271 color scheme is updated as well when color scheme is changed
1295 color scheme is updated as well when color scheme is changed
1272 interactively.
1296 interactively.
1273
1297
1274 2006-09-27 Ville Vainio <vivainio@gmail.com>
1298 2006-09-27 Ville Vainio <vivainio@gmail.com>
1275
1299
1276 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1300 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1277 infinite loop and just exit. It's a hack, but will do for a while.
1301 infinite loop and just exit. It's a hack, but will do for a while.
1278
1302
1279 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1303 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1280
1304
1281 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1305 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1282 the constructor, this makes it possible to get a list of only directories
1306 the constructor, this makes it possible to get a list of only directories
1283 or only files.
1307 or only files.
1284
1308
1285 2006-08-12 Ville Vainio <vivainio@gmail.com>
1309 2006-08-12 Ville Vainio <vivainio@gmail.com>
1286
1310
1287 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1311 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1288 they broke unittest
1312 they broke unittest
1289
1313
1290 2006-08-11 Ville Vainio <vivainio@gmail.com>
1314 2006-08-11 Ville Vainio <vivainio@gmail.com>
1291
1315
1292 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1316 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1293 by resolving issue properly, i.e. by inheriting FakeModule
1317 by resolving issue properly, i.e. by inheriting FakeModule
1294 from types.ModuleType. Pickling ipython interactive data
1318 from types.ModuleType. Pickling ipython interactive data
1295 should still work as usual (testing appreciated).
1319 should still work as usual (testing appreciated).
1296
1320
1297 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1321 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1298
1322
1299 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1323 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1300 running under python 2.3 with code from 2.4 to fix a bug with
1324 running under python 2.3 with code from 2.4 to fix a bug with
1301 help(). Reported by the Debian maintainers, Norbert Tretkowski
1325 help(). Reported by the Debian maintainers, Norbert Tretkowski
1302 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1326 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1303 <afayolle-AT-debian.org>.
1327 <afayolle-AT-debian.org>.
1304
1328
1305 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1329 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1306
1330
1307 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1331 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1308 (which was displaying "quit" twice).
1332 (which was displaying "quit" twice).
1309
1333
1310 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1334 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1311
1335
1312 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1336 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1313 the mode argument).
1337 the mode argument).
1314
1338
1315 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1339 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1316
1340
1317 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1341 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1318 not running under IPython.
1342 not running under IPython.
1319
1343
1320 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1344 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1321 and make it iterable (iterating over the attribute itself). Add two new
1345 and make it iterable (iterating over the attribute itself). Add two new
1322 magic strings for __xattrs__(): If the string starts with "-", the attribute
1346 magic strings for __xattrs__(): If the string starts with "-", the attribute
1323 will not be displayed in ibrowse's detail view (but it can still be
1347 will not be displayed in ibrowse's detail view (but it can still be
1324 iterated over). This makes it possible to add attributes that are large
1348 iterated over). This makes it possible to add attributes that are large
1325 lists or generator methods to the detail view. Replace magic attribute names
1349 lists or generator methods to the detail view. Replace magic attribute names
1326 and _attrname() and _getattr() with "descriptors": For each type of magic
1350 and _attrname() and _getattr() with "descriptors": For each type of magic
1327 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1351 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1328 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1352 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1329 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1353 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1330 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1354 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1331 are still supported.
1355 are still supported.
1332
1356
1333 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1357 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1334 fails in ibrowse.fetch(), the exception object is added as the last item
1358 fails in ibrowse.fetch(), the exception object is added as the last item
1335 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1359 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1336 a generator throws an exception midway through execution.
1360 a generator throws an exception midway through execution.
1337
1361
1338 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1362 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1339 encoding into methods.
1363 encoding into methods.
1340
1364
1341 2006-07-26 Ville Vainio <vivainio@gmail.com>
1365 2006-07-26 Ville Vainio <vivainio@gmail.com>
1342
1366
1343 * iplib.py: history now stores multiline input as single
1367 * iplib.py: history now stores multiline input as single
1344 history entries. Patch by Jorgen Cederlof.
1368 history entries. Patch by Jorgen Cederlof.
1345
1369
1346 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1370 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1347
1371
1348 * IPython/Extensions/ibrowse.py: Make cursor visible over
1372 * IPython/Extensions/ibrowse.py: Make cursor visible over
1349 non existing attributes.
1373 non existing attributes.
1350
1374
1351 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1375 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1352
1376
1353 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1377 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1354 error output of the running command doesn't mess up the screen.
1378 error output of the running command doesn't mess up the screen.
1355
1379
1356 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1380 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1357
1381
1358 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1382 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1359 argument. This sorts the items themselves.
1383 argument. This sorts the items themselves.
1360
1384
1361 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1385 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1362
1386
1363 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1387 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1364 Compile expression strings into code objects. This should speed
1388 Compile expression strings into code objects. This should speed
1365 up ifilter and friends somewhat.
1389 up ifilter and friends somewhat.
1366
1390
1367 2006-07-08 Ville Vainio <vivainio@gmail.com>
1391 2006-07-08 Ville Vainio <vivainio@gmail.com>
1368
1392
1369 * Magic.py: %cpaste now strips > from the beginning of lines
1393 * Magic.py: %cpaste now strips > from the beginning of lines
1370 to ease pasting quoted code from emails. Contributed by
1394 to ease pasting quoted code from emails. Contributed by
1371 Stefan van der Walt.
1395 Stefan van der Walt.
1372
1396
1373 2006-06-29 Ville Vainio <vivainio@gmail.com>
1397 2006-06-29 Ville Vainio <vivainio@gmail.com>
1374
1398
1375 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1399 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1376 mode, patch contributed by Darren Dale. NEEDS TESTING!
1400 mode, patch contributed by Darren Dale. NEEDS TESTING!
1377
1401
1378 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1402 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1379
1403
1380 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1404 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1381 a blue background. Fix fetching new display rows when the browser
1405 a blue background. Fix fetching new display rows when the browser
1382 scrolls more than a screenful (e.g. by using the goto command).
1406 scrolls more than a screenful (e.g. by using the goto command).
1383
1407
1384 2006-06-27 Ville Vainio <vivainio@gmail.com>
1408 2006-06-27 Ville Vainio <vivainio@gmail.com>
1385
1409
1386 * Magic.py (_inspect, _ofind) Apply David Huard's
1410 * Magic.py (_inspect, _ofind) Apply David Huard's
1387 patch for displaying the correct docstring for 'property'
1411 patch for displaying the correct docstring for 'property'
1388 attributes.
1412 attributes.
1389
1413
1390 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1414 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1391
1415
1392 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1416 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1393 commands into the methods implementing them.
1417 commands into the methods implementing them.
1394
1418
1395 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1419 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1396
1420
1397 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1421 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1398 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1422 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1399 autoindent support was authored by Jin Liu.
1423 autoindent support was authored by Jin Liu.
1400
1424
1401 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1425 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1402
1426
1403 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1427 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1404 for keymaps with a custom class that simplifies handling.
1428 for keymaps with a custom class that simplifies handling.
1405
1429
1406 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1430 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1407
1431
1408 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1432 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1409 resizing. This requires Python 2.5 to work.
1433 resizing. This requires Python 2.5 to work.
1410
1434
1411 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1435 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1412
1436
1413 * IPython/Extensions/ibrowse.py: Add two new commands to
1437 * IPython/Extensions/ibrowse.py: Add two new commands to
1414 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1438 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1415 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1439 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1416 attributes again. Remapped the help command to "?". Display
1440 attributes again. Remapped the help command to "?". Display
1417 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1441 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1418 as keys for the "home" and "end" commands. Add three new commands
1442 as keys for the "home" and "end" commands. Add three new commands
1419 to the input mode for "find" and friends: "delend" (CTRL-K)
1443 to the input mode for "find" and friends: "delend" (CTRL-K)
1420 deletes to the end of line. "incsearchup" searches upwards in the
1444 deletes to the end of line. "incsearchup" searches upwards in the
1421 command history for an input that starts with the text before the cursor.
1445 command history for an input that starts with the text before the cursor.
1422 "incsearchdown" does the same downwards. Removed a bogus mapping of
1446 "incsearchdown" does the same downwards. Removed a bogus mapping of
1423 the x key to "delete".
1447 the x key to "delete".
1424
1448
1425 2006-06-15 Ville Vainio <vivainio@gmail.com>
1449 2006-06-15 Ville Vainio <vivainio@gmail.com>
1426
1450
1427 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1451 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1428 used to create prompts dynamically, instead of the "old" way of
1452 used to create prompts dynamically, instead of the "old" way of
1429 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1453 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1430 way still works (it's invoked by the default hook), of course.
1454 way still works (it's invoked by the default hook), of course.
1431
1455
1432 * Prompts.py: added generate_output_prompt hook for altering output
1456 * Prompts.py: added generate_output_prompt hook for altering output
1433 prompt
1457 prompt
1434
1458
1435 * Release.py: Changed version string to 0.7.3.svn.
1459 * Release.py: Changed version string to 0.7.3.svn.
1436
1460
1437 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1461 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1438
1462
1439 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1463 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1440 the call to fetch() always tries to fetch enough data for at least one
1464 the call to fetch() always tries to fetch enough data for at least one
1441 full screen. This makes it possible to simply call moveto(0,0,True) in
1465 full screen. This makes it possible to simply call moveto(0,0,True) in
1442 the constructor. Fix typos and removed the obsolete goto attribute.
1466 the constructor. Fix typos and removed the obsolete goto attribute.
1443
1467
1444 2006-06-12 Ville Vainio <vivainio@gmail.com>
1468 2006-06-12 Ville Vainio <vivainio@gmail.com>
1445
1469
1446 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1470 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1447 allowing $variable interpolation within multiline statements,
1471 allowing $variable interpolation within multiline statements,
1448 though so far only with "sh" profile for a testing period.
1472 though so far only with "sh" profile for a testing period.
1449 The patch also enables splitting long commands with \ but it
1473 The patch also enables splitting long commands with \ but it
1450 doesn't work properly yet.
1474 doesn't work properly yet.
1451
1475
1452 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1476 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1453
1477
1454 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1478 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1455 input history and the position of the cursor in the input history for
1479 input history and the position of the cursor in the input history for
1456 the find, findbackwards and goto command.
1480 the find, findbackwards and goto command.
1457
1481
1458 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1482 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1459
1483
1460 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1484 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1461 implements the basic functionality of browser commands that require
1485 implements the basic functionality of browser commands that require
1462 input. Reimplement the goto, find and findbackwards commands as
1486 input. Reimplement the goto, find and findbackwards commands as
1463 subclasses of _CommandInput. Add an input history and keymaps to those
1487 subclasses of _CommandInput. Add an input history and keymaps to those
1464 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1488 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1465 execute commands.
1489 execute commands.
1466
1490
1467 2006-06-07 Ville Vainio <vivainio@gmail.com>
1491 2006-06-07 Ville Vainio <vivainio@gmail.com>
1468
1492
1469 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1493 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1470 running the batch files instead of leaving the session open.
1494 running the batch files instead of leaving the session open.
1471
1495
1472 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1496 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1473
1497
1474 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1498 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1475 the original fix was incomplete. Patch submitted by W. Maier.
1499 the original fix was incomplete. Patch submitted by W. Maier.
1476
1500
1477 2006-06-07 Ville Vainio <vivainio@gmail.com>
1501 2006-06-07 Ville Vainio <vivainio@gmail.com>
1478
1502
1479 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1503 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1480 Confirmation prompts can be supressed by 'quiet' option.
1504 Confirmation prompts can be supressed by 'quiet' option.
1481 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1505 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1482
1506
1483 2006-06-06 *** Released version 0.7.2
1507 2006-06-06 *** Released version 0.7.2
1484
1508
1485 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1509 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1486
1510
1487 * IPython/Release.py (version): Made 0.7.2 final for release.
1511 * IPython/Release.py (version): Made 0.7.2 final for release.
1488 Repo tagged and release cut.
1512 Repo tagged and release cut.
1489
1513
1490 2006-06-05 Ville Vainio <vivainio@gmail.com>
1514 2006-06-05 Ville Vainio <vivainio@gmail.com>
1491
1515
1492 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1516 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1493 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1517 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1494
1518
1495 * upgrade_dir.py: try import 'path' module a bit harder
1519 * upgrade_dir.py: try import 'path' module a bit harder
1496 (for %upgrade)
1520 (for %upgrade)
1497
1521
1498 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1522 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1499
1523
1500 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1524 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1501 instead of looping 20 times.
1525 instead of looping 20 times.
1502
1526
1503 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1527 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1504 correctly at initialization time. Bug reported by Krishna Mohan
1528 correctly at initialization time. Bug reported by Krishna Mohan
1505 Gundu <gkmohan-AT-gmail.com> on the user list.
1529 Gundu <gkmohan-AT-gmail.com> on the user list.
1506
1530
1507 * IPython/Release.py (version): Mark 0.7.2 version to start
1531 * IPython/Release.py (version): Mark 0.7.2 version to start
1508 testing for release on 06/06.
1532 testing for release on 06/06.
1509
1533
1510 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1534 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1511
1535
1512 * scripts/irunner: thin script interface so users don't have to
1536 * scripts/irunner: thin script interface so users don't have to
1513 find the module and call it as an executable, since modules rarely
1537 find the module and call it as an executable, since modules rarely
1514 live in people's PATH.
1538 live in people's PATH.
1515
1539
1516 * IPython/irunner.py (InteractiveRunner.__init__): added
1540 * IPython/irunner.py (InteractiveRunner.__init__): added
1517 delaybeforesend attribute to control delays with newer versions of
1541 delaybeforesend attribute to control delays with newer versions of
1518 pexpect. Thanks to detailed help from pexpect's author, Noah
1542 pexpect. Thanks to detailed help from pexpect's author, Noah
1519 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1543 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1520 correctly (it works in NoColor mode).
1544 correctly (it works in NoColor mode).
1521
1545
1522 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1546 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1523 SAGE list, from improper log() calls.
1547 SAGE list, from improper log() calls.
1524
1548
1525 2006-05-31 Ville Vainio <vivainio@gmail.com>
1549 2006-05-31 Ville Vainio <vivainio@gmail.com>
1526
1550
1527 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1551 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1528 with args in parens to work correctly with dirs that have spaces.
1552 with args in parens to work correctly with dirs that have spaces.
1529
1553
1530 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1554 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1531
1555
1532 * IPython/Logger.py (Logger.logstart): add option to log raw input
1556 * IPython/Logger.py (Logger.logstart): add option to log raw input
1533 instead of the processed one. A -r flag was added to the
1557 instead of the processed one. A -r flag was added to the
1534 %logstart magic used for controlling logging.
1558 %logstart magic used for controlling logging.
1535
1559
1536 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1560 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1537
1561
1538 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1562 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1539 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1563 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1540 recognize the option. After a bug report by Will Maier. This
1564 recognize the option. After a bug report by Will Maier. This
1541 closes #64 (will do it after confirmation from W. Maier).
1565 closes #64 (will do it after confirmation from W. Maier).
1542
1566
1543 * IPython/irunner.py: New module to run scripts as if manually
1567 * IPython/irunner.py: New module to run scripts as if manually
1544 typed into an interactive environment, based on pexpect. After a
1568 typed into an interactive environment, based on pexpect. After a
1545 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1569 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1546 ipython-user list. Simple unittests in the tests/ directory.
1570 ipython-user list. Simple unittests in the tests/ directory.
1547
1571
1548 * tools/release: add Will Maier, OpenBSD port maintainer, to
1572 * tools/release: add Will Maier, OpenBSD port maintainer, to
1549 recepients list. We are now officially part of the OpenBSD ports:
1573 recepients list. We are now officially part of the OpenBSD ports:
1550 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1574 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1551 work.
1575 work.
1552
1576
1553 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1577 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1554
1578
1555 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1579 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1556 so that it doesn't break tkinter apps.
1580 so that it doesn't break tkinter apps.
1557
1581
1558 * IPython/iplib.py (_prefilter): fix bug where aliases would
1582 * IPython/iplib.py (_prefilter): fix bug where aliases would
1559 shadow variables when autocall was fully off. Reported by SAGE
1583 shadow variables when autocall was fully off. Reported by SAGE
1560 author William Stein.
1584 author William Stein.
1561
1585
1562 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1586 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1563 at what detail level strings are computed when foo? is requested.
1587 at what detail level strings are computed when foo? is requested.
1564 This allows users to ask for example that the string form of an
1588 This allows users to ask for example that the string form of an
1565 object is only computed when foo?? is called, or even never, by
1589 object is only computed when foo?? is called, or even never, by
1566 setting the object_info_string_level >= 2 in the configuration
1590 setting the object_info_string_level >= 2 in the configuration
1567 file. This new option has been added and documented. After a
1591 file. This new option has been added and documented. After a
1568 request by SAGE to be able to control the printing of very large
1592 request by SAGE to be able to control the printing of very large
1569 objects more easily.
1593 objects more easily.
1570
1594
1571 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1595 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1572
1596
1573 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1597 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1574 from sys.argv, to be 100% consistent with how Python itself works
1598 from sys.argv, to be 100% consistent with how Python itself works
1575 (as seen for example with python -i file.py). After a bug report
1599 (as seen for example with python -i file.py). After a bug report
1576 by Jeffrey Collins.
1600 by Jeffrey Collins.
1577
1601
1578 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1602 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1579 nasty bug which was preventing custom namespaces with -pylab,
1603 nasty bug which was preventing custom namespaces with -pylab,
1580 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1604 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1581 compatibility (long gone from mpl).
1605 compatibility (long gone from mpl).
1582
1606
1583 * IPython/ipapi.py (make_session): name change: create->make. We
1607 * IPython/ipapi.py (make_session): name change: create->make. We
1584 use make in other places (ipmaker,...), it's shorter and easier to
1608 use make in other places (ipmaker,...), it's shorter and easier to
1585 type and say, etc. I'm trying to clean things before 0.7.2 so
1609 type and say, etc. I'm trying to clean things before 0.7.2 so
1586 that I can keep things stable wrt to ipapi in the chainsaw branch.
1610 that I can keep things stable wrt to ipapi in the chainsaw branch.
1587
1611
1588 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1612 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1589 python-mode recognizes our debugger mode. Add support for
1613 python-mode recognizes our debugger mode. Add support for
1590 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1614 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1591 <m.liu.jin-AT-gmail.com> originally written by
1615 <m.liu.jin-AT-gmail.com> originally written by
1592 doxgen-AT-newsmth.net (with minor modifications for xemacs
1616 doxgen-AT-newsmth.net (with minor modifications for xemacs
1593 compatibility)
1617 compatibility)
1594
1618
1595 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1619 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1596 tracebacks when walking the stack so that the stack tracking system
1620 tracebacks when walking the stack so that the stack tracking system
1597 in emacs' python-mode can identify the frames correctly.
1621 in emacs' python-mode can identify the frames correctly.
1598
1622
1599 * IPython/ipmaker.py (make_IPython): make the internal (and
1623 * IPython/ipmaker.py (make_IPython): make the internal (and
1600 default config) autoedit_syntax value false by default. Too many
1624 default config) autoedit_syntax value false by default. Too many
1601 users have complained to me (both on and off-list) about problems
1625 users have complained to me (both on and off-list) about problems
1602 with this option being on by default, so I'm making it default to
1626 with this option being on by default, so I'm making it default to
1603 off. It can still be enabled by anyone via the usual mechanisms.
1627 off. It can still be enabled by anyone via the usual mechanisms.
1604
1628
1605 * IPython/completer.py (Completer.attr_matches): add support for
1629 * IPython/completer.py (Completer.attr_matches): add support for
1606 PyCrust-style _getAttributeNames magic method. Patch contributed
1630 PyCrust-style _getAttributeNames magic method. Patch contributed
1607 by <mscott-AT-goldenspud.com>. Closes #50.
1631 by <mscott-AT-goldenspud.com>. Closes #50.
1608
1632
1609 * IPython/iplib.py (InteractiveShell.__init__): remove the
1633 * IPython/iplib.py (InteractiveShell.__init__): remove the
1610 deletion of exit/quit from __builtin__, which can break
1634 deletion of exit/quit from __builtin__, which can break
1611 third-party tools like the Zope debugging console. The
1635 third-party tools like the Zope debugging console. The
1612 %exit/%quit magics remain. In general, it's probably a good idea
1636 %exit/%quit magics remain. In general, it's probably a good idea
1613 not to delete anything from __builtin__, since we never know what
1637 not to delete anything from __builtin__, since we never know what
1614 that will break. In any case, python now (for 2.5) will support
1638 that will break. In any case, python now (for 2.5) will support
1615 'real' exit/quit, so this issue is moot. Closes #55.
1639 'real' exit/quit, so this issue is moot. Closes #55.
1616
1640
1617 * IPython/genutils.py (with_obj): rename the 'with' function to
1641 * IPython/genutils.py (with_obj): rename the 'with' function to
1618 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1642 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1619 becomes a language keyword. Closes #53.
1643 becomes a language keyword. Closes #53.
1620
1644
1621 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1645 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1622 __file__ attribute to this so it fools more things into thinking
1646 __file__ attribute to this so it fools more things into thinking
1623 it is a real module. Closes #59.
1647 it is a real module. Closes #59.
1624
1648
1625 * IPython/Magic.py (magic_edit): add -n option to open the editor
1649 * IPython/Magic.py (magic_edit): add -n option to open the editor
1626 at a specific line number. After a patch by Stefan van der Walt.
1650 at a specific line number. After a patch by Stefan van der Walt.
1627
1651
1628 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1652 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1629
1653
1630 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1654 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1631 reason the file could not be opened. After automatic crash
1655 reason the file could not be opened. After automatic crash
1632 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1656 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1633 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1657 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1634 (_should_recompile): Don't fire editor if using %bg, since there
1658 (_should_recompile): Don't fire editor if using %bg, since there
1635 is no file in the first place. From the same report as above.
1659 is no file in the first place. From the same report as above.
1636 (raw_input): protect against faulty third-party prefilters. After
1660 (raw_input): protect against faulty third-party prefilters. After
1637 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1661 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1638 while running under SAGE.
1662 while running under SAGE.
1639
1663
1640 2006-05-23 Ville Vainio <vivainio@gmail.com>
1664 2006-05-23 Ville Vainio <vivainio@gmail.com>
1641
1665
1642 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1666 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1643 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1667 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1644 now returns None (again), unless dummy is specifically allowed by
1668 now returns None (again), unless dummy is specifically allowed by
1645 ipapi.get(allow_dummy=True).
1669 ipapi.get(allow_dummy=True).
1646
1670
1647 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1671 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1648
1672
1649 * IPython: remove all 2.2-compatibility objects and hacks from
1673 * IPython: remove all 2.2-compatibility objects and hacks from
1650 everywhere, since we only support 2.3 at this point. Docs
1674 everywhere, since we only support 2.3 at this point. Docs
1651 updated.
1675 updated.
1652
1676
1653 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1677 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1654 Anything requiring extra validation can be turned into a Python
1678 Anything requiring extra validation can be turned into a Python
1655 property in the future. I used a property for the db one b/c
1679 property in the future. I used a property for the db one b/c
1656 there was a nasty circularity problem with the initialization
1680 there was a nasty circularity problem with the initialization
1657 order, which right now I don't have time to clean up.
1681 order, which right now I don't have time to clean up.
1658
1682
1659 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1683 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1660 another locking bug reported by Jorgen. I'm not 100% sure though,
1684 another locking bug reported by Jorgen. I'm not 100% sure though,
1661 so more testing is needed...
1685 so more testing is needed...
1662
1686
1663 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1687 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1664
1688
1665 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1689 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1666 local variables from any routine in user code (typically executed
1690 local variables from any routine in user code (typically executed
1667 with %run) directly into the interactive namespace. Very useful
1691 with %run) directly into the interactive namespace. Very useful
1668 when doing complex debugging.
1692 when doing complex debugging.
1669 (IPythonNotRunning): Changed the default None object to a dummy
1693 (IPythonNotRunning): Changed the default None object to a dummy
1670 whose attributes can be queried as well as called without
1694 whose attributes can be queried as well as called without
1671 exploding, to ease writing code which works transparently both in
1695 exploding, to ease writing code which works transparently both in
1672 and out of ipython and uses some of this API.
1696 and out of ipython and uses some of this API.
1673
1697
1674 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1698 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1675
1699
1676 * IPython/hooks.py (result_display): Fix the fact that our display
1700 * IPython/hooks.py (result_display): Fix the fact that our display
1677 hook was using str() instead of repr(), as the default python
1701 hook was using str() instead of repr(), as the default python
1678 console does. This had gone unnoticed b/c it only happened if
1702 console does. This had gone unnoticed b/c it only happened if
1679 %Pprint was off, but the inconsistency was there.
1703 %Pprint was off, but the inconsistency was there.
1680
1704
1681 2006-05-15 Ville Vainio <vivainio@gmail.com>
1705 2006-05-15 Ville Vainio <vivainio@gmail.com>
1682
1706
1683 * Oinspect.py: Only show docstring for nonexisting/binary files
1707 * Oinspect.py: Only show docstring for nonexisting/binary files
1684 when doing object??, closing ticket #62
1708 when doing object??, closing ticket #62
1685
1709
1686 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1710 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1687
1711
1688 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1712 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1689 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1713 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1690 was being released in a routine which hadn't checked if it had
1714 was being released in a routine which hadn't checked if it had
1691 been the one to acquire it.
1715 been the one to acquire it.
1692
1716
1693 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1717 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1694
1718
1695 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1719 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1696
1720
1697 2006-04-11 Ville Vainio <vivainio@gmail.com>
1721 2006-04-11 Ville Vainio <vivainio@gmail.com>
1698
1722
1699 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1723 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1700 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1724 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1701 prefilters, allowing stuff like magics and aliases in the file.
1725 prefilters, allowing stuff like magics and aliases in the file.
1702
1726
1703 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1727 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1704 added. Supported now are "%clear in" and "%clear out" (clear input and
1728 added. Supported now are "%clear in" and "%clear out" (clear input and
1705 output history, respectively). Also fixed CachedOutput.flush to
1729 output history, respectively). Also fixed CachedOutput.flush to
1706 properly flush the output cache.
1730 properly flush the output cache.
1707
1731
1708 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1732 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1709 half-success (and fail explicitly).
1733 half-success (and fail explicitly).
1710
1734
1711 2006-03-28 Ville Vainio <vivainio@gmail.com>
1735 2006-03-28 Ville Vainio <vivainio@gmail.com>
1712
1736
1713 * iplib.py: Fix quoting of aliases so that only argless ones
1737 * iplib.py: Fix quoting of aliases so that only argless ones
1714 are quoted
1738 are quoted
1715
1739
1716 2006-03-28 Ville Vainio <vivainio@gmail.com>
1740 2006-03-28 Ville Vainio <vivainio@gmail.com>
1717
1741
1718 * iplib.py: Quote aliases with spaces in the name.
1742 * iplib.py: Quote aliases with spaces in the name.
1719 "c:\program files\blah\bin" is now legal alias target.
1743 "c:\program files\blah\bin" is now legal alias target.
1720
1744
1721 * ext_rehashdir.py: Space no longer allowed as arg
1745 * ext_rehashdir.py: Space no longer allowed as arg
1722 separator, since space is legal in path names.
1746 separator, since space is legal in path names.
1723
1747
1724 2006-03-16 Ville Vainio <vivainio@gmail.com>
1748 2006-03-16 Ville Vainio <vivainio@gmail.com>
1725
1749
1726 * upgrade_dir.py: Take path.py from Extensions, correcting
1750 * upgrade_dir.py: Take path.py from Extensions, correcting
1727 %upgrade magic
1751 %upgrade magic
1728
1752
1729 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1753 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1730
1754
1731 * hooks.py: Only enclose editor binary in quotes if legal and
1755 * hooks.py: Only enclose editor binary in quotes if legal and
1732 necessary (space in the name, and is an existing file). Fixes a bug
1756 necessary (space in the name, and is an existing file). Fixes a bug
1733 reported by Zachary Pincus.
1757 reported by Zachary Pincus.
1734
1758
1735 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1759 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1736
1760
1737 * Manual: thanks to a tip on proper color handling for Emacs, by
1761 * Manual: thanks to a tip on proper color handling for Emacs, by
1738 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1762 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1739
1763
1740 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1764 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1741 by applying the provided patch. Thanks to Liu Jin
1765 by applying the provided patch. Thanks to Liu Jin
1742 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1766 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1743 XEmacs/Linux, I'm trusting the submitter that it actually helps
1767 XEmacs/Linux, I'm trusting the submitter that it actually helps
1744 under win32/GNU Emacs. Will revisit if any problems are reported.
1768 under win32/GNU Emacs. Will revisit if any problems are reported.
1745
1769
1746 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1770 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1747
1771
1748 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1772 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1749 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1773 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1750
1774
1751 2006-03-12 Ville Vainio <vivainio@gmail.com>
1775 2006-03-12 Ville Vainio <vivainio@gmail.com>
1752
1776
1753 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1777 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1754 Torsten Marek.
1778 Torsten Marek.
1755
1779
1756 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1780 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1757
1781
1758 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1782 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1759 line ranges works again.
1783 line ranges works again.
1760
1784
1761 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1785 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1762
1786
1763 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1787 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1764 and friends, after a discussion with Zach Pincus on ipython-user.
1788 and friends, after a discussion with Zach Pincus on ipython-user.
1765 I'm not 100% sure, but after thinking about it quite a bit, it may
1789 I'm not 100% sure, but after thinking about it quite a bit, it may
1766 be OK. Testing with the multithreaded shells didn't reveal any
1790 be OK. Testing with the multithreaded shells didn't reveal any
1767 problems, but let's keep an eye out.
1791 problems, but let's keep an eye out.
1768
1792
1769 In the process, I fixed a few things which were calling
1793 In the process, I fixed a few things which were calling
1770 self.InteractiveTB() directly (like safe_execfile), which is a
1794 self.InteractiveTB() directly (like safe_execfile), which is a
1771 mistake: ALL exception reporting should be done by calling
1795 mistake: ALL exception reporting should be done by calling
1772 self.showtraceback(), which handles state and tab-completion and
1796 self.showtraceback(), which handles state and tab-completion and
1773 more.
1797 more.
1774
1798
1775 2006-03-01 Ville Vainio <vivainio@gmail.com>
1799 2006-03-01 Ville Vainio <vivainio@gmail.com>
1776
1800
1777 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1801 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1778 To use, do "from ipipe import *".
1802 To use, do "from ipipe import *".
1779
1803
1780 2006-02-24 Ville Vainio <vivainio@gmail.com>
1804 2006-02-24 Ville Vainio <vivainio@gmail.com>
1781
1805
1782 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1806 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1783 "cleanly" and safely than the older upgrade mechanism.
1807 "cleanly" and safely than the older upgrade mechanism.
1784
1808
1785 2006-02-21 Ville Vainio <vivainio@gmail.com>
1809 2006-02-21 Ville Vainio <vivainio@gmail.com>
1786
1810
1787 * Magic.py: %save works again.
1811 * Magic.py: %save works again.
1788
1812
1789 2006-02-15 Ville Vainio <vivainio@gmail.com>
1813 2006-02-15 Ville Vainio <vivainio@gmail.com>
1790
1814
1791 * Magic.py: %Pprint works again
1815 * Magic.py: %Pprint works again
1792
1816
1793 * Extensions/ipy_sane_defaults.py: Provide everything provided
1817 * Extensions/ipy_sane_defaults.py: Provide everything provided
1794 in default ipythonrc, to make it possible to have a completely empty
1818 in default ipythonrc, to make it possible to have a completely empty
1795 ipythonrc (and thus completely rc-file free configuration)
1819 ipythonrc (and thus completely rc-file free configuration)
1796
1820
1797 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1821 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1798
1822
1799 * IPython/hooks.py (editor): quote the call to the editor command,
1823 * IPython/hooks.py (editor): quote the call to the editor command,
1800 to allow commands with spaces in them. Problem noted by watching
1824 to allow commands with spaces in them. Problem noted by watching
1801 Ian Oswald's video about textpad under win32 at
1825 Ian Oswald's video about textpad under win32 at
1802 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1826 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1803
1827
1804 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1828 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1805 describing magics (we haven't used @ for a loong time).
1829 describing magics (we haven't used @ for a loong time).
1806
1830
1807 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1831 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1808 contributed by marienz to close
1832 contributed by marienz to close
1809 http://www.scipy.net/roundup/ipython/issue53.
1833 http://www.scipy.net/roundup/ipython/issue53.
1810
1834
1811 2006-02-10 Ville Vainio <vivainio@gmail.com>
1835 2006-02-10 Ville Vainio <vivainio@gmail.com>
1812
1836
1813 * genutils.py: getoutput now works in win32 too
1837 * genutils.py: getoutput now works in win32 too
1814
1838
1815 * completer.py: alias and magic completion only invoked
1839 * completer.py: alias and magic completion only invoked
1816 at the first "item" in the line, to avoid "cd %store"
1840 at the first "item" in the line, to avoid "cd %store"
1817 nonsense.
1841 nonsense.
1818
1842
1819 2006-02-09 Ville Vainio <vivainio@gmail.com>
1843 2006-02-09 Ville Vainio <vivainio@gmail.com>
1820
1844
1821 * test/*: Added a unit testing framework (finally).
1845 * test/*: Added a unit testing framework (finally).
1822 '%run runtests.py' to run test_*.
1846 '%run runtests.py' to run test_*.
1823
1847
1824 * ipapi.py: Exposed runlines and set_custom_exc
1848 * ipapi.py: Exposed runlines and set_custom_exc
1825
1849
1826 2006-02-07 Ville Vainio <vivainio@gmail.com>
1850 2006-02-07 Ville Vainio <vivainio@gmail.com>
1827
1851
1828 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1852 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1829 instead use "f(1 2)" as before.
1853 instead use "f(1 2)" as before.
1830
1854
1831 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1855 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1832
1856
1833 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1857 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1834 facilities, for demos processed by the IPython input filter
1858 facilities, for demos processed by the IPython input filter
1835 (IPythonDemo), and for running a script one-line-at-a-time as a
1859 (IPythonDemo), and for running a script one-line-at-a-time as a
1836 demo, both for pure Python (LineDemo) and for IPython-processed
1860 demo, both for pure Python (LineDemo) and for IPython-processed
1837 input (IPythonLineDemo). After a request by Dave Kohel, from the
1861 input (IPythonLineDemo). After a request by Dave Kohel, from the
1838 SAGE team.
1862 SAGE team.
1839 (Demo.edit): added an edit() method to the demo objects, to edit
1863 (Demo.edit): added an edit() method to the demo objects, to edit
1840 the in-memory copy of the last executed block.
1864 the in-memory copy of the last executed block.
1841
1865
1842 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1866 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1843 processing to %edit, %macro and %save. These commands can now be
1867 processing to %edit, %macro and %save. These commands can now be
1844 invoked on the unprocessed input as it was typed by the user
1868 invoked on the unprocessed input as it was typed by the user
1845 (without any prefilters applied). After requests by the SAGE team
1869 (without any prefilters applied). After requests by the SAGE team
1846 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1870 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1847
1871
1848 2006-02-01 Ville Vainio <vivainio@gmail.com>
1872 2006-02-01 Ville Vainio <vivainio@gmail.com>
1849
1873
1850 * setup.py, eggsetup.py: easy_install ipython==dev works
1874 * setup.py, eggsetup.py: easy_install ipython==dev works
1851 correctly now (on Linux)
1875 correctly now (on Linux)
1852
1876
1853 * ipy_user_conf,ipmaker: user config changes, removed spurious
1877 * ipy_user_conf,ipmaker: user config changes, removed spurious
1854 warnings
1878 warnings
1855
1879
1856 * iplib: if rc.banner is string, use it as is.
1880 * iplib: if rc.banner is string, use it as is.
1857
1881
1858 * Magic: %pycat accepts a string argument and pages it's contents.
1882 * Magic: %pycat accepts a string argument and pages it's contents.
1859
1883
1860
1884
1861 2006-01-30 Ville Vainio <vivainio@gmail.com>
1885 2006-01-30 Ville Vainio <vivainio@gmail.com>
1862
1886
1863 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1887 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1864 Now %store and bookmarks work through PickleShare, meaning that
1888 Now %store and bookmarks work through PickleShare, meaning that
1865 concurrent access is possible and all ipython sessions see the
1889 concurrent access is possible and all ipython sessions see the
1866 same database situation all the time, instead of snapshot of
1890 same database situation all the time, instead of snapshot of
1867 the situation when the session was started. Hence, %bookmark
1891 the situation when the session was started. Hence, %bookmark
1868 results are immediately accessible from othes sessions. The database
1892 results are immediately accessible from othes sessions. The database
1869 is also available for use by user extensions. See:
1893 is also available for use by user extensions. See:
1870 http://www.python.org/pypi/pickleshare
1894 http://www.python.org/pypi/pickleshare
1871
1895
1872 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1896 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1873
1897
1874 * aliases can now be %store'd
1898 * aliases can now be %store'd
1875
1899
1876 * path.py moved to Extensions so that pickleshare does not need
1900 * path.py moved to Extensions so that pickleshare does not need
1877 IPython-specific import. Extensions added to pythonpath right
1901 IPython-specific import. Extensions added to pythonpath right
1878 at __init__.
1902 at __init__.
1879
1903
1880 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1904 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1881 called with _ip.system and the pre-transformed command string.
1905 called with _ip.system and the pre-transformed command string.
1882
1906
1883 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1907 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1884
1908
1885 * IPython/iplib.py (interact): Fix that we were not catching
1909 * IPython/iplib.py (interact): Fix that we were not catching
1886 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1910 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1887 logic here had to change, but it's fixed now.
1911 logic here had to change, but it's fixed now.
1888
1912
1889 2006-01-29 Ville Vainio <vivainio@gmail.com>
1913 2006-01-29 Ville Vainio <vivainio@gmail.com>
1890
1914
1891 * iplib.py: Try to import pyreadline on Windows.
1915 * iplib.py: Try to import pyreadline on Windows.
1892
1916
1893 2006-01-27 Ville Vainio <vivainio@gmail.com>
1917 2006-01-27 Ville Vainio <vivainio@gmail.com>
1894
1918
1895 * iplib.py: Expose ipapi as _ip in builtin namespace.
1919 * iplib.py: Expose ipapi as _ip in builtin namespace.
1896 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1920 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1897 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1921 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1898 syntax now produce _ip.* variant of the commands.
1922 syntax now produce _ip.* variant of the commands.
1899
1923
1900 * "_ip.options().autoedit_syntax = 2" automatically throws
1924 * "_ip.options().autoedit_syntax = 2" automatically throws
1901 user to editor for syntax error correction without prompting.
1925 user to editor for syntax error correction without prompting.
1902
1926
1903 2006-01-27 Ville Vainio <vivainio@gmail.com>
1927 2006-01-27 Ville Vainio <vivainio@gmail.com>
1904
1928
1905 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1929 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1906 'ipython' at argv[0]) executed through command line.
1930 'ipython' at argv[0]) executed through command line.
1907 NOTE: this DEPRECATES calling ipython with multiple scripts
1931 NOTE: this DEPRECATES calling ipython with multiple scripts
1908 ("ipython a.py b.py c.py")
1932 ("ipython a.py b.py c.py")
1909
1933
1910 * iplib.py, hooks.py: Added configurable input prefilter,
1934 * iplib.py, hooks.py: Added configurable input prefilter,
1911 named 'input_prefilter'. See ext_rescapture.py for example
1935 named 'input_prefilter'. See ext_rescapture.py for example
1912 usage.
1936 usage.
1913
1937
1914 * ext_rescapture.py, Magic.py: Better system command output capture
1938 * ext_rescapture.py, Magic.py: Better system command output capture
1915 through 'var = !ls' (deprecates user-visible %sc). Same notation
1939 through 'var = !ls' (deprecates user-visible %sc). Same notation
1916 applies for magics, 'var = %alias' assigns alias list to var.
1940 applies for magics, 'var = %alias' assigns alias list to var.
1917
1941
1918 * ipapi.py: added meta() for accessing extension-usable data store.
1942 * ipapi.py: added meta() for accessing extension-usable data store.
1919
1943
1920 * iplib.py: added InteractiveShell.getapi(). New magics should be
1944 * iplib.py: added InteractiveShell.getapi(). New magics should be
1921 written doing self.getapi() instead of using the shell directly.
1945 written doing self.getapi() instead of using the shell directly.
1922
1946
1923 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1947 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1924 %store foo >> ~/myfoo.txt to store variables to files (in clean
1948 %store foo >> ~/myfoo.txt to store variables to files (in clean
1925 textual form, not a restorable pickle).
1949 textual form, not a restorable pickle).
1926
1950
1927 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1951 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1928
1952
1929 * usage.py, Magic.py: added %quickref
1953 * usage.py, Magic.py: added %quickref
1930
1954
1931 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1955 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1932
1956
1933 * GetoptErrors when invoking magics etc. with wrong args
1957 * GetoptErrors when invoking magics etc. with wrong args
1934 are now more helpful:
1958 are now more helpful:
1935 GetoptError: option -l not recognized (allowed: "qb" )
1959 GetoptError: option -l not recognized (allowed: "qb" )
1936
1960
1937 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1961 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1938
1962
1939 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1963 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1940 computationally intensive blocks don't appear to stall the demo.
1964 computationally intensive blocks don't appear to stall the demo.
1941
1965
1942 2006-01-24 Ville Vainio <vivainio@gmail.com>
1966 2006-01-24 Ville Vainio <vivainio@gmail.com>
1943
1967
1944 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1968 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1945 value to manipulate resulting history entry.
1969 value to manipulate resulting history entry.
1946
1970
1947 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1971 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1948 to instance methods of IPApi class, to make extending an embedded
1972 to instance methods of IPApi class, to make extending an embedded
1949 IPython feasible. See ext_rehashdir.py for example usage.
1973 IPython feasible. See ext_rehashdir.py for example usage.
1950
1974
1951 * Merged 1071-1076 from branches/0.7.1
1975 * Merged 1071-1076 from branches/0.7.1
1952
1976
1953
1977
1954 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1978 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1955
1979
1956 * tools/release (daystamp): Fix build tools to use the new
1980 * tools/release (daystamp): Fix build tools to use the new
1957 eggsetup.py script to build lightweight eggs.
1981 eggsetup.py script to build lightweight eggs.
1958
1982
1959 * Applied changesets 1062 and 1064 before 0.7.1 release.
1983 * Applied changesets 1062 and 1064 before 0.7.1 release.
1960
1984
1961 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1985 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1962 see the raw input history (without conversions like %ls ->
1986 see the raw input history (without conversions like %ls ->
1963 ipmagic("ls")). After a request from W. Stein, SAGE
1987 ipmagic("ls")). After a request from W. Stein, SAGE
1964 (http://modular.ucsd.edu/sage) developer. This information is
1988 (http://modular.ucsd.edu/sage) developer. This information is
1965 stored in the input_hist_raw attribute of the IPython instance, so
1989 stored in the input_hist_raw attribute of the IPython instance, so
1966 developers can access it if needed (it's an InputList instance).
1990 developers can access it if needed (it's an InputList instance).
1967
1991
1968 * Versionstring = 0.7.2.svn
1992 * Versionstring = 0.7.2.svn
1969
1993
1970 * eggsetup.py: A separate script for constructing eggs, creates
1994 * eggsetup.py: A separate script for constructing eggs, creates
1971 proper launch scripts even on Windows (an .exe file in
1995 proper launch scripts even on Windows (an .exe file in
1972 \python24\scripts).
1996 \python24\scripts).
1973
1997
1974 * ipapi.py: launch_new_instance, launch entry point needed for the
1998 * ipapi.py: launch_new_instance, launch entry point needed for the
1975 egg.
1999 egg.
1976
2000
1977 2006-01-23 Ville Vainio <vivainio@gmail.com>
2001 2006-01-23 Ville Vainio <vivainio@gmail.com>
1978
2002
1979 * Added %cpaste magic for pasting python code
2003 * Added %cpaste magic for pasting python code
1980
2004
1981 2006-01-22 Ville Vainio <vivainio@gmail.com>
2005 2006-01-22 Ville Vainio <vivainio@gmail.com>
1982
2006
1983 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2007 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1984
2008
1985 * Versionstring = 0.7.2.svn
2009 * Versionstring = 0.7.2.svn
1986
2010
1987 * eggsetup.py: A separate script for constructing eggs, creates
2011 * eggsetup.py: A separate script for constructing eggs, creates
1988 proper launch scripts even on Windows (an .exe file in
2012 proper launch scripts even on Windows (an .exe file in
1989 \python24\scripts).
2013 \python24\scripts).
1990
2014
1991 * ipapi.py: launch_new_instance, launch entry point needed for the
2015 * ipapi.py: launch_new_instance, launch entry point needed for the
1992 egg.
2016 egg.
1993
2017
1994 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2018 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1995
2019
1996 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2020 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1997 %pfile foo would print the file for foo even if it was a binary.
2021 %pfile foo would print the file for foo even if it was a binary.
1998 Now, extensions '.so' and '.dll' are skipped.
2022 Now, extensions '.so' and '.dll' are skipped.
1999
2023
2000 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2024 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2001 bug, where macros would fail in all threaded modes. I'm not 100%
2025 bug, where macros would fail in all threaded modes. I'm not 100%
2002 sure, so I'm going to put out an rc instead of making a release
2026 sure, so I'm going to put out an rc instead of making a release
2003 today, and wait for feedback for at least a few days.
2027 today, and wait for feedback for at least a few days.
2004
2028
2005 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2029 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2006 it...) the handling of pasting external code with autoindent on.
2030 it...) the handling of pasting external code with autoindent on.
2007 To get out of a multiline input, the rule will appear for most
2031 To get out of a multiline input, the rule will appear for most
2008 users unchanged: two blank lines or change the indent level
2032 users unchanged: two blank lines or change the indent level
2009 proposed by IPython. But there is a twist now: you can
2033 proposed by IPython. But there is a twist now: you can
2010 add/subtract only *one or two spaces*. If you add/subtract three
2034 add/subtract only *one or two spaces*. If you add/subtract three
2011 or more (unless you completely delete the line), IPython will
2035 or more (unless you completely delete the line), IPython will
2012 accept that line, and you'll need to enter a second one of pure
2036 accept that line, and you'll need to enter a second one of pure
2013 whitespace. I know it sounds complicated, but I can't find a
2037 whitespace. I know it sounds complicated, but I can't find a
2014 different solution that covers all the cases, with the right
2038 different solution that covers all the cases, with the right
2015 heuristics. Hopefully in actual use, nobody will really notice
2039 heuristics. Hopefully in actual use, nobody will really notice
2016 all these strange rules and things will 'just work'.
2040 all these strange rules and things will 'just work'.
2017
2041
2018 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2042 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2019
2043
2020 * IPython/iplib.py (interact): catch exceptions which can be
2044 * IPython/iplib.py (interact): catch exceptions which can be
2021 triggered asynchronously by signal handlers. Thanks to an
2045 triggered asynchronously by signal handlers. Thanks to an
2022 automatic crash report, submitted by Colin Kingsley
2046 automatic crash report, submitted by Colin Kingsley
2023 <tercel-AT-gentoo.org>.
2047 <tercel-AT-gentoo.org>.
2024
2048
2025 2006-01-20 Ville Vainio <vivainio@gmail.com>
2049 2006-01-20 Ville Vainio <vivainio@gmail.com>
2026
2050
2027 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2051 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2028 (%rehashdir, very useful, try it out) of how to extend ipython
2052 (%rehashdir, very useful, try it out) of how to extend ipython
2029 with new magics. Also added Extensions dir to pythonpath to make
2053 with new magics. Also added Extensions dir to pythonpath to make
2030 importing extensions easy.
2054 importing extensions easy.
2031
2055
2032 * %store now complains when trying to store interactively declared
2056 * %store now complains when trying to store interactively declared
2033 classes / instances of those classes.
2057 classes / instances of those classes.
2034
2058
2035 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2059 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2036 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2060 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2037 if they exist, and ipy_user_conf.py with some defaults is created for
2061 if they exist, and ipy_user_conf.py with some defaults is created for
2038 the user.
2062 the user.
2039
2063
2040 * Startup rehashing done by the config file, not InterpreterExec.
2064 * Startup rehashing done by the config file, not InterpreterExec.
2041 This means system commands are available even without selecting the
2065 This means system commands are available even without selecting the
2042 pysh profile. It's the sensible default after all.
2066 pysh profile. It's the sensible default after all.
2043
2067
2044 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2068 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2045
2069
2046 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2070 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2047 multiline code with autoindent on working. But I am really not
2071 multiline code with autoindent on working. But I am really not
2048 sure, so this needs more testing. Will commit a debug-enabled
2072 sure, so this needs more testing. Will commit a debug-enabled
2049 version for now, while I test it some more, so that Ville and
2073 version for now, while I test it some more, so that Ville and
2050 others may also catch any problems. Also made
2074 others may also catch any problems. Also made
2051 self.indent_current_str() a method, to ensure that there's no
2075 self.indent_current_str() a method, to ensure that there's no
2052 chance of the indent space count and the corresponding string
2076 chance of the indent space count and the corresponding string
2053 falling out of sync. All code needing the string should just call
2077 falling out of sync. All code needing the string should just call
2054 the method.
2078 the method.
2055
2079
2056 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2080 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2057
2081
2058 * IPython/Magic.py (magic_edit): fix check for when users don't
2082 * IPython/Magic.py (magic_edit): fix check for when users don't
2059 save their output files, the try/except was in the wrong section.
2083 save their output files, the try/except was in the wrong section.
2060
2084
2061 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2085 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2062
2086
2063 * IPython/Magic.py (magic_run): fix __file__ global missing from
2087 * IPython/Magic.py (magic_run): fix __file__ global missing from
2064 script's namespace when executed via %run. After a report by
2088 script's namespace when executed via %run. After a report by
2065 Vivian.
2089 Vivian.
2066
2090
2067 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2091 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2068 when using python 2.4. The parent constructor changed in 2.4, and
2092 when using python 2.4. The parent constructor changed in 2.4, and
2069 we need to track it directly (we can't call it, as it messes up
2093 we need to track it directly (we can't call it, as it messes up
2070 readline and tab-completion inside our pdb would stop working).
2094 readline and tab-completion inside our pdb would stop working).
2071 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2095 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2072
2096
2073 2006-01-16 Ville Vainio <vivainio@gmail.com>
2097 2006-01-16 Ville Vainio <vivainio@gmail.com>
2074
2098
2075 * Ipython/magic.py: Reverted back to old %edit functionality
2099 * Ipython/magic.py: Reverted back to old %edit functionality
2076 that returns file contents on exit.
2100 that returns file contents on exit.
2077
2101
2078 * IPython/path.py: Added Jason Orendorff's "path" module to
2102 * IPython/path.py: Added Jason Orendorff's "path" module to
2079 IPython tree, http://www.jorendorff.com/articles/python/path/.
2103 IPython tree, http://www.jorendorff.com/articles/python/path/.
2080 You can get path objects conveniently through %sc, and !!, e.g.:
2104 You can get path objects conveniently through %sc, and !!, e.g.:
2081 sc files=ls
2105 sc files=ls
2082 for p in files.paths: # or files.p
2106 for p in files.paths: # or files.p
2083 print p,p.mtime
2107 print p,p.mtime
2084
2108
2085 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2109 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2086 now work again without considering the exclusion regexp -
2110 now work again without considering the exclusion regexp -
2087 hence, things like ',foo my/path' turn to 'foo("my/path")'
2111 hence, things like ',foo my/path' turn to 'foo("my/path")'
2088 instead of syntax error.
2112 instead of syntax error.
2089
2113
2090
2114
2091 2006-01-14 Ville Vainio <vivainio@gmail.com>
2115 2006-01-14 Ville Vainio <vivainio@gmail.com>
2092
2116
2093 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2117 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2094 ipapi decorators for python 2.4 users, options() provides access to rc
2118 ipapi decorators for python 2.4 users, options() provides access to rc
2095 data.
2119 data.
2096
2120
2097 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2121 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2098 as path separators (even on Linux ;-). Space character after
2122 as path separators (even on Linux ;-). Space character after
2099 backslash (as yielded by tab completer) is still space;
2123 backslash (as yielded by tab completer) is still space;
2100 "%cd long\ name" works as expected.
2124 "%cd long\ name" works as expected.
2101
2125
2102 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2126 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2103 as "chain of command", with priority. API stays the same,
2127 as "chain of command", with priority. API stays the same,
2104 TryNext exception raised by a hook function signals that
2128 TryNext exception raised by a hook function signals that
2105 current hook failed and next hook should try handling it, as
2129 current hook failed and next hook should try handling it, as
2106 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2130 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2107 requested configurable display hook, which is now implemented.
2131 requested configurable display hook, which is now implemented.
2108
2132
2109 2006-01-13 Ville Vainio <vivainio@gmail.com>
2133 2006-01-13 Ville Vainio <vivainio@gmail.com>
2110
2134
2111 * IPython/platutils*.py: platform specific utility functions,
2135 * IPython/platutils*.py: platform specific utility functions,
2112 so far only set_term_title is implemented (change terminal
2136 so far only set_term_title is implemented (change terminal
2113 label in windowing systems). %cd now changes the title to
2137 label in windowing systems). %cd now changes the title to
2114 current dir.
2138 current dir.
2115
2139
2116 * IPython/Release.py: Added myself to "authors" list,
2140 * IPython/Release.py: Added myself to "authors" list,
2117 had to create new files.
2141 had to create new files.
2118
2142
2119 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2143 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2120 shell escape; not a known bug but had potential to be one in the
2144 shell escape; not a known bug but had potential to be one in the
2121 future.
2145 future.
2122
2146
2123 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2147 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2124 extension API for IPython! See the module for usage example. Fix
2148 extension API for IPython! See the module for usage example. Fix
2125 OInspect for docstring-less magic functions.
2149 OInspect for docstring-less magic functions.
2126
2150
2127
2151
2128 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2152 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2129
2153
2130 * IPython/iplib.py (raw_input): temporarily deactivate all
2154 * IPython/iplib.py (raw_input): temporarily deactivate all
2131 attempts at allowing pasting of code with autoindent on. It
2155 attempts at allowing pasting of code with autoindent on. It
2132 introduced bugs (reported by Prabhu) and I can't seem to find a
2156 introduced bugs (reported by Prabhu) and I can't seem to find a
2133 robust combination which works in all cases. Will have to revisit
2157 robust combination which works in all cases. Will have to revisit
2134 later.
2158 later.
2135
2159
2136 * IPython/genutils.py: remove isspace() function. We've dropped
2160 * IPython/genutils.py: remove isspace() function. We've dropped
2137 2.2 compatibility, so it's OK to use the string method.
2161 2.2 compatibility, so it's OK to use the string method.
2138
2162
2139 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2163 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2140
2164
2141 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2165 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2142 matching what NOT to autocall on, to include all python binary
2166 matching what NOT to autocall on, to include all python binary
2143 operators (including things like 'and', 'or', 'is' and 'in').
2167 operators (including things like 'and', 'or', 'is' and 'in').
2144 Prompted by a bug report on 'foo & bar', but I realized we had
2168 Prompted by a bug report on 'foo & bar', but I realized we had
2145 many more potential bug cases with other operators. The regexp is
2169 many more potential bug cases with other operators. The regexp is
2146 self.re_exclude_auto, it's fairly commented.
2170 self.re_exclude_auto, it's fairly commented.
2147
2171
2148 2006-01-12 Ville Vainio <vivainio@gmail.com>
2172 2006-01-12 Ville Vainio <vivainio@gmail.com>
2149
2173
2150 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2174 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2151 Prettified and hardened string/backslash quoting with ipsystem(),
2175 Prettified and hardened string/backslash quoting with ipsystem(),
2152 ipalias() and ipmagic(). Now even \ characters are passed to
2176 ipalias() and ipmagic(). Now even \ characters are passed to
2153 %magics, !shell escapes and aliases exactly as they are in the
2177 %magics, !shell escapes and aliases exactly as they are in the
2154 ipython command line. Should improve backslash experience,
2178 ipython command line. Should improve backslash experience,
2155 particularly in Windows (path delimiter for some commands that
2179 particularly in Windows (path delimiter for some commands that
2156 won't understand '/'), but Unix benefits as well (regexps). %cd
2180 won't understand '/'), but Unix benefits as well (regexps). %cd
2157 magic still doesn't support backslash path delimiters, though. Also
2181 magic still doesn't support backslash path delimiters, though. Also
2158 deleted all pretense of supporting multiline command strings in
2182 deleted all pretense of supporting multiline command strings in
2159 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2183 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2160
2184
2161 * doc/build_doc_instructions.txt added. Documentation on how to
2185 * doc/build_doc_instructions.txt added. Documentation on how to
2162 use doc/update_manual.py, added yesterday. Both files contributed
2186 use doc/update_manual.py, added yesterday. Both files contributed
2163 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2187 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2164 doc/*.sh for deprecation at a later date.
2188 doc/*.sh for deprecation at a later date.
2165
2189
2166 * /ipython.py Added ipython.py to root directory for
2190 * /ipython.py Added ipython.py to root directory for
2167 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2191 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2168 ipython.py) and development convenience (no need to keep doing
2192 ipython.py) and development convenience (no need to keep doing
2169 "setup.py install" between changes).
2193 "setup.py install" between changes).
2170
2194
2171 * Made ! and !! shell escapes work (again) in multiline expressions:
2195 * Made ! and !! shell escapes work (again) in multiline expressions:
2172 if 1:
2196 if 1:
2173 !ls
2197 !ls
2174 !!ls
2198 !!ls
2175
2199
2176 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2200 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2177
2201
2178 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2202 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2179 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2203 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2180 module in case-insensitive installation. Was causing crashes
2204 module in case-insensitive installation. Was causing crashes
2181 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2205 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2182
2206
2183 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2207 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2184 <marienz-AT-gentoo.org>, closes
2208 <marienz-AT-gentoo.org>, closes
2185 http://www.scipy.net/roundup/ipython/issue51.
2209 http://www.scipy.net/roundup/ipython/issue51.
2186
2210
2187 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2211 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2188
2212
2189 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2213 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2190 problem of excessive CPU usage under *nix and keyboard lag under
2214 problem of excessive CPU usage under *nix and keyboard lag under
2191 win32.
2215 win32.
2192
2216
2193 2006-01-10 *** Released version 0.7.0
2217 2006-01-10 *** Released version 0.7.0
2194
2218
2195 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2219 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2196
2220
2197 * IPython/Release.py (revision): tag version number to 0.7.0,
2221 * IPython/Release.py (revision): tag version number to 0.7.0,
2198 ready for release.
2222 ready for release.
2199
2223
2200 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2224 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2201 it informs the user of the name of the temp. file used. This can
2225 it informs the user of the name of the temp. file used. This can
2202 help if you decide later to reuse that same file, so you know
2226 help if you decide later to reuse that same file, so you know
2203 where to copy the info from.
2227 where to copy the info from.
2204
2228
2205 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2229 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2206
2230
2207 * setup_bdist_egg.py: little script to build an egg. Added
2231 * setup_bdist_egg.py: little script to build an egg. Added
2208 support in the release tools as well.
2232 support in the release tools as well.
2209
2233
2210 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2234 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2211
2235
2212 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2236 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2213 version selection (new -wxversion command line and ipythonrc
2237 version selection (new -wxversion command line and ipythonrc
2214 parameter). Patch contributed by Arnd Baecker
2238 parameter). Patch contributed by Arnd Baecker
2215 <arnd.baecker-AT-web.de>.
2239 <arnd.baecker-AT-web.de>.
2216
2240
2217 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2241 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2218 embedded instances, for variables defined at the interactive
2242 embedded instances, for variables defined at the interactive
2219 prompt of the embedded ipython. Reported by Arnd.
2243 prompt of the embedded ipython. Reported by Arnd.
2220
2244
2221 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2245 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2222 it can be used as a (stateful) toggle, or with a direct parameter.
2246 it can be used as a (stateful) toggle, or with a direct parameter.
2223
2247
2224 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2248 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2225 could be triggered in certain cases and cause the traceback
2249 could be triggered in certain cases and cause the traceback
2226 printer not to work.
2250 printer not to work.
2227
2251
2228 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2252 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2229
2253
2230 * IPython/iplib.py (_should_recompile): Small fix, closes
2254 * IPython/iplib.py (_should_recompile): Small fix, closes
2231 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2255 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2232
2256
2233 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2257 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2234
2258
2235 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2259 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2236 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2260 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2237 Moad for help with tracking it down.
2261 Moad for help with tracking it down.
2238
2262
2239 * IPython/iplib.py (handle_auto): fix autocall handling for
2263 * IPython/iplib.py (handle_auto): fix autocall handling for
2240 objects which support BOTH __getitem__ and __call__ (so that f [x]
2264 objects which support BOTH __getitem__ and __call__ (so that f [x]
2241 is left alone, instead of becoming f([x]) automatically).
2265 is left alone, instead of becoming f([x]) automatically).
2242
2266
2243 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2267 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2244 Ville's patch.
2268 Ville's patch.
2245
2269
2246 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2270 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2247
2271
2248 * IPython/iplib.py (handle_auto): changed autocall semantics to
2272 * IPython/iplib.py (handle_auto): changed autocall semantics to
2249 include 'smart' mode, where the autocall transformation is NOT
2273 include 'smart' mode, where the autocall transformation is NOT
2250 applied if there are no arguments on the line. This allows you to
2274 applied if there are no arguments on the line. This allows you to
2251 just type 'foo' if foo is a callable to see its internal form,
2275 just type 'foo' if foo is a callable to see its internal form,
2252 instead of having it called with no arguments (typically a
2276 instead of having it called with no arguments (typically a
2253 mistake). The old 'full' autocall still exists: for that, you
2277 mistake). The old 'full' autocall still exists: for that, you
2254 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2278 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2255
2279
2256 * IPython/completer.py (Completer.attr_matches): add
2280 * IPython/completer.py (Completer.attr_matches): add
2257 tab-completion support for Enthoughts' traits. After a report by
2281 tab-completion support for Enthoughts' traits. After a report by
2258 Arnd and a patch by Prabhu.
2282 Arnd and a patch by Prabhu.
2259
2283
2260 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2284 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2261
2285
2262 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2286 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2263 Schmolck's patch to fix inspect.getinnerframes().
2287 Schmolck's patch to fix inspect.getinnerframes().
2264
2288
2265 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2289 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2266 for embedded instances, regarding handling of namespaces and items
2290 for embedded instances, regarding handling of namespaces and items
2267 added to the __builtin__ one. Multiple embedded instances and
2291 added to the __builtin__ one. Multiple embedded instances and
2268 recursive embeddings should work better now (though I'm not sure
2292 recursive embeddings should work better now (though I'm not sure
2269 I've got all the corner cases fixed, that code is a bit of a brain
2293 I've got all the corner cases fixed, that code is a bit of a brain
2270 twister).
2294 twister).
2271
2295
2272 * IPython/Magic.py (magic_edit): added support to edit in-memory
2296 * IPython/Magic.py (magic_edit): added support to edit in-memory
2273 macros (automatically creates the necessary temp files). %edit
2297 macros (automatically creates the necessary temp files). %edit
2274 also doesn't return the file contents anymore, it's just noise.
2298 also doesn't return the file contents anymore, it's just noise.
2275
2299
2276 * IPython/completer.py (Completer.attr_matches): revert change to
2300 * IPython/completer.py (Completer.attr_matches): revert change to
2277 complete only on attributes listed in __all__. I realized it
2301 complete only on attributes listed in __all__. I realized it
2278 cripples the tab-completion system as a tool for exploring the
2302 cripples the tab-completion system as a tool for exploring the
2279 internals of unknown libraries (it renders any non-__all__
2303 internals of unknown libraries (it renders any non-__all__
2280 attribute off-limits). I got bit by this when trying to see
2304 attribute off-limits). I got bit by this when trying to see
2281 something inside the dis module.
2305 something inside the dis module.
2282
2306
2283 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2307 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2284
2308
2285 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2309 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2286 namespace for users and extension writers to hold data in. This
2310 namespace for users and extension writers to hold data in. This
2287 follows the discussion in
2311 follows the discussion in
2288 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2312 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2289
2313
2290 * IPython/completer.py (IPCompleter.complete): small patch to help
2314 * IPython/completer.py (IPCompleter.complete): small patch to help
2291 tab-completion under Emacs, after a suggestion by John Barnard
2315 tab-completion under Emacs, after a suggestion by John Barnard
2292 <barnarj-AT-ccf.org>.
2316 <barnarj-AT-ccf.org>.
2293
2317
2294 * IPython/Magic.py (Magic.extract_input_slices): added support for
2318 * IPython/Magic.py (Magic.extract_input_slices): added support for
2295 the slice notation in magics to use N-M to represent numbers N...M
2319 the slice notation in magics to use N-M to represent numbers N...M
2296 (closed endpoints). This is used by %macro and %save.
2320 (closed endpoints). This is used by %macro and %save.
2297
2321
2298 * IPython/completer.py (Completer.attr_matches): for modules which
2322 * IPython/completer.py (Completer.attr_matches): for modules which
2299 define __all__, complete only on those. After a patch by Jeffrey
2323 define __all__, complete only on those. After a patch by Jeffrey
2300 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2324 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2301 speed up this routine.
2325 speed up this routine.
2302
2326
2303 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2327 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2304 don't know if this is the end of it, but the behavior now is
2328 don't know if this is the end of it, but the behavior now is
2305 certainly much more correct. Note that coupled with macros,
2329 certainly much more correct. Note that coupled with macros,
2306 slightly surprising (at first) behavior may occur: a macro will in
2330 slightly surprising (at first) behavior may occur: a macro will in
2307 general expand to multiple lines of input, so upon exiting, the
2331 general expand to multiple lines of input, so upon exiting, the
2308 in/out counters will both be bumped by the corresponding amount
2332 in/out counters will both be bumped by the corresponding amount
2309 (as if the macro's contents had been typed interactively). Typing
2333 (as if the macro's contents had been typed interactively). Typing
2310 %hist will reveal the intermediate (silently processed) lines.
2334 %hist will reveal the intermediate (silently processed) lines.
2311
2335
2312 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2336 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2313 pickle to fail (%run was overwriting __main__ and not restoring
2337 pickle to fail (%run was overwriting __main__ and not restoring
2314 it, but pickle relies on __main__ to operate).
2338 it, but pickle relies on __main__ to operate).
2315
2339
2316 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2340 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2317 using properties, but forgot to make the main InteractiveShell
2341 using properties, but forgot to make the main InteractiveShell
2318 class a new-style class. Properties fail silently, and
2342 class a new-style class. Properties fail silently, and
2319 mysteriously, with old-style class (getters work, but
2343 mysteriously, with old-style class (getters work, but
2320 setters don't do anything).
2344 setters don't do anything).
2321
2345
2322 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2346 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2323
2347
2324 * IPython/Magic.py (magic_history): fix history reporting bug (I
2348 * IPython/Magic.py (magic_history): fix history reporting bug (I
2325 know some nasties are still there, I just can't seem to find a
2349 know some nasties are still there, I just can't seem to find a
2326 reproducible test case to track them down; the input history is
2350 reproducible test case to track them down; the input history is
2327 falling out of sync...)
2351 falling out of sync...)
2328
2352
2329 * IPython/iplib.py (handle_shell_escape): fix bug where both
2353 * IPython/iplib.py (handle_shell_escape): fix bug where both
2330 aliases and system accesses where broken for indented code (such
2354 aliases and system accesses where broken for indented code (such
2331 as loops).
2355 as loops).
2332
2356
2333 * IPython/genutils.py (shell): fix small but critical bug for
2357 * IPython/genutils.py (shell): fix small but critical bug for
2334 win32 system access.
2358 win32 system access.
2335
2359
2336 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2360 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2337
2361
2338 * IPython/iplib.py (showtraceback): remove use of the
2362 * IPython/iplib.py (showtraceback): remove use of the
2339 sys.last_{type/value/traceback} structures, which are non
2363 sys.last_{type/value/traceback} structures, which are non
2340 thread-safe.
2364 thread-safe.
2341 (_prefilter): change control flow to ensure that we NEVER
2365 (_prefilter): change control flow to ensure that we NEVER
2342 introspect objects when autocall is off. This will guarantee that
2366 introspect objects when autocall is off. This will guarantee that
2343 having an input line of the form 'x.y', where access to attribute
2367 having an input line of the form 'x.y', where access to attribute
2344 'y' has side effects, doesn't trigger the side effect TWICE. It
2368 'y' has side effects, doesn't trigger the side effect TWICE. It
2345 is important to note that, with autocall on, these side effects
2369 is important to note that, with autocall on, these side effects
2346 can still happen.
2370 can still happen.
2347 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2371 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2348 trio. IPython offers these three kinds of special calls which are
2372 trio. IPython offers these three kinds of special calls which are
2349 not python code, and it's a good thing to have their call method
2373 not python code, and it's a good thing to have their call method
2350 be accessible as pure python functions (not just special syntax at
2374 be accessible as pure python functions (not just special syntax at
2351 the command line). It gives us a better internal implementation
2375 the command line). It gives us a better internal implementation
2352 structure, as well as exposing these for user scripting more
2376 structure, as well as exposing these for user scripting more
2353 cleanly.
2377 cleanly.
2354
2378
2355 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2379 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2356 file. Now that they'll be more likely to be used with the
2380 file. Now that they'll be more likely to be used with the
2357 persistance system (%store), I want to make sure their module path
2381 persistance system (%store), I want to make sure their module path
2358 doesn't change in the future, so that we don't break things for
2382 doesn't change in the future, so that we don't break things for
2359 users' persisted data.
2383 users' persisted data.
2360
2384
2361 * IPython/iplib.py (autoindent_update): move indentation
2385 * IPython/iplib.py (autoindent_update): move indentation
2362 management into the _text_ processing loop, not the keyboard
2386 management into the _text_ processing loop, not the keyboard
2363 interactive one. This is necessary to correctly process non-typed
2387 interactive one. This is necessary to correctly process non-typed
2364 multiline input (such as macros).
2388 multiline input (such as macros).
2365
2389
2366 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2390 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2367 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2391 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2368 which was producing problems in the resulting manual.
2392 which was producing problems in the resulting manual.
2369 (magic_whos): improve reporting of instances (show their class,
2393 (magic_whos): improve reporting of instances (show their class,
2370 instead of simply printing 'instance' which isn't terribly
2394 instead of simply printing 'instance' which isn't terribly
2371 informative).
2395 informative).
2372
2396
2373 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2397 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2374 (minor mods) to support network shares under win32.
2398 (minor mods) to support network shares under win32.
2375
2399
2376 * IPython/winconsole.py (get_console_size): add new winconsole
2400 * IPython/winconsole.py (get_console_size): add new winconsole
2377 module and fixes to page_dumb() to improve its behavior under
2401 module and fixes to page_dumb() to improve its behavior under
2378 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2402 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2379
2403
2380 * IPython/Magic.py (Macro): simplified Macro class to just
2404 * IPython/Magic.py (Macro): simplified Macro class to just
2381 subclass list. We've had only 2.2 compatibility for a very long
2405 subclass list. We've had only 2.2 compatibility for a very long
2382 time, yet I was still avoiding subclassing the builtin types. No
2406 time, yet I was still avoiding subclassing the builtin types. No
2383 more (I'm also starting to use properties, though I won't shift to
2407 more (I'm also starting to use properties, though I won't shift to
2384 2.3-specific features quite yet).
2408 2.3-specific features quite yet).
2385 (magic_store): added Ville's patch for lightweight variable
2409 (magic_store): added Ville's patch for lightweight variable
2386 persistence, after a request on the user list by Matt Wilkie
2410 persistence, after a request on the user list by Matt Wilkie
2387 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2411 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2388 details.
2412 details.
2389
2413
2390 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2414 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2391 changed the default logfile name from 'ipython.log' to
2415 changed the default logfile name from 'ipython.log' to
2392 'ipython_log.py'. These logs are real python files, and now that
2416 'ipython_log.py'. These logs are real python files, and now that
2393 we have much better multiline support, people are more likely to
2417 we have much better multiline support, people are more likely to
2394 want to use them as such. Might as well name them correctly.
2418 want to use them as such. Might as well name them correctly.
2395
2419
2396 * IPython/Magic.py: substantial cleanup. While we can't stop
2420 * IPython/Magic.py: substantial cleanup. While we can't stop
2397 using magics as mixins, due to the existing customizations 'out
2421 using magics as mixins, due to the existing customizations 'out
2398 there' which rely on the mixin naming conventions, at least I
2422 there' which rely on the mixin naming conventions, at least I
2399 cleaned out all cross-class name usage. So once we are OK with
2423 cleaned out all cross-class name usage. So once we are OK with
2400 breaking compatibility, the two systems can be separated.
2424 breaking compatibility, the two systems can be separated.
2401
2425
2402 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2426 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2403 anymore, and the class is a fair bit less hideous as well. New
2427 anymore, and the class is a fair bit less hideous as well. New
2404 features were also introduced: timestamping of input, and logging
2428 features were also introduced: timestamping of input, and logging
2405 of output results. These are user-visible with the -t and -o
2429 of output results. These are user-visible with the -t and -o
2406 options to %logstart. Closes
2430 options to %logstart. Closes
2407 http://www.scipy.net/roundup/ipython/issue11 and a request by
2431 http://www.scipy.net/roundup/ipython/issue11 and a request by
2408 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2432 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2409
2433
2410 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2434 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2411
2435
2412 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2436 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2413 better handle backslashes in paths. See the thread 'More Windows
2437 better handle backslashes in paths. See the thread 'More Windows
2414 questions part 2 - \/ characters revisited' on the iypthon user
2438 questions part 2 - \/ characters revisited' on the iypthon user
2415 list:
2439 list:
2416 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2440 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2417
2441
2418 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2442 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2419
2443
2420 (InteractiveShell.__init__): change threaded shells to not use the
2444 (InteractiveShell.__init__): change threaded shells to not use the
2421 ipython crash handler. This was causing more problems than not,
2445 ipython crash handler. This was causing more problems than not,
2422 as exceptions in the main thread (GUI code, typically) would
2446 as exceptions in the main thread (GUI code, typically) would
2423 always show up as a 'crash', when they really weren't.
2447 always show up as a 'crash', when they really weren't.
2424
2448
2425 The colors and exception mode commands (%colors/%xmode) have been
2449 The colors and exception mode commands (%colors/%xmode) have been
2426 synchronized to also take this into account, so users can get
2450 synchronized to also take this into account, so users can get
2427 verbose exceptions for their threaded code as well. I also added
2451 verbose exceptions for their threaded code as well. I also added
2428 support for activating pdb inside this exception handler as well,
2452 support for activating pdb inside this exception handler as well,
2429 so now GUI authors can use IPython's enhanced pdb at runtime.
2453 so now GUI authors can use IPython's enhanced pdb at runtime.
2430
2454
2431 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2455 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2432 true by default, and add it to the shipped ipythonrc file. Since
2456 true by default, and add it to the shipped ipythonrc file. Since
2433 this asks the user before proceeding, I think it's OK to make it
2457 this asks the user before proceeding, I think it's OK to make it
2434 true by default.
2458 true by default.
2435
2459
2436 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2460 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2437 of the previous special-casing of input in the eval loop. I think
2461 of the previous special-casing of input in the eval loop. I think
2438 this is cleaner, as they really are commands and shouldn't have
2462 this is cleaner, as they really are commands and shouldn't have
2439 a special role in the middle of the core code.
2463 a special role in the middle of the core code.
2440
2464
2441 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2465 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2442
2466
2443 * IPython/iplib.py (edit_syntax_error): added support for
2467 * IPython/iplib.py (edit_syntax_error): added support for
2444 automatically reopening the editor if the file had a syntax error
2468 automatically reopening the editor if the file had a syntax error
2445 in it. Thanks to scottt who provided the patch at:
2469 in it. Thanks to scottt who provided the patch at:
2446 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2470 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2447 version committed).
2471 version committed).
2448
2472
2449 * IPython/iplib.py (handle_normal): add suport for multi-line
2473 * IPython/iplib.py (handle_normal): add suport for multi-line
2450 input with emtpy lines. This fixes
2474 input with emtpy lines. This fixes
2451 http://www.scipy.net/roundup/ipython/issue43 and a similar
2475 http://www.scipy.net/roundup/ipython/issue43 and a similar
2452 discussion on the user list.
2476 discussion on the user list.
2453
2477
2454 WARNING: a behavior change is necessarily introduced to support
2478 WARNING: a behavior change is necessarily introduced to support
2455 blank lines: now a single blank line with whitespace does NOT
2479 blank lines: now a single blank line with whitespace does NOT
2456 break the input loop, which means that when autoindent is on, by
2480 break the input loop, which means that when autoindent is on, by
2457 default hitting return on the next (indented) line does NOT exit.
2481 default hitting return on the next (indented) line does NOT exit.
2458
2482
2459 Instead, to exit a multiline input you can either have:
2483 Instead, to exit a multiline input you can either have:
2460
2484
2461 - TWO whitespace lines (just hit return again), or
2485 - TWO whitespace lines (just hit return again), or
2462 - a single whitespace line of a different length than provided
2486 - a single whitespace line of a different length than provided
2463 by the autoindent (add or remove a space).
2487 by the autoindent (add or remove a space).
2464
2488
2465 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2489 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2466 module to better organize all readline-related functionality.
2490 module to better organize all readline-related functionality.
2467 I've deleted FlexCompleter and put all completion clases here.
2491 I've deleted FlexCompleter and put all completion clases here.
2468
2492
2469 * IPython/iplib.py (raw_input): improve indentation management.
2493 * IPython/iplib.py (raw_input): improve indentation management.
2470 It is now possible to paste indented code with autoindent on, and
2494 It is now possible to paste indented code with autoindent on, and
2471 the code is interpreted correctly (though it still looks bad on
2495 the code is interpreted correctly (though it still looks bad on
2472 screen, due to the line-oriented nature of ipython).
2496 screen, due to the line-oriented nature of ipython).
2473 (MagicCompleter.complete): change behavior so that a TAB key on an
2497 (MagicCompleter.complete): change behavior so that a TAB key on an
2474 otherwise empty line actually inserts a tab, instead of completing
2498 otherwise empty line actually inserts a tab, instead of completing
2475 on the entire global namespace. This makes it easier to use the
2499 on the entire global namespace. This makes it easier to use the
2476 TAB key for indentation. After a request by Hans Meine
2500 TAB key for indentation. After a request by Hans Meine
2477 <hans_meine-AT-gmx.net>
2501 <hans_meine-AT-gmx.net>
2478 (_prefilter): add support so that typing plain 'exit' or 'quit'
2502 (_prefilter): add support so that typing plain 'exit' or 'quit'
2479 does a sensible thing. Originally I tried to deviate as little as
2503 does a sensible thing. Originally I tried to deviate as little as
2480 possible from the default python behavior, but even that one may
2504 possible from the default python behavior, but even that one may
2481 change in this direction (thread on python-dev to that effect).
2505 change in this direction (thread on python-dev to that effect).
2482 Regardless, ipython should do the right thing even if CPython's
2506 Regardless, ipython should do the right thing even if CPython's
2483 '>>>' prompt doesn't.
2507 '>>>' prompt doesn't.
2484 (InteractiveShell): removed subclassing code.InteractiveConsole
2508 (InteractiveShell): removed subclassing code.InteractiveConsole
2485 class. By now we'd overridden just about all of its methods: I've
2509 class. By now we'd overridden just about all of its methods: I've
2486 copied the remaining two over, and now ipython is a standalone
2510 copied the remaining two over, and now ipython is a standalone
2487 class. This will provide a clearer picture for the chainsaw
2511 class. This will provide a clearer picture for the chainsaw
2488 branch refactoring.
2512 branch refactoring.
2489
2513
2490 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2514 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2491
2515
2492 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2516 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2493 failures for objects which break when dir() is called on them.
2517 failures for objects which break when dir() is called on them.
2494
2518
2495 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2519 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2496 distinct local and global namespaces in the completer API. This
2520 distinct local and global namespaces in the completer API. This
2497 change allows us to properly handle completion with distinct
2521 change allows us to properly handle completion with distinct
2498 scopes, including in embedded instances (this had never really
2522 scopes, including in embedded instances (this had never really
2499 worked correctly).
2523 worked correctly).
2500
2524
2501 Note: this introduces a change in the constructor for
2525 Note: this introduces a change in the constructor for
2502 MagicCompleter, as a new global_namespace parameter is now the
2526 MagicCompleter, as a new global_namespace parameter is now the
2503 second argument (the others were bumped one position).
2527 second argument (the others were bumped one position).
2504
2528
2505 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2529 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2506
2530
2507 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2531 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2508 embedded instances (which can be done now thanks to Vivian's
2532 embedded instances (which can be done now thanks to Vivian's
2509 frame-handling fixes for pdb).
2533 frame-handling fixes for pdb).
2510 (InteractiveShell.__init__): Fix namespace handling problem in
2534 (InteractiveShell.__init__): Fix namespace handling problem in
2511 embedded instances. We were overwriting __main__ unconditionally,
2535 embedded instances. We were overwriting __main__ unconditionally,
2512 and this should only be done for 'full' (non-embedded) IPython;
2536 and this should only be done for 'full' (non-embedded) IPython;
2513 embedded instances must respect the caller's __main__. Thanks to
2537 embedded instances must respect the caller's __main__. Thanks to
2514 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2538 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2515
2539
2516 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2540 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2517
2541
2518 * setup.py: added download_url to setup(). This registers the
2542 * setup.py: added download_url to setup(). This registers the
2519 download address at PyPI, which is not only useful to humans
2543 download address at PyPI, which is not only useful to humans
2520 browsing the site, but is also picked up by setuptools (the Eggs
2544 browsing the site, but is also picked up by setuptools (the Eggs
2521 machinery). Thanks to Ville and R. Kern for the info/discussion
2545 machinery). Thanks to Ville and R. Kern for the info/discussion
2522 on this.
2546 on this.
2523
2547
2524 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2548 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2525
2549
2526 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2550 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2527 This brings a lot of nice functionality to the pdb mode, which now
2551 This brings a lot of nice functionality to the pdb mode, which now
2528 has tab-completion, syntax highlighting, and better stack handling
2552 has tab-completion, syntax highlighting, and better stack handling
2529 than before. Many thanks to Vivian De Smedt
2553 than before. Many thanks to Vivian De Smedt
2530 <vivian-AT-vdesmedt.com> for the original patches.
2554 <vivian-AT-vdesmedt.com> for the original patches.
2531
2555
2532 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2556 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2533
2557
2534 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2558 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2535 sequence to consistently accept the banner argument. The
2559 sequence to consistently accept the banner argument. The
2536 inconsistency was tripping SAGE, thanks to Gary Zablackis
2560 inconsistency was tripping SAGE, thanks to Gary Zablackis
2537 <gzabl-AT-yahoo.com> for the report.
2561 <gzabl-AT-yahoo.com> for the report.
2538
2562
2539 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2563 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2540
2564
2541 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2565 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2542 Fix bug where a naked 'alias' call in the ipythonrc file would
2566 Fix bug where a naked 'alias' call in the ipythonrc file would
2543 cause a crash. Bug reported by Jorgen Stenarson.
2567 cause a crash. Bug reported by Jorgen Stenarson.
2544
2568
2545 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2569 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2546
2570
2547 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2571 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2548 startup time.
2572 startup time.
2549
2573
2550 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2574 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2551 instances had introduced a bug with globals in normal code. Now
2575 instances had introduced a bug with globals in normal code. Now
2552 it's working in all cases.
2576 it's working in all cases.
2553
2577
2554 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2578 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2555 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2579 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2556 has been introduced to set the default case sensitivity of the
2580 has been introduced to set the default case sensitivity of the
2557 searches. Users can still select either mode at runtime on a
2581 searches. Users can still select either mode at runtime on a
2558 per-search basis.
2582 per-search basis.
2559
2583
2560 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2584 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2561
2585
2562 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2586 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2563 attributes in wildcard searches for subclasses. Modified version
2587 attributes in wildcard searches for subclasses. Modified version
2564 of a patch by Jorgen.
2588 of a patch by Jorgen.
2565
2589
2566 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2590 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2567
2591
2568 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2592 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2569 embedded instances. I added a user_global_ns attribute to the
2593 embedded instances. I added a user_global_ns attribute to the
2570 InteractiveShell class to handle this.
2594 InteractiveShell class to handle this.
2571
2595
2572 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2596 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2573
2597
2574 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2598 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2575 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2599 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2576 (reported under win32, but may happen also in other platforms).
2600 (reported under win32, but may happen also in other platforms).
2577 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2601 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2578
2602
2579 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2603 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2580
2604
2581 * IPython/Magic.py (magic_psearch): new support for wildcard
2605 * IPython/Magic.py (magic_psearch): new support for wildcard
2582 patterns. Now, typing ?a*b will list all names which begin with a
2606 patterns. Now, typing ?a*b will list all names which begin with a
2583 and end in b, for example. The %psearch magic has full
2607 and end in b, for example. The %psearch magic has full
2584 docstrings. Many thanks to JΓΆrgen Stenarson
2608 docstrings. Many thanks to JΓΆrgen Stenarson
2585 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2609 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2586 implementing this functionality.
2610 implementing this functionality.
2587
2611
2588 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2612 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2589
2613
2590 * Manual: fixed long-standing annoyance of double-dashes (as in
2614 * Manual: fixed long-standing annoyance of double-dashes (as in
2591 --prefix=~, for example) being stripped in the HTML version. This
2615 --prefix=~, for example) being stripped in the HTML version. This
2592 is a latex2html bug, but a workaround was provided. Many thanks
2616 is a latex2html bug, but a workaround was provided. Many thanks
2593 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2617 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2594 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2618 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2595 rolling. This seemingly small issue had tripped a number of users
2619 rolling. This seemingly small issue had tripped a number of users
2596 when first installing, so I'm glad to see it gone.
2620 when first installing, so I'm glad to see it gone.
2597
2621
2598 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2622 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2599
2623
2600 * IPython/Extensions/numeric_formats.py: fix missing import,
2624 * IPython/Extensions/numeric_formats.py: fix missing import,
2601 reported by Stephen Walton.
2625 reported by Stephen Walton.
2602
2626
2603 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2627 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2604
2628
2605 * IPython/demo.py: finish demo module, fully documented now.
2629 * IPython/demo.py: finish demo module, fully documented now.
2606
2630
2607 * IPython/genutils.py (file_read): simple little utility to read a
2631 * IPython/genutils.py (file_read): simple little utility to read a
2608 file and ensure it's closed afterwards.
2632 file and ensure it's closed afterwards.
2609
2633
2610 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2634 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2611
2635
2612 * IPython/demo.py (Demo.__init__): added support for individually
2636 * IPython/demo.py (Demo.__init__): added support for individually
2613 tagging blocks for automatic execution.
2637 tagging blocks for automatic execution.
2614
2638
2615 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2639 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2616 syntax-highlighted python sources, requested by John.
2640 syntax-highlighted python sources, requested by John.
2617
2641
2618 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2642 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2619
2643
2620 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2644 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2621 finishing.
2645 finishing.
2622
2646
2623 * IPython/genutils.py (shlex_split): moved from Magic to here,
2647 * IPython/genutils.py (shlex_split): moved from Magic to here,
2624 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2648 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2625
2649
2626 * IPython/demo.py (Demo.__init__): added support for silent
2650 * IPython/demo.py (Demo.__init__): added support for silent
2627 blocks, improved marks as regexps, docstrings written.
2651 blocks, improved marks as regexps, docstrings written.
2628 (Demo.__init__): better docstring, added support for sys.argv.
2652 (Demo.__init__): better docstring, added support for sys.argv.
2629
2653
2630 * IPython/genutils.py (marquee): little utility used by the demo
2654 * IPython/genutils.py (marquee): little utility used by the demo
2631 code, handy in general.
2655 code, handy in general.
2632
2656
2633 * IPython/demo.py (Demo.__init__): new class for interactive
2657 * IPython/demo.py (Demo.__init__): new class for interactive
2634 demos. Not documented yet, I just wrote it in a hurry for
2658 demos. Not documented yet, I just wrote it in a hurry for
2635 scipy'05. Will docstring later.
2659 scipy'05. Will docstring later.
2636
2660
2637 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2661 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2638
2662
2639 * IPython/Shell.py (sigint_handler): Drastic simplification which
2663 * IPython/Shell.py (sigint_handler): Drastic simplification which
2640 also seems to make Ctrl-C work correctly across threads! This is
2664 also seems to make Ctrl-C work correctly across threads! This is
2641 so simple, that I can't beleive I'd missed it before. Needs more
2665 so simple, that I can't beleive I'd missed it before. Needs more
2642 testing, though.
2666 testing, though.
2643 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2667 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2644 like this before...
2668 like this before...
2645
2669
2646 * IPython/genutils.py (get_home_dir): add protection against
2670 * IPython/genutils.py (get_home_dir): add protection against
2647 non-dirs in win32 registry.
2671 non-dirs in win32 registry.
2648
2672
2649 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2673 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2650 bug where dict was mutated while iterating (pysh crash).
2674 bug where dict was mutated while iterating (pysh crash).
2651
2675
2652 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2676 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2653
2677
2654 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2678 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2655 spurious newlines added by this routine. After a report by
2679 spurious newlines added by this routine. After a report by
2656 F. Mantegazza.
2680 F. Mantegazza.
2657
2681
2658 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2682 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2659
2683
2660 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2684 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2661 calls. These were a leftover from the GTK 1.x days, and can cause
2685 calls. These were a leftover from the GTK 1.x days, and can cause
2662 problems in certain cases (after a report by John Hunter).
2686 problems in certain cases (after a report by John Hunter).
2663
2687
2664 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2688 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2665 os.getcwd() fails at init time. Thanks to patch from David Remahl
2689 os.getcwd() fails at init time. Thanks to patch from David Remahl
2666 <chmod007-AT-mac.com>.
2690 <chmod007-AT-mac.com>.
2667 (InteractiveShell.__init__): prevent certain special magics from
2691 (InteractiveShell.__init__): prevent certain special magics from
2668 being shadowed by aliases. Closes
2692 being shadowed by aliases. Closes
2669 http://www.scipy.net/roundup/ipython/issue41.
2693 http://www.scipy.net/roundup/ipython/issue41.
2670
2694
2671 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2695 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2672
2696
2673 * IPython/iplib.py (InteractiveShell.complete): Added new
2697 * IPython/iplib.py (InteractiveShell.complete): Added new
2674 top-level completion method to expose the completion mechanism
2698 top-level completion method to expose the completion mechanism
2675 beyond readline-based environments.
2699 beyond readline-based environments.
2676
2700
2677 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2701 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2678
2702
2679 * tools/ipsvnc (svnversion): fix svnversion capture.
2703 * tools/ipsvnc (svnversion): fix svnversion capture.
2680
2704
2681 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2705 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2682 attribute to self, which was missing. Before, it was set by a
2706 attribute to self, which was missing. Before, it was set by a
2683 routine which in certain cases wasn't being called, so the
2707 routine which in certain cases wasn't being called, so the
2684 instance could end up missing the attribute. This caused a crash.
2708 instance could end up missing the attribute. This caused a crash.
2685 Closes http://www.scipy.net/roundup/ipython/issue40.
2709 Closes http://www.scipy.net/roundup/ipython/issue40.
2686
2710
2687 2005-08-16 Fernando Perez <fperez@colorado.edu>
2711 2005-08-16 Fernando Perez <fperez@colorado.edu>
2688
2712
2689 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2713 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2690 contains non-string attribute. Closes
2714 contains non-string attribute. Closes
2691 http://www.scipy.net/roundup/ipython/issue38.
2715 http://www.scipy.net/roundup/ipython/issue38.
2692
2716
2693 2005-08-14 Fernando Perez <fperez@colorado.edu>
2717 2005-08-14 Fernando Perez <fperez@colorado.edu>
2694
2718
2695 * tools/ipsvnc: Minor improvements, to add changeset info.
2719 * tools/ipsvnc: Minor improvements, to add changeset info.
2696
2720
2697 2005-08-12 Fernando Perez <fperez@colorado.edu>
2721 2005-08-12 Fernando Perez <fperez@colorado.edu>
2698
2722
2699 * IPython/iplib.py (runsource): remove self.code_to_run_src
2723 * IPython/iplib.py (runsource): remove self.code_to_run_src
2700 attribute. I realized this is nothing more than
2724 attribute. I realized this is nothing more than
2701 '\n'.join(self.buffer), and having the same data in two different
2725 '\n'.join(self.buffer), and having the same data in two different
2702 places is just asking for synchronization bugs. This may impact
2726 places is just asking for synchronization bugs. This may impact
2703 people who have custom exception handlers, so I need to warn
2727 people who have custom exception handlers, so I need to warn
2704 ipython-dev about it (F. Mantegazza may use them).
2728 ipython-dev about it (F. Mantegazza may use them).
2705
2729
2706 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2730 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2707
2731
2708 * IPython/genutils.py: fix 2.2 compatibility (generators)
2732 * IPython/genutils.py: fix 2.2 compatibility (generators)
2709
2733
2710 2005-07-18 Fernando Perez <fperez@colorado.edu>
2734 2005-07-18 Fernando Perez <fperez@colorado.edu>
2711
2735
2712 * IPython/genutils.py (get_home_dir): fix to help users with
2736 * IPython/genutils.py (get_home_dir): fix to help users with
2713 invalid $HOME under win32.
2737 invalid $HOME under win32.
2714
2738
2715 2005-07-17 Fernando Perez <fperez@colorado.edu>
2739 2005-07-17 Fernando Perez <fperez@colorado.edu>
2716
2740
2717 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2741 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2718 some old hacks and clean up a bit other routines; code should be
2742 some old hacks and clean up a bit other routines; code should be
2719 simpler and a bit faster.
2743 simpler and a bit faster.
2720
2744
2721 * IPython/iplib.py (interact): removed some last-resort attempts
2745 * IPython/iplib.py (interact): removed some last-resort attempts
2722 to survive broken stdout/stderr. That code was only making it
2746 to survive broken stdout/stderr. That code was only making it
2723 harder to abstract out the i/o (necessary for gui integration),
2747 harder to abstract out the i/o (necessary for gui integration),
2724 and the crashes it could prevent were extremely rare in practice
2748 and the crashes it could prevent were extremely rare in practice
2725 (besides being fully user-induced in a pretty violent manner).
2749 (besides being fully user-induced in a pretty violent manner).
2726
2750
2727 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2751 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2728 Nothing major yet, but the code is simpler to read; this should
2752 Nothing major yet, but the code is simpler to read; this should
2729 make it easier to do more serious modifications in the future.
2753 make it easier to do more serious modifications in the future.
2730
2754
2731 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2755 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2732 which broke in .15 (thanks to a report by Ville).
2756 which broke in .15 (thanks to a report by Ville).
2733
2757
2734 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2758 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2735 be quite correct, I know next to nothing about unicode). This
2759 be quite correct, I know next to nothing about unicode). This
2736 will allow unicode strings to be used in prompts, amongst other
2760 will allow unicode strings to be used in prompts, amongst other
2737 cases. It also will prevent ipython from crashing when unicode
2761 cases. It also will prevent ipython from crashing when unicode
2738 shows up unexpectedly in many places. If ascii encoding fails, we
2762 shows up unexpectedly in many places. If ascii encoding fails, we
2739 assume utf_8. Currently the encoding is not a user-visible
2763 assume utf_8. Currently the encoding is not a user-visible
2740 setting, though it could be made so if there is demand for it.
2764 setting, though it could be made so if there is demand for it.
2741
2765
2742 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2766 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2743
2767
2744 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2768 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2745
2769
2746 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2770 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2747
2771
2748 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2772 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2749 code can work transparently for 2.2/2.3.
2773 code can work transparently for 2.2/2.3.
2750
2774
2751 2005-07-16 Fernando Perez <fperez@colorado.edu>
2775 2005-07-16 Fernando Perez <fperez@colorado.edu>
2752
2776
2753 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2777 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2754 out of the color scheme table used for coloring exception
2778 out of the color scheme table used for coloring exception
2755 tracebacks. This allows user code to add new schemes at runtime.
2779 tracebacks. This allows user code to add new schemes at runtime.
2756 This is a minimally modified version of the patch at
2780 This is a minimally modified version of the patch at
2757 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2781 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2758 for the contribution.
2782 for the contribution.
2759
2783
2760 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2784 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2761 slightly modified version of the patch in
2785 slightly modified version of the patch in
2762 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2786 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2763 to remove the previous try/except solution (which was costlier).
2787 to remove the previous try/except solution (which was costlier).
2764 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2788 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2765
2789
2766 2005-06-08 Fernando Perez <fperez@colorado.edu>
2790 2005-06-08 Fernando Perez <fperez@colorado.edu>
2767
2791
2768 * IPython/iplib.py (write/write_err): Add methods to abstract all
2792 * IPython/iplib.py (write/write_err): Add methods to abstract all
2769 I/O a bit more.
2793 I/O a bit more.
2770
2794
2771 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2795 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2772 warning, reported by Aric Hagberg, fix by JD Hunter.
2796 warning, reported by Aric Hagberg, fix by JD Hunter.
2773
2797
2774 2005-06-02 *** Released version 0.6.15
2798 2005-06-02 *** Released version 0.6.15
2775
2799
2776 2005-06-01 Fernando Perez <fperez@colorado.edu>
2800 2005-06-01 Fernando Perez <fperez@colorado.edu>
2777
2801
2778 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2802 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2779 tab-completion of filenames within open-quoted strings. Note that
2803 tab-completion of filenames within open-quoted strings. Note that
2780 this requires that in ~/.ipython/ipythonrc, users change the
2804 this requires that in ~/.ipython/ipythonrc, users change the
2781 readline delimiters configuration to read:
2805 readline delimiters configuration to read:
2782
2806
2783 readline_remove_delims -/~
2807 readline_remove_delims -/~
2784
2808
2785
2809
2786 2005-05-31 *** Released version 0.6.14
2810 2005-05-31 *** Released version 0.6.14
2787
2811
2788 2005-05-29 Fernando Perez <fperez@colorado.edu>
2812 2005-05-29 Fernando Perez <fperez@colorado.edu>
2789
2813
2790 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2814 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2791 with files not on the filesystem. Reported by Eliyahu Sandler
2815 with files not on the filesystem. Reported by Eliyahu Sandler
2792 <eli@gondolin.net>
2816 <eli@gondolin.net>
2793
2817
2794 2005-05-22 Fernando Perez <fperez@colorado.edu>
2818 2005-05-22 Fernando Perez <fperez@colorado.edu>
2795
2819
2796 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2820 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2797 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2821 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2798
2822
2799 2005-05-19 Fernando Perez <fperez@colorado.edu>
2823 2005-05-19 Fernando Perez <fperez@colorado.edu>
2800
2824
2801 * IPython/iplib.py (safe_execfile): close a file which could be
2825 * IPython/iplib.py (safe_execfile): close a file which could be
2802 left open (causing problems in win32, which locks open files).
2826 left open (causing problems in win32, which locks open files).
2803 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2827 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2804
2828
2805 2005-05-18 Fernando Perez <fperez@colorado.edu>
2829 2005-05-18 Fernando Perez <fperez@colorado.edu>
2806
2830
2807 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2831 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2808 keyword arguments correctly to safe_execfile().
2832 keyword arguments correctly to safe_execfile().
2809
2833
2810 2005-05-13 Fernando Perez <fperez@colorado.edu>
2834 2005-05-13 Fernando Perez <fperez@colorado.edu>
2811
2835
2812 * ipython.1: Added info about Qt to manpage, and threads warning
2836 * ipython.1: Added info about Qt to manpage, and threads warning
2813 to usage page (invoked with --help).
2837 to usage page (invoked with --help).
2814
2838
2815 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2839 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2816 new matcher (it goes at the end of the priority list) to do
2840 new matcher (it goes at the end of the priority list) to do
2817 tab-completion on named function arguments. Submitted by George
2841 tab-completion on named function arguments. Submitted by George
2818 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2842 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2819 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2843 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2820 for more details.
2844 for more details.
2821
2845
2822 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2846 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2823 SystemExit exceptions in the script being run. Thanks to a report
2847 SystemExit exceptions in the script being run. Thanks to a report
2824 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2848 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2825 producing very annoying behavior when running unit tests.
2849 producing very annoying behavior when running unit tests.
2826
2850
2827 2005-05-12 Fernando Perez <fperez@colorado.edu>
2851 2005-05-12 Fernando Perez <fperez@colorado.edu>
2828
2852
2829 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2853 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2830 which I'd broken (again) due to a changed regexp. In the process,
2854 which I'd broken (again) due to a changed regexp. In the process,
2831 added ';' as an escape to auto-quote the whole line without
2855 added ';' as an escape to auto-quote the whole line without
2832 splitting its arguments. Thanks to a report by Jerry McRae
2856 splitting its arguments. Thanks to a report by Jerry McRae
2833 <qrs0xyc02-AT-sneakemail.com>.
2857 <qrs0xyc02-AT-sneakemail.com>.
2834
2858
2835 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2859 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2836 possible crashes caused by a TokenError. Reported by Ed Schofield
2860 possible crashes caused by a TokenError. Reported by Ed Schofield
2837 <schofield-AT-ftw.at>.
2861 <schofield-AT-ftw.at>.
2838
2862
2839 2005-05-06 Fernando Perez <fperez@colorado.edu>
2863 2005-05-06 Fernando Perez <fperez@colorado.edu>
2840
2864
2841 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2865 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2842
2866
2843 2005-04-29 Fernando Perez <fperez@colorado.edu>
2867 2005-04-29 Fernando Perez <fperez@colorado.edu>
2844
2868
2845 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2869 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2846 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2870 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2847 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2871 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2848 which provides support for Qt interactive usage (similar to the
2872 which provides support for Qt interactive usage (similar to the
2849 existing one for WX and GTK). This had been often requested.
2873 existing one for WX and GTK). This had been often requested.
2850
2874
2851 2005-04-14 *** Released version 0.6.13
2875 2005-04-14 *** Released version 0.6.13
2852
2876
2853 2005-04-08 Fernando Perez <fperez@colorado.edu>
2877 2005-04-08 Fernando Perez <fperez@colorado.edu>
2854
2878
2855 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2879 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2856 from _ofind, which gets called on almost every input line. Now,
2880 from _ofind, which gets called on almost every input line. Now,
2857 we only try to get docstrings if they are actually going to be
2881 we only try to get docstrings if they are actually going to be
2858 used (the overhead of fetching unnecessary docstrings can be
2882 used (the overhead of fetching unnecessary docstrings can be
2859 noticeable for certain objects, such as Pyro proxies).
2883 noticeable for certain objects, such as Pyro proxies).
2860
2884
2861 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2885 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2862 for completers. For some reason I had been passing them the state
2886 for completers. For some reason I had been passing them the state
2863 variable, which completers never actually need, and was in
2887 variable, which completers never actually need, and was in
2864 conflict with the rlcompleter API. Custom completers ONLY need to
2888 conflict with the rlcompleter API. Custom completers ONLY need to
2865 take the text parameter.
2889 take the text parameter.
2866
2890
2867 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2891 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2868 work correctly in pysh. I've also moved all the logic which used
2892 work correctly in pysh. I've also moved all the logic which used
2869 to be in pysh.py here, which will prevent problems with future
2893 to be in pysh.py here, which will prevent problems with future
2870 upgrades. However, this time I must warn users to update their
2894 upgrades. However, this time I must warn users to update their
2871 pysh profile to include the line
2895 pysh profile to include the line
2872
2896
2873 import_all IPython.Extensions.InterpreterExec
2897 import_all IPython.Extensions.InterpreterExec
2874
2898
2875 because otherwise things won't work for them. They MUST also
2899 because otherwise things won't work for them. They MUST also
2876 delete pysh.py and the line
2900 delete pysh.py and the line
2877
2901
2878 execfile pysh.py
2902 execfile pysh.py
2879
2903
2880 from their ipythonrc-pysh.
2904 from their ipythonrc-pysh.
2881
2905
2882 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2906 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2883 robust in the face of objects whose dir() returns non-strings
2907 robust in the face of objects whose dir() returns non-strings
2884 (which it shouldn't, but some broken libs like ITK do). Thanks to
2908 (which it shouldn't, but some broken libs like ITK do). Thanks to
2885 a patch by John Hunter (implemented differently, though). Also
2909 a patch by John Hunter (implemented differently, though). Also
2886 minor improvements by using .extend instead of + on lists.
2910 minor improvements by using .extend instead of + on lists.
2887
2911
2888 * pysh.py:
2912 * pysh.py:
2889
2913
2890 2005-04-06 Fernando Perez <fperez@colorado.edu>
2914 2005-04-06 Fernando Perez <fperez@colorado.edu>
2891
2915
2892 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2916 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2893 by default, so that all users benefit from it. Those who don't
2917 by default, so that all users benefit from it. Those who don't
2894 want it can still turn it off.
2918 want it can still turn it off.
2895
2919
2896 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2920 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2897 config file, I'd forgotten about this, so users were getting it
2921 config file, I'd forgotten about this, so users were getting it
2898 off by default.
2922 off by default.
2899
2923
2900 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2924 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2901 consistency. Now magics can be called in multiline statements,
2925 consistency. Now magics can be called in multiline statements,
2902 and python variables can be expanded in magic calls via $var.
2926 and python variables can be expanded in magic calls via $var.
2903 This makes the magic system behave just like aliases or !system
2927 This makes the magic system behave just like aliases or !system
2904 calls.
2928 calls.
2905
2929
2906 2005-03-28 Fernando Perez <fperez@colorado.edu>
2930 2005-03-28 Fernando Perez <fperez@colorado.edu>
2907
2931
2908 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2932 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2909 expensive string additions for building command. Add support for
2933 expensive string additions for building command. Add support for
2910 trailing ';' when autocall is used.
2934 trailing ';' when autocall is used.
2911
2935
2912 2005-03-26 Fernando Perez <fperez@colorado.edu>
2936 2005-03-26 Fernando Perez <fperez@colorado.edu>
2913
2937
2914 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2938 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2915 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2939 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2916 ipython.el robust against prompts with any number of spaces
2940 ipython.el robust against prompts with any number of spaces
2917 (including 0) after the ':' character.
2941 (including 0) after the ':' character.
2918
2942
2919 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2943 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2920 continuation prompt, which misled users to think the line was
2944 continuation prompt, which misled users to think the line was
2921 already indented. Closes debian Bug#300847, reported to me by
2945 already indented. Closes debian Bug#300847, reported to me by
2922 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2946 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2923
2947
2924 2005-03-23 Fernando Perez <fperez@colorado.edu>
2948 2005-03-23 Fernando Perez <fperez@colorado.edu>
2925
2949
2926 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2950 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2927 properly aligned if they have embedded newlines.
2951 properly aligned if they have embedded newlines.
2928
2952
2929 * IPython/iplib.py (runlines): Add a public method to expose
2953 * IPython/iplib.py (runlines): Add a public method to expose
2930 IPython's code execution machinery, so that users can run strings
2954 IPython's code execution machinery, so that users can run strings
2931 as if they had been typed at the prompt interactively.
2955 as if they had been typed at the prompt interactively.
2932 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2956 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2933 methods which can call the system shell, but with python variable
2957 methods which can call the system shell, but with python variable
2934 expansion. The three such methods are: __IPYTHON__.system,
2958 expansion. The three such methods are: __IPYTHON__.system,
2935 .getoutput and .getoutputerror. These need to be documented in a
2959 .getoutput and .getoutputerror. These need to be documented in a
2936 'public API' section (to be written) of the manual.
2960 'public API' section (to be written) of the manual.
2937
2961
2938 2005-03-20 Fernando Perez <fperez@colorado.edu>
2962 2005-03-20 Fernando Perez <fperez@colorado.edu>
2939
2963
2940 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2964 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2941 for custom exception handling. This is quite powerful, and it
2965 for custom exception handling. This is quite powerful, and it
2942 allows for user-installable exception handlers which can trap
2966 allows for user-installable exception handlers which can trap
2943 custom exceptions at runtime and treat them separately from
2967 custom exceptions at runtime and treat them separately from
2944 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2968 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2945 Mantegazza <mantegazza-AT-ill.fr>.
2969 Mantegazza <mantegazza-AT-ill.fr>.
2946 (InteractiveShell.set_custom_completer): public API function to
2970 (InteractiveShell.set_custom_completer): public API function to
2947 add new completers at runtime.
2971 add new completers at runtime.
2948
2972
2949 2005-03-19 Fernando Perez <fperez@colorado.edu>
2973 2005-03-19 Fernando Perez <fperez@colorado.edu>
2950
2974
2951 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2975 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2952 allow objects which provide their docstrings via non-standard
2976 allow objects which provide their docstrings via non-standard
2953 mechanisms (like Pyro proxies) to still be inspected by ipython's
2977 mechanisms (like Pyro proxies) to still be inspected by ipython's
2954 ? system.
2978 ? system.
2955
2979
2956 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2980 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2957 automatic capture system. I tried quite hard to make it work
2981 automatic capture system. I tried quite hard to make it work
2958 reliably, and simply failed. I tried many combinations with the
2982 reliably, and simply failed. I tried many combinations with the
2959 subprocess module, but eventually nothing worked in all needed
2983 subprocess module, but eventually nothing worked in all needed
2960 cases (not blocking stdin for the child, duplicating stdout
2984 cases (not blocking stdin for the child, duplicating stdout
2961 without blocking, etc). The new %sc/%sx still do capture to these
2985 without blocking, etc). The new %sc/%sx still do capture to these
2962 magical list/string objects which make shell use much more
2986 magical list/string objects which make shell use much more
2963 conveninent, so not all is lost.
2987 conveninent, so not all is lost.
2964
2988
2965 XXX - FIX MANUAL for the change above!
2989 XXX - FIX MANUAL for the change above!
2966
2990
2967 (runsource): I copied code.py's runsource() into ipython to modify
2991 (runsource): I copied code.py's runsource() into ipython to modify
2968 it a bit. Now the code object and source to be executed are
2992 it a bit. Now the code object and source to be executed are
2969 stored in ipython. This makes this info accessible to third-party
2993 stored in ipython. This makes this info accessible to third-party
2970 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2994 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2971 Mantegazza <mantegazza-AT-ill.fr>.
2995 Mantegazza <mantegazza-AT-ill.fr>.
2972
2996
2973 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2997 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2974 history-search via readline (like C-p/C-n). I'd wanted this for a
2998 history-search via readline (like C-p/C-n). I'd wanted this for a
2975 long time, but only recently found out how to do it. For users
2999 long time, but only recently found out how to do it. For users
2976 who already have their ipythonrc files made and want this, just
3000 who already have their ipythonrc files made and want this, just
2977 add:
3001 add:
2978
3002
2979 readline_parse_and_bind "\e[A": history-search-backward
3003 readline_parse_and_bind "\e[A": history-search-backward
2980 readline_parse_and_bind "\e[B": history-search-forward
3004 readline_parse_and_bind "\e[B": history-search-forward
2981
3005
2982 2005-03-18 Fernando Perez <fperez@colorado.edu>
3006 2005-03-18 Fernando Perez <fperez@colorado.edu>
2983
3007
2984 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3008 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2985 LSString and SList classes which allow transparent conversions
3009 LSString and SList classes which allow transparent conversions
2986 between list mode and whitespace-separated string.
3010 between list mode and whitespace-separated string.
2987 (magic_r): Fix recursion problem in %r.
3011 (magic_r): Fix recursion problem in %r.
2988
3012
2989 * IPython/genutils.py (LSString): New class to be used for
3013 * IPython/genutils.py (LSString): New class to be used for
2990 automatic storage of the results of all alias/system calls in _o
3014 automatic storage of the results of all alias/system calls in _o
2991 and _e (stdout/err). These provide a .l/.list attribute which
3015 and _e (stdout/err). These provide a .l/.list attribute which
2992 does automatic splitting on newlines. This means that for most
3016 does automatic splitting on newlines. This means that for most
2993 uses, you'll never need to do capturing of output with %sc/%sx
3017 uses, you'll never need to do capturing of output with %sc/%sx
2994 anymore, since ipython keeps this always done for you. Note that
3018 anymore, since ipython keeps this always done for you. Note that
2995 only the LAST results are stored, the _o/e variables are
3019 only the LAST results are stored, the _o/e variables are
2996 overwritten on each call. If you need to save their contents
3020 overwritten on each call. If you need to save their contents
2997 further, simply bind them to any other name.
3021 further, simply bind them to any other name.
2998
3022
2999 2005-03-17 Fernando Perez <fperez@colorado.edu>
3023 2005-03-17 Fernando Perez <fperez@colorado.edu>
3000
3024
3001 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3025 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3002 prompt namespace handling.
3026 prompt namespace handling.
3003
3027
3004 2005-03-16 Fernando Perez <fperez@colorado.edu>
3028 2005-03-16 Fernando Perez <fperez@colorado.edu>
3005
3029
3006 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3030 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3007 classic prompts to be '>>> ' (final space was missing, and it
3031 classic prompts to be '>>> ' (final space was missing, and it
3008 trips the emacs python mode).
3032 trips the emacs python mode).
3009 (BasePrompt.__str__): Added safe support for dynamic prompt
3033 (BasePrompt.__str__): Added safe support for dynamic prompt
3010 strings. Now you can set your prompt string to be '$x', and the
3034 strings. Now you can set your prompt string to be '$x', and the
3011 value of x will be printed from your interactive namespace. The
3035 value of x will be printed from your interactive namespace. The
3012 interpolation syntax includes the full Itpl support, so
3036 interpolation syntax includes the full Itpl support, so
3013 ${foo()+x+bar()} is a valid prompt string now, and the function
3037 ${foo()+x+bar()} is a valid prompt string now, and the function
3014 calls will be made at runtime.
3038 calls will be made at runtime.
3015
3039
3016 2005-03-15 Fernando Perez <fperez@colorado.edu>
3040 2005-03-15 Fernando Perez <fperez@colorado.edu>
3017
3041
3018 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3042 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3019 avoid name clashes in pylab. %hist still works, it just forwards
3043 avoid name clashes in pylab. %hist still works, it just forwards
3020 the call to %history.
3044 the call to %history.
3021
3045
3022 2005-03-02 *** Released version 0.6.12
3046 2005-03-02 *** Released version 0.6.12
3023
3047
3024 2005-03-02 Fernando Perez <fperez@colorado.edu>
3048 2005-03-02 Fernando Perez <fperez@colorado.edu>
3025
3049
3026 * IPython/iplib.py (handle_magic): log magic calls properly as
3050 * IPython/iplib.py (handle_magic): log magic calls properly as
3027 ipmagic() function calls.
3051 ipmagic() function calls.
3028
3052
3029 * IPython/Magic.py (magic_time): Improved %time to support
3053 * IPython/Magic.py (magic_time): Improved %time to support
3030 statements and provide wall-clock as well as CPU time.
3054 statements and provide wall-clock as well as CPU time.
3031
3055
3032 2005-02-27 Fernando Perez <fperez@colorado.edu>
3056 2005-02-27 Fernando Perez <fperez@colorado.edu>
3033
3057
3034 * IPython/hooks.py: New hooks module, to expose user-modifiable
3058 * IPython/hooks.py: New hooks module, to expose user-modifiable
3035 IPython functionality in a clean manner. For now only the editor
3059 IPython functionality in a clean manner. For now only the editor
3036 hook is actually written, and other thigns which I intend to turn
3060 hook is actually written, and other thigns which I intend to turn
3037 into proper hooks aren't yet there. The display and prefilter
3061 into proper hooks aren't yet there. The display and prefilter
3038 stuff, for example, should be hooks. But at least now the
3062 stuff, for example, should be hooks. But at least now the
3039 framework is in place, and the rest can be moved here with more
3063 framework is in place, and the rest can be moved here with more
3040 time later. IPython had had a .hooks variable for a long time for
3064 time later. IPython had had a .hooks variable for a long time for
3041 this purpose, but I'd never actually used it for anything.
3065 this purpose, but I'd never actually used it for anything.
3042
3066
3043 2005-02-26 Fernando Perez <fperez@colorado.edu>
3067 2005-02-26 Fernando Perez <fperez@colorado.edu>
3044
3068
3045 * IPython/ipmaker.py (make_IPython): make the default ipython
3069 * IPython/ipmaker.py (make_IPython): make the default ipython
3046 directory be called _ipython under win32, to follow more the
3070 directory be called _ipython under win32, to follow more the
3047 naming peculiarities of that platform (where buggy software like
3071 naming peculiarities of that platform (where buggy software like
3048 Visual Sourcesafe breaks with .named directories). Reported by
3072 Visual Sourcesafe breaks with .named directories). Reported by
3049 Ville Vainio.
3073 Ville Vainio.
3050
3074
3051 2005-02-23 Fernando Perez <fperez@colorado.edu>
3075 2005-02-23 Fernando Perez <fperez@colorado.edu>
3052
3076
3053 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3077 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3054 auto_aliases for win32 which were causing problems. Users can
3078 auto_aliases for win32 which were causing problems. Users can
3055 define the ones they personally like.
3079 define the ones they personally like.
3056
3080
3057 2005-02-21 Fernando Perez <fperez@colorado.edu>
3081 2005-02-21 Fernando Perez <fperez@colorado.edu>
3058
3082
3059 * IPython/Magic.py (magic_time): new magic to time execution of
3083 * IPython/Magic.py (magic_time): new magic to time execution of
3060 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3084 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3061
3085
3062 2005-02-19 Fernando Perez <fperez@colorado.edu>
3086 2005-02-19 Fernando Perez <fperez@colorado.edu>
3063
3087
3064 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3088 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3065 into keys (for prompts, for example).
3089 into keys (for prompts, for example).
3066
3090
3067 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3091 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3068 prompts in case users want them. This introduces a small behavior
3092 prompts in case users want them. This introduces a small behavior
3069 change: ipython does not automatically add a space to all prompts
3093 change: ipython does not automatically add a space to all prompts
3070 anymore. To get the old prompts with a space, users should add it
3094 anymore. To get the old prompts with a space, users should add it
3071 manually to their ipythonrc file, so for example prompt_in1 should
3095 manually to their ipythonrc file, so for example prompt_in1 should
3072 now read 'In [\#]: ' instead of 'In [\#]:'.
3096 now read 'In [\#]: ' instead of 'In [\#]:'.
3073 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3097 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3074 file) to control left-padding of secondary prompts.
3098 file) to control left-padding of secondary prompts.
3075
3099
3076 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3100 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3077 the profiler can't be imported. Fix for Debian, which removed
3101 the profiler can't be imported. Fix for Debian, which removed
3078 profile.py because of License issues. I applied a slightly
3102 profile.py because of License issues. I applied a slightly
3079 modified version of the original Debian patch at
3103 modified version of the original Debian patch at
3080 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3104 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3081
3105
3082 2005-02-17 Fernando Perez <fperez@colorado.edu>
3106 2005-02-17 Fernando Perez <fperez@colorado.edu>
3083
3107
3084 * IPython/genutils.py (native_line_ends): Fix bug which would
3108 * IPython/genutils.py (native_line_ends): Fix bug which would
3085 cause improper line-ends under win32 b/c I was not opening files
3109 cause improper line-ends under win32 b/c I was not opening files
3086 in binary mode. Bug report and fix thanks to Ville.
3110 in binary mode. Bug report and fix thanks to Ville.
3087
3111
3088 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3112 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3089 trying to catch spurious foo[1] autocalls. My fix actually broke
3113 trying to catch spurious foo[1] autocalls. My fix actually broke
3090 ',/' autoquote/call with explicit escape (bad regexp).
3114 ',/' autoquote/call with explicit escape (bad regexp).
3091
3115
3092 2005-02-15 *** Released version 0.6.11
3116 2005-02-15 *** Released version 0.6.11
3093
3117
3094 2005-02-14 Fernando Perez <fperez@colorado.edu>
3118 2005-02-14 Fernando Perez <fperez@colorado.edu>
3095
3119
3096 * IPython/background_jobs.py: New background job management
3120 * IPython/background_jobs.py: New background job management
3097 subsystem. This is implemented via a new set of classes, and
3121 subsystem. This is implemented via a new set of classes, and
3098 IPython now provides a builtin 'jobs' object for background job
3122 IPython now provides a builtin 'jobs' object for background job
3099 execution. A convenience %bg magic serves as a lightweight
3123 execution. A convenience %bg magic serves as a lightweight
3100 frontend for starting the more common type of calls. This was
3124 frontend for starting the more common type of calls. This was
3101 inspired by discussions with B. Granger and the BackgroundCommand
3125 inspired by discussions with B. Granger and the BackgroundCommand
3102 class described in the book Python Scripting for Computational
3126 class described in the book Python Scripting for Computational
3103 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3127 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3104 (although ultimately no code from this text was used, as IPython's
3128 (although ultimately no code from this text was used, as IPython's
3105 system is a separate implementation).
3129 system is a separate implementation).
3106
3130
3107 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3131 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3108 to control the completion of single/double underscore names
3132 to control the completion of single/double underscore names
3109 separately. As documented in the example ipytonrc file, the
3133 separately. As documented in the example ipytonrc file, the
3110 readline_omit__names variable can now be set to 2, to omit even
3134 readline_omit__names variable can now be set to 2, to omit even
3111 single underscore names. Thanks to a patch by Brian Wong
3135 single underscore names. Thanks to a patch by Brian Wong
3112 <BrianWong-AT-AirgoNetworks.Com>.
3136 <BrianWong-AT-AirgoNetworks.Com>.
3113 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3137 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3114 be autocalled as foo([1]) if foo were callable. A problem for
3138 be autocalled as foo([1]) if foo were callable. A problem for
3115 things which are both callable and implement __getitem__.
3139 things which are both callable and implement __getitem__.
3116 (init_readline): Fix autoindentation for win32. Thanks to a patch
3140 (init_readline): Fix autoindentation for win32. Thanks to a patch
3117 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3141 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3118
3142
3119 2005-02-12 Fernando Perez <fperez@colorado.edu>
3143 2005-02-12 Fernando Perez <fperez@colorado.edu>
3120
3144
3121 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3145 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3122 which I had written long ago to sort out user error messages which
3146 which I had written long ago to sort out user error messages which
3123 may occur during startup. This seemed like a good idea initially,
3147 may occur during startup. This seemed like a good idea initially,
3124 but it has proven a disaster in retrospect. I don't want to
3148 but it has proven a disaster in retrospect. I don't want to
3125 change much code for now, so my fix is to set the internal 'debug'
3149 change much code for now, so my fix is to set the internal 'debug'
3126 flag to true everywhere, whose only job was precisely to control
3150 flag to true everywhere, whose only job was precisely to control
3127 this subsystem. This closes issue 28 (as well as avoiding all
3151 this subsystem. This closes issue 28 (as well as avoiding all
3128 sorts of strange hangups which occur from time to time).
3152 sorts of strange hangups which occur from time to time).
3129
3153
3130 2005-02-07 Fernando Perez <fperez@colorado.edu>
3154 2005-02-07 Fernando Perez <fperez@colorado.edu>
3131
3155
3132 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3156 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3133 previous call produced a syntax error.
3157 previous call produced a syntax error.
3134
3158
3135 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3159 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3136 classes without constructor.
3160 classes without constructor.
3137
3161
3138 2005-02-06 Fernando Perez <fperez@colorado.edu>
3162 2005-02-06 Fernando Perez <fperez@colorado.edu>
3139
3163
3140 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3164 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3141 completions with the results of each matcher, so we return results
3165 completions with the results of each matcher, so we return results
3142 to the user from all namespaces. This breaks with ipython
3166 to the user from all namespaces. This breaks with ipython
3143 tradition, but I think it's a nicer behavior. Now you get all
3167 tradition, but I think it's a nicer behavior. Now you get all
3144 possible completions listed, from all possible namespaces (python,
3168 possible completions listed, from all possible namespaces (python,
3145 filesystem, magics...) After a request by John Hunter
3169 filesystem, magics...) After a request by John Hunter
3146 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3170 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3147
3171
3148 2005-02-05 Fernando Perez <fperez@colorado.edu>
3172 2005-02-05 Fernando Perez <fperez@colorado.edu>
3149
3173
3150 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3174 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3151 the call had quote characters in it (the quotes were stripped).
3175 the call had quote characters in it (the quotes were stripped).
3152
3176
3153 2005-01-31 Fernando Perez <fperez@colorado.edu>
3177 2005-01-31 Fernando Perez <fperez@colorado.edu>
3154
3178
3155 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3179 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3156 Itpl.itpl() to make the code more robust against psyco
3180 Itpl.itpl() to make the code more robust against psyco
3157 optimizations.
3181 optimizations.
3158
3182
3159 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3183 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3160 of causing an exception. Quicker, cleaner.
3184 of causing an exception. Quicker, cleaner.
3161
3185
3162 2005-01-28 Fernando Perez <fperez@colorado.edu>
3186 2005-01-28 Fernando Perez <fperez@colorado.edu>
3163
3187
3164 * scripts/ipython_win_post_install.py (install): hardcode
3188 * scripts/ipython_win_post_install.py (install): hardcode
3165 sys.prefix+'python.exe' as the executable path. It turns out that
3189 sys.prefix+'python.exe' as the executable path. It turns out that
3166 during the post-installation run, sys.executable resolves to the
3190 during the post-installation run, sys.executable resolves to the
3167 name of the binary installer! I should report this as a distutils
3191 name of the binary installer! I should report this as a distutils
3168 bug, I think. I updated the .10 release with this tiny fix, to
3192 bug, I think. I updated the .10 release with this tiny fix, to
3169 avoid annoying the lists further.
3193 avoid annoying the lists further.
3170
3194
3171 2005-01-27 *** Released version 0.6.10
3195 2005-01-27 *** Released version 0.6.10
3172
3196
3173 2005-01-27 Fernando Perez <fperez@colorado.edu>
3197 2005-01-27 Fernando Perez <fperez@colorado.edu>
3174
3198
3175 * IPython/numutils.py (norm): Added 'inf' as optional name for
3199 * IPython/numutils.py (norm): Added 'inf' as optional name for
3176 L-infinity norm, included references to mathworld.com for vector
3200 L-infinity norm, included references to mathworld.com for vector
3177 norm definitions.
3201 norm definitions.
3178 (amin/amax): added amin/amax for array min/max. Similar to what
3202 (amin/amax): added amin/amax for array min/max. Similar to what
3179 pylab ships with after the recent reorganization of names.
3203 pylab ships with after the recent reorganization of names.
3180 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3204 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3181
3205
3182 * ipython.el: committed Alex's recent fixes and improvements.
3206 * ipython.el: committed Alex's recent fixes and improvements.
3183 Tested with python-mode from CVS, and it looks excellent. Since
3207 Tested with python-mode from CVS, and it looks excellent. Since
3184 python-mode hasn't released anything in a while, I'm temporarily
3208 python-mode hasn't released anything in a while, I'm temporarily
3185 putting a copy of today's CVS (v 4.70) of python-mode in:
3209 putting a copy of today's CVS (v 4.70) of python-mode in:
3186 http://ipython.scipy.org/tmp/python-mode.el
3210 http://ipython.scipy.org/tmp/python-mode.el
3187
3211
3188 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3212 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3189 sys.executable for the executable name, instead of assuming it's
3213 sys.executable for the executable name, instead of assuming it's
3190 called 'python.exe' (the post-installer would have produced broken
3214 called 'python.exe' (the post-installer would have produced broken
3191 setups on systems with a differently named python binary).
3215 setups on systems with a differently named python binary).
3192
3216
3193 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3217 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3194 references to os.linesep, to make the code more
3218 references to os.linesep, to make the code more
3195 platform-independent. This is also part of the win32 coloring
3219 platform-independent. This is also part of the win32 coloring
3196 fixes.
3220 fixes.
3197
3221
3198 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3222 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3199 lines, which actually cause coloring bugs because the length of
3223 lines, which actually cause coloring bugs because the length of
3200 the line is very difficult to correctly compute with embedded
3224 the line is very difficult to correctly compute with embedded
3201 escapes. This was the source of all the coloring problems under
3225 escapes. This was the source of all the coloring problems under
3202 Win32. I think that _finally_, Win32 users have a properly
3226 Win32. I think that _finally_, Win32 users have a properly
3203 working ipython in all respects. This would never have happened
3227 working ipython in all respects. This would never have happened
3204 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3228 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3205
3229
3206 2005-01-26 *** Released version 0.6.9
3230 2005-01-26 *** Released version 0.6.9
3207
3231
3208 2005-01-25 Fernando Perez <fperez@colorado.edu>
3232 2005-01-25 Fernando Perez <fperez@colorado.edu>
3209
3233
3210 * setup.py: finally, we have a true Windows installer, thanks to
3234 * setup.py: finally, we have a true Windows installer, thanks to
3211 the excellent work of Viktor Ransmayr
3235 the excellent work of Viktor Ransmayr
3212 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3236 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3213 Windows users. The setup routine is quite a bit cleaner thanks to
3237 Windows users. The setup routine is quite a bit cleaner thanks to
3214 this, and the post-install script uses the proper functions to
3238 this, and the post-install script uses the proper functions to
3215 allow a clean de-installation using the standard Windows Control
3239 allow a clean de-installation using the standard Windows Control
3216 Panel.
3240 Panel.
3217
3241
3218 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3242 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3219 environment variable under all OSes (including win32) if
3243 environment variable under all OSes (including win32) if
3220 available. This will give consistency to win32 users who have set
3244 available. This will give consistency to win32 users who have set
3221 this variable for any reason. If os.environ['HOME'] fails, the
3245 this variable for any reason. If os.environ['HOME'] fails, the
3222 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3246 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3223
3247
3224 2005-01-24 Fernando Perez <fperez@colorado.edu>
3248 2005-01-24 Fernando Perez <fperez@colorado.edu>
3225
3249
3226 * IPython/numutils.py (empty_like): add empty_like(), similar to
3250 * IPython/numutils.py (empty_like): add empty_like(), similar to
3227 zeros_like() but taking advantage of the new empty() Numeric routine.
3251 zeros_like() but taking advantage of the new empty() Numeric routine.
3228
3252
3229 2005-01-23 *** Released version 0.6.8
3253 2005-01-23 *** Released version 0.6.8
3230
3254
3231 2005-01-22 Fernando Perez <fperez@colorado.edu>
3255 2005-01-22 Fernando Perez <fperez@colorado.edu>
3232
3256
3233 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3257 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3234 automatic show() calls. After discussing things with JDH, it
3258 automatic show() calls. After discussing things with JDH, it
3235 turns out there are too many corner cases where this can go wrong.
3259 turns out there are too many corner cases where this can go wrong.
3236 It's best not to try to be 'too smart', and simply have ipython
3260 It's best not to try to be 'too smart', and simply have ipython
3237 reproduce as much as possible the default behavior of a normal
3261 reproduce as much as possible the default behavior of a normal
3238 python shell.
3262 python shell.
3239
3263
3240 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3264 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3241 line-splitting regexp and _prefilter() to avoid calling getattr()
3265 line-splitting regexp and _prefilter() to avoid calling getattr()
3242 on assignments. This closes
3266 on assignments. This closes
3243 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3267 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3244 readline uses getattr(), so a simple <TAB> keypress is still
3268 readline uses getattr(), so a simple <TAB> keypress is still
3245 enough to trigger getattr() calls on an object.
3269 enough to trigger getattr() calls on an object.
3246
3270
3247 2005-01-21 Fernando Perez <fperez@colorado.edu>
3271 2005-01-21 Fernando Perez <fperez@colorado.edu>
3248
3272
3249 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3273 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3250 docstring under pylab so it doesn't mask the original.
3274 docstring under pylab so it doesn't mask the original.
3251
3275
3252 2005-01-21 *** Released version 0.6.7
3276 2005-01-21 *** Released version 0.6.7
3253
3277
3254 2005-01-21 Fernando Perez <fperez@colorado.edu>
3278 2005-01-21 Fernando Perez <fperez@colorado.edu>
3255
3279
3256 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3280 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3257 signal handling for win32 users in multithreaded mode.
3281 signal handling for win32 users in multithreaded mode.
3258
3282
3259 2005-01-17 Fernando Perez <fperez@colorado.edu>
3283 2005-01-17 Fernando Perez <fperez@colorado.edu>
3260
3284
3261 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3285 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3262 instances with no __init__. After a crash report by Norbert Nemec
3286 instances with no __init__. After a crash report by Norbert Nemec
3263 <Norbert-AT-nemec-online.de>.
3287 <Norbert-AT-nemec-online.de>.
3264
3288
3265 2005-01-14 Fernando Perez <fperez@colorado.edu>
3289 2005-01-14 Fernando Perez <fperez@colorado.edu>
3266
3290
3267 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3291 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3268 names for verbose exceptions, when multiple dotted names and the
3292 names for verbose exceptions, when multiple dotted names and the
3269 'parent' object were present on the same line.
3293 'parent' object were present on the same line.
3270
3294
3271 2005-01-11 Fernando Perez <fperez@colorado.edu>
3295 2005-01-11 Fernando Perez <fperez@colorado.edu>
3272
3296
3273 * IPython/genutils.py (flag_calls): new utility to trap and flag
3297 * IPython/genutils.py (flag_calls): new utility to trap and flag
3274 calls in functions. I need it to clean up matplotlib support.
3298 calls in functions. I need it to clean up matplotlib support.
3275 Also removed some deprecated code in genutils.
3299 Also removed some deprecated code in genutils.
3276
3300
3277 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3301 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3278 that matplotlib scripts called with %run, which don't call show()
3302 that matplotlib scripts called with %run, which don't call show()
3279 themselves, still have their plotting windows open.
3303 themselves, still have their plotting windows open.
3280
3304
3281 2005-01-05 Fernando Perez <fperez@colorado.edu>
3305 2005-01-05 Fernando Perez <fperez@colorado.edu>
3282
3306
3283 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3307 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3284 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3308 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3285
3309
3286 2004-12-19 Fernando Perez <fperez@colorado.edu>
3310 2004-12-19 Fernando Perez <fperez@colorado.edu>
3287
3311
3288 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3312 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3289 parent_runcode, which was an eyesore. The same result can be
3313 parent_runcode, which was an eyesore. The same result can be
3290 obtained with Python's regular superclass mechanisms.
3314 obtained with Python's regular superclass mechanisms.
3291
3315
3292 2004-12-17 Fernando Perez <fperez@colorado.edu>
3316 2004-12-17 Fernando Perez <fperez@colorado.edu>
3293
3317
3294 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3318 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3295 reported by Prabhu.
3319 reported by Prabhu.
3296 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3320 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3297 sys.stderr) instead of explicitly calling sys.stderr. This helps
3321 sys.stderr) instead of explicitly calling sys.stderr. This helps
3298 maintain our I/O abstractions clean, for future GUI embeddings.
3322 maintain our I/O abstractions clean, for future GUI embeddings.
3299
3323
3300 * IPython/genutils.py (info): added new utility for sys.stderr
3324 * IPython/genutils.py (info): added new utility for sys.stderr
3301 unified info message handling (thin wrapper around warn()).
3325 unified info message handling (thin wrapper around warn()).
3302
3326
3303 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3327 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3304 composite (dotted) names on verbose exceptions.
3328 composite (dotted) names on verbose exceptions.
3305 (VerboseTB.nullrepr): harden against another kind of errors which
3329 (VerboseTB.nullrepr): harden against another kind of errors which
3306 Python's inspect module can trigger, and which were crashing
3330 Python's inspect module can trigger, and which were crashing
3307 IPython. Thanks to a report by Marco Lombardi
3331 IPython. Thanks to a report by Marco Lombardi
3308 <mlombard-AT-ma010192.hq.eso.org>.
3332 <mlombard-AT-ma010192.hq.eso.org>.
3309
3333
3310 2004-12-13 *** Released version 0.6.6
3334 2004-12-13 *** Released version 0.6.6
3311
3335
3312 2004-12-12 Fernando Perez <fperez@colorado.edu>
3336 2004-12-12 Fernando Perez <fperez@colorado.edu>
3313
3337
3314 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3338 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3315 generated by pygtk upon initialization if it was built without
3339 generated by pygtk upon initialization if it was built without
3316 threads (for matplotlib users). After a crash reported by
3340 threads (for matplotlib users). After a crash reported by
3317 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3341 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3318
3342
3319 * IPython/ipmaker.py (make_IPython): fix small bug in the
3343 * IPython/ipmaker.py (make_IPython): fix small bug in the
3320 import_some parameter for multiple imports.
3344 import_some parameter for multiple imports.
3321
3345
3322 * IPython/iplib.py (ipmagic): simplified the interface of
3346 * IPython/iplib.py (ipmagic): simplified the interface of
3323 ipmagic() to take a single string argument, just as it would be
3347 ipmagic() to take a single string argument, just as it would be
3324 typed at the IPython cmd line.
3348 typed at the IPython cmd line.
3325 (ipalias): Added new ipalias() with an interface identical to
3349 (ipalias): Added new ipalias() with an interface identical to
3326 ipmagic(). This completes exposing a pure python interface to the
3350 ipmagic(). This completes exposing a pure python interface to the
3327 alias and magic system, which can be used in loops or more complex
3351 alias and magic system, which can be used in loops or more complex
3328 code where IPython's automatic line mangling is not active.
3352 code where IPython's automatic line mangling is not active.
3329
3353
3330 * IPython/genutils.py (timing): changed interface of timing to
3354 * IPython/genutils.py (timing): changed interface of timing to
3331 simply run code once, which is the most common case. timings()
3355 simply run code once, which is the most common case. timings()
3332 remains unchanged, for the cases where you want multiple runs.
3356 remains unchanged, for the cases where you want multiple runs.
3333
3357
3334 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3358 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3335 bug where Python2.2 crashes with exec'ing code which does not end
3359 bug where Python2.2 crashes with exec'ing code which does not end
3336 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3360 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3337 before.
3361 before.
3338
3362
3339 2004-12-10 Fernando Perez <fperez@colorado.edu>
3363 2004-12-10 Fernando Perez <fperez@colorado.edu>
3340
3364
3341 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3365 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3342 -t to -T, to accomodate the new -t flag in %run (the %run and
3366 -t to -T, to accomodate the new -t flag in %run (the %run and
3343 %prun options are kind of intermixed, and it's not easy to change
3367 %prun options are kind of intermixed, and it's not easy to change
3344 this with the limitations of python's getopt).
3368 this with the limitations of python's getopt).
3345
3369
3346 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3370 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3347 the execution of scripts. It's not as fine-tuned as timeit.py,
3371 the execution of scripts. It's not as fine-tuned as timeit.py,
3348 but it works from inside ipython (and under 2.2, which lacks
3372 but it works from inside ipython (and under 2.2, which lacks
3349 timeit.py). Optionally a number of runs > 1 can be given for
3373 timeit.py). Optionally a number of runs > 1 can be given for
3350 timing very short-running code.
3374 timing very short-running code.
3351
3375
3352 * IPython/genutils.py (uniq_stable): new routine which returns a
3376 * IPython/genutils.py (uniq_stable): new routine which returns a
3353 list of unique elements in any iterable, but in stable order of
3377 list of unique elements in any iterable, but in stable order of
3354 appearance. I needed this for the ultraTB fixes, and it's a handy
3378 appearance. I needed this for the ultraTB fixes, and it's a handy
3355 utility.
3379 utility.
3356
3380
3357 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3381 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3358 dotted names in Verbose exceptions. This had been broken since
3382 dotted names in Verbose exceptions. This had been broken since
3359 the very start, now x.y will properly be printed in a Verbose
3383 the very start, now x.y will properly be printed in a Verbose
3360 traceback, instead of x being shown and y appearing always as an
3384 traceback, instead of x being shown and y appearing always as an
3361 'undefined global'. Getting this to work was a bit tricky,
3385 'undefined global'. Getting this to work was a bit tricky,
3362 because by default python tokenizers are stateless. Saved by
3386 because by default python tokenizers are stateless. Saved by
3363 python's ability to easily add a bit of state to an arbitrary
3387 python's ability to easily add a bit of state to an arbitrary
3364 function (without needing to build a full-blown callable object).
3388 function (without needing to build a full-blown callable object).
3365
3389
3366 Also big cleanup of this code, which had horrendous runtime
3390 Also big cleanup of this code, which had horrendous runtime
3367 lookups of zillions of attributes for colorization. Moved all
3391 lookups of zillions of attributes for colorization. Moved all
3368 this code into a few templates, which make it cleaner and quicker.
3392 this code into a few templates, which make it cleaner and quicker.
3369
3393
3370 Printout quality was also improved for Verbose exceptions: one
3394 Printout quality was also improved for Verbose exceptions: one
3371 variable per line, and memory addresses are printed (this can be
3395 variable per line, and memory addresses are printed (this can be
3372 quite handy in nasty debugging situations, which is what Verbose
3396 quite handy in nasty debugging situations, which is what Verbose
3373 is for).
3397 is for).
3374
3398
3375 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3399 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3376 the command line as scripts to be loaded by embedded instances.
3400 the command line as scripts to be loaded by embedded instances.
3377 Doing so has the potential for an infinite recursion if there are
3401 Doing so has the potential for an infinite recursion if there are
3378 exceptions thrown in the process. This fixes a strange crash
3402 exceptions thrown in the process. This fixes a strange crash
3379 reported by Philippe MULLER <muller-AT-irit.fr>.
3403 reported by Philippe MULLER <muller-AT-irit.fr>.
3380
3404
3381 2004-12-09 Fernando Perez <fperez@colorado.edu>
3405 2004-12-09 Fernando Perez <fperez@colorado.edu>
3382
3406
3383 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3407 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3384 to reflect new names in matplotlib, which now expose the
3408 to reflect new names in matplotlib, which now expose the
3385 matlab-compatible interface via a pylab module instead of the
3409 matlab-compatible interface via a pylab module instead of the
3386 'matlab' name. The new code is backwards compatible, so users of
3410 'matlab' name. The new code is backwards compatible, so users of
3387 all matplotlib versions are OK. Patch by J. Hunter.
3411 all matplotlib versions are OK. Patch by J. Hunter.
3388
3412
3389 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3413 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3390 of __init__ docstrings for instances (class docstrings are already
3414 of __init__ docstrings for instances (class docstrings are already
3391 automatically printed). Instances with customized docstrings
3415 automatically printed). Instances with customized docstrings
3392 (indep. of the class) are also recognized and all 3 separate
3416 (indep. of the class) are also recognized and all 3 separate
3393 docstrings are printed (instance, class, constructor). After some
3417 docstrings are printed (instance, class, constructor). After some
3394 comments/suggestions by J. Hunter.
3418 comments/suggestions by J. Hunter.
3395
3419
3396 2004-12-05 Fernando Perez <fperez@colorado.edu>
3420 2004-12-05 Fernando Perez <fperez@colorado.edu>
3397
3421
3398 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3422 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3399 warnings when tab-completion fails and triggers an exception.
3423 warnings when tab-completion fails and triggers an exception.
3400
3424
3401 2004-12-03 Fernando Perez <fperez@colorado.edu>
3425 2004-12-03 Fernando Perez <fperez@colorado.edu>
3402
3426
3403 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3427 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3404 be triggered when using 'run -p'. An incorrect option flag was
3428 be triggered when using 'run -p'. An incorrect option flag was
3405 being set ('d' instead of 'D').
3429 being set ('d' instead of 'D').
3406 (manpage): fix missing escaped \- sign.
3430 (manpage): fix missing escaped \- sign.
3407
3431
3408 2004-11-30 *** Released version 0.6.5
3432 2004-11-30 *** Released version 0.6.5
3409
3433
3410 2004-11-30 Fernando Perez <fperez@colorado.edu>
3434 2004-11-30 Fernando Perez <fperez@colorado.edu>
3411
3435
3412 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3436 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3413 setting with -d option.
3437 setting with -d option.
3414
3438
3415 * setup.py (docfiles): Fix problem where the doc glob I was using
3439 * setup.py (docfiles): Fix problem where the doc glob I was using
3416 was COMPLETELY BROKEN. It was giving the right files by pure
3440 was COMPLETELY BROKEN. It was giving the right files by pure
3417 accident, but failed once I tried to include ipython.el. Note:
3441 accident, but failed once I tried to include ipython.el. Note:
3418 glob() does NOT allow you to do exclusion on multiple endings!
3442 glob() does NOT allow you to do exclusion on multiple endings!
3419
3443
3420 2004-11-29 Fernando Perez <fperez@colorado.edu>
3444 2004-11-29 Fernando Perez <fperez@colorado.edu>
3421
3445
3422 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3446 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3423 the manpage as the source. Better formatting & consistency.
3447 the manpage as the source. Better formatting & consistency.
3424
3448
3425 * IPython/Magic.py (magic_run): Added new -d option, to run
3449 * IPython/Magic.py (magic_run): Added new -d option, to run
3426 scripts under the control of the python pdb debugger. Note that
3450 scripts under the control of the python pdb debugger. Note that
3427 this required changing the %prun option -d to -D, to avoid a clash
3451 this required changing the %prun option -d to -D, to avoid a clash
3428 (since %run must pass options to %prun, and getopt is too dumb to
3452 (since %run must pass options to %prun, and getopt is too dumb to
3429 handle options with string values with embedded spaces). Thanks
3453 handle options with string values with embedded spaces). Thanks
3430 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3454 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3431 (magic_who_ls): added type matching to %who and %whos, so that one
3455 (magic_who_ls): added type matching to %who and %whos, so that one
3432 can filter their output to only include variables of certain
3456 can filter their output to only include variables of certain
3433 types. Another suggestion by Matthew.
3457 types. Another suggestion by Matthew.
3434 (magic_whos): Added memory summaries in kb and Mb for arrays.
3458 (magic_whos): Added memory summaries in kb and Mb for arrays.
3435 (magic_who): Improve formatting (break lines every 9 vars).
3459 (magic_who): Improve formatting (break lines every 9 vars).
3436
3460
3437 2004-11-28 Fernando Perez <fperez@colorado.edu>
3461 2004-11-28 Fernando Perez <fperez@colorado.edu>
3438
3462
3439 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3463 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3440 cache when empty lines were present.
3464 cache when empty lines were present.
3441
3465
3442 2004-11-24 Fernando Perez <fperez@colorado.edu>
3466 2004-11-24 Fernando Perez <fperez@colorado.edu>
3443
3467
3444 * IPython/usage.py (__doc__): document the re-activated threading
3468 * IPython/usage.py (__doc__): document the re-activated threading
3445 options for WX and GTK.
3469 options for WX and GTK.
3446
3470
3447 2004-11-23 Fernando Perez <fperez@colorado.edu>
3471 2004-11-23 Fernando Perez <fperez@colorado.edu>
3448
3472
3449 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3473 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3450 the -wthread and -gthread options, along with a new -tk one to try
3474 the -wthread and -gthread options, along with a new -tk one to try
3451 and coordinate Tk threading with wx/gtk. The tk support is very
3475 and coordinate Tk threading with wx/gtk. The tk support is very
3452 platform dependent, since it seems to require Tcl and Tk to be
3476 platform dependent, since it seems to require Tcl and Tk to be
3453 built with threads (Fedora1/2 appears NOT to have it, but in
3477 built with threads (Fedora1/2 appears NOT to have it, but in
3454 Prabhu's Debian boxes it works OK). But even with some Tk
3478 Prabhu's Debian boxes it works OK). But even with some Tk
3455 limitations, this is a great improvement.
3479 limitations, this is a great improvement.
3456
3480
3457 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3481 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3458 info in user prompts. Patch by Prabhu.
3482 info in user prompts. Patch by Prabhu.
3459
3483
3460 2004-11-18 Fernando Perez <fperez@colorado.edu>
3484 2004-11-18 Fernando Perez <fperez@colorado.edu>
3461
3485
3462 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3486 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3463 EOFErrors and bail, to avoid infinite loops if a non-terminating
3487 EOFErrors and bail, to avoid infinite loops if a non-terminating
3464 file is fed into ipython. Patch submitted in issue 19 by user,
3488 file is fed into ipython. Patch submitted in issue 19 by user,
3465 many thanks.
3489 many thanks.
3466
3490
3467 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3491 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3468 autoquote/parens in continuation prompts, which can cause lots of
3492 autoquote/parens in continuation prompts, which can cause lots of
3469 problems. Closes roundup issue 20.
3493 problems. Closes roundup issue 20.
3470
3494
3471 2004-11-17 Fernando Perez <fperez@colorado.edu>
3495 2004-11-17 Fernando Perez <fperez@colorado.edu>
3472
3496
3473 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3497 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3474 reported as debian bug #280505. I'm not sure my local changelog
3498 reported as debian bug #280505. I'm not sure my local changelog
3475 entry has the proper debian format (Jack?).
3499 entry has the proper debian format (Jack?).
3476
3500
3477 2004-11-08 *** Released version 0.6.4
3501 2004-11-08 *** Released version 0.6.4
3478
3502
3479 2004-11-08 Fernando Perez <fperez@colorado.edu>
3503 2004-11-08 Fernando Perez <fperez@colorado.edu>
3480
3504
3481 * IPython/iplib.py (init_readline): Fix exit message for Windows
3505 * IPython/iplib.py (init_readline): Fix exit message for Windows
3482 when readline is active. Thanks to a report by Eric Jones
3506 when readline is active. Thanks to a report by Eric Jones
3483 <eric-AT-enthought.com>.
3507 <eric-AT-enthought.com>.
3484
3508
3485 2004-11-07 Fernando Perez <fperez@colorado.edu>
3509 2004-11-07 Fernando Perez <fperez@colorado.edu>
3486
3510
3487 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3511 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3488 sometimes seen by win2k/cygwin users.
3512 sometimes seen by win2k/cygwin users.
3489
3513
3490 2004-11-06 Fernando Perez <fperez@colorado.edu>
3514 2004-11-06 Fernando Perez <fperez@colorado.edu>
3491
3515
3492 * IPython/iplib.py (interact): Change the handling of %Exit from
3516 * IPython/iplib.py (interact): Change the handling of %Exit from
3493 trying to propagate a SystemExit to an internal ipython flag.
3517 trying to propagate a SystemExit to an internal ipython flag.
3494 This is less elegant than using Python's exception mechanism, but
3518 This is less elegant than using Python's exception mechanism, but
3495 I can't get that to work reliably with threads, so under -pylab
3519 I can't get that to work reliably with threads, so under -pylab
3496 %Exit was hanging IPython. Cross-thread exception handling is
3520 %Exit was hanging IPython. Cross-thread exception handling is
3497 really a bitch. Thaks to a bug report by Stephen Walton
3521 really a bitch. Thaks to a bug report by Stephen Walton
3498 <stephen.walton-AT-csun.edu>.
3522 <stephen.walton-AT-csun.edu>.
3499
3523
3500 2004-11-04 Fernando Perez <fperez@colorado.edu>
3524 2004-11-04 Fernando Perez <fperez@colorado.edu>
3501
3525
3502 * IPython/iplib.py (raw_input_original): store a pointer to the
3526 * IPython/iplib.py (raw_input_original): store a pointer to the
3503 true raw_input to harden against code which can modify it
3527 true raw_input to harden against code which can modify it
3504 (wx.py.PyShell does this and would otherwise crash ipython).
3528 (wx.py.PyShell does this and would otherwise crash ipython).
3505 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3529 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3506
3530
3507 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3531 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3508 Ctrl-C problem, which does not mess up the input line.
3532 Ctrl-C problem, which does not mess up the input line.
3509
3533
3510 2004-11-03 Fernando Perez <fperez@colorado.edu>
3534 2004-11-03 Fernando Perez <fperez@colorado.edu>
3511
3535
3512 * IPython/Release.py: Changed licensing to BSD, in all files.
3536 * IPython/Release.py: Changed licensing to BSD, in all files.
3513 (name): lowercase name for tarball/RPM release.
3537 (name): lowercase name for tarball/RPM release.
3514
3538
3515 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3539 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3516 use throughout ipython.
3540 use throughout ipython.
3517
3541
3518 * IPython/Magic.py (Magic._ofind): Switch to using the new
3542 * IPython/Magic.py (Magic._ofind): Switch to using the new
3519 OInspect.getdoc() function.
3543 OInspect.getdoc() function.
3520
3544
3521 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3545 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3522 of the line currently being canceled via Ctrl-C. It's extremely
3546 of the line currently being canceled via Ctrl-C. It's extremely
3523 ugly, but I don't know how to do it better (the problem is one of
3547 ugly, but I don't know how to do it better (the problem is one of
3524 handling cross-thread exceptions).
3548 handling cross-thread exceptions).
3525
3549
3526 2004-10-28 Fernando Perez <fperez@colorado.edu>
3550 2004-10-28 Fernando Perez <fperez@colorado.edu>
3527
3551
3528 * IPython/Shell.py (signal_handler): add signal handlers to trap
3552 * IPython/Shell.py (signal_handler): add signal handlers to trap
3529 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3553 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3530 report by Francesc Alted.
3554 report by Francesc Alted.
3531
3555
3532 2004-10-21 Fernando Perez <fperez@colorado.edu>
3556 2004-10-21 Fernando Perez <fperez@colorado.edu>
3533
3557
3534 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3558 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3535 to % for pysh syntax extensions.
3559 to % for pysh syntax extensions.
3536
3560
3537 2004-10-09 Fernando Perez <fperez@colorado.edu>
3561 2004-10-09 Fernando Perez <fperez@colorado.edu>
3538
3562
3539 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3563 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3540 arrays to print a more useful summary, without calling str(arr).
3564 arrays to print a more useful summary, without calling str(arr).
3541 This avoids the problem of extremely lengthy computations which
3565 This avoids the problem of extremely lengthy computations which
3542 occur if arr is large, and appear to the user as a system lockup
3566 occur if arr is large, and appear to the user as a system lockup
3543 with 100% cpu activity. After a suggestion by Kristian Sandberg
3567 with 100% cpu activity. After a suggestion by Kristian Sandberg
3544 <Kristian.Sandberg@colorado.edu>.
3568 <Kristian.Sandberg@colorado.edu>.
3545 (Magic.__init__): fix bug in global magic escapes not being
3569 (Magic.__init__): fix bug in global magic escapes not being
3546 correctly set.
3570 correctly set.
3547
3571
3548 2004-10-08 Fernando Perez <fperez@colorado.edu>
3572 2004-10-08 Fernando Perez <fperez@colorado.edu>
3549
3573
3550 * IPython/Magic.py (__license__): change to absolute imports of
3574 * IPython/Magic.py (__license__): change to absolute imports of
3551 ipython's own internal packages, to start adapting to the absolute
3575 ipython's own internal packages, to start adapting to the absolute
3552 import requirement of PEP-328.
3576 import requirement of PEP-328.
3553
3577
3554 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3578 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3555 files, and standardize author/license marks through the Release
3579 files, and standardize author/license marks through the Release
3556 module instead of having per/file stuff (except for files with
3580 module instead of having per/file stuff (except for files with
3557 particular licenses, like the MIT/PSF-licensed codes).
3581 particular licenses, like the MIT/PSF-licensed codes).
3558
3582
3559 * IPython/Debugger.py: remove dead code for python 2.1
3583 * IPython/Debugger.py: remove dead code for python 2.1
3560
3584
3561 2004-10-04 Fernando Perez <fperez@colorado.edu>
3585 2004-10-04 Fernando Perez <fperez@colorado.edu>
3562
3586
3563 * IPython/iplib.py (ipmagic): New function for accessing magics
3587 * IPython/iplib.py (ipmagic): New function for accessing magics
3564 via a normal python function call.
3588 via a normal python function call.
3565
3589
3566 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3590 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3567 from '@' to '%', to accomodate the new @decorator syntax of python
3591 from '@' to '%', to accomodate the new @decorator syntax of python
3568 2.4.
3592 2.4.
3569
3593
3570 2004-09-29 Fernando Perez <fperez@colorado.edu>
3594 2004-09-29 Fernando Perez <fperez@colorado.edu>
3571
3595
3572 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3596 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3573 matplotlib.use to prevent running scripts which try to switch
3597 matplotlib.use to prevent running scripts which try to switch
3574 interactive backends from within ipython. This will just crash
3598 interactive backends from within ipython. This will just crash
3575 the python interpreter, so we can't allow it (but a detailed error
3599 the python interpreter, so we can't allow it (but a detailed error
3576 is given to the user).
3600 is given to the user).
3577
3601
3578 2004-09-28 Fernando Perez <fperez@colorado.edu>
3602 2004-09-28 Fernando Perez <fperez@colorado.edu>
3579
3603
3580 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3604 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3581 matplotlib-related fixes so that using @run with non-matplotlib
3605 matplotlib-related fixes so that using @run with non-matplotlib
3582 scripts doesn't pop up spurious plot windows. This requires
3606 scripts doesn't pop up spurious plot windows. This requires
3583 matplotlib >= 0.63, where I had to make some changes as well.
3607 matplotlib >= 0.63, where I had to make some changes as well.
3584
3608
3585 * IPython/ipmaker.py (make_IPython): update version requirement to
3609 * IPython/ipmaker.py (make_IPython): update version requirement to
3586 python 2.2.
3610 python 2.2.
3587
3611
3588 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3612 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3589 banner arg for embedded customization.
3613 banner arg for embedded customization.
3590
3614
3591 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3615 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3592 explicit uses of __IP as the IPython's instance name. Now things
3616 explicit uses of __IP as the IPython's instance name. Now things
3593 are properly handled via the shell.name value. The actual code
3617 are properly handled via the shell.name value. The actual code
3594 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3618 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3595 is much better than before. I'll clean things completely when the
3619 is much better than before. I'll clean things completely when the
3596 magic stuff gets a real overhaul.
3620 magic stuff gets a real overhaul.
3597
3621
3598 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3622 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3599 minor changes to debian dir.
3623 minor changes to debian dir.
3600
3624
3601 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3625 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3602 pointer to the shell itself in the interactive namespace even when
3626 pointer to the shell itself in the interactive namespace even when
3603 a user-supplied dict is provided. This is needed for embedding
3627 a user-supplied dict is provided. This is needed for embedding
3604 purposes (found by tests with Michel Sanner).
3628 purposes (found by tests with Michel Sanner).
3605
3629
3606 2004-09-27 Fernando Perez <fperez@colorado.edu>
3630 2004-09-27 Fernando Perez <fperez@colorado.edu>
3607
3631
3608 * IPython/UserConfig/ipythonrc: remove []{} from
3632 * IPython/UserConfig/ipythonrc: remove []{} from
3609 readline_remove_delims, so that things like [modname.<TAB> do
3633 readline_remove_delims, so that things like [modname.<TAB> do
3610 proper completion. This disables [].TAB, but that's a less common
3634 proper completion. This disables [].TAB, but that's a less common
3611 case than module names in list comprehensions, for example.
3635 case than module names in list comprehensions, for example.
3612 Thanks to a report by Andrea Riciputi.
3636 Thanks to a report by Andrea Riciputi.
3613
3637
3614 2004-09-09 Fernando Perez <fperez@colorado.edu>
3638 2004-09-09 Fernando Perez <fperez@colorado.edu>
3615
3639
3616 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3640 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3617 blocking problems in win32 and osx. Fix by John.
3641 blocking problems in win32 and osx. Fix by John.
3618
3642
3619 2004-09-08 Fernando Perez <fperez@colorado.edu>
3643 2004-09-08 Fernando Perez <fperez@colorado.edu>
3620
3644
3621 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3645 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3622 for Win32 and OSX. Fix by John Hunter.
3646 for Win32 and OSX. Fix by John Hunter.
3623
3647
3624 2004-08-30 *** Released version 0.6.3
3648 2004-08-30 *** Released version 0.6.3
3625
3649
3626 2004-08-30 Fernando Perez <fperez@colorado.edu>
3650 2004-08-30 Fernando Perez <fperez@colorado.edu>
3627
3651
3628 * setup.py (isfile): Add manpages to list of dependent files to be
3652 * setup.py (isfile): Add manpages to list of dependent files to be
3629 updated.
3653 updated.
3630
3654
3631 2004-08-27 Fernando Perez <fperez@colorado.edu>
3655 2004-08-27 Fernando Perez <fperez@colorado.edu>
3632
3656
3633 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3657 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3634 for now. They don't really work with standalone WX/GTK code
3658 for now. They don't really work with standalone WX/GTK code
3635 (though matplotlib IS working fine with both of those backends).
3659 (though matplotlib IS working fine with both of those backends).
3636 This will neeed much more testing. I disabled most things with
3660 This will neeed much more testing. I disabled most things with
3637 comments, so turning it back on later should be pretty easy.
3661 comments, so turning it back on later should be pretty easy.
3638
3662
3639 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3663 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3640 autocalling of expressions like r'foo', by modifying the line
3664 autocalling of expressions like r'foo', by modifying the line
3641 split regexp. Closes
3665 split regexp. Closes
3642 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3666 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3643 Riley <ipythonbugs-AT-sabi.net>.
3667 Riley <ipythonbugs-AT-sabi.net>.
3644 (InteractiveShell.mainloop): honor --nobanner with banner
3668 (InteractiveShell.mainloop): honor --nobanner with banner
3645 extensions.
3669 extensions.
3646
3670
3647 * IPython/Shell.py: Significant refactoring of all classes, so
3671 * IPython/Shell.py: Significant refactoring of all classes, so
3648 that we can really support ALL matplotlib backends and threading
3672 that we can really support ALL matplotlib backends and threading
3649 models (John spotted a bug with Tk which required this). Now we
3673 models (John spotted a bug with Tk which required this). Now we
3650 should support single-threaded, WX-threads and GTK-threads, both
3674 should support single-threaded, WX-threads and GTK-threads, both
3651 for generic code and for matplotlib.
3675 for generic code and for matplotlib.
3652
3676
3653 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3677 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3654 -pylab, to simplify things for users. Will also remove the pylab
3678 -pylab, to simplify things for users. Will also remove the pylab
3655 profile, since now all of matplotlib configuration is directly
3679 profile, since now all of matplotlib configuration is directly
3656 handled here. This also reduces startup time.
3680 handled here. This also reduces startup time.
3657
3681
3658 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3682 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3659 shell wasn't being correctly called. Also in IPShellWX.
3683 shell wasn't being correctly called. Also in IPShellWX.
3660
3684
3661 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3685 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3662 fine-tune banner.
3686 fine-tune banner.
3663
3687
3664 * IPython/numutils.py (spike): Deprecate these spike functions,
3688 * IPython/numutils.py (spike): Deprecate these spike functions,
3665 delete (long deprecated) gnuplot_exec handler.
3689 delete (long deprecated) gnuplot_exec handler.
3666
3690
3667 2004-08-26 Fernando Perez <fperez@colorado.edu>
3691 2004-08-26 Fernando Perez <fperez@colorado.edu>
3668
3692
3669 * ipython.1: Update for threading options, plus some others which
3693 * ipython.1: Update for threading options, plus some others which
3670 were missing.
3694 were missing.
3671
3695
3672 * IPython/ipmaker.py (__call__): Added -wthread option for
3696 * IPython/ipmaker.py (__call__): Added -wthread option for
3673 wxpython thread handling. Make sure threading options are only
3697 wxpython thread handling. Make sure threading options are only
3674 valid at the command line.
3698 valid at the command line.
3675
3699
3676 * scripts/ipython: moved shell selection into a factory function
3700 * scripts/ipython: moved shell selection into a factory function
3677 in Shell.py, to keep the starter script to a minimum.
3701 in Shell.py, to keep the starter script to a minimum.
3678
3702
3679 2004-08-25 Fernando Perez <fperez@colorado.edu>
3703 2004-08-25 Fernando Perez <fperez@colorado.edu>
3680
3704
3681 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3705 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3682 John. Along with some recent changes he made to matplotlib, the
3706 John. Along with some recent changes he made to matplotlib, the
3683 next versions of both systems should work very well together.
3707 next versions of both systems should work very well together.
3684
3708
3685 2004-08-24 Fernando Perez <fperez@colorado.edu>
3709 2004-08-24 Fernando Perez <fperez@colorado.edu>
3686
3710
3687 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3711 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3688 tried to switch the profiling to using hotshot, but I'm getting
3712 tried to switch the profiling to using hotshot, but I'm getting
3689 strange errors from prof.runctx() there. I may be misreading the
3713 strange errors from prof.runctx() there. I may be misreading the
3690 docs, but it looks weird. For now the profiling code will
3714 docs, but it looks weird. For now the profiling code will
3691 continue to use the standard profiler.
3715 continue to use the standard profiler.
3692
3716
3693 2004-08-23 Fernando Perez <fperez@colorado.edu>
3717 2004-08-23 Fernando Perez <fperez@colorado.edu>
3694
3718
3695 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3719 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3696 threaded shell, by John Hunter. It's not quite ready yet, but
3720 threaded shell, by John Hunter. It's not quite ready yet, but
3697 close.
3721 close.
3698
3722
3699 2004-08-22 Fernando Perez <fperez@colorado.edu>
3723 2004-08-22 Fernando Perez <fperez@colorado.edu>
3700
3724
3701 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3725 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3702 in Magic and ultraTB.
3726 in Magic and ultraTB.
3703
3727
3704 * ipython.1: document threading options in manpage.
3728 * ipython.1: document threading options in manpage.
3705
3729
3706 * scripts/ipython: Changed name of -thread option to -gthread,
3730 * scripts/ipython: Changed name of -thread option to -gthread,
3707 since this is GTK specific. I want to leave the door open for a
3731 since this is GTK specific. I want to leave the door open for a
3708 -wthread option for WX, which will most likely be necessary. This
3732 -wthread option for WX, which will most likely be necessary. This
3709 change affects usage and ipmaker as well.
3733 change affects usage and ipmaker as well.
3710
3734
3711 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3735 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3712 handle the matplotlib shell issues. Code by John Hunter
3736 handle the matplotlib shell issues. Code by John Hunter
3713 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3737 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3714 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3738 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3715 broken (and disabled for end users) for now, but it puts the
3739 broken (and disabled for end users) for now, but it puts the
3716 infrastructure in place.
3740 infrastructure in place.
3717
3741
3718 2004-08-21 Fernando Perez <fperez@colorado.edu>
3742 2004-08-21 Fernando Perez <fperez@colorado.edu>
3719
3743
3720 * ipythonrc-pylab: Add matplotlib support.
3744 * ipythonrc-pylab: Add matplotlib support.
3721
3745
3722 * matplotlib_config.py: new files for matplotlib support, part of
3746 * matplotlib_config.py: new files for matplotlib support, part of
3723 the pylab profile.
3747 the pylab profile.
3724
3748
3725 * IPython/usage.py (__doc__): documented the threading options.
3749 * IPython/usage.py (__doc__): documented the threading options.
3726
3750
3727 2004-08-20 Fernando Perez <fperez@colorado.edu>
3751 2004-08-20 Fernando Perez <fperez@colorado.edu>
3728
3752
3729 * ipython: Modified the main calling routine to handle the -thread
3753 * ipython: Modified the main calling routine to handle the -thread
3730 and -mpthread options. This needs to be done as a top-level hack,
3754 and -mpthread options. This needs to be done as a top-level hack,
3731 because it determines which class to instantiate for IPython
3755 because it determines which class to instantiate for IPython
3732 itself.
3756 itself.
3733
3757
3734 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3758 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3735 classes to support multithreaded GTK operation without blocking,
3759 classes to support multithreaded GTK operation without blocking,
3736 and matplotlib with all backends. This is a lot of still very
3760 and matplotlib with all backends. This is a lot of still very
3737 experimental code, and threads are tricky. So it may still have a
3761 experimental code, and threads are tricky. So it may still have a
3738 few rough edges... This code owes a lot to
3762 few rough edges... This code owes a lot to
3739 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3763 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3740 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3764 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3741 to John Hunter for all the matplotlib work.
3765 to John Hunter for all the matplotlib work.
3742
3766
3743 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3767 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3744 options for gtk thread and matplotlib support.
3768 options for gtk thread and matplotlib support.
3745
3769
3746 2004-08-16 Fernando Perez <fperez@colorado.edu>
3770 2004-08-16 Fernando Perez <fperez@colorado.edu>
3747
3771
3748 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3772 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3749 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3773 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3750 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3774 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3751
3775
3752 2004-08-11 Fernando Perez <fperez@colorado.edu>
3776 2004-08-11 Fernando Perez <fperez@colorado.edu>
3753
3777
3754 * setup.py (isfile): Fix build so documentation gets updated for
3778 * setup.py (isfile): Fix build so documentation gets updated for
3755 rpms (it was only done for .tgz builds).
3779 rpms (it was only done for .tgz builds).
3756
3780
3757 2004-08-10 Fernando Perez <fperez@colorado.edu>
3781 2004-08-10 Fernando Perez <fperez@colorado.edu>
3758
3782
3759 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3783 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3760
3784
3761 * iplib.py : Silence syntax error exceptions in tab-completion.
3785 * iplib.py : Silence syntax error exceptions in tab-completion.
3762
3786
3763 2004-08-05 Fernando Perez <fperez@colorado.edu>
3787 2004-08-05 Fernando Perez <fperez@colorado.edu>
3764
3788
3765 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3789 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3766 'color off' mark for continuation prompts. This was causing long
3790 'color off' mark for continuation prompts. This was causing long
3767 continuation lines to mis-wrap.
3791 continuation lines to mis-wrap.
3768
3792
3769 2004-08-01 Fernando Perez <fperez@colorado.edu>
3793 2004-08-01 Fernando Perez <fperez@colorado.edu>
3770
3794
3771 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3795 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3772 for building ipython to be a parameter. All this is necessary
3796 for building ipython to be a parameter. All this is necessary
3773 right now to have a multithreaded version, but this insane
3797 right now to have a multithreaded version, but this insane
3774 non-design will be cleaned up soon. For now, it's a hack that
3798 non-design will be cleaned up soon. For now, it's a hack that
3775 works.
3799 works.
3776
3800
3777 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3801 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3778 args in various places. No bugs so far, but it's a dangerous
3802 args in various places. No bugs so far, but it's a dangerous
3779 practice.
3803 practice.
3780
3804
3781 2004-07-31 Fernando Perez <fperez@colorado.edu>
3805 2004-07-31 Fernando Perez <fperez@colorado.edu>
3782
3806
3783 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3807 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3784 fix completion of files with dots in their names under most
3808 fix completion of files with dots in their names under most
3785 profiles (pysh was OK because the completion order is different).
3809 profiles (pysh was OK because the completion order is different).
3786
3810
3787 2004-07-27 Fernando Perez <fperez@colorado.edu>
3811 2004-07-27 Fernando Perez <fperez@colorado.edu>
3788
3812
3789 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3813 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3790 keywords manually, b/c the one in keyword.py was removed in python
3814 keywords manually, b/c the one in keyword.py was removed in python
3791 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3815 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3792 This is NOT a bug under python 2.3 and earlier.
3816 This is NOT a bug under python 2.3 and earlier.
3793
3817
3794 2004-07-26 Fernando Perez <fperez@colorado.edu>
3818 2004-07-26 Fernando Perez <fperez@colorado.edu>
3795
3819
3796 * IPython/ultraTB.py (VerboseTB.text): Add another
3820 * IPython/ultraTB.py (VerboseTB.text): Add another
3797 linecache.checkcache() call to try to prevent inspect.py from
3821 linecache.checkcache() call to try to prevent inspect.py from
3798 crashing under python 2.3. I think this fixes
3822 crashing under python 2.3. I think this fixes
3799 http://www.scipy.net/roundup/ipython/issue17.
3823 http://www.scipy.net/roundup/ipython/issue17.
3800
3824
3801 2004-07-26 *** Released version 0.6.2
3825 2004-07-26 *** Released version 0.6.2
3802
3826
3803 2004-07-26 Fernando Perez <fperez@colorado.edu>
3827 2004-07-26 Fernando Perez <fperez@colorado.edu>
3804
3828
3805 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3829 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3806 fail for any number.
3830 fail for any number.
3807 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3831 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3808 empty bookmarks.
3832 empty bookmarks.
3809
3833
3810 2004-07-26 *** Released version 0.6.1
3834 2004-07-26 *** Released version 0.6.1
3811
3835
3812 2004-07-26 Fernando Perez <fperez@colorado.edu>
3836 2004-07-26 Fernando Perez <fperez@colorado.edu>
3813
3837
3814 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3838 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3815
3839
3816 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3840 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3817 escaping '()[]{}' in filenames.
3841 escaping '()[]{}' in filenames.
3818
3842
3819 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3843 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3820 Python 2.2 users who lack a proper shlex.split.
3844 Python 2.2 users who lack a proper shlex.split.
3821
3845
3822 2004-07-19 Fernando Perez <fperez@colorado.edu>
3846 2004-07-19 Fernando Perez <fperez@colorado.edu>
3823
3847
3824 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3848 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3825 for reading readline's init file. I follow the normal chain:
3849 for reading readline's init file. I follow the normal chain:
3826 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3850 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3827 report by Mike Heeter. This closes
3851 report by Mike Heeter. This closes
3828 http://www.scipy.net/roundup/ipython/issue16.
3852 http://www.scipy.net/roundup/ipython/issue16.
3829
3853
3830 2004-07-18 Fernando Perez <fperez@colorado.edu>
3854 2004-07-18 Fernando Perez <fperez@colorado.edu>
3831
3855
3832 * IPython/iplib.py (__init__): Add better handling of '\' under
3856 * IPython/iplib.py (__init__): Add better handling of '\' under
3833 Win32 for filenames. After a patch by Ville.
3857 Win32 for filenames. After a patch by Ville.
3834
3858
3835 2004-07-17 Fernando Perez <fperez@colorado.edu>
3859 2004-07-17 Fernando Perez <fperez@colorado.edu>
3836
3860
3837 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3861 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3838 autocalling would be triggered for 'foo is bar' if foo is
3862 autocalling would be triggered for 'foo is bar' if foo is
3839 callable. I also cleaned up the autocall detection code to use a
3863 callable. I also cleaned up the autocall detection code to use a
3840 regexp, which is faster. Bug reported by Alexander Schmolck.
3864 regexp, which is faster. Bug reported by Alexander Schmolck.
3841
3865
3842 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3866 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3843 '?' in them would confuse the help system. Reported by Alex
3867 '?' in them would confuse the help system. Reported by Alex
3844 Schmolck.
3868 Schmolck.
3845
3869
3846 2004-07-16 Fernando Perez <fperez@colorado.edu>
3870 2004-07-16 Fernando Perez <fperez@colorado.edu>
3847
3871
3848 * IPython/GnuplotInteractive.py (__all__): added plot2.
3872 * IPython/GnuplotInteractive.py (__all__): added plot2.
3849
3873
3850 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3874 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3851 plotting dictionaries, lists or tuples of 1d arrays.
3875 plotting dictionaries, lists or tuples of 1d arrays.
3852
3876
3853 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3877 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3854 optimizations.
3878 optimizations.
3855
3879
3856 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3880 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3857 the information which was there from Janko's original IPP code:
3881 the information which was there from Janko's original IPP code:
3858
3882
3859 03.05.99 20:53 porto.ifm.uni-kiel.de
3883 03.05.99 20:53 porto.ifm.uni-kiel.de
3860 --Started changelog.
3884 --Started changelog.
3861 --make clear do what it say it does
3885 --make clear do what it say it does
3862 --added pretty output of lines from inputcache
3886 --added pretty output of lines from inputcache
3863 --Made Logger a mixin class, simplifies handling of switches
3887 --Made Logger a mixin class, simplifies handling of switches
3864 --Added own completer class. .string<TAB> expands to last history
3888 --Added own completer class. .string<TAB> expands to last history
3865 line which starts with string. The new expansion is also present
3889 line which starts with string. The new expansion is also present
3866 with Ctrl-r from the readline library. But this shows, who this
3890 with Ctrl-r from the readline library. But this shows, who this
3867 can be done for other cases.
3891 can be done for other cases.
3868 --Added convention that all shell functions should accept a
3892 --Added convention that all shell functions should accept a
3869 parameter_string This opens the door for different behaviour for
3893 parameter_string This opens the door for different behaviour for
3870 each function. @cd is a good example of this.
3894 each function. @cd is a good example of this.
3871
3895
3872 04.05.99 12:12 porto.ifm.uni-kiel.de
3896 04.05.99 12:12 porto.ifm.uni-kiel.de
3873 --added logfile rotation
3897 --added logfile rotation
3874 --added new mainloop method which freezes first the namespace
3898 --added new mainloop method which freezes first the namespace
3875
3899
3876 07.05.99 21:24 porto.ifm.uni-kiel.de
3900 07.05.99 21:24 porto.ifm.uni-kiel.de
3877 --added the docreader classes. Now there is a help system.
3901 --added the docreader classes. Now there is a help system.
3878 -This is only a first try. Currently it's not easy to put new
3902 -This is only a first try. Currently it's not easy to put new
3879 stuff in the indices. But this is the way to go. Info would be
3903 stuff in the indices. But this is the way to go. Info would be
3880 better, but HTML is every where and not everybody has an info
3904 better, but HTML is every where and not everybody has an info
3881 system installed and it's not so easy to change html-docs to info.
3905 system installed and it's not so easy to change html-docs to info.
3882 --added global logfile option
3906 --added global logfile option
3883 --there is now a hook for object inspection method pinfo needs to
3907 --there is now a hook for object inspection method pinfo needs to
3884 be provided for this. Can be reached by two '??'.
3908 be provided for this. Can be reached by two '??'.
3885
3909
3886 08.05.99 20:51 porto.ifm.uni-kiel.de
3910 08.05.99 20:51 porto.ifm.uni-kiel.de
3887 --added a README
3911 --added a README
3888 --bug in rc file. Something has changed so functions in the rc
3912 --bug in rc file. Something has changed so functions in the rc
3889 file need to reference the shell and not self. Not clear if it's a
3913 file need to reference the shell and not self. Not clear if it's a
3890 bug or feature.
3914 bug or feature.
3891 --changed rc file for new behavior
3915 --changed rc file for new behavior
3892
3916
3893 2004-07-15 Fernando Perez <fperez@colorado.edu>
3917 2004-07-15 Fernando Perez <fperez@colorado.edu>
3894
3918
3895 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3919 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3896 cache was falling out of sync in bizarre manners when multi-line
3920 cache was falling out of sync in bizarre manners when multi-line
3897 input was present. Minor optimizations and cleanup.
3921 input was present. Minor optimizations and cleanup.
3898
3922
3899 (Logger): Remove old Changelog info for cleanup. This is the
3923 (Logger): Remove old Changelog info for cleanup. This is the
3900 information which was there from Janko's original code:
3924 information which was there from Janko's original code:
3901
3925
3902 Changes to Logger: - made the default log filename a parameter
3926 Changes to Logger: - made the default log filename a parameter
3903
3927
3904 - put a check for lines beginning with !@? in log(). Needed
3928 - put a check for lines beginning with !@? in log(). Needed
3905 (even if the handlers properly log their lines) for mid-session
3929 (even if the handlers properly log their lines) for mid-session
3906 logging activation to work properly. Without this, lines logged
3930 logging activation to work properly. Without this, lines logged
3907 in mid session, which get read from the cache, would end up
3931 in mid session, which get read from the cache, would end up
3908 'bare' (with !@? in the open) in the log. Now they are caught
3932 'bare' (with !@? in the open) in the log. Now they are caught
3909 and prepended with a #.
3933 and prepended with a #.
3910
3934
3911 * IPython/iplib.py (InteractiveShell.init_readline): added check
3935 * IPython/iplib.py (InteractiveShell.init_readline): added check
3912 in case MagicCompleter fails to be defined, so we don't crash.
3936 in case MagicCompleter fails to be defined, so we don't crash.
3913
3937
3914 2004-07-13 Fernando Perez <fperez@colorado.edu>
3938 2004-07-13 Fernando Perez <fperez@colorado.edu>
3915
3939
3916 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3940 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3917 of EPS if the requested filename ends in '.eps'.
3941 of EPS if the requested filename ends in '.eps'.
3918
3942
3919 2004-07-04 Fernando Perez <fperez@colorado.edu>
3943 2004-07-04 Fernando Perez <fperez@colorado.edu>
3920
3944
3921 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3945 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3922 escaping of quotes when calling the shell.
3946 escaping of quotes when calling the shell.
3923
3947
3924 2004-07-02 Fernando Perez <fperez@colorado.edu>
3948 2004-07-02 Fernando Perez <fperez@colorado.edu>
3925
3949
3926 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3950 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3927 gettext not working because we were clobbering '_'. Fixes
3951 gettext not working because we were clobbering '_'. Fixes
3928 http://www.scipy.net/roundup/ipython/issue6.
3952 http://www.scipy.net/roundup/ipython/issue6.
3929
3953
3930 2004-07-01 Fernando Perez <fperez@colorado.edu>
3954 2004-07-01 Fernando Perez <fperez@colorado.edu>
3931
3955
3932 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3956 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3933 into @cd. Patch by Ville.
3957 into @cd. Patch by Ville.
3934
3958
3935 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3959 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3936 new function to store things after ipmaker runs. Patch by Ville.
3960 new function to store things after ipmaker runs. Patch by Ville.
3937 Eventually this will go away once ipmaker is removed and the class
3961 Eventually this will go away once ipmaker is removed and the class
3938 gets cleaned up, but for now it's ok. Key functionality here is
3962 gets cleaned up, but for now it's ok. Key functionality here is
3939 the addition of the persistent storage mechanism, a dict for
3963 the addition of the persistent storage mechanism, a dict for
3940 keeping data across sessions (for now just bookmarks, but more can
3964 keeping data across sessions (for now just bookmarks, but more can
3941 be implemented later).
3965 be implemented later).
3942
3966
3943 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3967 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3944 persistent across sections. Patch by Ville, I modified it
3968 persistent across sections. Patch by Ville, I modified it
3945 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3969 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3946 added a '-l' option to list all bookmarks.
3970 added a '-l' option to list all bookmarks.
3947
3971
3948 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3972 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3949 center for cleanup. Registered with atexit.register(). I moved
3973 center for cleanup. Registered with atexit.register(). I moved
3950 here the old exit_cleanup(). After a patch by Ville.
3974 here the old exit_cleanup(). After a patch by Ville.
3951
3975
3952 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3976 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3953 characters in the hacked shlex_split for python 2.2.
3977 characters in the hacked shlex_split for python 2.2.
3954
3978
3955 * IPython/iplib.py (file_matches): more fixes to filenames with
3979 * IPython/iplib.py (file_matches): more fixes to filenames with
3956 whitespace in them. It's not perfect, but limitations in python's
3980 whitespace in them. It's not perfect, but limitations in python's
3957 readline make it impossible to go further.
3981 readline make it impossible to go further.
3958
3982
3959 2004-06-29 Fernando Perez <fperez@colorado.edu>
3983 2004-06-29 Fernando Perez <fperez@colorado.edu>
3960
3984
3961 * IPython/iplib.py (file_matches): escape whitespace correctly in
3985 * IPython/iplib.py (file_matches): escape whitespace correctly in
3962 filename completions. Bug reported by Ville.
3986 filename completions. Bug reported by Ville.
3963
3987
3964 2004-06-28 Fernando Perez <fperez@colorado.edu>
3988 2004-06-28 Fernando Perez <fperez@colorado.edu>
3965
3989
3966 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3990 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3967 the history file will be called 'history-PROFNAME' (or just
3991 the history file will be called 'history-PROFNAME' (or just
3968 'history' if no profile is loaded). I was getting annoyed at
3992 'history' if no profile is loaded). I was getting annoyed at
3969 getting my Numerical work history clobbered by pysh sessions.
3993 getting my Numerical work history clobbered by pysh sessions.
3970
3994
3971 * IPython/iplib.py (InteractiveShell.__init__): Internal
3995 * IPython/iplib.py (InteractiveShell.__init__): Internal
3972 getoutputerror() function so that we can honor the system_verbose
3996 getoutputerror() function so that we can honor the system_verbose
3973 flag for _all_ system calls. I also added escaping of #
3997 flag for _all_ system calls. I also added escaping of #
3974 characters here to avoid confusing Itpl.
3998 characters here to avoid confusing Itpl.
3975
3999
3976 * IPython/Magic.py (shlex_split): removed call to shell in
4000 * IPython/Magic.py (shlex_split): removed call to shell in
3977 parse_options and replaced it with shlex.split(). The annoying
4001 parse_options and replaced it with shlex.split(). The annoying
3978 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4002 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3979 to backport it from 2.3, with several frail hacks (the shlex
4003 to backport it from 2.3, with several frail hacks (the shlex
3980 module is rather limited in 2.2). Thanks to a suggestion by Ville
4004 module is rather limited in 2.2). Thanks to a suggestion by Ville
3981 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4005 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3982 problem.
4006 problem.
3983
4007
3984 (Magic.magic_system_verbose): new toggle to print the actual
4008 (Magic.magic_system_verbose): new toggle to print the actual
3985 system calls made by ipython. Mainly for debugging purposes.
4009 system calls made by ipython. Mainly for debugging purposes.
3986
4010
3987 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4011 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3988 doesn't support persistence. Reported (and fix suggested) by
4012 doesn't support persistence. Reported (and fix suggested) by
3989 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4013 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3990
4014
3991 2004-06-26 Fernando Perez <fperez@colorado.edu>
4015 2004-06-26 Fernando Perez <fperez@colorado.edu>
3992
4016
3993 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4017 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3994 continue prompts.
4018 continue prompts.
3995
4019
3996 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4020 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3997 function (basically a big docstring) and a few more things here to
4021 function (basically a big docstring) and a few more things here to
3998 speedup startup. pysh.py is now very lightweight. We want because
4022 speedup startup. pysh.py is now very lightweight. We want because
3999 it gets execfile'd, while InterpreterExec gets imported, so
4023 it gets execfile'd, while InterpreterExec gets imported, so
4000 byte-compilation saves time.
4024 byte-compilation saves time.
4001
4025
4002 2004-06-25 Fernando Perez <fperez@colorado.edu>
4026 2004-06-25 Fernando Perez <fperez@colorado.edu>
4003
4027
4004 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4028 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4005 -NUM', which was recently broken.
4029 -NUM', which was recently broken.
4006
4030
4007 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4031 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4008 in multi-line input (but not !!, which doesn't make sense there).
4032 in multi-line input (but not !!, which doesn't make sense there).
4009
4033
4010 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4034 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4011 It's just too useful, and people can turn it off in the less
4035 It's just too useful, and people can turn it off in the less
4012 common cases where it's a problem.
4036 common cases where it's a problem.
4013
4037
4014 2004-06-24 Fernando Perez <fperez@colorado.edu>
4038 2004-06-24 Fernando Perez <fperez@colorado.edu>
4015
4039
4016 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4040 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4017 special syntaxes (like alias calling) is now allied in multi-line
4041 special syntaxes (like alias calling) is now allied in multi-line
4018 input. This is still _very_ experimental, but it's necessary for
4042 input. This is still _very_ experimental, but it's necessary for
4019 efficient shell usage combining python looping syntax with system
4043 efficient shell usage combining python looping syntax with system
4020 calls. For now it's restricted to aliases, I don't think it
4044 calls. For now it's restricted to aliases, I don't think it
4021 really even makes sense to have this for magics.
4045 really even makes sense to have this for magics.
4022
4046
4023 2004-06-23 Fernando Perez <fperez@colorado.edu>
4047 2004-06-23 Fernando Perez <fperez@colorado.edu>
4024
4048
4025 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4049 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4026 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4050 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4027
4051
4028 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4052 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4029 extensions under Windows (after code sent by Gary Bishop). The
4053 extensions under Windows (after code sent by Gary Bishop). The
4030 extensions considered 'executable' are stored in IPython's rc
4054 extensions considered 'executable' are stored in IPython's rc
4031 structure as win_exec_ext.
4055 structure as win_exec_ext.
4032
4056
4033 * IPython/genutils.py (shell): new function, like system() but
4057 * IPython/genutils.py (shell): new function, like system() but
4034 without return value. Very useful for interactive shell work.
4058 without return value. Very useful for interactive shell work.
4035
4059
4036 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4060 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4037 delete aliases.
4061 delete aliases.
4038
4062
4039 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4063 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4040 sure that the alias table doesn't contain python keywords.
4064 sure that the alias table doesn't contain python keywords.
4041
4065
4042 2004-06-21 Fernando Perez <fperez@colorado.edu>
4066 2004-06-21 Fernando Perez <fperez@colorado.edu>
4043
4067
4044 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4068 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4045 non-existent items are found in $PATH. Reported by Thorsten.
4069 non-existent items are found in $PATH. Reported by Thorsten.
4046
4070
4047 2004-06-20 Fernando Perez <fperez@colorado.edu>
4071 2004-06-20 Fernando Perez <fperez@colorado.edu>
4048
4072
4049 * IPython/iplib.py (complete): modified the completer so that the
4073 * IPython/iplib.py (complete): modified the completer so that the
4050 order of priorities can be easily changed at runtime.
4074 order of priorities can be easily changed at runtime.
4051
4075
4052 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4076 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4053 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4077 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4054
4078
4055 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4079 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4056 expand Python variables prepended with $ in all system calls. The
4080 expand Python variables prepended with $ in all system calls. The
4057 same was done to InteractiveShell.handle_shell_escape. Now all
4081 same was done to InteractiveShell.handle_shell_escape. Now all
4058 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4082 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4059 expansion of python variables and expressions according to the
4083 expansion of python variables and expressions according to the
4060 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4084 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4061
4085
4062 Though PEP-215 has been rejected, a similar (but simpler) one
4086 Though PEP-215 has been rejected, a similar (but simpler) one
4063 seems like it will go into Python 2.4, PEP-292 -
4087 seems like it will go into Python 2.4, PEP-292 -
4064 http://www.python.org/peps/pep-0292.html.
4088 http://www.python.org/peps/pep-0292.html.
4065
4089
4066 I'll keep the full syntax of PEP-215, since IPython has since the
4090 I'll keep the full syntax of PEP-215, since IPython has since the
4067 start used Ka-Ping Yee's reference implementation discussed there
4091 start used Ka-Ping Yee's reference implementation discussed there
4068 (Itpl), and I actually like the powerful semantics it offers.
4092 (Itpl), and I actually like the powerful semantics it offers.
4069
4093
4070 In order to access normal shell variables, the $ has to be escaped
4094 In order to access normal shell variables, the $ has to be escaped
4071 via an extra $. For example:
4095 via an extra $. For example:
4072
4096
4073 In [7]: PATH='a python variable'
4097 In [7]: PATH='a python variable'
4074
4098
4075 In [8]: !echo $PATH
4099 In [8]: !echo $PATH
4076 a python variable
4100 a python variable
4077
4101
4078 In [9]: !echo $$PATH
4102 In [9]: !echo $$PATH
4079 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4103 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4080
4104
4081 (Magic.parse_options): escape $ so the shell doesn't evaluate
4105 (Magic.parse_options): escape $ so the shell doesn't evaluate
4082 things prematurely.
4106 things prematurely.
4083
4107
4084 * IPython/iplib.py (InteractiveShell.call_alias): added the
4108 * IPython/iplib.py (InteractiveShell.call_alias): added the
4085 ability for aliases to expand python variables via $.
4109 ability for aliases to expand python variables via $.
4086
4110
4087 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4111 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4088 system, now there's a @rehash/@rehashx pair of magics. These work
4112 system, now there's a @rehash/@rehashx pair of magics. These work
4089 like the csh rehash command, and can be invoked at any time. They
4113 like the csh rehash command, and can be invoked at any time. They
4090 build a table of aliases to everything in the user's $PATH
4114 build a table of aliases to everything in the user's $PATH
4091 (@rehash uses everything, @rehashx is slower but only adds
4115 (@rehash uses everything, @rehashx is slower but only adds
4092 executable files). With this, the pysh.py-based shell profile can
4116 executable files). With this, the pysh.py-based shell profile can
4093 now simply call rehash upon startup, and full access to all
4117 now simply call rehash upon startup, and full access to all
4094 programs in the user's path is obtained.
4118 programs in the user's path is obtained.
4095
4119
4096 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4120 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4097 functionality is now fully in place. I removed the old dynamic
4121 functionality is now fully in place. I removed the old dynamic
4098 code generation based approach, in favor of a much lighter one
4122 code generation based approach, in favor of a much lighter one
4099 based on a simple dict. The advantage is that this allows me to
4123 based on a simple dict. The advantage is that this allows me to
4100 now have thousands of aliases with negligible cost (unthinkable
4124 now have thousands of aliases with negligible cost (unthinkable
4101 with the old system).
4125 with the old system).
4102
4126
4103 2004-06-19 Fernando Perez <fperez@colorado.edu>
4127 2004-06-19 Fernando Perez <fperez@colorado.edu>
4104
4128
4105 * IPython/iplib.py (__init__): extended MagicCompleter class to
4129 * IPython/iplib.py (__init__): extended MagicCompleter class to
4106 also complete (last in priority) on user aliases.
4130 also complete (last in priority) on user aliases.
4107
4131
4108 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4132 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4109 call to eval.
4133 call to eval.
4110 (ItplNS.__init__): Added a new class which functions like Itpl,
4134 (ItplNS.__init__): Added a new class which functions like Itpl,
4111 but allows configuring the namespace for the evaluation to occur
4135 but allows configuring the namespace for the evaluation to occur
4112 in.
4136 in.
4113
4137
4114 2004-06-18 Fernando Perez <fperez@colorado.edu>
4138 2004-06-18 Fernando Perez <fperez@colorado.edu>
4115
4139
4116 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4140 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4117 better message when 'exit' or 'quit' are typed (a common newbie
4141 better message when 'exit' or 'quit' are typed (a common newbie
4118 confusion).
4142 confusion).
4119
4143
4120 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4144 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4121 check for Windows users.
4145 check for Windows users.
4122
4146
4123 * IPython/iplib.py (InteractiveShell.user_setup): removed
4147 * IPython/iplib.py (InteractiveShell.user_setup): removed
4124 disabling of colors for Windows. I'll test at runtime and issue a
4148 disabling of colors for Windows. I'll test at runtime and issue a
4125 warning if Gary's readline isn't found, as to nudge users to
4149 warning if Gary's readline isn't found, as to nudge users to
4126 download it.
4150 download it.
4127
4151
4128 2004-06-16 Fernando Perez <fperez@colorado.edu>
4152 2004-06-16 Fernando Perez <fperez@colorado.edu>
4129
4153
4130 * IPython/genutils.py (Stream.__init__): changed to print errors
4154 * IPython/genutils.py (Stream.__init__): changed to print errors
4131 to sys.stderr. I had a circular dependency here. Now it's
4155 to sys.stderr. I had a circular dependency here. Now it's
4132 possible to run ipython as IDLE's shell (consider this pre-alpha,
4156 possible to run ipython as IDLE's shell (consider this pre-alpha,
4133 since true stdout things end up in the starting terminal instead
4157 since true stdout things end up in the starting terminal instead
4134 of IDLE's out).
4158 of IDLE's out).
4135
4159
4136 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4160 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4137 users who haven't # updated their prompt_in2 definitions. Remove
4161 users who haven't # updated their prompt_in2 definitions. Remove
4138 eventually.
4162 eventually.
4139 (multiple_replace): added credit to original ASPN recipe.
4163 (multiple_replace): added credit to original ASPN recipe.
4140
4164
4141 2004-06-15 Fernando Perez <fperez@colorado.edu>
4165 2004-06-15 Fernando Perez <fperez@colorado.edu>
4142
4166
4143 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4167 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4144 list of auto-defined aliases.
4168 list of auto-defined aliases.
4145
4169
4146 2004-06-13 Fernando Perez <fperez@colorado.edu>
4170 2004-06-13 Fernando Perez <fperez@colorado.edu>
4147
4171
4148 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4172 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4149 install was really requested (so setup.py can be used for other
4173 install was really requested (so setup.py can be used for other
4150 things under Windows).
4174 things under Windows).
4151
4175
4152 2004-06-10 Fernando Perez <fperez@colorado.edu>
4176 2004-06-10 Fernando Perez <fperez@colorado.edu>
4153
4177
4154 * IPython/Logger.py (Logger.create_log): Manually remove any old
4178 * IPython/Logger.py (Logger.create_log): Manually remove any old
4155 backup, since os.remove may fail under Windows. Fixes bug
4179 backup, since os.remove may fail under Windows. Fixes bug
4156 reported by Thorsten.
4180 reported by Thorsten.
4157
4181
4158 2004-06-09 Fernando Perez <fperez@colorado.edu>
4182 2004-06-09 Fernando Perez <fperez@colorado.edu>
4159
4183
4160 * examples/example-embed.py: fixed all references to %n (replaced
4184 * examples/example-embed.py: fixed all references to %n (replaced
4161 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4185 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4162 for all examples and the manual as well.
4186 for all examples and the manual as well.
4163
4187
4164 2004-06-08 Fernando Perez <fperez@colorado.edu>
4188 2004-06-08 Fernando Perez <fperez@colorado.edu>
4165
4189
4166 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4190 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4167 alignment and color management. All 3 prompt subsystems now
4191 alignment and color management. All 3 prompt subsystems now
4168 inherit from BasePrompt.
4192 inherit from BasePrompt.
4169
4193
4170 * tools/release: updates for windows installer build and tag rpms
4194 * tools/release: updates for windows installer build and tag rpms
4171 with python version (since paths are fixed).
4195 with python version (since paths are fixed).
4172
4196
4173 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4197 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4174 which will become eventually obsolete. Also fixed the default
4198 which will become eventually obsolete. Also fixed the default
4175 prompt_in2 to use \D, so at least new users start with the correct
4199 prompt_in2 to use \D, so at least new users start with the correct
4176 defaults.
4200 defaults.
4177 WARNING: Users with existing ipythonrc files will need to apply
4201 WARNING: Users with existing ipythonrc files will need to apply
4178 this fix manually!
4202 this fix manually!
4179
4203
4180 * setup.py: make windows installer (.exe). This is finally the
4204 * setup.py: make windows installer (.exe). This is finally the
4181 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4205 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4182 which I hadn't included because it required Python 2.3 (or recent
4206 which I hadn't included because it required Python 2.3 (or recent
4183 distutils).
4207 distutils).
4184
4208
4185 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4209 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4186 usage of new '\D' escape.
4210 usage of new '\D' escape.
4187
4211
4188 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4212 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4189 lacks os.getuid())
4213 lacks os.getuid())
4190 (CachedOutput.set_colors): Added the ability to turn coloring
4214 (CachedOutput.set_colors): Added the ability to turn coloring
4191 on/off with @colors even for manually defined prompt colors. It
4215 on/off with @colors even for manually defined prompt colors. It
4192 uses a nasty global, but it works safely and via the generic color
4216 uses a nasty global, but it works safely and via the generic color
4193 handling mechanism.
4217 handling mechanism.
4194 (Prompt2.__init__): Introduced new escape '\D' for continuation
4218 (Prompt2.__init__): Introduced new escape '\D' for continuation
4195 prompts. It represents the counter ('\#') as dots.
4219 prompts. It represents the counter ('\#') as dots.
4196 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4220 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4197 need to update their ipythonrc files and replace '%n' with '\D' in
4221 need to update their ipythonrc files and replace '%n' with '\D' in
4198 their prompt_in2 settings everywhere. Sorry, but there's
4222 their prompt_in2 settings everywhere. Sorry, but there's
4199 otherwise no clean way to get all prompts to properly align. The
4223 otherwise no clean way to get all prompts to properly align. The
4200 ipythonrc shipped with IPython has been updated.
4224 ipythonrc shipped with IPython has been updated.
4201
4225
4202 2004-06-07 Fernando Perez <fperez@colorado.edu>
4226 2004-06-07 Fernando Perez <fperez@colorado.edu>
4203
4227
4204 * setup.py (isfile): Pass local_icons option to latex2html, so the
4228 * setup.py (isfile): Pass local_icons option to latex2html, so the
4205 resulting HTML file is self-contained. Thanks to
4229 resulting HTML file is self-contained. Thanks to
4206 dryice-AT-liu.com.cn for the tip.
4230 dryice-AT-liu.com.cn for the tip.
4207
4231
4208 * pysh.py: I created a new profile 'shell', which implements a
4232 * pysh.py: I created a new profile 'shell', which implements a
4209 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4233 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4210 system shell, nor will it become one anytime soon. It's mainly
4234 system shell, nor will it become one anytime soon. It's mainly
4211 meant to illustrate the use of the new flexible bash-like prompts.
4235 meant to illustrate the use of the new flexible bash-like prompts.
4212 I guess it could be used by hardy souls for true shell management,
4236 I guess it could be used by hardy souls for true shell management,
4213 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4237 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4214 profile. This uses the InterpreterExec extension provided by
4238 profile. This uses the InterpreterExec extension provided by
4215 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4239 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4216
4240
4217 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4241 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4218 auto-align itself with the length of the previous input prompt
4242 auto-align itself with the length of the previous input prompt
4219 (taking into account the invisible color escapes).
4243 (taking into account the invisible color escapes).
4220 (CachedOutput.__init__): Large restructuring of this class. Now
4244 (CachedOutput.__init__): Large restructuring of this class. Now
4221 all three prompts (primary1, primary2, output) are proper objects,
4245 all three prompts (primary1, primary2, output) are proper objects,
4222 managed by the 'parent' CachedOutput class. The code is still a
4246 managed by the 'parent' CachedOutput class. The code is still a
4223 bit hackish (all prompts share state via a pointer to the cache),
4247 bit hackish (all prompts share state via a pointer to the cache),
4224 but it's overall far cleaner than before.
4248 but it's overall far cleaner than before.
4225
4249
4226 * IPython/genutils.py (getoutputerror): modified to add verbose,
4250 * IPython/genutils.py (getoutputerror): modified to add verbose,
4227 debug and header options. This makes the interface of all getout*
4251 debug and header options. This makes the interface of all getout*
4228 functions uniform.
4252 functions uniform.
4229 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4253 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4230
4254
4231 * IPython/Magic.py (Magic.default_option): added a function to
4255 * IPython/Magic.py (Magic.default_option): added a function to
4232 allow registering default options for any magic command. This
4256 allow registering default options for any magic command. This
4233 makes it easy to have profiles which customize the magics globally
4257 makes it easy to have profiles which customize the magics globally
4234 for a certain use. The values set through this function are
4258 for a certain use. The values set through this function are
4235 picked up by the parse_options() method, which all magics should
4259 picked up by the parse_options() method, which all magics should
4236 use to parse their options.
4260 use to parse their options.
4237
4261
4238 * IPython/genutils.py (warn): modified the warnings framework to
4262 * IPython/genutils.py (warn): modified the warnings framework to
4239 use the Term I/O class. I'm trying to slowly unify all of
4263 use the Term I/O class. I'm trying to slowly unify all of
4240 IPython's I/O operations to pass through Term.
4264 IPython's I/O operations to pass through Term.
4241
4265
4242 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4266 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4243 the secondary prompt to correctly match the length of the primary
4267 the secondary prompt to correctly match the length of the primary
4244 one for any prompt. Now multi-line code will properly line up
4268 one for any prompt. Now multi-line code will properly line up
4245 even for path dependent prompts, such as the new ones available
4269 even for path dependent prompts, such as the new ones available
4246 via the prompt_specials.
4270 via the prompt_specials.
4247
4271
4248 2004-06-06 Fernando Perez <fperez@colorado.edu>
4272 2004-06-06 Fernando Perez <fperez@colorado.edu>
4249
4273
4250 * IPython/Prompts.py (prompt_specials): Added the ability to have
4274 * IPython/Prompts.py (prompt_specials): Added the ability to have
4251 bash-like special sequences in the prompts, which get
4275 bash-like special sequences in the prompts, which get
4252 automatically expanded. Things like hostname, current working
4276 automatically expanded. Things like hostname, current working
4253 directory and username are implemented already, but it's easy to
4277 directory and username are implemented already, but it's easy to
4254 add more in the future. Thanks to a patch by W.J. van der Laan
4278 add more in the future. Thanks to a patch by W.J. van der Laan
4255 <gnufnork-AT-hetdigitalegat.nl>
4279 <gnufnork-AT-hetdigitalegat.nl>
4256 (prompt_specials): Added color support for prompt strings, so
4280 (prompt_specials): Added color support for prompt strings, so
4257 users can define arbitrary color setups for their prompts.
4281 users can define arbitrary color setups for their prompts.
4258
4282
4259 2004-06-05 Fernando Perez <fperez@colorado.edu>
4283 2004-06-05 Fernando Perez <fperez@colorado.edu>
4260
4284
4261 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4285 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4262 code to load Gary Bishop's readline and configure it
4286 code to load Gary Bishop's readline and configure it
4263 automatically. Thanks to Gary for help on this.
4287 automatically. Thanks to Gary for help on this.
4264
4288
4265 2004-06-01 Fernando Perez <fperez@colorado.edu>
4289 2004-06-01 Fernando Perez <fperez@colorado.edu>
4266
4290
4267 * IPython/Logger.py (Logger.create_log): fix bug for logging
4291 * IPython/Logger.py (Logger.create_log): fix bug for logging
4268 with no filename (previous fix was incomplete).
4292 with no filename (previous fix was incomplete).
4269
4293
4270 2004-05-25 Fernando Perez <fperez@colorado.edu>
4294 2004-05-25 Fernando Perez <fperez@colorado.edu>
4271
4295
4272 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4296 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4273 parens would get passed to the shell.
4297 parens would get passed to the shell.
4274
4298
4275 2004-05-20 Fernando Perez <fperez@colorado.edu>
4299 2004-05-20 Fernando Perez <fperez@colorado.edu>
4276
4300
4277 * IPython/Magic.py (Magic.magic_prun): changed default profile
4301 * IPython/Magic.py (Magic.magic_prun): changed default profile
4278 sort order to 'time' (the more common profiling need).
4302 sort order to 'time' (the more common profiling need).
4279
4303
4280 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4304 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4281 so that source code shown is guaranteed in sync with the file on
4305 so that source code shown is guaranteed in sync with the file on
4282 disk (also changed in psource). Similar fix to the one for
4306 disk (also changed in psource). Similar fix to the one for
4283 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4307 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4284 <yann.ledu-AT-noos.fr>.
4308 <yann.ledu-AT-noos.fr>.
4285
4309
4286 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4310 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4287 with a single option would not be correctly parsed. Closes
4311 with a single option would not be correctly parsed. Closes
4288 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4312 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4289 introduced in 0.6.0 (on 2004-05-06).
4313 introduced in 0.6.0 (on 2004-05-06).
4290
4314
4291 2004-05-13 *** Released version 0.6.0
4315 2004-05-13 *** Released version 0.6.0
4292
4316
4293 2004-05-13 Fernando Perez <fperez@colorado.edu>
4317 2004-05-13 Fernando Perez <fperez@colorado.edu>
4294
4318
4295 * debian/: Added debian/ directory to CVS, so that debian support
4319 * debian/: Added debian/ directory to CVS, so that debian support
4296 is publicly accessible. The debian package is maintained by Jack
4320 is publicly accessible. The debian package is maintained by Jack
4297 Moffit <jack-AT-xiph.org>.
4321 Moffit <jack-AT-xiph.org>.
4298
4322
4299 * Documentation: included the notes about an ipython-based system
4323 * Documentation: included the notes about an ipython-based system
4300 shell (the hypothetical 'pysh') into the new_design.pdf document,
4324 shell (the hypothetical 'pysh') into the new_design.pdf document,
4301 so that these ideas get distributed to users along with the
4325 so that these ideas get distributed to users along with the
4302 official documentation.
4326 official documentation.
4303
4327
4304 2004-05-10 Fernando Perez <fperez@colorado.edu>
4328 2004-05-10 Fernando Perez <fperez@colorado.edu>
4305
4329
4306 * IPython/Logger.py (Logger.create_log): fix recently introduced
4330 * IPython/Logger.py (Logger.create_log): fix recently introduced
4307 bug (misindented line) where logstart would fail when not given an
4331 bug (misindented line) where logstart would fail when not given an
4308 explicit filename.
4332 explicit filename.
4309
4333
4310 2004-05-09 Fernando Perez <fperez@colorado.edu>
4334 2004-05-09 Fernando Perez <fperez@colorado.edu>
4311
4335
4312 * IPython/Magic.py (Magic.parse_options): skip system call when
4336 * IPython/Magic.py (Magic.parse_options): skip system call when
4313 there are no options to look for. Faster, cleaner for the common
4337 there are no options to look for. Faster, cleaner for the common
4314 case.
4338 case.
4315
4339
4316 * Documentation: many updates to the manual: describing Windows
4340 * Documentation: many updates to the manual: describing Windows
4317 support better, Gnuplot updates, credits, misc small stuff. Also
4341 support better, Gnuplot updates, credits, misc small stuff. Also
4318 updated the new_design doc a bit.
4342 updated the new_design doc a bit.
4319
4343
4320 2004-05-06 *** Released version 0.6.0.rc1
4344 2004-05-06 *** Released version 0.6.0.rc1
4321
4345
4322 2004-05-06 Fernando Perez <fperez@colorado.edu>
4346 2004-05-06 Fernando Perez <fperez@colorado.edu>
4323
4347
4324 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4348 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4325 operations to use the vastly more efficient list/''.join() method.
4349 operations to use the vastly more efficient list/''.join() method.
4326 (FormattedTB.text): Fix
4350 (FormattedTB.text): Fix
4327 http://www.scipy.net/roundup/ipython/issue12 - exception source
4351 http://www.scipy.net/roundup/ipython/issue12 - exception source
4328 extract not updated after reload. Thanks to Mike Salib
4352 extract not updated after reload. Thanks to Mike Salib
4329 <msalib-AT-mit.edu> for pinning the source of the problem.
4353 <msalib-AT-mit.edu> for pinning the source of the problem.
4330 Fortunately, the solution works inside ipython and doesn't require
4354 Fortunately, the solution works inside ipython and doesn't require
4331 any changes to python proper.
4355 any changes to python proper.
4332
4356
4333 * IPython/Magic.py (Magic.parse_options): Improved to process the
4357 * IPython/Magic.py (Magic.parse_options): Improved to process the
4334 argument list as a true shell would (by actually using the
4358 argument list as a true shell would (by actually using the
4335 underlying system shell). This way, all @magics automatically get
4359 underlying system shell). This way, all @magics automatically get
4336 shell expansion for variables. Thanks to a comment by Alex
4360 shell expansion for variables. Thanks to a comment by Alex
4337 Schmolck.
4361 Schmolck.
4338
4362
4339 2004-04-04 Fernando Perez <fperez@colorado.edu>
4363 2004-04-04 Fernando Perez <fperez@colorado.edu>
4340
4364
4341 * IPython/iplib.py (InteractiveShell.interact): Added a special
4365 * IPython/iplib.py (InteractiveShell.interact): Added a special
4342 trap for a debugger quit exception, which is basically impossible
4366 trap for a debugger quit exception, which is basically impossible
4343 to handle by normal mechanisms, given what pdb does to the stack.
4367 to handle by normal mechanisms, given what pdb does to the stack.
4344 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4368 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4345
4369
4346 2004-04-03 Fernando Perez <fperez@colorado.edu>
4370 2004-04-03 Fernando Perez <fperez@colorado.edu>
4347
4371
4348 * IPython/genutils.py (Term): Standardized the names of the Term
4372 * IPython/genutils.py (Term): Standardized the names of the Term
4349 class streams to cin/cout/cerr, following C++ naming conventions
4373 class streams to cin/cout/cerr, following C++ naming conventions
4350 (I can't use in/out/err because 'in' is not a valid attribute
4374 (I can't use in/out/err because 'in' is not a valid attribute
4351 name).
4375 name).
4352
4376
4353 * IPython/iplib.py (InteractiveShell.interact): don't increment
4377 * IPython/iplib.py (InteractiveShell.interact): don't increment
4354 the prompt if there's no user input. By Daniel 'Dang' Griffith
4378 the prompt if there's no user input. By Daniel 'Dang' Griffith
4355 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4379 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4356 Francois Pinard.
4380 Francois Pinard.
4357
4381
4358 2004-04-02 Fernando Perez <fperez@colorado.edu>
4382 2004-04-02 Fernando Perez <fperez@colorado.edu>
4359
4383
4360 * IPython/genutils.py (Stream.__init__): Modified to survive at
4384 * IPython/genutils.py (Stream.__init__): Modified to survive at
4361 least importing in contexts where stdin/out/err aren't true file
4385 least importing in contexts where stdin/out/err aren't true file
4362 objects, such as PyCrust (they lack fileno() and mode). However,
4386 objects, such as PyCrust (they lack fileno() and mode). However,
4363 the recovery facilities which rely on these things existing will
4387 the recovery facilities which rely on these things existing will
4364 not work.
4388 not work.
4365
4389
4366 2004-04-01 Fernando Perez <fperez@colorado.edu>
4390 2004-04-01 Fernando Perez <fperez@colorado.edu>
4367
4391
4368 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4392 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4369 use the new getoutputerror() function, so it properly
4393 use the new getoutputerror() function, so it properly
4370 distinguishes stdout/err.
4394 distinguishes stdout/err.
4371
4395
4372 * IPython/genutils.py (getoutputerror): added a function to
4396 * IPython/genutils.py (getoutputerror): added a function to
4373 capture separately the standard output and error of a command.
4397 capture separately the standard output and error of a command.
4374 After a comment from dang on the mailing lists. This code is
4398 After a comment from dang on the mailing lists. This code is
4375 basically a modified version of commands.getstatusoutput(), from
4399 basically a modified version of commands.getstatusoutput(), from
4376 the standard library.
4400 the standard library.
4377
4401
4378 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4402 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4379 '!!' as a special syntax (shorthand) to access @sx.
4403 '!!' as a special syntax (shorthand) to access @sx.
4380
4404
4381 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4405 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4382 command and return its output as a list split on '\n'.
4406 command and return its output as a list split on '\n'.
4383
4407
4384 2004-03-31 Fernando Perez <fperez@colorado.edu>
4408 2004-03-31 Fernando Perez <fperez@colorado.edu>
4385
4409
4386 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4410 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4387 method to dictionaries used as FakeModule instances if they lack
4411 method to dictionaries used as FakeModule instances if they lack
4388 it. At least pydoc in python2.3 breaks for runtime-defined
4412 it. At least pydoc in python2.3 breaks for runtime-defined
4389 functions without this hack. At some point I need to _really_
4413 functions without this hack. At some point I need to _really_
4390 understand what FakeModule is doing, because it's a gross hack.
4414 understand what FakeModule is doing, because it's a gross hack.
4391 But it solves Arnd's problem for now...
4415 But it solves Arnd's problem for now...
4392
4416
4393 2004-02-27 Fernando Perez <fperez@colorado.edu>
4417 2004-02-27 Fernando Perez <fperez@colorado.edu>
4394
4418
4395 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4419 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4396 mode would behave erratically. Also increased the number of
4420 mode would behave erratically. Also increased the number of
4397 possible logs in rotate mod to 999. Thanks to Rod Holland
4421 possible logs in rotate mod to 999. Thanks to Rod Holland
4398 <rhh@StructureLABS.com> for the report and fixes.
4422 <rhh@StructureLABS.com> for the report and fixes.
4399
4423
4400 2004-02-26 Fernando Perez <fperez@colorado.edu>
4424 2004-02-26 Fernando Perez <fperez@colorado.edu>
4401
4425
4402 * IPython/genutils.py (page): Check that the curses module really
4426 * IPython/genutils.py (page): Check that the curses module really
4403 has the initscr attribute before trying to use it. For some
4427 has the initscr attribute before trying to use it. For some
4404 reason, the Solaris curses module is missing this. I think this
4428 reason, the Solaris curses module is missing this. I think this
4405 should be considered a Solaris python bug, but I'm not sure.
4429 should be considered a Solaris python bug, but I'm not sure.
4406
4430
4407 2004-01-17 Fernando Perez <fperez@colorado.edu>
4431 2004-01-17 Fernando Perez <fperez@colorado.edu>
4408
4432
4409 * IPython/genutils.py (Stream.__init__): Changes to try to make
4433 * IPython/genutils.py (Stream.__init__): Changes to try to make
4410 ipython robust against stdin/out/err being closed by the user.
4434 ipython robust against stdin/out/err being closed by the user.
4411 This is 'user error' (and blocks a normal python session, at least
4435 This is 'user error' (and blocks a normal python session, at least
4412 the stdout case). However, Ipython should be able to survive such
4436 the stdout case). However, Ipython should be able to survive such
4413 instances of abuse as gracefully as possible. To simplify the
4437 instances of abuse as gracefully as possible. To simplify the
4414 coding and maintain compatibility with Gary Bishop's Term
4438 coding and maintain compatibility with Gary Bishop's Term
4415 contributions, I've made use of classmethods for this. I think
4439 contributions, I've made use of classmethods for this. I think
4416 this introduces a dependency on python 2.2.
4440 this introduces a dependency on python 2.2.
4417
4441
4418 2004-01-13 Fernando Perez <fperez@colorado.edu>
4442 2004-01-13 Fernando Perez <fperez@colorado.edu>
4419
4443
4420 * IPython/numutils.py (exp_safe): simplified the code a bit and
4444 * IPython/numutils.py (exp_safe): simplified the code a bit and
4421 removed the need for importing the kinds module altogether.
4445 removed the need for importing the kinds module altogether.
4422
4446
4423 2004-01-06 Fernando Perez <fperez@colorado.edu>
4447 2004-01-06 Fernando Perez <fperez@colorado.edu>
4424
4448
4425 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4449 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4426 a magic function instead, after some community feedback. No
4450 a magic function instead, after some community feedback. No
4427 special syntax will exist for it, but its name is deliberately
4451 special syntax will exist for it, but its name is deliberately
4428 very short.
4452 very short.
4429
4453
4430 2003-12-20 Fernando Perez <fperez@colorado.edu>
4454 2003-12-20 Fernando Perez <fperez@colorado.edu>
4431
4455
4432 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4456 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4433 new functionality, to automagically assign the result of a shell
4457 new functionality, to automagically assign the result of a shell
4434 command to a variable. I'll solicit some community feedback on
4458 command to a variable. I'll solicit some community feedback on
4435 this before making it permanent.
4459 this before making it permanent.
4436
4460
4437 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4461 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4438 requested about callables for which inspect couldn't obtain a
4462 requested about callables for which inspect couldn't obtain a
4439 proper argspec. Thanks to a crash report sent by Etienne
4463 proper argspec. Thanks to a crash report sent by Etienne
4440 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4464 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4441
4465
4442 2003-12-09 Fernando Perez <fperez@colorado.edu>
4466 2003-12-09 Fernando Perez <fperez@colorado.edu>
4443
4467
4444 * IPython/genutils.py (page): patch for the pager to work across
4468 * IPython/genutils.py (page): patch for the pager to work across
4445 various versions of Windows. By Gary Bishop.
4469 various versions of Windows. By Gary Bishop.
4446
4470
4447 2003-12-04 Fernando Perez <fperez@colorado.edu>
4471 2003-12-04 Fernando Perez <fperez@colorado.edu>
4448
4472
4449 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4473 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4450 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4474 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4451 While I tested this and it looks ok, there may still be corner
4475 While I tested this and it looks ok, there may still be corner
4452 cases I've missed.
4476 cases I've missed.
4453
4477
4454 2003-12-01 Fernando Perez <fperez@colorado.edu>
4478 2003-12-01 Fernando Perez <fperez@colorado.edu>
4455
4479
4456 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4480 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4457 where a line like 'p,q=1,2' would fail because the automagic
4481 where a line like 'p,q=1,2' would fail because the automagic
4458 system would be triggered for @p.
4482 system would be triggered for @p.
4459
4483
4460 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4484 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4461 cleanups, code unmodified.
4485 cleanups, code unmodified.
4462
4486
4463 * IPython/genutils.py (Term): added a class for IPython to handle
4487 * IPython/genutils.py (Term): added a class for IPython to handle
4464 output. In most cases it will just be a proxy for stdout/err, but
4488 output. In most cases it will just be a proxy for stdout/err, but
4465 having this allows modifications to be made for some platforms,
4489 having this allows modifications to be made for some platforms,
4466 such as handling color escapes under Windows. All of this code
4490 such as handling color escapes under Windows. All of this code
4467 was contributed by Gary Bishop, with minor modifications by me.
4491 was contributed by Gary Bishop, with minor modifications by me.
4468 The actual changes affect many files.
4492 The actual changes affect many files.
4469
4493
4470 2003-11-30 Fernando Perez <fperez@colorado.edu>
4494 2003-11-30 Fernando Perez <fperez@colorado.edu>
4471
4495
4472 * IPython/iplib.py (file_matches): new completion code, courtesy
4496 * IPython/iplib.py (file_matches): new completion code, courtesy
4473 of Jeff Collins. This enables filename completion again under
4497 of Jeff Collins. This enables filename completion again under
4474 python 2.3, which disabled it at the C level.
4498 python 2.3, which disabled it at the C level.
4475
4499
4476 2003-11-11 Fernando Perez <fperez@colorado.edu>
4500 2003-11-11 Fernando Perez <fperez@colorado.edu>
4477
4501
4478 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4502 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4479 for Numeric.array(map(...)), but often convenient.
4503 for Numeric.array(map(...)), but often convenient.
4480
4504
4481 2003-11-05 Fernando Perez <fperez@colorado.edu>
4505 2003-11-05 Fernando Perez <fperez@colorado.edu>
4482
4506
4483 * IPython/numutils.py (frange): Changed a call from int() to
4507 * IPython/numutils.py (frange): Changed a call from int() to
4484 int(round()) to prevent a problem reported with arange() in the
4508 int(round()) to prevent a problem reported with arange() in the
4485 numpy list.
4509 numpy list.
4486
4510
4487 2003-10-06 Fernando Perez <fperez@colorado.edu>
4511 2003-10-06 Fernando Perez <fperez@colorado.edu>
4488
4512
4489 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4513 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4490 prevent crashes if sys lacks an argv attribute (it happens with
4514 prevent crashes if sys lacks an argv attribute (it happens with
4491 embedded interpreters which build a bare-bones sys module).
4515 embedded interpreters which build a bare-bones sys module).
4492 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4516 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4493
4517
4494 2003-09-24 Fernando Perez <fperez@colorado.edu>
4518 2003-09-24 Fernando Perez <fperez@colorado.edu>
4495
4519
4496 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4520 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4497 to protect against poorly written user objects where __getattr__
4521 to protect against poorly written user objects where __getattr__
4498 raises exceptions other than AttributeError. Thanks to a bug
4522 raises exceptions other than AttributeError. Thanks to a bug
4499 report by Oliver Sander <osander-AT-gmx.de>.
4523 report by Oliver Sander <osander-AT-gmx.de>.
4500
4524
4501 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4525 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4502 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4526 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4503
4527
4504 2003-09-09 Fernando Perez <fperez@colorado.edu>
4528 2003-09-09 Fernando Perez <fperez@colorado.edu>
4505
4529
4506 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4530 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4507 unpacking a list whith a callable as first element would
4531 unpacking a list whith a callable as first element would
4508 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4532 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4509 Collins.
4533 Collins.
4510
4534
4511 2003-08-25 *** Released version 0.5.0
4535 2003-08-25 *** Released version 0.5.0
4512
4536
4513 2003-08-22 Fernando Perez <fperez@colorado.edu>
4537 2003-08-22 Fernando Perez <fperez@colorado.edu>
4514
4538
4515 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4539 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4516 improperly defined user exceptions. Thanks to feedback from Mark
4540 improperly defined user exceptions. Thanks to feedback from Mark
4517 Russell <mrussell-AT-verio.net>.
4541 Russell <mrussell-AT-verio.net>.
4518
4542
4519 2003-08-20 Fernando Perez <fperez@colorado.edu>
4543 2003-08-20 Fernando Perez <fperez@colorado.edu>
4520
4544
4521 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4545 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4522 printing so that it would print multi-line string forms starting
4546 printing so that it would print multi-line string forms starting
4523 with a new line. This way the formatting is better respected for
4547 with a new line. This way the formatting is better respected for
4524 objects which work hard to make nice string forms.
4548 objects which work hard to make nice string forms.
4525
4549
4526 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4550 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4527 autocall would overtake data access for objects with both
4551 autocall would overtake data access for objects with both
4528 __getitem__ and __call__.
4552 __getitem__ and __call__.
4529
4553
4530 2003-08-19 *** Released version 0.5.0-rc1
4554 2003-08-19 *** Released version 0.5.0-rc1
4531
4555
4532 2003-08-19 Fernando Perez <fperez@colorado.edu>
4556 2003-08-19 Fernando Perez <fperez@colorado.edu>
4533
4557
4534 * IPython/deep_reload.py (load_tail): single tiny change here
4558 * IPython/deep_reload.py (load_tail): single tiny change here
4535 seems to fix the long-standing bug of dreload() failing to work
4559 seems to fix the long-standing bug of dreload() failing to work
4536 for dotted names. But this module is pretty tricky, so I may have
4560 for dotted names. But this module is pretty tricky, so I may have
4537 missed some subtlety. Needs more testing!.
4561 missed some subtlety. Needs more testing!.
4538
4562
4539 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4563 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4540 exceptions which have badly implemented __str__ methods.
4564 exceptions which have badly implemented __str__ methods.
4541 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4565 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4542 which I've been getting reports about from Python 2.3 users. I
4566 which I've been getting reports about from Python 2.3 users. I
4543 wish I had a simple test case to reproduce the problem, so I could
4567 wish I had a simple test case to reproduce the problem, so I could
4544 either write a cleaner workaround or file a bug report if
4568 either write a cleaner workaround or file a bug report if
4545 necessary.
4569 necessary.
4546
4570
4547 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4571 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4548 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4572 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4549 a bug report by Tjabo Kloppenburg.
4573 a bug report by Tjabo Kloppenburg.
4550
4574
4551 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4575 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4552 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4576 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4553 seems rather unstable. Thanks to a bug report by Tjabo
4577 seems rather unstable. Thanks to a bug report by Tjabo
4554 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4578 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4555
4579
4556 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4580 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4557 this out soon because of the critical fixes in the inner loop for
4581 this out soon because of the critical fixes in the inner loop for
4558 generators.
4582 generators.
4559
4583
4560 * IPython/Magic.py (Magic.getargspec): removed. This (and
4584 * IPython/Magic.py (Magic.getargspec): removed. This (and
4561 _get_def) have been obsoleted by OInspect for a long time, I
4585 _get_def) have been obsoleted by OInspect for a long time, I
4562 hadn't noticed that they were dead code.
4586 hadn't noticed that they were dead code.
4563 (Magic._ofind): restored _ofind functionality for a few literals
4587 (Magic._ofind): restored _ofind functionality for a few literals
4564 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4588 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4565 for things like "hello".capitalize?, since that would require a
4589 for things like "hello".capitalize?, since that would require a
4566 potentially dangerous eval() again.
4590 potentially dangerous eval() again.
4567
4591
4568 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4592 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4569 logic a bit more to clean up the escapes handling and minimize the
4593 logic a bit more to clean up the escapes handling and minimize the
4570 use of _ofind to only necessary cases. The interactive 'feel' of
4594 use of _ofind to only necessary cases. The interactive 'feel' of
4571 IPython should have improved quite a bit with the changes in
4595 IPython should have improved quite a bit with the changes in
4572 _prefilter and _ofind (besides being far safer than before).
4596 _prefilter and _ofind (besides being far safer than before).
4573
4597
4574 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4598 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4575 obscure, never reported). Edit would fail to find the object to
4599 obscure, never reported). Edit would fail to find the object to
4576 edit under some circumstances.
4600 edit under some circumstances.
4577 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4601 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4578 which were causing double-calling of generators. Those eval calls
4602 which were causing double-calling of generators. Those eval calls
4579 were _very_ dangerous, since code with side effects could be
4603 were _very_ dangerous, since code with side effects could be
4580 triggered. As they say, 'eval is evil'... These were the
4604 triggered. As they say, 'eval is evil'... These were the
4581 nastiest evals in IPython. Besides, _ofind is now far simpler,
4605 nastiest evals in IPython. Besides, _ofind is now far simpler,
4582 and it should also be quite a bit faster. Its use of inspect is
4606 and it should also be quite a bit faster. Its use of inspect is
4583 also safer, so perhaps some of the inspect-related crashes I've
4607 also safer, so perhaps some of the inspect-related crashes I've
4584 seen lately with Python 2.3 might be taken care of. That will
4608 seen lately with Python 2.3 might be taken care of. That will
4585 need more testing.
4609 need more testing.
4586
4610
4587 2003-08-17 Fernando Perez <fperez@colorado.edu>
4611 2003-08-17 Fernando Perez <fperez@colorado.edu>
4588
4612
4589 * IPython/iplib.py (InteractiveShell._prefilter): significant
4613 * IPython/iplib.py (InteractiveShell._prefilter): significant
4590 simplifications to the logic for handling user escapes. Faster
4614 simplifications to the logic for handling user escapes. Faster
4591 and simpler code.
4615 and simpler code.
4592
4616
4593 2003-08-14 Fernando Perez <fperez@colorado.edu>
4617 2003-08-14 Fernando Perez <fperez@colorado.edu>
4594
4618
4595 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4619 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4596 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4620 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4597 but it should be quite a bit faster. And the recursive version
4621 but it should be quite a bit faster. And the recursive version
4598 generated O(log N) intermediate storage for all rank>1 arrays,
4622 generated O(log N) intermediate storage for all rank>1 arrays,
4599 even if they were contiguous.
4623 even if they were contiguous.
4600 (l1norm): Added this function.
4624 (l1norm): Added this function.
4601 (norm): Added this function for arbitrary norms (including
4625 (norm): Added this function for arbitrary norms (including
4602 l-infinity). l1 and l2 are still special cases for convenience
4626 l-infinity). l1 and l2 are still special cases for convenience
4603 and speed.
4627 and speed.
4604
4628
4605 2003-08-03 Fernando Perez <fperez@colorado.edu>
4629 2003-08-03 Fernando Perez <fperez@colorado.edu>
4606
4630
4607 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4631 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4608 exceptions, which now raise PendingDeprecationWarnings in Python
4632 exceptions, which now raise PendingDeprecationWarnings in Python
4609 2.3. There were some in Magic and some in Gnuplot2.
4633 2.3. There were some in Magic and some in Gnuplot2.
4610
4634
4611 2003-06-30 Fernando Perez <fperez@colorado.edu>
4635 2003-06-30 Fernando Perez <fperez@colorado.edu>
4612
4636
4613 * IPython/genutils.py (page): modified to call curses only for
4637 * IPython/genutils.py (page): modified to call curses only for
4614 terminals where TERM=='xterm'. After problems under many other
4638 terminals where TERM=='xterm'. After problems under many other
4615 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4639 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4616
4640
4617 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4641 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4618 would be triggered when readline was absent. This was just an old
4642 would be triggered when readline was absent. This was just an old
4619 debugging statement I'd forgotten to take out.
4643 debugging statement I'd forgotten to take out.
4620
4644
4621 2003-06-20 Fernando Perez <fperez@colorado.edu>
4645 2003-06-20 Fernando Perez <fperez@colorado.edu>
4622
4646
4623 * IPython/genutils.py (clock): modified to return only user time
4647 * IPython/genutils.py (clock): modified to return only user time
4624 (not counting system time), after a discussion on scipy. While
4648 (not counting system time), after a discussion on scipy. While
4625 system time may be a useful quantity occasionally, it may much
4649 system time may be a useful quantity occasionally, it may much
4626 more easily be skewed by occasional swapping or other similar
4650 more easily be skewed by occasional swapping or other similar
4627 activity.
4651 activity.
4628
4652
4629 2003-06-05 Fernando Perez <fperez@colorado.edu>
4653 2003-06-05 Fernando Perez <fperez@colorado.edu>
4630
4654
4631 * IPython/numutils.py (identity): new function, for building
4655 * IPython/numutils.py (identity): new function, for building
4632 arbitrary rank Kronecker deltas (mostly backwards compatible with
4656 arbitrary rank Kronecker deltas (mostly backwards compatible with
4633 Numeric.identity)
4657 Numeric.identity)
4634
4658
4635 2003-06-03 Fernando Perez <fperez@colorado.edu>
4659 2003-06-03 Fernando Perez <fperez@colorado.edu>
4636
4660
4637 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4661 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4638 arguments passed to magics with spaces, to allow trailing '\' to
4662 arguments passed to magics with spaces, to allow trailing '\' to
4639 work normally (mainly for Windows users).
4663 work normally (mainly for Windows users).
4640
4664
4641 2003-05-29 Fernando Perez <fperez@colorado.edu>
4665 2003-05-29 Fernando Perez <fperez@colorado.edu>
4642
4666
4643 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4667 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4644 instead of pydoc.help. This fixes a bizarre behavior where
4668 instead of pydoc.help. This fixes a bizarre behavior where
4645 printing '%s' % locals() would trigger the help system. Now
4669 printing '%s' % locals() would trigger the help system. Now
4646 ipython behaves like normal python does.
4670 ipython behaves like normal python does.
4647
4671
4648 Note that if one does 'from pydoc import help', the bizarre
4672 Note that if one does 'from pydoc import help', the bizarre
4649 behavior returns, but this will also happen in normal python, so
4673 behavior returns, but this will also happen in normal python, so
4650 it's not an ipython bug anymore (it has to do with how pydoc.help
4674 it's not an ipython bug anymore (it has to do with how pydoc.help
4651 is implemented).
4675 is implemented).
4652
4676
4653 2003-05-22 Fernando Perez <fperez@colorado.edu>
4677 2003-05-22 Fernando Perez <fperez@colorado.edu>
4654
4678
4655 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4679 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4656 return [] instead of None when nothing matches, also match to end
4680 return [] instead of None when nothing matches, also match to end
4657 of line. Patch by Gary Bishop.
4681 of line. Patch by Gary Bishop.
4658
4682
4659 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4683 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4660 protection as before, for files passed on the command line. This
4684 protection as before, for files passed on the command line. This
4661 prevents the CrashHandler from kicking in if user files call into
4685 prevents the CrashHandler from kicking in if user files call into
4662 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4686 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4663 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4687 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4664
4688
4665 2003-05-20 *** Released version 0.4.0
4689 2003-05-20 *** Released version 0.4.0
4666
4690
4667 2003-05-20 Fernando Perez <fperez@colorado.edu>
4691 2003-05-20 Fernando Perez <fperez@colorado.edu>
4668
4692
4669 * setup.py: added support for manpages. It's a bit hackish b/c of
4693 * setup.py: added support for manpages. It's a bit hackish b/c of
4670 a bug in the way the bdist_rpm distutils target handles gzipped
4694 a bug in the way the bdist_rpm distutils target handles gzipped
4671 manpages, but it works. After a patch by Jack.
4695 manpages, but it works. After a patch by Jack.
4672
4696
4673 2003-05-19 Fernando Perez <fperez@colorado.edu>
4697 2003-05-19 Fernando Perez <fperez@colorado.edu>
4674
4698
4675 * IPython/numutils.py: added a mockup of the kinds module, since
4699 * IPython/numutils.py: added a mockup of the kinds module, since
4676 it was recently removed from Numeric. This way, numutils will
4700 it was recently removed from Numeric. This way, numutils will
4677 work for all users even if they are missing kinds.
4701 work for all users even if they are missing kinds.
4678
4702
4679 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4703 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4680 failure, which can occur with SWIG-wrapped extensions. After a
4704 failure, which can occur with SWIG-wrapped extensions. After a
4681 crash report from Prabhu.
4705 crash report from Prabhu.
4682
4706
4683 2003-05-16 Fernando Perez <fperez@colorado.edu>
4707 2003-05-16 Fernando Perez <fperez@colorado.edu>
4684
4708
4685 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4709 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4686 protect ipython from user code which may call directly
4710 protect ipython from user code which may call directly
4687 sys.excepthook (this looks like an ipython crash to the user, even
4711 sys.excepthook (this looks like an ipython crash to the user, even
4688 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4712 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4689 This is especially important to help users of WxWindows, but may
4713 This is especially important to help users of WxWindows, but may
4690 also be useful in other cases.
4714 also be useful in other cases.
4691
4715
4692 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4716 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4693 an optional tb_offset to be specified, and to preserve exception
4717 an optional tb_offset to be specified, and to preserve exception
4694 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4718 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4695
4719
4696 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4720 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4697
4721
4698 2003-05-15 Fernando Perez <fperez@colorado.edu>
4722 2003-05-15 Fernando Perez <fperez@colorado.edu>
4699
4723
4700 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4724 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4701 installing for a new user under Windows.
4725 installing for a new user under Windows.
4702
4726
4703 2003-05-12 Fernando Perez <fperez@colorado.edu>
4727 2003-05-12 Fernando Perez <fperez@colorado.edu>
4704
4728
4705 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4729 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4706 handler for Emacs comint-based lines. Currently it doesn't do
4730 handler for Emacs comint-based lines. Currently it doesn't do
4707 much (but importantly, it doesn't update the history cache). In
4731 much (but importantly, it doesn't update the history cache). In
4708 the future it may be expanded if Alex needs more functionality
4732 the future it may be expanded if Alex needs more functionality
4709 there.
4733 there.
4710
4734
4711 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4735 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4712 info to crash reports.
4736 info to crash reports.
4713
4737
4714 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4738 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4715 just like Python's -c. Also fixed crash with invalid -color
4739 just like Python's -c. Also fixed crash with invalid -color
4716 option value at startup. Thanks to Will French
4740 option value at startup. Thanks to Will French
4717 <wfrench-AT-bestweb.net> for the bug report.
4741 <wfrench-AT-bestweb.net> for the bug report.
4718
4742
4719 2003-05-09 Fernando Perez <fperez@colorado.edu>
4743 2003-05-09 Fernando Perez <fperez@colorado.edu>
4720
4744
4721 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4745 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4722 to EvalDict (it's a mapping, after all) and simplified its code
4746 to EvalDict (it's a mapping, after all) and simplified its code
4723 quite a bit, after a nice discussion on c.l.py where Gustavo
4747 quite a bit, after a nice discussion on c.l.py where Gustavo
4724 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4748 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4725
4749
4726 2003-04-30 Fernando Perez <fperez@colorado.edu>
4750 2003-04-30 Fernando Perez <fperez@colorado.edu>
4727
4751
4728 * IPython/genutils.py (timings_out): modified it to reduce its
4752 * IPython/genutils.py (timings_out): modified it to reduce its
4729 overhead in the common reps==1 case.
4753 overhead in the common reps==1 case.
4730
4754
4731 2003-04-29 Fernando Perez <fperez@colorado.edu>
4755 2003-04-29 Fernando Perez <fperez@colorado.edu>
4732
4756
4733 * IPython/genutils.py (timings_out): Modified to use the resource
4757 * IPython/genutils.py (timings_out): Modified to use the resource
4734 module, which avoids the wraparound problems of time.clock().
4758 module, which avoids the wraparound problems of time.clock().
4735
4759
4736 2003-04-17 *** Released version 0.2.15pre4
4760 2003-04-17 *** Released version 0.2.15pre4
4737
4761
4738 2003-04-17 Fernando Perez <fperez@colorado.edu>
4762 2003-04-17 Fernando Perez <fperez@colorado.edu>
4739
4763
4740 * setup.py (scriptfiles): Split windows-specific stuff over to a
4764 * setup.py (scriptfiles): Split windows-specific stuff over to a
4741 separate file, in an attempt to have a Windows GUI installer.
4765 separate file, in an attempt to have a Windows GUI installer.
4742 That didn't work, but part of the groundwork is done.
4766 That didn't work, but part of the groundwork is done.
4743
4767
4744 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4768 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4745 indent/unindent with 4 spaces. Particularly useful in combination
4769 indent/unindent with 4 spaces. Particularly useful in combination
4746 with the new auto-indent option.
4770 with the new auto-indent option.
4747
4771
4748 2003-04-16 Fernando Perez <fperez@colorado.edu>
4772 2003-04-16 Fernando Perez <fperez@colorado.edu>
4749
4773
4750 * IPython/Magic.py: various replacements of self.rc for
4774 * IPython/Magic.py: various replacements of self.rc for
4751 self.shell.rc. A lot more remains to be done to fully disentangle
4775 self.shell.rc. A lot more remains to be done to fully disentangle
4752 this class from the main Shell class.
4776 this class from the main Shell class.
4753
4777
4754 * IPython/GnuplotRuntime.py: added checks for mouse support so
4778 * IPython/GnuplotRuntime.py: added checks for mouse support so
4755 that we don't try to enable it if the current gnuplot doesn't
4779 that we don't try to enable it if the current gnuplot doesn't
4756 really support it. Also added checks so that we don't try to
4780 really support it. Also added checks so that we don't try to
4757 enable persist under Windows (where Gnuplot doesn't recognize the
4781 enable persist under Windows (where Gnuplot doesn't recognize the
4758 option).
4782 option).
4759
4783
4760 * IPython/iplib.py (InteractiveShell.interact): Added optional
4784 * IPython/iplib.py (InteractiveShell.interact): Added optional
4761 auto-indenting code, after a patch by King C. Shu
4785 auto-indenting code, after a patch by King C. Shu
4762 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4786 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4763 get along well with pasting indented code. If I ever figure out
4787 get along well with pasting indented code. If I ever figure out
4764 how to make that part go well, it will become on by default.
4788 how to make that part go well, it will become on by default.
4765
4789
4766 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4790 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4767 crash ipython if there was an unmatched '%' in the user's prompt
4791 crash ipython if there was an unmatched '%' in the user's prompt
4768 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4792 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4769
4793
4770 * IPython/iplib.py (InteractiveShell.interact): removed the
4794 * IPython/iplib.py (InteractiveShell.interact): removed the
4771 ability to ask the user whether he wants to crash or not at the
4795 ability to ask the user whether he wants to crash or not at the
4772 'last line' exception handler. Calling functions at that point
4796 'last line' exception handler. Calling functions at that point
4773 changes the stack, and the error reports would have incorrect
4797 changes the stack, and the error reports would have incorrect
4774 tracebacks.
4798 tracebacks.
4775
4799
4776 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4800 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4777 pass through a peger a pretty-printed form of any object. After a
4801 pass through a peger a pretty-printed form of any object. After a
4778 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4802 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4779
4803
4780 2003-04-14 Fernando Perez <fperez@colorado.edu>
4804 2003-04-14 Fernando Perez <fperez@colorado.edu>
4781
4805
4782 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4806 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4783 all files in ~ would be modified at first install (instead of
4807 all files in ~ would be modified at first install (instead of
4784 ~/.ipython). This could be potentially disastrous, as the
4808 ~/.ipython). This could be potentially disastrous, as the
4785 modification (make line-endings native) could damage binary files.
4809 modification (make line-endings native) could damage binary files.
4786
4810
4787 2003-04-10 Fernando Perez <fperez@colorado.edu>
4811 2003-04-10 Fernando Perez <fperez@colorado.edu>
4788
4812
4789 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4813 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4790 handle only lines which are invalid python. This now means that
4814 handle only lines which are invalid python. This now means that
4791 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4815 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4792 for the bug report.
4816 for the bug report.
4793
4817
4794 2003-04-01 Fernando Perez <fperez@colorado.edu>
4818 2003-04-01 Fernando Perez <fperez@colorado.edu>
4795
4819
4796 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4820 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4797 where failing to set sys.last_traceback would crash pdb.pm().
4821 where failing to set sys.last_traceback would crash pdb.pm().
4798 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4822 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4799 report.
4823 report.
4800
4824
4801 2003-03-25 Fernando Perez <fperez@colorado.edu>
4825 2003-03-25 Fernando Perez <fperez@colorado.edu>
4802
4826
4803 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4827 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4804 before printing it (it had a lot of spurious blank lines at the
4828 before printing it (it had a lot of spurious blank lines at the
4805 end).
4829 end).
4806
4830
4807 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4831 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4808 output would be sent 21 times! Obviously people don't use this
4832 output would be sent 21 times! Obviously people don't use this
4809 too often, or I would have heard about it.
4833 too often, or I would have heard about it.
4810
4834
4811 2003-03-24 Fernando Perez <fperez@colorado.edu>
4835 2003-03-24 Fernando Perez <fperez@colorado.edu>
4812
4836
4813 * setup.py (scriptfiles): renamed the data_files parameter from
4837 * setup.py (scriptfiles): renamed the data_files parameter from
4814 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4838 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4815 for the patch.
4839 for the patch.
4816
4840
4817 2003-03-20 Fernando Perez <fperez@colorado.edu>
4841 2003-03-20 Fernando Perez <fperez@colorado.edu>
4818
4842
4819 * IPython/genutils.py (error): added error() and fatal()
4843 * IPython/genutils.py (error): added error() and fatal()
4820 functions.
4844 functions.
4821
4845
4822 2003-03-18 *** Released version 0.2.15pre3
4846 2003-03-18 *** Released version 0.2.15pre3
4823
4847
4824 2003-03-18 Fernando Perez <fperez@colorado.edu>
4848 2003-03-18 Fernando Perez <fperez@colorado.edu>
4825
4849
4826 * setupext/install_data_ext.py
4850 * setupext/install_data_ext.py
4827 (install_data_ext.initialize_options): Class contributed by Jack
4851 (install_data_ext.initialize_options): Class contributed by Jack
4828 Moffit for fixing the old distutils hack. He is sending this to
4852 Moffit for fixing the old distutils hack. He is sending this to
4829 the distutils folks so in the future we may not need it as a
4853 the distutils folks so in the future we may not need it as a
4830 private fix.
4854 private fix.
4831
4855
4832 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4856 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4833 changes for Debian packaging. See his patch for full details.
4857 changes for Debian packaging. See his patch for full details.
4834 The old distutils hack of making the ipythonrc* files carry a
4858 The old distutils hack of making the ipythonrc* files carry a
4835 bogus .py extension is gone, at last. Examples were moved to a
4859 bogus .py extension is gone, at last. Examples were moved to a
4836 separate subdir under doc/, and the separate executable scripts
4860 separate subdir under doc/, and the separate executable scripts
4837 now live in their own directory. Overall a great cleanup. The
4861 now live in their own directory. Overall a great cleanup. The
4838 manual was updated to use the new files, and setup.py has been
4862 manual was updated to use the new files, and setup.py has been
4839 fixed for this setup.
4863 fixed for this setup.
4840
4864
4841 * IPython/PyColorize.py (Parser.usage): made non-executable and
4865 * IPython/PyColorize.py (Parser.usage): made non-executable and
4842 created a pycolor wrapper around it to be included as a script.
4866 created a pycolor wrapper around it to be included as a script.
4843
4867
4844 2003-03-12 *** Released version 0.2.15pre2
4868 2003-03-12 *** Released version 0.2.15pre2
4845
4869
4846 2003-03-12 Fernando Perez <fperez@colorado.edu>
4870 2003-03-12 Fernando Perez <fperez@colorado.edu>
4847
4871
4848 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4872 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4849 long-standing problem with garbage characters in some terminals.
4873 long-standing problem with garbage characters in some terminals.
4850 The issue was really that the \001 and \002 escapes must _only_ be
4874 The issue was really that the \001 and \002 escapes must _only_ be
4851 passed to input prompts (which call readline), but _never_ to
4875 passed to input prompts (which call readline), but _never_ to
4852 normal text to be printed on screen. I changed ColorANSI to have
4876 normal text to be printed on screen. I changed ColorANSI to have
4853 two classes: TermColors and InputTermColors, each with the
4877 two classes: TermColors and InputTermColors, each with the
4854 appropriate escapes for input prompts or normal text. The code in
4878 appropriate escapes for input prompts or normal text. The code in
4855 Prompts.py got slightly more complicated, but this very old and
4879 Prompts.py got slightly more complicated, but this very old and
4856 annoying bug is finally fixed.
4880 annoying bug is finally fixed.
4857
4881
4858 All the credit for nailing down the real origin of this problem
4882 All the credit for nailing down the real origin of this problem
4859 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4883 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4860 *Many* thanks to him for spending quite a bit of effort on this.
4884 *Many* thanks to him for spending quite a bit of effort on this.
4861
4885
4862 2003-03-05 *** Released version 0.2.15pre1
4886 2003-03-05 *** Released version 0.2.15pre1
4863
4887
4864 2003-03-03 Fernando Perez <fperez@colorado.edu>
4888 2003-03-03 Fernando Perez <fperez@colorado.edu>
4865
4889
4866 * IPython/FakeModule.py: Moved the former _FakeModule to a
4890 * IPython/FakeModule.py: Moved the former _FakeModule to a
4867 separate file, because it's also needed by Magic (to fix a similar
4891 separate file, because it's also needed by Magic (to fix a similar
4868 pickle-related issue in @run).
4892 pickle-related issue in @run).
4869
4893
4870 2003-03-02 Fernando Perez <fperez@colorado.edu>
4894 2003-03-02 Fernando Perez <fperez@colorado.edu>
4871
4895
4872 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4896 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4873 the autocall option at runtime.
4897 the autocall option at runtime.
4874 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4898 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4875 across Magic.py to start separating Magic from InteractiveShell.
4899 across Magic.py to start separating Magic from InteractiveShell.
4876 (Magic._ofind): Fixed to return proper namespace for dotted
4900 (Magic._ofind): Fixed to return proper namespace for dotted
4877 names. Before, a dotted name would always return 'not currently
4901 names. Before, a dotted name would always return 'not currently
4878 defined', because it would find the 'parent'. s.x would be found,
4902 defined', because it would find the 'parent'. s.x would be found,
4879 but since 'x' isn't defined by itself, it would get confused.
4903 but since 'x' isn't defined by itself, it would get confused.
4880 (Magic.magic_run): Fixed pickling problems reported by Ralf
4904 (Magic.magic_run): Fixed pickling problems reported by Ralf
4881 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4905 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4882 that I'd used when Mike Heeter reported similar issues at the
4906 that I'd used when Mike Heeter reported similar issues at the
4883 top-level, but now for @run. It boils down to injecting the
4907 top-level, but now for @run. It boils down to injecting the
4884 namespace where code is being executed with something that looks
4908 namespace where code is being executed with something that looks
4885 enough like a module to fool pickle.dump(). Since a pickle stores
4909 enough like a module to fool pickle.dump(). Since a pickle stores
4886 a named reference to the importing module, we need this for
4910 a named reference to the importing module, we need this for
4887 pickles to save something sensible.
4911 pickles to save something sensible.
4888
4912
4889 * IPython/ipmaker.py (make_IPython): added an autocall option.
4913 * IPython/ipmaker.py (make_IPython): added an autocall option.
4890
4914
4891 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4915 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4892 the auto-eval code. Now autocalling is an option, and the code is
4916 the auto-eval code. Now autocalling is an option, and the code is
4893 also vastly safer. There is no more eval() involved at all.
4917 also vastly safer. There is no more eval() involved at all.
4894
4918
4895 2003-03-01 Fernando Perez <fperez@colorado.edu>
4919 2003-03-01 Fernando Perez <fperez@colorado.edu>
4896
4920
4897 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4921 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4898 dict with named keys instead of a tuple.
4922 dict with named keys instead of a tuple.
4899
4923
4900 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4924 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4901
4925
4902 * setup.py (make_shortcut): Fixed message about directories
4926 * setup.py (make_shortcut): Fixed message about directories
4903 created during Windows installation (the directories were ok, just
4927 created during Windows installation (the directories were ok, just
4904 the printed message was misleading). Thanks to Chris Liechti
4928 the printed message was misleading). Thanks to Chris Liechti
4905 <cliechti-AT-gmx.net> for the heads up.
4929 <cliechti-AT-gmx.net> for the heads up.
4906
4930
4907 2003-02-21 Fernando Perez <fperez@colorado.edu>
4931 2003-02-21 Fernando Perez <fperez@colorado.edu>
4908
4932
4909 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4933 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4910 of ValueError exception when checking for auto-execution. This
4934 of ValueError exception when checking for auto-execution. This
4911 one is raised by things like Numeric arrays arr.flat when the
4935 one is raised by things like Numeric arrays arr.flat when the
4912 array is non-contiguous.
4936 array is non-contiguous.
4913
4937
4914 2003-01-31 Fernando Perez <fperez@colorado.edu>
4938 2003-01-31 Fernando Perez <fperez@colorado.edu>
4915
4939
4916 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4940 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4917 not return any value at all (even though the command would get
4941 not return any value at all (even though the command would get
4918 executed).
4942 executed).
4919 (xsys): Flush stdout right after printing the command to ensure
4943 (xsys): Flush stdout right after printing the command to ensure
4920 proper ordering of commands and command output in the total
4944 proper ordering of commands and command output in the total
4921 output.
4945 output.
4922 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4946 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4923 system/getoutput as defaults. The old ones are kept for
4947 system/getoutput as defaults. The old ones are kept for
4924 compatibility reasons, so no code which uses this library needs
4948 compatibility reasons, so no code which uses this library needs
4925 changing.
4949 changing.
4926
4950
4927 2003-01-27 *** Released version 0.2.14
4951 2003-01-27 *** Released version 0.2.14
4928
4952
4929 2003-01-25 Fernando Perez <fperez@colorado.edu>
4953 2003-01-25 Fernando Perez <fperez@colorado.edu>
4930
4954
4931 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4955 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4932 functions defined in previous edit sessions could not be re-edited
4956 functions defined in previous edit sessions could not be re-edited
4933 (because the temp files were immediately removed). Now temp files
4957 (because the temp files were immediately removed). Now temp files
4934 are removed only at IPython's exit.
4958 are removed only at IPython's exit.
4935 (Magic.magic_run): Improved @run to perform shell-like expansions
4959 (Magic.magic_run): Improved @run to perform shell-like expansions
4936 on its arguments (~users and $VARS). With this, @run becomes more
4960 on its arguments (~users and $VARS). With this, @run becomes more
4937 like a normal command-line.
4961 like a normal command-line.
4938
4962
4939 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4963 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4940 bugs related to embedding and cleaned up that code. A fairly
4964 bugs related to embedding and cleaned up that code. A fairly
4941 important one was the impossibility to access the global namespace
4965 important one was the impossibility to access the global namespace
4942 through the embedded IPython (only local variables were visible).
4966 through the embedded IPython (only local variables were visible).
4943
4967
4944 2003-01-14 Fernando Perez <fperez@colorado.edu>
4968 2003-01-14 Fernando Perez <fperez@colorado.edu>
4945
4969
4946 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4970 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4947 auto-calling to be a bit more conservative. Now it doesn't get
4971 auto-calling to be a bit more conservative. Now it doesn't get
4948 triggered if any of '!=()<>' are in the rest of the input line, to
4972 triggered if any of '!=()<>' are in the rest of the input line, to
4949 allow comparing callables. Thanks to Alex for the heads up.
4973 allow comparing callables. Thanks to Alex for the heads up.
4950
4974
4951 2003-01-07 Fernando Perez <fperez@colorado.edu>
4975 2003-01-07 Fernando Perez <fperez@colorado.edu>
4952
4976
4953 * IPython/genutils.py (page): fixed estimation of the number of
4977 * IPython/genutils.py (page): fixed estimation of the number of
4954 lines in a string to be paged to simply count newlines. This
4978 lines in a string to be paged to simply count newlines. This
4955 prevents over-guessing due to embedded escape sequences. A better
4979 prevents over-guessing due to embedded escape sequences. A better
4956 long-term solution would involve stripping out the control chars
4980 long-term solution would involve stripping out the control chars
4957 for the count, but it's potentially so expensive I just don't
4981 for the count, but it's potentially so expensive I just don't
4958 think it's worth doing.
4982 think it's worth doing.
4959
4983
4960 2002-12-19 *** Released version 0.2.14pre50
4984 2002-12-19 *** Released version 0.2.14pre50
4961
4985
4962 2002-12-19 Fernando Perez <fperez@colorado.edu>
4986 2002-12-19 Fernando Perez <fperez@colorado.edu>
4963
4987
4964 * tools/release (version): Changed release scripts to inform
4988 * tools/release (version): Changed release scripts to inform
4965 Andrea and build a NEWS file with a list of recent changes.
4989 Andrea and build a NEWS file with a list of recent changes.
4966
4990
4967 * IPython/ColorANSI.py (__all__): changed terminal detection
4991 * IPython/ColorANSI.py (__all__): changed terminal detection
4968 code. Seems to work better for xterms without breaking
4992 code. Seems to work better for xterms without breaking
4969 konsole. Will need more testing to determine if WinXP and Mac OSX
4993 konsole. Will need more testing to determine if WinXP and Mac OSX
4970 also work ok.
4994 also work ok.
4971
4995
4972 2002-12-18 *** Released version 0.2.14pre49
4996 2002-12-18 *** Released version 0.2.14pre49
4973
4997
4974 2002-12-18 Fernando Perez <fperez@colorado.edu>
4998 2002-12-18 Fernando Perez <fperez@colorado.edu>
4975
4999
4976 * Docs: added new info about Mac OSX, from Andrea.
5000 * Docs: added new info about Mac OSX, from Andrea.
4977
5001
4978 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5002 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4979 allow direct plotting of python strings whose format is the same
5003 allow direct plotting of python strings whose format is the same
4980 of gnuplot data files.
5004 of gnuplot data files.
4981
5005
4982 2002-12-16 Fernando Perez <fperez@colorado.edu>
5006 2002-12-16 Fernando Perez <fperez@colorado.edu>
4983
5007
4984 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5008 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4985 value of exit question to be acknowledged.
5009 value of exit question to be acknowledged.
4986
5010
4987 2002-12-03 Fernando Perez <fperez@colorado.edu>
5011 2002-12-03 Fernando Perez <fperez@colorado.edu>
4988
5012
4989 * IPython/ipmaker.py: removed generators, which had been added
5013 * IPython/ipmaker.py: removed generators, which had been added
4990 by mistake in an earlier debugging run. This was causing trouble
5014 by mistake in an earlier debugging run. This was causing trouble
4991 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5015 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4992 for pointing this out.
5016 for pointing this out.
4993
5017
4994 2002-11-17 Fernando Perez <fperez@colorado.edu>
5018 2002-11-17 Fernando Perez <fperez@colorado.edu>
4995
5019
4996 * Manual: updated the Gnuplot section.
5020 * Manual: updated the Gnuplot section.
4997
5021
4998 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5022 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4999 a much better split of what goes in Runtime and what goes in
5023 a much better split of what goes in Runtime and what goes in
5000 Interactive.
5024 Interactive.
5001
5025
5002 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5026 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5003 being imported from iplib.
5027 being imported from iplib.
5004
5028
5005 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5029 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5006 for command-passing. Now the global Gnuplot instance is called
5030 for command-passing. Now the global Gnuplot instance is called
5007 'gp' instead of 'g', which was really a far too fragile and
5031 'gp' instead of 'g', which was really a far too fragile and
5008 common name.
5032 common name.
5009
5033
5010 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5034 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5011 bounding boxes generated by Gnuplot for square plots.
5035 bounding boxes generated by Gnuplot for square plots.
5012
5036
5013 * IPython/genutils.py (popkey): new function added. I should
5037 * IPython/genutils.py (popkey): new function added. I should
5014 suggest this on c.l.py as a dict method, it seems useful.
5038 suggest this on c.l.py as a dict method, it seems useful.
5015
5039
5016 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5040 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5017 to transparently handle PostScript generation. MUCH better than
5041 to transparently handle PostScript generation. MUCH better than
5018 the previous plot_eps/replot_eps (which I removed now). The code
5042 the previous plot_eps/replot_eps (which I removed now). The code
5019 is also fairly clean and well documented now (including
5043 is also fairly clean and well documented now (including
5020 docstrings).
5044 docstrings).
5021
5045
5022 2002-11-13 Fernando Perez <fperez@colorado.edu>
5046 2002-11-13 Fernando Perez <fperez@colorado.edu>
5023
5047
5024 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5048 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5025 (inconsistent with options).
5049 (inconsistent with options).
5026
5050
5027 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5051 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5028 manually disabled, I don't know why. Fixed it.
5052 manually disabled, I don't know why. Fixed it.
5029 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5053 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5030 eps output.
5054 eps output.
5031
5055
5032 2002-11-12 Fernando Perez <fperez@colorado.edu>
5056 2002-11-12 Fernando Perez <fperez@colorado.edu>
5033
5057
5034 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5058 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5035 don't propagate up to caller. Fixes crash reported by François
5059 don't propagate up to caller. Fixes crash reported by François
5036 Pinard.
5060 Pinard.
5037
5061
5038 2002-11-09 Fernando Perez <fperez@colorado.edu>
5062 2002-11-09 Fernando Perez <fperez@colorado.edu>
5039
5063
5040 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5064 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5041 history file for new users.
5065 history file for new users.
5042 (make_IPython): fixed bug where initial install would leave the
5066 (make_IPython): fixed bug where initial install would leave the
5043 user running in the .ipython dir.
5067 user running in the .ipython dir.
5044 (make_IPython): fixed bug where config dir .ipython would be
5068 (make_IPython): fixed bug where config dir .ipython would be
5045 created regardless of the given -ipythondir option. Thanks to Cory
5069 created regardless of the given -ipythondir option. Thanks to Cory
5046 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5070 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5047
5071
5048 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5072 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5049 type confirmations. Will need to use it in all of IPython's code
5073 type confirmations. Will need to use it in all of IPython's code
5050 consistently.
5074 consistently.
5051
5075
5052 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5076 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5053 context to print 31 lines instead of the default 5. This will make
5077 context to print 31 lines instead of the default 5. This will make
5054 the crash reports extremely detailed in case the problem is in
5078 the crash reports extremely detailed in case the problem is in
5055 libraries I don't have access to.
5079 libraries I don't have access to.
5056
5080
5057 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5081 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5058 line of defense' code to still crash, but giving users fair
5082 line of defense' code to still crash, but giving users fair
5059 warning. I don't want internal errors to go unreported: if there's
5083 warning. I don't want internal errors to go unreported: if there's
5060 an internal problem, IPython should crash and generate a full
5084 an internal problem, IPython should crash and generate a full
5061 report.
5085 report.
5062
5086
5063 2002-11-08 Fernando Perez <fperez@colorado.edu>
5087 2002-11-08 Fernando Perez <fperez@colorado.edu>
5064
5088
5065 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5089 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5066 otherwise uncaught exceptions which can appear if people set
5090 otherwise uncaught exceptions which can appear if people set
5067 sys.stdout to something badly broken. Thanks to a crash report
5091 sys.stdout to something badly broken. Thanks to a crash report
5068 from henni-AT-mail.brainbot.com.
5092 from henni-AT-mail.brainbot.com.
5069
5093
5070 2002-11-04 Fernando Perez <fperez@colorado.edu>
5094 2002-11-04 Fernando Perez <fperez@colorado.edu>
5071
5095
5072 * IPython/iplib.py (InteractiveShell.interact): added
5096 * IPython/iplib.py (InteractiveShell.interact): added
5073 __IPYTHON__active to the builtins. It's a flag which goes on when
5097 __IPYTHON__active to the builtins. It's a flag which goes on when
5074 the interaction starts and goes off again when it stops. This
5098 the interaction starts and goes off again when it stops. This
5075 allows embedding code to detect being inside IPython. Before this
5099 allows embedding code to detect being inside IPython. Before this
5076 was done via __IPYTHON__, but that only shows that an IPython
5100 was done via __IPYTHON__, but that only shows that an IPython
5077 instance has been created.
5101 instance has been created.
5078
5102
5079 * IPython/Magic.py (Magic.magic_env): I realized that in a
5103 * IPython/Magic.py (Magic.magic_env): I realized that in a
5080 UserDict, instance.data holds the data as a normal dict. So I
5104 UserDict, instance.data holds the data as a normal dict. So I
5081 modified @env to return os.environ.data instead of rebuilding a
5105 modified @env to return os.environ.data instead of rebuilding a
5082 dict by hand.
5106 dict by hand.
5083
5107
5084 2002-11-02 Fernando Perez <fperez@colorado.edu>
5108 2002-11-02 Fernando Perez <fperez@colorado.edu>
5085
5109
5086 * IPython/genutils.py (warn): changed so that level 1 prints no
5110 * IPython/genutils.py (warn): changed so that level 1 prints no
5087 header. Level 2 is now the default (with 'WARNING' header, as
5111 header. Level 2 is now the default (with 'WARNING' header, as
5088 before). I think I tracked all places where changes were needed in
5112 before). I think I tracked all places where changes were needed in
5089 IPython, but outside code using the old level numbering may have
5113 IPython, but outside code using the old level numbering may have
5090 broken.
5114 broken.
5091
5115
5092 * IPython/iplib.py (InteractiveShell.runcode): added this to
5116 * IPython/iplib.py (InteractiveShell.runcode): added this to
5093 handle the tracebacks in SystemExit traps correctly. The previous
5117 handle the tracebacks in SystemExit traps correctly. The previous
5094 code (through interact) was printing more of the stack than
5118 code (through interact) was printing more of the stack than
5095 necessary, showing IPython internal code to the user.
5119 necessary, showing IPython internal code to the user.
5096
5120
5097 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5121 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5098 default. Now that the default at the confirmation prompt is yes,
5122 default. Now that the default at the confirmation prompt is yes,
5099 it's not so intrusive. François' argument that ipython sessions
5123 it's not so intrusive. François' argument that ipython sessions
5100 tend to be complex enough not to lose them from an accidental C-d,
5124 tend to be complex enough not to lose them from an accidental C-d,
5101 is a valid one.
5125 is a valid one.
5102
5126
5103 * IPython/iplib.py (InteractiveShell.interact): added a
5127 * IPython/iplib.py (InteractiveShell.interact): added a
5104 showtraceback() call to the SystemExit trap, and modified the exit
5128 showtraceback() call to the SystemExit trap, and modified the exit
5105 confirmation to have yes as the default.
5129 confirmation to have yes as the default.
5106
5130
5107 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5131 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5108 this file. It's been gone from the code for a long time, this was
5132 this file. It's been gone from the code for a long time, this was
5109 simply leftover junk.
5133 simply leftover junk.
5110
5134
5111 2002-11-01 Fernando Perez <fperez@colorado.edu>
5135 2002-11-01 Fernando Perez <fperez@colorado.edu>
5112
5136
5113 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5137 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5114 added. If set, IPython now traps EOF and asks for
5138 added. If set, IPython now traps EOF and asks for
5115 confirmation. After a request by François Pinard.
5139 confirmation. After a request by François Pinard.
5116
5140
5117 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5141 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5118 of @abort, and with a new (better) mechanism for handling the
5142 of @abort, and with a new (better) mechanism for handling the
5119 exceptions.
5143 exceptions.
5120
5144
5121 2002-10-27 Fernando Perez <fperez@colorado.edu>
5145 2002-10-27 Fernando Perez <fperez@colorado.edu>
5122
5146
5123 * IPython/usage.py (__doc__): updated the --help information and
5147 * IPython/usage.py (__doc__): updated the --help information and
5124 the ipythonrc file to indicate that -log generates
5148 the ipythonrc file to indicate that -log generates
5125 ./ipython.log. Also fixed the corresponding info in @logstart.
5149 ./ipython.log. Also fixed the corresponding info in @logstart.
5126 This and several other fixes in the manuals thanks to reports by
5150 This and several other fixes in the manuals thanks to reports by
5127 François Pinard <pinard-AT-iro.umontreal.ca>.
5151 François Pinard <pinard-AT-iro.umontreal.ca>.
5128
5152
5129 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5153 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5130 refer to @logstart (instead of @log, which doesn't exist).
5154 refer to @logstart (instead of @log, which doesn't exist).
5131
5155
5132 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5156 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5133 AttributeError crash. Thanks to Christopher Armstrong
5157 AttributeError crash. Thanks to Christopher Armstrong
5134 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5158 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5135 introduced recently (in 0.2.14pre37) with the fix to the eval
5159 introduced recently (in 0.2.14pre37) with the fix to the eval
5136 problem mentioned below.
5160 problem mentioned below.
5137
5161
5138 2002-10-17 Fernando Perez <fperez@colorado.edu>
5162 2002-10-17 Fernando Perez <fperez@colorado.edu>
5139
5163
5140 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5164 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5141 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5165 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5142
5166
5143 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5167 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5144 this function to fix a problem reported by Alex Schmolck. He saw
5168 this function to fix a problem reported by Alex Schmolck. He saw
5145 it with list comprehensions and generators, which were getting
5169 it with list comprehensions and generators, which were getting
5146 called twice. The real problem was an 'eval' call in testing for
5170 called twice. The real problem was an 'eval' call in testing for
5147 automagic which was evaluating the input line silently.
5171 automagic which was evaluating the input line silently.
5148
5172
5149 This is a potentially very nasty bug, if the input has side
5173 This is a potentially very nasty bug, if the input has side
5150 effects which must not be repeated. The code is much cleaner now,
5174 effects which must not be repeated. The code is much cleaner now,
5151 without any blanket 'except' left and with a regexp test for
5175 without any blanket 'except' left and with a regexp test for
5152 actual function names.
5176 actual function names.
5153
5177
5154 But an eval remains, which I'm not fully comfortable with. I just
5178 But an eval remains, which I'm not fully comfortable with. I just
5155 don't know how to find out if an expression could be a callable in
5179 don't know how to find out if an expression could be a callable in
5156 the user's namespace without doing an eval on the string. However
5180 the user's namespace without doing an eval on the string. However
5157 that string is now much more strictly checked so that no code
5181 that string is now much more strictly checked so that no code
5158 slips by, so the eval should only happen for things that can
5182 slips by, so the eval should only happen for things that can
5159 really be only function/method names.
5183 really be only function/method names.
5160
5184
5161 2002-10-15 Fernando Perez <fperez@colorado.edu>
5185 2002-10-15 Fernando Perez <fperez@colorado.edu>
5162
5186
5163 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5187 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5164 OSX information to main manual, removed README_Mac_OSX file from
5188 OSX information to main manual, removed README_Mac_OSX file from
5165 distribution. Also updated credits for recent additions.
5189 distribution. Also updated credits for recent additions.
5166
5190
5167 2002-10-10 Fernando Perez <fperez@colorado.edu>
5191 2002-10-10 Fernando Perez <fperez@colorado.edu>
5168
5192
5169 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5193 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5170 terminal-related issues. Many thanks to Andrea Riciputi
5194 terminal-related issues. Many thanks to Andrea Riciputi
5171 <andrea.riciputi-AT-libero.it> for writing it.
5195 <andrea.riciputi-AT-libero.it> for writing it.
5172
5196
5173 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5197 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5174 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5198 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5175
5199
5176 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5200 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5177 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5201 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5178 <syver-en-AT-online.no> who both submitted patches for this problem.
5202 <syver-en-AT-online.no> who both submitted patches for this problem.
5179
5203
5180 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5204 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5181 global embedding to make sure that things don't overwrite user
5205 global embedding to make sure that things don't overwrite user
5182 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5206 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5183
5207
5184 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5208 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5185 compatibility. Thanks to Hayden Callow
5209 compatibility. Thanks to Hayden Callow
5186 <h.callow-AT-elec.canterbury.ac.nz>
5210 <h.callow-AT-elec.canterbury.ac.nz>
5187
5211
5188 2002-10-04 Fernando Perez <fperez@colorado.edu>
5212 2002-10-04 Fernando Perez <fperez@colorado.edu>
5189
5213
5190 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5214 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5191 Gnuplot.File objects.
5215 Gnuplot.File objects.
5192
5216
5193 2002-07-23 Fernando Perez <fperez@colorado.edu>
5217 2002-07-23 Fernando Perez <fperez@colorado.edu>
5194
5218
5195 * IPython/genutils.py (timing): Added timings() and timing() for
5219 * IPython/genutils.py (timing): Added timings() and timing() for
5196 quick access to the most commonly needed data, the execution
5220 quick access to the most commonly needed data, the execution
5197 times. Old timing() renamed to timings_out().
5221 times. Old timing() renamed to timings_out().
5198
5222
5199 2002-07-18 Fernando Perez <fperez@colorado.edu>
5223 2002-07-18 Fernando Perez <fperez@colorado.edu>
5200
5224
5201 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5225 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5202 bug with nested instances disrupting the parent's tab completion.
5226 bug with nested instances disrupting the parent's tab completion.
5203
5227
5204 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5228 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5205 all_completions code to begin the emacs integration.
5229 all_completions code to begin the emacs integration.
5206
5230
5207 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5231 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5208 argument to allow titling individual arrays when plotting.
5232 argument to allow titling individual arrays when plotting.
5209
5233
5210 2002-07-15 Fernando Perez <fperez@colorado.edu>
5234 2002-07-15 Fernando Perez <fperez@colorado.edu>
5211
5235
5212 * setup.py (make_shortcut): changed to retrieve the value of
5236 * setup.py (make_shortcut): changed to retrieve the value of
5213 'Program Files' directory from the registry (this value changes in
5237 'Program Files' directory from the registry (this value changes in
5214 non-english versions of Windows). Thanks to Thomas Fanslau
5238 non-english versions of Windows). Thanks to Thomas Fanslau
5215 <tfanslau-AT-gmx.de> for the report.
5239 <tfanslau-AT-gmx.de> for the report.
5216
5240
5217 2002-07-10 Fernando Perez <fperez@colorado.edu>
5241 2002-07-10 Fernando Perez <fperez@colorado.edu>
5218
5242
5219 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5243 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5220 a bug in pdb, which crashes if a line with only whitespace is
5244 a bug in pdb, which crashes if a line with only whitespace is
5221 entered. Bug report submitted to sourceforge.
5245 entered. Bug report submitted to sourceforge.
5222
5246
5223 2002-07-09 Fernando Perez <fperez@colorado.edu>
5247 2002-07-09 Fernando Perez <fperez@colorado.edu>
5224
5248
5225 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5249 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5226 reporting exceptions (it's a bug in inspect.py, I just set a
5250 reporting exceptions (it's a bug in inspect.py, I just set a
5227 workaround).
5251 workaround).
5228
5252
5229 2002-07-08 Fernando Perez <fperez@colorado.edu>
5253 2002-07-08 Fernando Perez <fperez@colorado.edu>
5230
5254
5231 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5255 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5232 __IPYTHON__ in __builtins__ to show up in user_ns.
5256 __IPYTHON__ in __builtins__ to show up in user_ns.
5233
5257
5234 2002-07-03 Fernando Perez <fperez@colorado.edu>
5258 2002-07-03 Fernando Perez <fperez@colorado.edu>
5235
5259
5236 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5260 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5237 name from @gp_set_instance to @gp_set_default.
5261 name from @gp_set_instance to @gp_set_default.
5238
5262
5239 * IPython/ipmaker.py (make_IPython): default editor value set to
5263 * IPython/ipmaker.py (make_IPython): default editor value set to
5240 '0' (a string), to match the rc file. Otherwise will crash when
5264 '0' (a string), to match the rc file. Otherwise will crash when
5241 .strip() is called on it.
5265 .strip() is called on it.
5242
5266
5243
5267
5244 2002-06-28 Fernando Perez <fperez@colorado.edu>
5268 2002-06-28 Fernando Perez <fperez@colorado.edu>
5245
5269
5246 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5270 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5247 of files in current directory when a file is executed via
5271 of files in current directory when a file is executed via
5248 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5272 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5249
5273
5250 * setup.py (manfiles): fix for rpm builds, submitted by RA
5274 * setup.py (manfiles): fix for rpm builds, submitted by RA
5251 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5275 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5252
5276
5253 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5277 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5254 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5278 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5255 string!). A. Schmolck caught this one.
5279 string!). A. Schmolck caught this one.
5256
5280
5257 2002-06-27 Fernando Perez <fperez@colorado.edu>
5281 2002-06-27 Fernando Perez <fperez@colorado.edu>
5258
5282
5259 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5283 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5260 defined files at the cmd line. __name__ wasn't being set to
5284 defined files at the cmd line. __name__ wasn't being set to
5261 __main__.
5285 __main__.
5262
5286
5263 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5287 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5264 regular lists and tuples besides Numeric arrays.
5288 regular lists and tuples besides Numeric arrays.
5265
5289
5266 * IPython/Prompts.py (CachedOutput.__call__): Added output
5290 * IPython/Prompts.py (CachedOutput.__call__): Added output
5267 supression for input ending with ';'. Similar to Mathematica and
5291 supression for input ending with ';'. Similar to Mathematica and
5268 Matlab. The _* vars and Out[] list are still updated, just like
5292 Matlab. The _* vars and Out[] list are still updated, just like
5269 Mathematica behaves.
5293 Mathematica behaves.
5270
5294
5271 2002-06-25 Fernando Perez <fperez@colorado.edu>
5295 2002-06-25 Fernando Perez <fperez@colorado.edu>
5272
5296
5273 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5297 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5274 .ini extensions for profiels under Windows.
5298 .ini extensions for profiels under Windows.
5275
5299
5276 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5300 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5277 string form. Fix contributed by Alexander Schmolck
5301 string form. Fix contributed by Alexander Schmolck
5278 <a.schmolck-AT-gmx.net>
5302 <a.schmolck-AT-gmx.net>
5279
5303
5280 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5304 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5281 pre-configured Gnuplot instance.
5305 pre-configured Gnuplot instance.
5282
5306
5283 2002-06-21 Fernando Perez <fperez@colorado.edu>
5307 2002-06-21 Fernando Perez <fperez@colorado.edu>
5284
5308
5285 * IPython/numutils.py (exp_safe): new function, works around the
5309 * IPython/numutils.py (exp_safe): new function, works around the
5286 underflow problems in Numeric.
5310 underflow problems in Numeric.
5287 (log2): New fn. Safe log in base 2: returns exact integer answer
5311 (log2): New fn. Safe log in base 2: returns exact integer answer
5288 for exact integer powers of 2.
5312 for exact integer powers of 2.
5289
5313
5290 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5314 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5291 properly.
5315 properly.
5292
5316
5293 2002-06-20 Fernando Perez <fperez@colorado.edu>
5317 2002-06-20 Fernando Perez <fperez@colorado.edu>
5294
5318
5295 * IPython/genutils.py (timing): new function like
5319 * IPython/genutils.py (timing): new function like
5296 Mathematica's. Similar to time_test, but returns more info.
5320 Mathematica's. Similar to time_test, but returns more info.
5297
5321
5298 2002-06-18 Fernando Perez <fperez@colorado.edu>
5322 2002-06-18 Fernando Perez <fperez@colorado.edu>
5299
5323
5300 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5324 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5301 according to Mike Heeter's suggestions.
5325 according to Mike Heeter's suggestions.
5302
5326
5303 2002-06-16 Fernando Perez <fperez@colorado.edu>
5327 2002-06-16 Fernando Perez <fperez@colorado.edu>
5304
5328
5305 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5329 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5306 system. GnuplotMagic is gone as a user-directory option. New files
5330 system. GnuplotMagic is gone as a user-directory option. New files
5307 make it easier to use all the gnuplot stuff both from external
5331 make it easier to use all the gnuplot stuff both from external
5308 programs as well as from IPython. Had to rewrite part of
5332 programs as well as from IPython. Had to rewrite part of
5309 hardcopy() b/c of a strange bug: often the ps files simply don't
5333 hardcopy() b/c of a strange bug: often the ps files simply don't
5310 get created, and require a repeat of the command (often several
5334 get created, and require a repeat of the command (often several
5311 times).
5335 times).
5312
5336
5313 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5337 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5314 resolve output channel at call time, so that if sys.stderr has
5338 resolve output channel at call time, so that if sys.stderr has
5315 been redirected by user this gets honored.
5339 been redirected by user this gets honored.
5316
5340
5317 2002-06-13 Fernando Perez <fperez@colorado.edu>
5341 2002-06-13 Fernando Perez <fperez@colorado.edu>
5318
5342
5319 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5343 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5320 IPShell. Kept a copy with the old names to avoid breaking people's
5344 IPShell. Kept a copy with the old names to avoid breaking people's
5321 embedded code.
5345 embedded code.
5322
5346
5323 * IPython/ipython: simplified it to the bare minimum after
5347 * IPython/ipython: simplified it to the bare minimum after
5324 Holger's suggestions. Added info about how to use it in
5348 Holger's suggestions. Added info about how to use it in
5325 PYTHONSTARTUP.
5349 PYTHONSTARTUP.
5326
5350
5327 * IPython/Shell.py (IPythonShell): changed the options passing
5351 * IPython/Shell.py (IPythonShell): changed the options passing
5328 from a string with funky %s replacements to a straight list. Maybe
5352 from a string with funky %s replacements to a straight list. Maybe
5329 a bit more typing, but it follows sys.argv conventions, so there's
5353 a bit more typing, but it follows sys.argv conventions, so there's
5330 less special-casing to remember.
5354 less special-casing to remember.
5331
5355
5332 2002-06-12 Fernando Perez <fperez@colorado.edu>
5356 2002-06-12 Fernando Perez <fperez@colorado.edu>
5333
5357
5334 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5358 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5335 command. Thanks to a suggestion by Mike Heeter.
5359 command. Thanks to a suggestion by Mike Heeter.
5336 (Magic.magic_pfile): added behavior to look at filenames if given
5360 (Magic.magic_pfile): added behavior to look at filenames if given
5337 arg is not a defined object.
5361 arg is not a defined object.
5338 (Magic.magic_save): New @save function to save code snippets. Also
5362 (Magic.magic_save): New @save function to save code snippets. Also
5339 a Mike Heeter idea.
5363 a Mike Heeter idea.
5340
5364
5341 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5365 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5342 plot() and replot(). Much more convenient now, especially for
5366 plot() and replot(). Much more convenient now, especially for
5343 interactive use.
5367 interactive use.
5344
5368
5345 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5369 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5346 filenames.
5370 filenames.
5347
5371
5348 2002-06-02 Fernando Perez <fperez@colorado.edu>
5372 2002-06-02 Fernando Perez <fperez@colorado.edu>
5349
5373
5350 * IPython/Struct.py (Struct.__init__): modified to admit
5374 * IPython/Struct.py (Struct.__init__): modified to admit
5351 initialization via another struct.
5375 initialization via another struct.
5352
5376
5353 * IPython/genutils.py (SystemExec.__init__): New stateful
5377 * IPython/genutils.py (SystemExec.__init__): New stateful
5354 interface to xsys and bq. Useful for writing system scripts.
5378 interface to xsys and bq. Useful for writing system scripts.
5355
5379
5356 2002-05-30 Fernando Perez <fperez@colorado.edu>
5380 2002-05-30 Fernando Perez <fperez@colorado.edu>
5357
5381
5358 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5382 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5359 documents. This will make the user download smaller (it's getting
5383 documents. This will make the user download smaller (it's getting
5360 too big).
5384 too big).
5361
5385
5362 2002-05-29 Fernando Perez <fperez@colorado.edu>
5386 2002-05-29 Fernando Perez <fperez@colorado.edu>
5363
5387
5364 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5388 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5365 fix problems with shelve and pickle. Seems to work, but I don't
5389 fix problems with shelve and pickle. Seems to work, but I don't
5366 know if corner cases break it. Thanks to Mike Heeter
5390 know if corner cases break it. Thanks to Mike Heeter
5367 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5391 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5368
5392
5369 2002-05-24 Fernando Perez <fperez@colorado.edu>
5393 2002-05-24 Fernando Perez <fperez@colorado.edu>
5370
5394
5371 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5395 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5372 macros having broken.
5396 macros having broken.
5373
5397
5374 2002-05-21 Fernando Perez <fperez@colorado.edu>
5398 2002-05-21 Fernando Perez <fperez@colorado.edu>
5375
5399
5376 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5400 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5377 introduced logging bug: all history before logging started was
5401 introduced logging bug: all history before logging started was
5378 being written one character per line! This came from the redesign
5402 being written one character per line! This came from the redesign
5379 of the input history as a special list which slices to strings,
5403 of the input history as a special list which slices to strings,
5380 not to lists.
5404 not to lists.
5381
5405
5382 2002-05-20 Fernando Perez <fperez@colorado.edu>
5406 2002-05-20 Fernando Perez <fperez@colorado.edu>
5383
5407
5384 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5408 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5385 be an attribute of all classes in this module. The design of these
5409 be an attribute of all classes in this module. The design of these
5386 classes needs some serious overhauling.
5410 classes needs some serious overhauling.
5387
5411
5388 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5412 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5389 which was ignoring '_' in option names.
5413 which was ignoring '_' in option names.
5390
5414
5391 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5415 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5392 'Verbose_novars' to 'Context' and made it the new default. It's a
5416 'Verbose_novars' to 'Context' and made it the new default. It's a
5393 bit more readable and also safer than verbose.
5417 bit more readable and also safer than verbose.
5394
5418
5395 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5419 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5396 triple-quoted strings.
5420 triple-quoted strings.
5397
5421
5398 * IPython/OInspect.py (__all__): new module exposing the object
5422 * IPython/OInspect.py (__all__): new module exposing the object
5399 introspection facilities. Now the corresponding magics are dummy
5423 introspection facilities. Now the corresponding magics are dummy
5400 wrappers around this. Having this module will make it much easier
5424 wrappers around this. Having this module will make it much easier
5401 to put these functions into our modified pdb.
5425 to put these functions into our modified pdb.
5402 This new object inspector system uses the new colorizing module,
5426 This new object inspector system uses the new colorizing module,
5403 so source code and other things are nicely syntax highlighted.
5427 so source code and other things are nicely syntax highlighted.
5404
5428
5405 2002-05-18 Fernando Perez <fperez@colorado.edu>
5429 2002-05-18 Fernando Perez <fperez@colorado.edu>
5406
5430
5407 * IPython/ColorANSI.py: Split the coloring tools into a separate
5431 * IPython/ColorANSI.py: Split the coloring tools into a separate
5408 module so I can use them in other code easier (they were part of
5432 module so I can use them in other code easier (they were part of
5409 ultraTB).
5433 ultraTB).
5410
5434
5411 2002-05-17 Fernando Perez <fperez@colorado.edu>
5435 2002-05-17 Fernando Perez <fperez@colorado.edu>
5412
5436
5413 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5437 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5414 fixed it to set the global 'g' also to the called instance, as
5438 fixed it to set the global 'g' also to the called instance, as
5415 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5439 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5416 user's 'g' variables).
5440 user's 'g' variables).
5417
5441
5418 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5442 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5419 global variables (aliases to _ih,_oh) so that users which expect
5443 global variables (aliases to _ih,_oh) so that users which expect
5420 In[5] or Out[7] to work aren't unpleasantly surprised.
5444 In[5] or Out[7] to work aren't unpleasantly surprised.
5421 (InputList.__getslice__): new class to allow executing slices of
5445 (InputList.__getslice__): new class to allow executing slices of
5422 input history directly. Very simple class, complements the use of
5446 input history directly. Very simple class, complements the use of
5423 macros.
5447 macros.
5424
5448
5425 2002-05-16 Fernando Perez <fperez@colorado.edu>
5449 2002-05-16 Fernando Perez <fperez@colorado.edu>
5426
5450
5427 * setup.py (docdirbase): make doc directory be just doc/IPython
5451 * setup.py (docdirbase): make doc directory be just doc/IPython
5428 without version numbers, it will reduce clutter for users.
5452 without version numbers, it will reduce clutter for users.
5429
5453
5430 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5454 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5431 execfile call to prevent possible memory leak. See for details:
5455 execfile call to prevent possible memory leak. See for details:
5432 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5456 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5433
5457
5434 2002-05-15 Fernando Perez <fperez@colorado.edu>
5458 2002-05-15 Fernando Perez <fperez@colorado.edu>
5435
5459
5436 * IPython/Magic.py (Magic.magic_psource): made the object
5460 * IPython/Magic.py (Magic.magic_psource): made the object
5437 introspection names be more standard: pdoc, pdef, pfile and
5461 introspection names be more standard: pdoc, pdef, pfile and
5438 psource. They all print/page their output, and it makes
5462 psource. They all print/page their output, and it makes
5439 remembering them easier. Kept old names for compatibility as
5463 remembering them easier. Kept old names for compatibility as
5440 aliases.
5464 aliases.
5441
5465
5442 2002-05-14 Fernando Perez <fperez@colorado.edu>
5466 2002-05-14 Fernando Perez <fperez@colorado.edu>
5443
5467
5444 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5468 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5445 what the mouse problem was. The trick is to use gnuplot with temp
5469 what the mouse problem was. The trick is to use gnuplot with temp
5446 files and NOT with pipes (for data communication), because having
5470 files and NOT with pipes (for data communication), because having
5447 both pipes and the mouse on is bad news.
5471 both pipes and the mouse on is bad news.
5448
5472
5449 2002-05-13 Fernando Perez <fperez@colorado.edu>
5473 2002-05-13 Fernando Perez <fperez@colorado.edu>
5450
5474
5451 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5475 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5452 bug. Information would be reported about builtins even when
5476 bug. Information would be reported about builtins even when
5453 user-defined functions overrode them.
5477 user-defined functions overrode them.
5454
5478
5455 2002-05-11 Fernando Perez <fperez@colorado.edu>
5479 2002-05-11 Fernando Perez <fperez@colorado.edu>
5456
5480
5457 * IPython/__init__.py (__all__): removed FlexCompleter from
5481 * IPython/__init__.py (__all__): removed FlexCompleter from
5458 __all__ so that things don't fail in platforms without readline.
5482 __all__ so that things don't fail in platforms without readline.
5459
5483
5460 2002-05-10 Fernando Perez <fperez@colorado.edu>
5484 2002-05-10 Fernando Perez <fperez@colorado.edu>
5461
5485
5462 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5486 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5463 it requires Numeric, effectively making Numeric a dependency for
5487 it requires Numeric, effectively making Numeric a dependency for
5464 IPython.
5488 IPython.
5465
5489
5466 * Released 0.2.13
5490 * Released 0.2.13
5467
5491
5468 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5492 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5469 profiler interface. Now all the major options from the profiler
5493 profiler interface. Now all the major options from the profiler
5470 module are directly supported in IPython, both for single
5494 module are directly supported in IPython, both for single
5471 expressions (@prun) and for full programs (@run -p).
5495 expressions (@prun) and for full programs (@run -p).
5472
5496
5473 2002-05-09 Fernando Perez <fperez@colorado.edu>
5497 2002-05-09 Fernando Perez <fperez@colorado.edu>
5474
5498
5475 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5499 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5476 magic properly formatted for screen.
5500 magic properly formatted for screen.
5477
5501
5478 * setup.py (make_shortcut): Changed things to put pdf version in
5502 * setup.py (make_shortcut): Changed things to put pdf version in
5479 doc/ instead of doc/manual (had to change lyxport a bit).
5503 doc/ instead of doc/manual (had to change lyxport a bit).
5480
5504
5481 * IPython/Magic.py (Profile.string_stats): made profile runs go
5505 * IPython/Magic.py (Profile.string_stats): made profile runs go
5482 through pager (they are long and a pager allows searching, saving,
5506 through pager (they are long and a pager allows searching, saving,
5483 etc.)
5507 etc.)
5484
5508
5485 2002-05-08 Fernando Perez <fperez@colorado.edu>
5509 2002-05-08 Fernando Perez <fperez@colorado.edu>
5486
5510
5487 * Released 0.2.12
5511 * Released 0.2.12
5488
5512
5489 2002-05-06 Fernando Perez <fperez@colorado.edu>
5513 2002-05-06 Fernando Perez <fperez@colorado.edu>
5490
5514
5491 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5515 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5492 introduced); 'hist n1 n2' was broken.
5516 introduced); 'hist n1 n2' was broken.
5493 (Magic.magic_pdb): added optional on/off arguments to @pdb
5517 (Magic.magic_pdb): added optional on/off arguments to @pdb
5494 (Magic.magic_run): added option -i to @run, which executes code in
5518 (Magic.magic_run): added option -i to @run, which executes code in
5495 the IPython namespace instead of a clean one. Also added @irun as
5519 the IPython namespace instead of a clean one. Also added @irun as
5496 an alias to @run -i.
5520 an alias to @run -i.
5497
5521
5498 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5522 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5499 fixed (it didn't really do anything, the namespaces were wrong).
5523 fixed (it didn't really do anything, the namespaces were wrong).
5500
5524
5501 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5525 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5502
5526
5503 * IPython/__init__.py (__all__): Fixed package namespace, now
5527 * IPython/__init__.py (__all__): Fixed package namespace, now
5504 'import IPython' does give access to IPython.<all> as
5528 'import IPython' does give access to IPython.<all> as
5505 expected. Also renamed __release__ to Release.
5529 expected. Also renamed __release__ to Release.
5506
5530
5507 * IPython/Debugger.py (__license__): created new Pdb class which
5531 * IPython/Debugger.py (__license__): created new Pdb class which
5508 functions like a drop-in for the normal pdb.Pdb but does NOT
5532 functions like a drop-in for the normal pdb.Pdb but does NOT
5509 import readline by default. This way it doesn't muck up IPython's
5533 import readline by default. This way it doesn't muck up IPython's
5510 readline handling, and now tab-completion finally works in the
5534 readline handling, and now tab-completion finally works in the
5511 debugger -- sort of. It completes things globally visible, but the
5535 debugger -- sort of. It completes things globally visible, but the
5512 completer doesn't track the stack as pdb walks it. That's a bit
5536 completer doesn't track the stack as pdb walks it. That's a bit
5513 tricky, and I'll have to implement it later.
5537 tricky, and I'll have to implement it later.
5514
5538
5515 2002-05-05 Fernando Perez <fperez@colorado.edu>
5539 2002-05-05 Fernando Perez <fperez@colorado.edu>
5516
5540
5517 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5541 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5518 magic docstrings when printed via ? (explicit \'s were being
5542 magic docstrings when printed via ? (explicit \'s were being
5519 printed).
5543 printed).
5520
5544
5521 * IPython/ipmaker.py (make_IPython): fixed namespace
5545 * IPython/ipmaker.py (make_IPython): fixed namespace
5522 identification bug. Now variables loaded via logs or command-line
5546 identification bug. Now variables loaded via logs or command-line
5523 files are recognized in the interactive namespace by @who.
5547 files are recognized in the interactive namespace by @who.
5524
5548
5525 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5549 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5526 log replay system stemming from the string form of Structs.
5550 log replay system stemming from the string form of Structs.
5527
5551
5528 * IPython/Magic.py (Macro.__init__): improved macros to properly
5552 * IPython/Magic.py (Macro.__init__): improved macros to properly
5529 handle magic commands in them.
5553 handle magic commands in them.
5530 (Magic.magic_logstart): usernames are now expanded so 'logstart
5554 (Magic.magic_logstart): usernames are now expanded so 'logstart
5531 ~/mylog' now works.
5555 ~/mylog' now works.
5532
5556
5533 * IPython/iplib.py (complete): fixed bug where paths starting with
5557 * IPython/iplib.py (complete): fixed bug where paths starting with
5534 '/' would be completed as magic names.
5558 '/' would be completed as magic names.
5535
5559
5536 2002-05-04 Fernando Perez <fperez@colorado.edu>
5560 2002-05-04 Fernando Perez <fperez@colorado.edu>
5537
5561
5538 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5562 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5539 allow running full programs under the profiler's control.
5563 allow running full programs under the profiler's control.
5540
5564
5541 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5565 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5542 mode to report exceptions verbosely but without formatting
5566 mode to report exceptions verbosely but without formatting
5543 variables. This addresses the issue of ipython 'freezing' (it's
5567 variables. This addresses the issue of ipython 'freezing' (it's
5544 not frozen, but caught in an expensive formatting loop) when huge
5568 not frozen, but caught in an expensive formatting loop) when huge
5545 variables are in the context of an exception.
5569 variables are in the context of an exception.
5546 (VerboseTB.text): Added '--->' markers at line where exception was
5570 (VerboseTB.text): Added '--->' markers at line where exception was
5547 triggered. Much clearer to read, especially in NoColor modes.
5571 triggered. Much clearer to read, especially in NoColor modes.
5548
5572
5549 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5573 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5550 implemented in reverse when changing to the new parse_options().
5574 implemented in reverse when changing to the new parse_options().
5551
5575
5552 2002-05-03 Fernando Perez <fperez@colorado.edu>
5576 2002-05-03 Fernando Perez <fperez@colorado.edu>
5553
5577
5554 * IPython/Magic.py (Magic.parse_options): new function so that
5578 * IPython/Magic.py (Magic.parse_options): new function so that
5555 magics can parse options easier.
5579 magics can parse options easier.
5556 (Magic.magic_prun): new function similar to profile.run(),
5580 (Magic.magic_prun): new function similar to profile.run(),
5557 suggested by Chris Hart.
5581 suggested by Chris Hart.
5558 (Magic.magic_cd): fixed behavior so that it only changes if
5582 (Magic.magic_cd): fixed behavior so that it only changes if
5559 directory actually is in history.
5583 directory actually is in history.
5560
5584
5561 * IPython/usage.py (__doc__): added information about potential
5585 * IPython/usage.py (__doc__): added information about potential
5562 slowness of Verbose exception mode when there are huge data
5586 slowness of Verbose exception mode when there are huge data
5563 structures to be formatted (thanks to Archie Paulson).
5587 structures to be formatted (thanks to Archie Paulson).
5564
5588
5565 * IPython/ipmaker.py (make_IPython): Changed default logging
5589 * IPython/ipmaker.py (make_IPython): Changed default logging
5566 (when simply called with -log) to use curr_dir/ipython.log in
5590 (when simply called with -log) to use curr_dir/ipython.log in
5567 rotate mode. Fixed crash which was occuring with -log before
5591 rotate mode. Fixed crash which was occuring with -log before
5568 (thanks to Jim Boyle).
5592 (thanks to Jim Boyle).
5569
5593
5570 2002-05-01 Fernando Perez <fperez@colorado.edu>
5594 2002-05-01 Fernando Perez <fperez@colorado.edu>
5571
5595
5572 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5596 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5573 was nasty -- though somewhat of a corner case).
5597 was nasty -- though somewhat of a corner case).
5574
5598
5575 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5599 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5576 text (was a bug).
5600 text (was a bug).
5577
5601
5578 2002-04-30 Fernando Perez <fperez@colorado.edu>
5602 2002-04-30 Fernando Perez <fperez@colorado.edu>
5579
5603
5580 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5604 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5581 a print after ^D or ^C from the user so that the In[] prompt
5605 a print after ^D or ^C from the user so that the In[] prompt
5582 doesn't over-run the gnuplot one.
5606 doesn't over-run the gnuplot one.
5583
5607
5584 2002-04-29 Fernando Perez <fperez@colorado.edu>
5608 2002-04-29 Fernando Perez <fperez@colorado.edu>
5585
5609
5586 * Released 0.2.10
5610 * Released 0.2.10
5587
5611
5588 * IPython/__release__.py (version): get date dynamically.
5612 * IPython/__release__.py (version): get date dynamically.
5589
5613
5590 * Misc. documentation updates thanks to Arnd's comments. Also ran
5614 * Misc. documentation updates thanks to Arnd's comments. Also ran
5591 a full spellcheck on the manual (hadn't been done in a while).
5615 a full spellcheck on the manual (hadn't been done in a while).
5592
5616
5593 2002-04-27 Fernando Perez <fperez@colorado.edu>
5617 2002-04-27 Fernando Perez <fperez@colorado.edu>
5594
5618
5595 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5619 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5596 starting a log in mid-session would reset the input history list.
5620 starting a log in mid-session would reset the input history list.
5597
5621
5598 2002-04-26 Fernando Perez <fperez@colorado.edu>
5622 2002-04-26 Fernando Perez <fperez@colorado.edu>
5599
5623
5600 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5624 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5601 all files were being included in an update. Now anything in
5625 all files were being included in an update. Now anything in
5602 UserConfig that matches [A-Za-z]*.py will go (this excludes
5626 UserConfig that matches [A-Za-z]*.py will go (this excludes
5603 __init__.py)
5627 __init__.py)
5604
5628
5605 2002-04-25 Fernando Perez <fperez@colorado.edu>
5629 2002-04-25 Fernando Perez <fperez@colorado.edu>
5606
5630
5607 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5631 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5608 to __builtins__ so that any form of embedded or imported code can
5632 to __builtins__ so that any form of embedded or imported code can
5609 test for being inside IPython.
5633 test for being inside IPython.
5610
5634
5611 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5635 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5612 changed to GnuplotMagic because it's now an importable module,
5636 changed to GnuplotMagic because it's now an importable module,
5613 this makes the name follow that of the standard Gnuplot module.
5637 this makes the name follow that of the standard Gnuplot module.
5614 GnuplotMagic can now be loaded at any time in mid-session.
5638 GnuplotMagic can now be loaded at any time in mid-session.
5615
5639
5616 2002-04-24 Fernando Perez <fperez@colorado.edu>
5640 2002-04-24 Fernando Perez <fperez@colorado.edu>
5617
5641
5618 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5642 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5619 the globals (IPython has its own namespace) and the
5643 the globals (IPython has its own namespace) and the
5620 PhysicalQuantity stuff is much better anyway.
5644 PhysicalQuantity stuff is much better anyway.
5621
5645
5622 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5646 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5623 embedding example to standard user directory for
5647 embedding example to standard user directory for
5624 distribution. Also put it in the manual.
5648 distribution. Also put it in the manual.
5625
5649
5626 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5650 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5627 instance as first argument (so it doesn't rely on some obscure
5651 instance as first argument (so it doesn't rely on some obscure
5628 hidden global).
5652 hidden global).
5629
5653
5630 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5654 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5631 delimiters. While it prevents ().TAB from working, it allows
5655 delimiters. While it prevents ().TAB from working, it allows
5632 completions in open (... expressions. This is by far a more common
5656 completions in open (... expressions. This is by far a more common
5633 case.
5657 case.
5634
5658
5635 2002-04-23 Fernando Perez <fperez@colorado.edu>
5659 2002-04-23 Fernando Perez <fperez@colorado.edu>
5636
5660
5637 * IPython/Extensions/InterpreterPasteInput.py: new
5661 * IPython/Extensions/InterpreterPasteInput.py: new
5638 syntax-processing module for pasting lines with >>> or ... at the
5662 syntax-processing module for pasting lines with >>> or ... at the
5639 start.
5663 start.
5640
5664
5641 * IPython/Extensions/PhysicalQ_Interactive.py
5665 * IPython/Extensions/PhysicalQ_Interactive.py
5642 (PhysicalQuantityInteractive.__int__): fixed to work with either
5666 (PhysicalQuantityInteractive.__int__): fixed to work with either
5643 Numeric or math.
5667 Numeric or math.
5644
5668
5645 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5669 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5646 provided profiles. Now we have:
5670 provided profiles. Now we have:
5647 -math -> math module as * and cmath with its own namespace.
5671 -math -> math module as * and cmath with its own namespace.
5648 -numeric -> Numeric as *, plus gnuplot & grace
5672 -numeric -> Numeric as *, plus gnuplot & grace
5649 -physics -> same as before
5673 -physics -> same as before
5650
5674
5651 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5675 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5652 user-defined magics wouldn't be found by @magic if they were
5676 user-defined magics wouldn't be found by @magic if they were
5653 defined as class methods. Also cleaned up the namespace search
5677 defined as class methods. Also cleaned up the namespace search
5654 logic and the string building (to use %s instead of many repeated
5678 logic and the string building (to use %s instead of many repeated
5655 string adds).
5679 string adds).
5656
5680
5657 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5681 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5658 of user-defined magics to operate with class methods (cleaner, in
5682 of user-defined magics to operate with class methods (cleaner, in
5659 line with the gnuplot code).
5683 line with the gnuplot code).
5660
5684
5661 2002-04-22 Fernando Perez <fperez@colorado.edu>
5685 2002-04-22 Fernando Perez <fperez@colorado.edu>
5662
5686
5663 * setup.py: updated dependency list so that manual is updated when
5687 * setup.py: updated dependency list so that manual is updated when
5664 all included files change.
5688 all included files change.
5665
5689
5666 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5690 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5667 the delimiter removal option (the fix is ugly right now).
5691 the delimiter removal option (the fix is ugly right now).
5668
5692
5669 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5693 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5670 all of the math profile (quicker loading, no conflict between
5694 all of the math profile (quicker loading, no conflict between
5671 g-9.8 and g-gnuplot).
5695 g-9.8 and g-gnuplot).
5672
5696
5673 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5697 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5674 name of post-mortem files to IPython_crash_report.txt.
5698 name of post-mortem files to IPython_crash_report.txt.
5675
5699
5676 * Cleanup/update of the docs. Added all the new readline info and
5700 * Cleanup/update of the docs. Added all the new readline info and
5677 formatted all lists as 'real lists'.
5701 formatted all lists as 'real lists'.
5678
5702
5679 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5703 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5680 tab-completion options, since the full readline parse_and_bind is
5704 tab-completion options, since the full readline parse_and_bind is
5681 now accessible.
5705 now accessible.
5682
5706
5683 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5707 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5684 handling of readline options. Now users can specify any string to
5708 handling of readline options. Now users can specify any string to
5685 be passed to parse_and_bind(), as well as the delimiters to be
5709 be passed to parse_and_bind(), as well as the delimiters to be
5686 removed.
5710 removed.
5687 (InteractiveShell.__init__): Added __name__ to the global
5711 (InteractiveShell.__init__): Added __name__ to the global
5688 namespace so that things like Itpl which rely on its existence
5712 namespace so that things like Itpl which rely on its existence
5689 don't crash.
5713 don't crash.
5690 (InteractiveShell._prefilter): Defined the default with a _ so
5714 (InteractiveShell._prefilter): Defined the default with a _ so
5691 that prefilter() is easier to override, while the default one
5715 that prefilter() is easier to override, while the default one
5692 remains available.
5716 remains available.
5693
5717
5694 2002-04-18 Fernando Perez <fperez@colorado.edu>
5718 2002-04-18 Fernando Perez <fperez@colorado.edu>
5695
5719
5696 * Added information about pdb in the docs.
5720 * Added information about pdb in the docs.
5697
5721
5698 2002-04-17 Fernando Perez <fperez@colorado.edu>
5722 2002-04-17 Fernando Perez <fperez@colorado.edu>
5699
5723
5700 * IPython/ipmaker.py (make_IPython): added rc_override option to
5724 * IPython/ipmaker.py (make_IPython): added rc_override option to
5701 allow passing config options at creation time which may override
5725 allow passing config options at creation time which may override
5702 anything set in the config files or command line. This is
5726 anything set in the config files or command line. This is
5703 particularly useful for configuring embedded instances.
5727 particularly useful for configuring embedded instances.
5704
5728
5705 2002-04-15 Fernando Perez <fperez@colorado.edu>
5729 2002-04-15 Fernando Perez <fperez@colorado.edu>
5706
5730
5707 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5731 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5708 crash embedded instances because of the input cache falling out of
5732 crash embedded instances because of the input cache falling out of
5709 sync with the output counter.
5733 sync with the output counter.
5710
5734
5711 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5735 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5712 mode which calls pdb after an uncaught exception in IPython itself.
5736 mode which calls pdb after an uncaught exception in IPython itself.
5713
5737
5714 2002-04-14 Fernando Perez <fperez@colorado.edu>
5738 2002-04-14 Fernando Perez <fperez@colorado.edu>
5715
5739
5716 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5740 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5717 readline, fix it back after each call.
5741 readline, fix it back after each call.
5718
5742
5719 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5743 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5720 method to force all access via __call__(), which guarantees that
5744 method to force all access via __call__(), which guarantees that
5721 traceback references are properly deleted.
5745 traceback references are properly deleted.
5722
5746
5723 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5747 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5724 improve printing when pprint is in use.
5748 improve printing when pprint is in use.
5725
5749
5726 2002-04-13 Fernando Perez <fperez@colorado.edu>
5750 2002-04-13 Fernando Perez <fperez@colorado.edu>
5727
5751
5728 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5752 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5729 exceptions aren't caught anymore. If the user triggers one, he
5753 exceptions aren't caught anymore. If the user triggers one, he
5730 should know why he's doing it and it should go all the way up,
5754 should know why he's doing it and it should go all the way up,
5731 just like any other exception. So now @abort will fully kill the
5755 just like any other exception. So now @abort will fully kill the
5732 embedded interpreter and the embedding code (unless that happens
5756 embedded interpreter and the embedding code (unless that happens
5733 to catch SystemExit).
5757 to catch SystemExit).
5734
5758
5735 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5759 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5736 and a debugger() method to invoke the interactive pdb debugger
5760 and a debugger() method to invoke the interactive pdb debugger
5737 after printing exception information. Also added the corresponding
5761 after printing exception information. Also added the corresponding
5738 -pdb option and @pdb magic to control this feature, and updated
5762 -pdb option and @pdb magic to control this feature, and updated
5739 the docs. After a suggestion from Christopher Hart
5763 the docs. After a suggestion from Christopher Hart
5740 (hart-AT-caltech.edu).
5764 (hart-AT-caltech.edu).
5741
5765
5742 2002-04-12 Fernando Perez <fperez@colorado.edu>
5766 2002-04-12 Fernando Perez <fperez@colorado.edu>
5743
5767
5744 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5768 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5745 the exception handlers defined by the user (not the CrashHandler)
5769 the exception handlers defined by the user (not the CrashHandler)
5746 so that user exceptions don't trigger an ipython bug report.
5770 so that user exceptions don't trigger an ipython bug report.
5747
5771
5748 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5772 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5749 configurable (it should have always been so).
5773 configurable (it should have always been so).
5750
5774
5751 2002-03-26 Fernando Perez <fperez@colorado.edu>
5775 2002-03-26 Fernando Perez <fperez@colorado.edu>
5752
5776
5753 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5777 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5754 and there to fix embedding namespace issues. This should all be
5778 and there to fix embedding namespace issues. This should all be
5755 done in a more elegant way.
5779 done in a more elegant way.
5756
5780
5757 2002-03-25 Fernando Perez <fperez@colorado.edu>
5781 2002-03-25 Fernando Perez <fperez@colorado.edu>
5758
5782
5759 * IPython/genutils.py (get_home_dir): Try to make it work under
5783 * IPython/genutils.py (get_home_dir): Try to make it work under
5760 win9x also.
5784 win9x also.
5761
5785
5762 2002-03-20 Fernando Perez <fperez@colorado.edu>
5786 2002-03-20 Fernando Perez <fperez@colorado.edu>
5763
5787
5764 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5788 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5765 sys.displayhook untouched upon __init__.
5789 sys.displayhook untouched upon __init__.
5766
5790
5767 2002-03-19 Fernando Perez <fperez@colorado.edu>
5791 2002-03-19 Fernando Perez <fperez@colorado.edu>
5768
5792
5769 * Released 0.2.9 (for embedding bug, basically).
5793 * Released 0.2.9 (for embedding bug, basically).
5770
5794
5771 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5795 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5772 exceptions so that enclosing shell's state can be restored.
5796 exceptions so that enclosing shell's state can be restored.
5773
5797
5774 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5798 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5775 naming conventions in the .ipython/ dir.
5799 naming conventions in the .ipython/ dir.
5776
5800
5777 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5801 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5778 from delimiters list so filenames with - in them get expanded.
5802 from delimiters list so filenames with - in them get expanded.
5779
5803
5780 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5804 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5781 sys.displayhook not being properly restored after an embedded call.
5805 sys.displayhook not being properly restored after an embedded call.
5782
5806
5783 2002-03-18 Fernando Perez <fperez@colorado.edu>
5807 2002-03-18 Fernando Perez <fperez@colorado.edu>
5784
5808
5785 * Released 0.2.8
5809 * Released 0.2.8
5786
5810
5787 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5811 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5788 some files weren't being included in a -upgrade.
5812 some files weren't being included in a -upgrade.
5789 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5813 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5790 on' so that the first tab completes.
5814 on' so that the first tab completes.
5791 (InteractiveShell.handle_magic): fixed bug with spaces around
5815 (InteractiveShell.handle_magic): fixed bug with spaces around
5792 quotes breaking many magic commands.
5816 quotes breaking many magic commands.
5793
5817
5794 * setup.py: added note about ignoring the syntax error messages at
5818 * setup.py: added note about ignoring the syntax error messages at
5795 installation.
5819 installation.
5796
5820
5797 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5821 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5798 streamlining the gnuplot interface, now there's only one magic @gp.
5822 streamlining the gnuplot interface, now there's only one magic @gp.
5799
5823
5800 2002-03-17 Fernando Perez <fperez@colorado.edu>
5824 2002-03-17 Fernando Perez <fperez@colorado.edu>
5801
5825
5802 * IPython/UserConfig/magic_gnuplot.py: new name for the
5826 * IPython/UserConfig/magic_gnuplot.py: new name for the
5803 example-magic_pm.py file. Much enhanced system, now with a shell
5827 example-magic_pm.py file. Much enhanced system, now with a shell
5804 for communicating directly with gnuplot, one command at a time.
5828 for communicating directly with gnuplot, one command at a time.
5805
5829
5806 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5830 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5807 setting __name__=='__main__'.
5831 setting __name__=='__main__'.
5808
5832
5809 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5833 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5810 mini-shell for accessing gnuplot from inside ipython. Should
5834 mini-shell for accessing gnuplot from inside ipython. Should
5811 extend it later for grace access too. Inspired by Arnd's
5835 extend it later for grace access too. Inspired by Arnd's
5812 suggestion.
5836 suggestion.
5813
5837
5814 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5838 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5815 calling magic functions with () in their arguments. Thanks to Arnd
5839 calling magic functions with () in their arguments. Thanks to Arnd
5816 Baecker for pointing this to me.
5840 Baecker for pointing this to me.
5817
5841
5818 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5842 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5819 infinitely for integer or complex arrays (only worked with floats).
5843 infinitely for integer or complex arrays (only worked with floats).
5820
5844
5821 2002-03-16 Fernando Perez <fperez@colorado.edu>
5845 2002-03-16 Fernando Perez <fperez@colorado.edu>
5822
5846
5823 * setup.py: Merged setup and setup_windows into a single script
5847 * setup.py: Merged setup and setup_windows into a single script
5824 which properly handles things for windows users.
5848 which properly handles things for windows users.
5825
5849
5826 2002-03-15 Fernando Perez <fperez@colorado.edu>
5850 2002-03-15 Fernando Perez <fperez@colorado.edu>
5827
5851
5828 * Big change to the manual: now the magics are all automatically
5852 * Big change to the manual: now the magics are all automatically
5829 documented. This information is generated from their docstrings
5853 documented. This information is generated from their docstrings
5830 and put in a latex file included by the manual lyx file. This way
5854 and put in a latex file included by the manual lyx file. This way
5831 we get always up to date information for the magics. The manual
5855 we get always up to date information for the magics. The manual
5832 now also has proper version information, also auto-synced.
5856 now also has proper version information, also auto-synced.
5833
5857
5834 For this to work, an undocumented --magic_docstrings option was added.
5858 For this to work, an undocumented --magic_docstrings option was added.
5835
5859
5836 2002-03-13 Fernando Perez <fperez@colorado.edu>
5860 2002-03-13 Fernando Perez <fperez@colorado.edu>
5837
5861
5838 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5862 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5839 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5863 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5840
5864
5841 2002-03-12 Fernando Perez <fperez@colorado.edu>
5865 2002-03-12 Fernando Perez <fperez@colorado.edu>
5842
5866
5843 * IPython/ultraTB.py (TermColors): changed color escapes again to
5867 * IPython/ultraTB.py (TermColors): changed color escapes again to
5844 fix the (old, reintroduced) line-wrapping bug. Basically, if
5868 fix the (old, reintroduced) line-wrapping bug. Basically, if
5845 \001..\002 aren't given in the color escapes, lines get wrapped
5869 \001..\002 aren't given in the color escapes, lines get wrapped
5846 weirdly. But giving those screws up old xterms and emacs terms. So
5870 weirdly. But giving those screws up old xterms and emacs terms. So
5847 I added some logic for emacs terms to be ok, but I can't identify old
5871 I added some logic for emacs terms to be ok, but I can't identify old
5848 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5872 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5849
5873
5850 2002-03-10 Fernando Perez <fperez@colorado.edu>
5874 2002-03-10 Fernando Perez <fperez@colorado.edu>
5851
5875
5852 * IPython/usage.py (__doc__): Various documentation cleanups and
5876 * IPython/usage.py (__doc__): Various documentation cleanups and
5853 updates, both in usage docstrings and in the manual.
5877 updates, both in usage docstrings and in the manual.
5854
5878
5855 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5879 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5856 handling of caching. Set minimum acceptabe value for having a
5880 handling of caching. Set minimum acceptabe value for having a
5857 cache at 20 values.
5881 cache at 20 values.
5858
5882
5859 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5883 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5860 install_first_time function to a method, renamed it and added an
5884 install_first_time function to a method, renamed it and added an
5861 'upgrade' mode. Now people can update their config directory with
5885 'upgrade' mode. Now people can update their config directory with
5862 a simple command line switch (-upgrade, also new).
5886 a simple command line switch (-upgrade, also new).
5863
5887
5864 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5888 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5865 @file (convenient for automagic users under Python >= 2.2).
5889 @file (convenient for automagic users under Python >= 2.2).
5866 Removed @files (it seemed more like a plural than an abbrev. of
5890 Removed @files (it seemed more like a plural than an abbrev. of
5867 'file show').
5891 'file show').
5868
5892
5869 * IPython/iplib.py (install_first_time): Fixed crash if there were
5893 * IPython/iplib.py (install_first_time): Fixed crash if there were
5870 backup files ('~') in .ipython/ install directory.
5894 backup files ('~') in .ipython/ install directory.
5871
5895
5872 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5896 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5873 system. Things look fine, but these changes are fairly
5897 system. Things look fine, but these changes are fairly
5874 intrusive. Test them for a few days.
5898 intrusive. Test them for a few days.
5875
5899
5876 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5900 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5877 the prompts system. Now all in/out prompt strings are user
5901 the prompts system. Now all in/out prompt strings are user
5878 controllable. This is particularly useful for embedding, as one
5902 controllable. This is particularly useful for embedding, as one
5879 can tag embedded instances with particular prompts.
5903 can tag embedded instances with particular prompts.
5880
5904
5881 Also removed global use of sys.ps1/2, which now allows nested
5905 Also removed global use of sys.ps1/2, which now allows nested
5882 embeddings without any problems. Added command-line options for
5906 embeddings without any problems. Added command-line options for
5883 the prompt strings.
5907 the prompt strings.
5884
5908
5885 2002-03-08 Fernando Perez <fperez@colorado.edu>
5909 2002-03-08 Fernando Perez <fperez@colorado.edu>
5886
5910
5887 * IPython/UserConfig/example-embed-short.py (ipshell): added
5911 * IPython/UserConfig/example-embed-short.py (ipshell): added
5888 example file with the bare minimum code for embedding.
5912 example file with the bare minimum code for embedding.
5889
5913
5890 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5914 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5891 functionality for the embeddable shell to be activated/deactivated
5915 functionality for the embeddable shell to be activated/deactivated
5892 either globally or at each call.
5916 either globally or at each call.
5893
5917
5894 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5918 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5895 rewriting the prompt with '--->' for auto-inputs with proper
5919 rewriting the prompt with '--->' for auto-inputs with proper
5896 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5920 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5897 this is handled by the prompts class itself, as it should.
5921 this is handled by the prompts class itself, as it should.
5898
5922
5899 2002-03-05 Fernando Perez <fperez@colorado.edu>
5923 2002-03-05 Fernando Perez <fperez@colorado.edu>
5900
5924
5901 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5925 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5902 @logstart to avoid name clashes with the math log function.
5926 @logstart to avoid name clashes with the math log function.
5903
5927
5904 * Big updates to X/Emacs section of the manual.
5928 * Big updates to X/Emacs section of the manual.
5905
5929
5906 * Removed ipython_emacs. Milan explained to me how to pass
5930 * Removed ipython_emacs. Milan explained to me how to pass
5907 arguments to ipython through Emacs. Some day I'm going to end up
5931 arguments to ipython through Emacs. Some day I'm going to end up
5908 learning some lisp...
5932 learning some lisp...
5909
5933
5910 2002-03-04 Fernando Perez <fperez@colorado.edu>
5934 2002-03-04 Fernando Perez <fperez@colorado.edu>
5911
5935
5912 * IPython/ipython_emacs: Created script to be used as the
5936 * IPython/ipython_emacs: Created script to be used as the
5913 py-python-command Emacs variable so we can pass IPython
5937 py-python-command Emacs variable so we can pass IPython
5914 parameters. I can't figure out how to tell Emacs directly to pass
5938 parameters. I can't figure out how to tell Emacs directly to pass
5915 parameters to IPython, so a dummy shell script will do it.
5939 parameters to IPython, so a dummy shell script will do it.
5916
5940
5917 Other enhancements made for things to work better under Emacs'
5941 Other enhancements made for things to work better under Emacs'
5918 various types of terminals. Many thanks to Milan Zamazal
5942 various types of terminals. Many thanks to Milan Zamazal
5919 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5943 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5920
5944
5921 2002-03-01 Fernando Perez <fperez@colorado.edu>
5945 2002-03-01 Fernando Perez <fperez@colorado.edu>
5922
5946
5923 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5947 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5924 that loading of readline is now optional. This gives better
5948 that loading of readline is now optional. This gives better
5925 control to emacs users.
5949 control to emacs users.
5926
5950
5927 * IPython/ultraTB.py (__date__): Modified color escape sequences
5951 * IPython/ultraTB.py (__date__): Modified color escape sequences
5928 and now things work fine under xterm and in Emacs' term buffers
5952 and now things work fine under xterm and in Emacs' term buffers
5929 (though not shell ones). Well, in emacs you get colors, but all
5953 (though not shell ones). Well, in emacs you get colors, but all
5930 seem to be 'light' colors (no difference between dark and light
5954 seem to be 'light' colors (no difference between dark and light
5931 ones). But the garbage chars are gone, and also in xterms. It
5955 ones). But the garbage chars are gone, and also in xterms. It
5932 seems that now I'm using 'cleaner' ansi sequences.
5956 seems that now I'm using 'cleaner' ansi sequences.
5933
5957
5934 2002-02-21 Fernando Perez <fperez@colorado.edu>
5958 2002-02-21 Fernando Perez <fperez@colorado.edu>
5935
5959
5936 * Released 0.2.7 (mainly to publish the scoping fix).
5960 * Released 0.2.7 (mainly to publish the scoping fix).
5937
5961
5938 * IPython/Logger.py (Logger.logstate): added. A corresponding
5962 * IPython/Logger.py (Logger.logstate): added. A corresponding
5939 @logstate magic was created.
5963 @logstate magic was created.
5940
5964
5941 * IPython/Magic.py: fixed nested scoping problem under Python
5965 * IPython/Magic.py: fixed nested scoping problem under Python
5942 2.1.x (automagic wasn't working).
5966 2.1.x (automagic wasn't working).
5943
5967
5944 2002-02-20 Fernando Perez <fperez@colorado.edu>
5968 2002-02-20 Fernando Perez <fperez@colorado.edu>
5945
5969
5946 * Released 0.2.6.
5970 * Released 0.2.6.
5947
5971
5948 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5972 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5949 option so that logs can come out without any headers at all.
5973 option so that logs can come out without any headers at all.
5950
5974
5951 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5975 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5952 SciPy.
5976 SciPy.
5953
5977
5954 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5978 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5955 that embedded IPython calls don't require vars() to be explicitly
5979 that embedded IPython calls don't require vars() to be explicitly
5956 passed. Now they are extracted from the caller's frame (code
5980 passed. Now they are extracted from the caller's frame (code
5957 snatched from Eric Jones' weave). Added better documentation to
5981 snatched from Eric Jones' weave). Added better documentation to
5958 the section on embedding and the example file.
5982 the section on embedding and the example file.
5959
5983
5960 * IPython/genutils.py (page): Changed so that under emacs, it just
5984 * IPython/genutils.py (page): Changed so that under emacs, it just
5961 prints the string. You can then page up and down in the emacs
5985 prints the string. You can then page up and down in the emacs
5962 buffer itself. This is how the builtin help() works.
5986 buffer itself. This is how the builtin help() works.
5963
5987
5964 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5988 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5965 macro scoping: macros need to be executed in the user's namespace
5989 macro scoping: macros need to be executed in the user's namespace
5966 to work as if they had been typed by the user.
5990 to work as if they had been typed by the user.
5967
5991
5968 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5992 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5969 execute automatically (no need to type 'exec...'). They then
5993 execute automatically (no need to type 'exec...'). They then
5970 behave like 'true macros'. The printing system was also modified
5994 behave like 'true macros'. The printing system was also modified
5971 for this to work.
5995 for this to work.
5972
5996
5973 2002-02-19 Fernando Perez <fperez@colorado.edu>
5997 2002-02-19 Fernando Perez <fperez@colorado.edu>
5974
5998
5975 * IPython/genutils.py (page_file): new function for paging files
5999 * IPython/genutils.py (page_file): new function for paging files
5976 in an OS-independent way. Also necessary for file viewing to work
6000 in an OS-independent way. Also necessary for file viewing to work
5977 well inside Emacs buffers.
6001 well inside Emacs buffers.
5978 (page): Added checks for being in an emacs buffer.
6002 (page): Added checks for being in an emacs buffer.
5979 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6003 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5980 same bug in iplib.
6004 same bug in iplib.
5981
6005
5982 2002-02-18 Fernando Perez <fperez@colorado.edu>
6006 2002-02-18 Fernando Perez <fperez@colorado.edu>
5983
6007
5984 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6008 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5985 of readline so that IPython can work inside an Emacs buffer.
6009 of readline so that IPython can work inside an Emacs buffer.
5986
6010
5987 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6011 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5988 method signatures (they weren't really bugs, but it looks cleaner
6012 method signatures (they weren't really bugs, but it looks cleaner
5989 and keeps PyChecker happy).
6013 and keeps PyChecker happy).
5990
6014
5991 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6015 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5992 for implementing various user-defined hooks. Currently only
6016 for implementing various user-defined hooks. Currently only
5993 display is done.
6017 display is done.
5994
6018
5995 * IPython/Prompts.py (CachedOutput._display): changed display
6019 * IPython/Prompts.py (CachedOutput._display): changed display
5996 functions so that they can be dynamically changed by users easily.
6020 functions so that they can be dynamically changed by users easily.
5997
6021
5998 * IPython/Extensions/numeric_formats.py (num_display): added an
6022 * IPython/Extensions/numeric_formats.py (num_display): added an
5999 extension for printing NumPy arrays in flexible manners. It
6023 extension for printing NumPy arrays in flexible manners. It
6000 doesn't do anything yet, but all the structure is in
6024 doesn't do anything yet, but all the structure is in
6001 place. Ultimately the plan is to implement output format control
6025 place. Ultimately the plan is to implement output format control
6002 like in Octave.
6026 like in Octave.
6003
6027
6004 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6028 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6005 methods are found at run-time by all the automatic machinery.
6029 methods are found at run-time by all the automatic machinery.
6006
6030
6007 2002-02-17 Fernando Perez <fperez@colorado.edu>
6031 2002-02-17 Fernando Perez <fperez@colorado.edu>
6008
6032
6009 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6033 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6010 whole file a little.
6034 whole file a little.
6011
6035
6012 * ToDo: closed this document. Now there's a new_design.lyx
6036 * ToDo: closed this document. Now there's a new_design.lyx
6013 document for all new ideas. Added making a pdf of it for the
6037 document for all new ideas. Added making a pdf of it for the
6014 end-user distro.
6038 end-user distro.
6015
6039
6016 * IPython/Logger.py (Logger.switch_log): Created this to replace
6040 * IPython/Logger.py (Logger.switch_log): Created this to replace
6017 logon() and logoff(). It also fixes a nasty crash reported by
6041 logon() and logoff(). It also fixes a nasty crash reported by
6018 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6042 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6019
6043
6020 * IPython/iplib.py (complete): got auto-completion to work with
6044 * IPython/iplib.py (complete): got auto-completion to work with
6021 automagic (I had wanted this for a long time).
6045 automagic (I had wanted this for a long time).
6022
6046
6023 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6047 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6024 to @file, since file() is now a builtin and clashes with automagic
6048 to @file, since file() is now a builtin and clashes with automagic
6025 for @file.
6049 for @file.
6026
6050
6027 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6051 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6028 of this was previously in iplib, which had grown to more than 2000
6052 of this was previously in iplib, which had grown to more than 2000
6029 lines, way too long. No new functionality, but it makes managing
6053 lines, way too long. No new functionality, but it makes managing
6030 the code a bit easier.
6054 the code a bit easier.
6031
6055
6032 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6056 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6033 information to crash reports.
6057 information to crash reports.
6034
6058
6035 2002-02-12 Fernando Perez <fperez@colorado.edu>
6059 2002-02-12 Fernando Perez <fperez@colorado.edu>
6036
6060
6037 * Released 0.2.5.
6061 * Released 0.2.5.
6038
6062
6039 2002-02-11 Fernando Perez <fperez@colorado.edu>
6063 2002-02-11 Fernando Perez <fperez@colorado.edu>
6040
6064
6041 * Wrote a relatively complete Windows installer. It puts
6065 * Wrote a relatively complete Windows installer. It puts
6042 everything in place, creates Start Menu entries and fixes the
6066 everything in place, creates Start Menu entries and fixes the
6043 color issues. Nothing fancy, but it works.
6067 color issues. Nothing fancy, but it works.
6044
6068
6045 2002-02-10 Fernando Perez <fperez@colorado.edu>
6069 2002-02-10 Fernando Perez <fperez@colorado.edu>
6046
6070
6047 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6071 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6048 os.path.expanduser() call so that we can type @run ~/myfile.py and
6072 os.path.expanduser() call so that we can type @run ~/myfile.py and
6049 have thigs work as expected.
6073 have thigs work as expected.
6050
6074
6051 * IPython/genutils.py (page): fixed exception handling so things
6075 * IPython/genutils.py (page): fixed exception handling so things
6052 work both in Unix and Windows correctly. Quitting a pager triggers
6076 work both in Unix and Windows correctly. Quitting a pager triggers
6053 an IOError/broken pipe in Unix, and in windows not finding a pager
6077 an IOError/broken pipe in Unix, and in windows not finding a pager
6054 is also an IOError, so I had to actually look at the return value
6078 is also an IOError, so I had to actually look at the return value
6055 of the exception, not just the exception itself. Should be ok now.
6079 of the exception, not just the exception itself. Should be ok now.
6056
6080
6057 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6081 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6058 modified to allow case-insensitive color scheme changes.
6082 modified to allow case-insensitive color scheme changes.
6059
6083
6060 2002-02-09 Fernando Perez <fperez@colorado.edu>
6084 2002-02-09 Fernando Perez <fperez@colorado.edu>
6061
6085
6062 * IPython/genutils.py (native_line_ends): new function to leave
6086 * IPython/genutils.py (native_line_ends): new function to leave
6063 user config files with os-native line-endings.
6087 user config files with os-native line-endings.
6064
6088
6065 * README and manual updates.
6089 * README and manual updates.
6066
6090
6067 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6091 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6068 instead of StringType to catch Unicode strings.
6092 instead of StringType to catch Unicode strings.
6069
6093
6070 * IPython/genutils.py (filefind): fixed bug for paths with
6094 * IPython/genutils.py (filefind): fixed bug for paths with
6071 embedded spaces (very common in Windows).
6095 embedded spaces (very common in Windows).
6072
6096
6073 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6097 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6074 files under Windows, so that they get automatically associated
6098 files under Windows, so that they get automatically associated
6075 with a text editor. Windows makes it a pain to handle
6099 with a text editor. Windows makes it a pain to handle
6076 extension-less files.
6100 extension-less files.
6077
6101
6078 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6102 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6079 warning about readline only occur for Posix. In Windows there's no
6103 warning about readline only occur for Posix. In Windows there's no
6080 way to get readline, so why bother with the warning.
6104 way to get readline, so why bother with the warning.
6081
6105
6082 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6106 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6083 for __str__ instead of dir(self), since dir() changed in 2.2.
6107 for __str__ instead of dir(self), since dir() changed in 2.2.
6084
6108
6085 * Ported to Windows! Tested on XP, I suspect it should work fine
6109 * Ported to Windows! Tested on XP, I suspect it should work fine
6086 on NT/2000, but I don't think it will work on 98 et al. That
6110 on NT/2000, but I don't think it will work on 98 et al. That
6087 series of Windows is such a piece of junk anyway that I won't try
6111 series of Windows is such a piece of junk anyway that I won't try
6088 porting it there. The XP port was straightforward, showed a few
6112 porting it there. The XP port was straightforward, showed a few
6089 bugs here and there (fixed all), in particular some string
6113 bugs here and there (fixed all), in particular some string
6090 handling stuff which required considering Unicode strings (which
6114 handling stuff which required considering Unicode strings (which
6091 Windows uses). This is good, but hasn't been too tested :) No
6115 Windows uses). This is good, but hasn't been too tested :) No
6092 fancy installer yet, I'll put a note in the manual so people at
6116 fancy installer yet, I'll put a note in the manual so people at
6093 least make manually a shortcut.
6117 least make manually a shortcut.
6094
6118
6095 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6119 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6096 into a single one, "colors". This now controls both prompt and
6120 into a single one, "colors". This now controls both prompt and
6097 exception color schemes, and can be changed both at startup
6121 exception color schemes, and can be changed both at startup
6098 (either via command-line switches or via ipythonrc files) and at
6122 (either via command-line switches or via ipythonrc files) and at
6099 runtime, with @colors.
6123 runtime, with @colors.
6100 (Magic.magic_run): renamed @prun to @run and removed the old
6124 (Magic.magic_run): renamed @prun to @run and removed the old
6101 @run. The two were too similar to warrant keeping both.
6125 @run. The two were too similar to warrant keeping both.
6102
6126
6103 2002-02-03 Fernando Perez <fperez@colorado.edu>
6127 2002-02-03 Fernando Perez <fperez@colorado.edu>
6104
6128
6105 * IPython/iplib.py (install_first_time): Added comment on how to
6129 * IPython/iplib.py (install_first_time): Added comment on how to
6106 configure the color options for first-time users. Put a <return>
6130 configure the color options for first-time users. Put a <return>
6107 request at the end so that small-terminal users get a chance to
6131 request at the end so that small-terminal users get a chance to
6108 read the startup info.
6132 read the startup info.
6109
6133
6110 2002-01-23 Fernando Perez <fperez@colorado.edu>
6134 2002-01-23 Fernando Perez <fperez@colorado.edu>
6111
6135
6112 * IPython/iplib.py (CachedOutput.update): Changed output memory
6136 * IPython/iplib.py (CachedOutput.update): Changed output memory
6113 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6137 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6114 input history we still use _i. Did this b/c these variable are
6138 input history we still use _i. Did this b/c these variable are
6115 very commonly used in interactive work, so the less we need to
6139 very commonly used in interactive work, so the less we need to
6116 type the better off we are.
6140 type the better off we are.
6117 (Magic.magic_prun): updated @prun to better handle the namespaces
6141 (Magic.magic_prun): updated @prun to better handle the namespaces
6118 the file will run in, including a fix for __name__ not being set
6142 the file will run in, including a fix for __name__ not being set
6119 before.
6143 before.
6120
6144
6121 2002-01-20 Fernando Perez <fperez@colorado.edu>
6145 2002-01-20 Fernando Perez <fperez@colorado.edu>
6122
6146
6123 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6147 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6124 extra garbage for Python 2.2. Need to look more carefully into
6148 extra garbage for Python 2.2. Need to look more carefully into
6125 this later.
6149 this later.
6126
6150
6127 2002-01-19 Fernando Perez <fperez@colorado.edu>
6151 2002-01-19 Fernando Perez <fperez@colorado.edu>
6128
6152
6129 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6153 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6130 display SyntaxError exceptions properly formatted when they occur
6154 display SyntaxError exceptions properly formatted when they occur
6131 (they can be triggered by imported code).
6155 (they can be triggered by imported code).
6132
6156
6133 2002-01-18 Fernando Perez <fperez@colorado.edu>
6157 2002-01-18 Fernando Perez <fperez@colorado.edu>
6134
6158
6135 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6159 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6136 SyntaxError exceptions are reported nicely formatted, instead of
6160 SyntaxError exceptions are reported nicely formatted, instead of
6137 spitting out only offset information as before.
6161 spitting out only offset information as before.
6138 (Magic.magic_prun): Added the @prun function for executing
6162 (Magic.magic_prun): Added the @prun function for executing
6139 programs with command line args inside IPython.
6163 programs with command line args inside IPython.
6140
6164
6141 2002-01-16 Fernando Perez <fperez@colorado.edu>
6165 2002-01-16 Fernando Perez <fperez@colorado.edu>
6142
6166
6143 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6167 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6144 to *not* include the last item given in a range. This brings their
6168 to *not* include the last item given in a range. This brings their
6145 behavior in line with Python's slicing:
6169 behavior in line with Python's slicing:
6146 a[n1:n2] -> a[n1]...a[n2-1]
6170 a[n1:n2] -> a[n1]...a[n2-1]
6147 It may be a bit less convenient, but I prefer to stick to Python's
6171 It may be a bit less convenient, but I prefer to stick to Python's
6148 conventions *everywhere*, so users never have to wonder.
6172 conventions *everywhere*, so users never have to wonder.
6149 (Magic.magic_macro): Added @macro function to ease the creation of
6173 (Magic.magic_macro): Added @macro function to ease the creation of
6150 macros.
6174 macros.
6151
6175
6152 2002-01-05 Fernando Perez <fperez@colorado.edu>
6176 2002-01-05 Fernando Perez <fperez@colorado.edu>
6153
6177
6154 * Released 0.2.4.
6178 * Released 0.2.4.
6155
6179
6156 * IPython/iplib.py (Magic.magic_pdef):
6180 * IPython/iplib.py (Magic.magic_pdef):
6157 (InteractiveShell.safe_execfile): report magic lines and error
6181 (InteractiveShell.safe_execfile): report magic lines and error
6158 lines without line numbers so one can easily copy/paste them for
6182 lines without line numbers so one can easily copy/paste them for
6159 re-execution.
6183 re-execution.
6160
6184
6161 * Updated manual with recent changes.
6185 * Updated manual with recent changes.
6162
6186
6163 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6187 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6164 docstring printing when class? is called. Very handy for knowing
6188 docstring printing when class? is called. Very handy for knowing
6165 how to create class instances (as long as __init__ is well
6189 how to create class instances (as long as __init__ is well
6166 documented, of course :)
6190 documented, of course :)
6167 (Magic.magic_doc): print both class and constructor docstrings.
6191 (Magic.magic_doc): print both class and constructor docstrings.
6168 (Magic.magic_pdef): give constructor info if passed a class and
6192 (Magic.magic_pdef): give constructor info if passed a class and
6169 __call__ info for callable object instances.
6193 __call__ info for callable object instances.
6170
6194
6171 2002-01-04 Fernando Perez <fperez@colorado.edu>
6195 2002-01-04 Fernando Perez <fperez@colorado.edu>
6172
6196
6173 * Made deep_reload() off by default. It doesn't always work
6197 * Made deep_reload() off by default. It doesn't always work
6174 exactly as intended, so it's probably safer to have it off. It's
6198 exactly as intended, so it's probably safer to have it off. It's
6175 still available as dreload() anyway, so nothing is lost.
6199 still available as dreload() anyway, so nothing is lost.
6176
6200
6177 2002-01-02 Fernando Perez <fperez@colorado.edu>
6201 2002-01-02 Fernando Perez <fperez@colorado.edu>
6178
6202
6179 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6203 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6180 so I wanted an updated release).
6204 so I wanted an updated release).
6181
6205
6182 2001-12-27 Fernando Perez <fperez@colorado.edu>
6206 2001-12-27 Fernando Perez <fperez@colorado.edu>
6183
6207
6184 * IPython/iplib.py (InteractiveShell.interact): Added the original
6208 * IPython/iplib.py (InteractiveShell.interact): Added the original
6185 code from 'code.py' for this module in order to change the
6209 code from 'code.py' for this module in order to change the
6186 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6210 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6187 the history cache would break when the user hit Ctrl-C, and
6211 the history cache would break when the user hit Ctrl-C, and
6188 interact() offers no way to add any hooks to it.
6212 interact() offers no way to add any hooks to it.
6189
6213
6190 2001-12-23 Fernando Perez <fperez@colorado.edu>
6214 2001-12-23 Fernando Perez <fperez@colorado.edu>
6191
6215
6192 * setup.py: added check for 'MANIFEST' before trying to remove
6216 * setup.py: added check for 'MANIFEST' before trying to remove
6193 it. Thanks to Sean Reifschneider.
6217 it. Thanks to Sean Reifschneider.
6194
6218
6195 2001-12-22 Fernando Perez <fperez@colorado.edu>
6219 2001-12-22 Fernando Perez <fperez@colorado.edu>
6196
6220
6197 * Released 0.2.2.
6221 * Released 0.2.2.
6198
6222
6199 * Finished (reasonably) writing the manual. Later will add the
6223 * Finished (reasonably) writing the manual. Later will add the
6200 python-standard navigation stylesheets, but for the time being
6224 python-standard navigation stylesheets, but for the time being
6201 it's fairly complete. Distribution will include html and pdf
6225 it's fairly complete. Distribution will include html and pdf
6202 versions.
6226 versions.
6203
6227
6204 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6228 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6205 (MayaVi author).
6229 (MayaVi author).
6206
6230
6207 2001-12-21 Fernando Perez <fperez@colorado.edu>
6231 2001-12-21 Fernando Perez <fperez@colorado.edu>
6208
6232
6209 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6233 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6210 good public release, I think (with the manual and the distutils
6234 good public release, I think (with the manual and the distutils
6211 installer). The manual can use some work, but that can go
6235 installer). The manual can use some work, but that can go
6212 slowly. Otherwise I think it's quite nice for end users. Next
6236 slowly. Otherwise I think it's quite nice for end users. Next
6213 summer, rewrite the guts of it...
6237 summer, rewrite the guts of it...
6214
6238
6215 * Changed format of ipythonrc files to use whitespace as the
6239 * Changed format of ipythonrc files to use whitespace as the
6216 separator instead of an explicit '='. Cleaner.
6240 separator instead of an explicit '='. Cleaner.
6217
6241
6218 2001-12-20 Fernando Perez <fperez@colorado.edu>
6242 2001-12-20 Fernando Perez <fperez@colorado.edu>
6219
6243
6220 * Started a manual in LyX. For now it's just a quick merge of the
6244 * Started a manual in LyX. For now it's just a quick merge of the
6221 various internal docstrings and READMEs. Later it may grow into a
6245 various internal docstrings and READMEs. Later it may grow into a
6222 nice, full-blown manual.
6246 nice, full-blown manual.
6223
6247
6224 * Set up a distutils based installer. Installation should now be
6248 * Set up a distutils based installer. Installation should now be
6225 trivially simple for end-users.
6249 trivially simple for end-users.
6226
6250
6227 2001-12-11 Fernando Perez <fperez@colorado.edu>
6251 2001-12-11 Fernando Perez <fperez@colorado.edu>
6228
6252
6229 * Released 0.2.0. First public release, announced it at
6253 * Released 0.2.0. First public release, announced it at
6230 comp.lang.python. From now on, just bugfixes...
6254 comp.lang.python. From now on, just bugfixes...
6231
6255
6232 * Went through all the files, set copyright/license notices and
6256 * Went through all the files, set copyright/license notices and
6233 cleaned up things. Ready for release.
6257 cleaned up things. Ready for release.
6234
6258
6235 2001-12-10 Fernando Perez <fperez@colorado.edu>
6259 2001-12-10 Fernando Perez <fperez@colorado.edu>
6236
6260
6237 * Changed the first-time installer not to use tarfiles. It's more
6261 * Changed the first-time installer not to use tarfiles. It's more
6238 robust now and less unix-dependent. Also makes it easier for
6262 robust now and less unix-dependent. Also makes it easier for
6239 people to later upgrade versions.
6263 people to later upgrade versions.
6240
6264
6241 * Changed @exit to @abort to reflect the fact that it's pretty
6265 * Changed @exit to @abort to reflect the fact that it's pretty
6242 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6266 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6243 becomes significant only when IPyhton is embedded: in that case,
6267 becomes significant only when IPyhton is embedded: in that case,
6244 C-D closes IPython only, but @abort kills the enclosing program
6268 C-D closes IPython only, but @abort kills the enclosing program
6245 too (unless it had called IPython inside a try catching
6269 too (unless it had called IPython inside a try catching
6246 SystemExit).
6270 SystemExit).
6247
6271
6248 * Created Shell module which exposes the actuall IPython Shell
6272 * Created Shell module which exposes the actuall IPython Shell
6249 classes, currently the normal and the embeddable one. This at
6273 classes, currently the normal and the embeddable one. This at
6250 least offers a stable interface we won't need to change when
6274 least offers a stable interface we won't need to change when
6251 (later) the internals are rewritten. That rewrite will be confined
6275 (later) the internals are rewritten. That rewrite will be confined
6252 to iplib and ipmaker, but the Shell interface should remain as is.
6276 to iplib and ipmaker, but the Shell interface should remain as is.
6253
6277
6254 * Added embed module which offers an embeddable IPShell object,
6278 * Added embed module which offers an embeddable IPShell object,
6255 useful to fire up IPython *inside* a running program. Great for
6279 useful to fire up IPython *inside* a running program. Great for
6256 debugging or dynamical data analysis.
6280 debugging or dynamical data analysis.
6257
6281
6258 2001-12-08 Fernando Perez <fperez@colorado.edu>
6282 2001-12-08 Fernando Perez <fperez@colorado.edu>
6259
6283
6260 * Fixed small bug preventing seeing info from methods of defined
6284 * Fixed small bug preventing seeing info from methods of defined
6261 objects (incorrect namespace in _ofind()).
6285 objects (incorrect namespace in _ofind()).
6262
6286
6263 * Documentation cleanup. Moved the main usage docstrings to a
6287 * Documentation cleanup. Moved the main usage docstrings to a
6264 separate file, usage.py (cleaner to maintain, and hopefully in the
6288 separate file, usage.py (cleaner to maintain, and hopefully in the
6265 future some perlpod-like way of producing interactive, man and
6289 future some perlpod-like way of producing interactive, man and
6266 html docs out of it will be found).
6290 html docs out of it will be found).
6267
6291
6268 * Added @profile to see your profile at any time.
6292 * Added @profile to see your profile at any time.
6269
6293
6270 * Added @p as an alias for 'print'. It's especially convenient if
6294 * Added @p as an alias for 'print'. It's especially convenient if
6271 using automagic ('p x' prints x).
6295 using automagic ('p x' prints x).
6272
6296
6273 * Small cleanups and fixes after a pychecker run.
6297 * Small cleanups and fixes after a pychecker run.
6274
6298
6275 * Changed the @cd command to handle @cd - and @cd -<n> for
6299 * Changed the @cd command to handle @cd - and @cd -<n> for
6276 visiting any directory in _dh.
6300 visiting any directory in _dh.
6277
6301
6278 * Introduced _dh, a history of visited directories. @dhist prints
6302 * Introduced _dh, a history of visited directories. @dhist prints
6279 it out with numbers.
6303 it out with numbers.
6280
6304
6281 2001-12-07 Fernando Perez <fperez@colorado.edu>
6305 2001-12-07 Fernando Perez <fperez@colorado.edu>
6282
6306
6283 * Released 0.1.22
6307 * Released 0.1.22
6284
6308
6285 * Made initialization a bit more robust against invalid color
6309 * Made initialization a bit more robust against invalid color
6286 options in user input (exit, not traceback-crash).
6310 options in user input (exit, not traceback-crash).
6287
6311
6288 * Changed the bug crash reporter to write the report only in the
6312 * Changed the bug crash reporter to write the report only in the
6289 user's .ipython directory. That way IPython won't litter people's
6313 user's .ipython directory. That way IPython won't litter people's
6290 hard disks with crash files all over the place. Also print on
6314 hard disks with crash files all over the place. Also print on
6291 screen the necessary mail command.
6315 screen the necessary mail command.
6292
6316
6293 * With the new ultraTB, implemented LightBG color scheme for light
6317 * With the new ultraTB, implemented LightBG color scheme for light
6294 background terminals. A lot of people like white backgrounds, so I
6318 background terminals. A lot of people like white backgrounds, so I
6295 guess we should at least give them something readable.
6319 guess we should at least give them something readable.
6296
6320
6297 2001-12-06 Fernando Perez <fperez@colorado.edu>
6321 2001-12-06 Fernando Perez <fperez@colorado.edu>
6298
6322
6299 * Modified the structure of ultraTB. Now there's a proper class
6323 * Modified the structure of ultraTB. Now there's a proper class
6300 for tables of color schemes which allow adding schemes easily and
6324 for tables of color schemes which allow adding schemes easily and
6301 switching the active scheme without creating a new instance every
6325 switching the active scheme without creating a new instance every
6302 time (which was ridiculous). The syntax for creating new schemes
6326 time (which was ridiculous). The syntax for creating new schemes
6303 is also cleaner. I think ultraTB is finally done, with a clean
6327 is also cleaner. I think ultraTB is finally done, with a clean
6304 class structure. Names are also much cleaner (now there's proper
6328 class structure. Names are also much cleaner (now there's proper
6305 color tables, no need for every variable to also have 'color' in
6329 color tables, no need for every variable to also have 'color' in
6306 its name).
6330 its name).
6307
6331
6308 * Broke down genutils into separate files. Now genutils only
6332 * Broke down genutils into separate files. Now genutils only
6309 contains utility functions, and classes have been moved to their
6333 contains utility functions, and classes have been moved to their
6310 own files (they had enough independent functionality to warrant
6334 own files (they had enough independent functionality to warrant
6311 it): ConfigLoader, OutputTrap, Struct.
6335 it): ConfigLoader, OutputTrap, Struct.
6312
6336
6313 2001-12-05 Fernando Perez <fperez@colorado.edu>
6337 2001-12-05 Fernando Perez <fperez@colorado.edu>
6314
6338
6315 * IPython turns 21! Released version 0.1.21, as a candidate for
6339 * IPython turns 21! Released version 0.1.21, as a candidate for
6316 public consumption. If all goes well, release in a few days.
6340 public consumption. If all goes well, release in a few days.
6317
6341
6318 * Fixed path bug (files in Extensions/ directory wouldn't be found
6342 * Fixed path bug (files in Extensions/ directory wouldn't be found
6319 unless IPython/ was explicitly in sys.path).
6343 unless IPython/ was explicitly in sys.path).
6320
6344
6321 * Extended the FlexCompleter class as MagicCompleter to allow
6345 * Extended the FlexCompleter class as MagicCompleter to allow
6322 completion of @-starting lines.
6346 completion of @-starting lines.
6323
6347
6324 * Created __release__.py file as a central repository for release
6348 * Created __release__.py file as a central repository for release
6325 info that other files can read from.
6349 info that other files can read from.
6326
6350
6327 * Fixed small bug in logging: when logging was turned on in
6351 * Fixed small bug in logging: when logging was turned on in
6328 mid-session, old lines with special meanings (!@?) were being
6352 mid-session, old lines with special meanings (!@?) were being
6329 logged without the prepended comment, which is necessary since
6353 logged without the prepended comment, which is necessary since
6330 they are not truly valid python syntax. This should make session
6354 they are not truly valid python syntax. This should make session
6331 restores produce less errors.
6355 restores produce less errors.
6332
6356
6333 * The namespace cleanup forced me to make a FlexCompleter class
6357 * The namespace cleanup forced me to make a FlexCompleter class
6334 which is nothing but a ripoff of rlcompleter, but with selectable
6358 which is nothing but a ripoff of rlcompleter, but with selectable
6335 namespace (rlcompleter only works in __main__.__dict__). I'll try
6359 namespace (rlcompleter only works in __main__.__dict__). I'll try
6336 to submit a note to the authors to see if this change can be
6360 to submit a note to the authors to see if this change can be
6337 incorporated in future rlcompleter releases (Dec.6: done)
6361 incorporated in future rlcompleter releases (Dec.6: done)
6338
6362
6339 * More fixes to namespace handling. It was a mess! Now all
6363 * More fixes to namespace handling. It was a mess! Now all
6340 explicit references to __main__.__dict__ are gone (except when
6364 explicit references to __main__.__dict__ are gone (except when
6341 really needed) and everything is handled through the namespace
6365 really needed) and everything is handled through the namespace
6342 dicts in the IPython instance. We seem to be getting somewhere
6366 dicts in the IPython instance. We seem to be getting somewhere
6343 with this, finally...
6367 with this, finally...
6344
6368
6345 * Small documentation updates.
6369 * Small documentation updates.
6346
6370
6347 * Created the Extensions directory under IPython (with an
6371 * Created the Extensions directory under IPython (with an
6348 __init__.py). Put the PhysicalQ stuff there. This directory should
6372 __init__.py). Put the PhysicalQ stuff there. This directory should
6349 be used for all special-purpose extensions.
6373 be used for all special-purpose extensions.
6350
6374
6351 * File renaming:
6375 * File renaming:
6352 ipythonlib --> ipmaker
6376 ipythonlib --> ipmaker
6353 ipplib --> iplib
6377 ipplib --> iplib
6354 This makes a bit more sense in terms of what these files actually do.
6378 This makes a bit more sense in terms of what these files actually do.
6355
6379
6356 * Moved all the classes and functions in ipythonlib to ipplib, so
6380 * Moved all the classes and functions in ipythonlib to ipplib, so
6357 now ipythonlib only has make_IPython(). This will ease up its
6381 now ipythonlib only has make_IPython(). This will ease up its
6358 splitting in smaller functional chunks later.
6382 splitting in smaller functional chunks later.
6359
6383
6360 * Cleaned up (done, I think) output of @whos. Better column
6384 * Cleaned up (done, I think) output of @whos. Better column
6361 formatting, and now shows str(var) for as much as it can, which is
6385 formatting, and now shows str(var) for as much as it can, which is
6362 typically what one gets with a 'print var'.
6386 typically what one gets with a 'print var'.
6363
6387
6364 2001-12-04 Fernando Perez <fperez@colorado.edu>
6388 2001-12-04 Fernando Perez <fperez@colorado.edu>
6365
6389
6366 * Fixed namespace problems. Now builtin/IPyhton/user names get
6390 * Fixed namespace problems. Now builtin/IPyhton/user names get
6367 properly reported in their namespace. Internal namespace handling
6391 properly reported in their namespace. Internal namespace handling
6368 is finally getting decent (not perfect yet, but much better than
6392 is finally getting decent (not perfect yet, but much better than
6369 the ad-hoc mess we had).
6393 the ad-hoc mess we had).
6370
6394
6371 * Removed -exit option. If people just want to run a python
6395 * Removed -exit option. If people just want to run a python
6372 script, that's what the normal interpreter is for. Less
6396 script, that's what the normal interpreter is for. Less
6373 unnecessary options, less chances for bugs.
6397 unnecessary options, less chances for bugs.
6374
6398
6375 * Added a crash handler which generates a complete post-mortem if
6399 * Added a crash handler which generates a complete post-mortem if
6376 IPython crashes. This will help a lot in tracking bugs down the
6400 IPython crashes. This will help a lot in tracking bugs down the
6377 road.
6401 road.
6378
6402
6379 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6403 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6380 which were boud to functions being reassigned would bypass the
6404 which were boud to functions being reassigned would bypass the
6381 logger, breaking the sync of _il with the prompt counter. This
6405 logger, breaking the sync of _il with the prompt counter. This
6382 would then crash IPython later when a new line was logged.
6406 would then crash IPython later when a new line was logged.
6383
6407
6384 2001-12-02 Fernando Perez <fperez@colorado.edu>
6408 2001-12-02 Fernando Perez <fperez@colorado.edu>
6385
6409
6386 * Made IPython a package. This means people don't have to clutter
6410 * Made IPython a package. This means people don't have to clutter
6387 their sys.path with yet another directory. Changed the INSTALL
6411 their sys.path with yet another directory. Changed the INSTALL
6388 file accordingly.
6412 file accordingly.
6389
6413
6390 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6414 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6391 sorts its output (so @who shows it sorted) and @whos formats the
6415 sorts its output (so @who shows it sorted) and @whos formats the
6392 table according to the width of the first column. Nicer, easier to
6416 table according to the width of the first column. Nicer, easier to
6393 read. Todo: write a generic table_format() which takes a list of
6417 read. Todo: write a generic table_format() which takes a list of
6394 lists and prints it nicely formatted, with optional row/column
6418 lists and prints it nicely formatted, with optional row/column
6395 separators and proper padding and justification.
6419 separators and proper padding and justification.
6396
6420
6397 * Released 0.1.20
6421 * Released 0.1.20
6398
6422
6399 * Fixed bug in @log which would reverse the inputcache list (a
6423 * Fixed bug in @log which would reverse the inputcache list (a
6400 copy operation was missing).
6424 copy operation was missing).
6401
6425
6402 * Code cleanup. @config was changed to use page(). Better, since
6426 * Code cleanup. @config was changed to use page(). Better, since
6403 its output is always quite long.
6427 its output is always quite long.
6404
6428
6405 * Itpl is back as a dependency. I was having too many problems
6429 * Itpl is back as a dependency. I was having too many problems
6406 getting the parametric aliases to work reliably, and it's just
6430 getting the parametric aliases to work reliably, and it's just
6407 easier to code weird string operations with it than playing %()s
6431 easier to code weird string operations with it than playing %()s
6408 games. It's only ~6k, so I don't think it's too big a deal.
6432 games. It's only ~6k, so I don't think it's too big a deal.
6409
6433
6410 * Found (and fixed) a very nasty bug with history. !lines weren't
6434 * Found (and fixed) a very nasty bug with history. !lines weren't
6411 getting cached, and the out of sync caches would crash
6435 getting cached, and the out of sync caches would crash
6412 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6436 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6413 division of labor a bit better. Bug fixed, cleaner structure.
6437 division of labor a bit better. Bug fixed, cleaner structure.
6414
6438
6415 2001-12-01 Fernando Perez <fperez@colorado.edu>
6439 2001-12-01 Fernando Perez <fperez@colorado.edu>
6416
6440
6417 * Released 0.1.19
6441 * Released 0.1.19
6418
6442
6419 * Added option -n to @hist to prevent line number printing. Much
6443 * Added option -n to @hist to prevent line number printing. Much
6420 easier to copy/paste code this way.
6444 easier to copy/paste code this way.
6421
6445
6422 * Created global _il to hold the input list. Allows easy
6446 * Created global _il to hold the input list. Allows easy
6423 re-execution of blocks of code by slicing it (inspired by Janko's
6447 re-execution of blocks of code by slicing it (inspired by Janko's
6424 comment on 'macros').
6448 comment on 'macros').
6425
6449
6426 * Small fixes and doc updates.
6450 * Small fixes and doc updates.
6427
6451
6428 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6452 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6429 much too fragile with automagic. Handles properly multi-line
6453 much too fragile with automagic. Handles properly multi-line
6430 statements and takes parameters.
6454 statements and takes parameters.
6431
6455
6432 2001-11-30 Fernando Perez <fperez@colorado.edu>
6456 2001-11-30 Fernando Perez <fperez@colorado.edu>
6433
6457
6434 * Version 0.1.18 released.
6458 * Version 0.1.18 released.
6435
6459
6436 * Fixed nasty namespace bug in initial module imports.
6460 * Fixed nasty namespace bug in initial module imports.
6437
6461
6438 * Added copyright/license notes to all code files (except
6462 * Added copyright/license notes to all code files (except
6439 DPyGetOpt). For the time being, LGPL. That could change.
6463 DPyGetOpt). For the time being, LGPL. That could change.
6440
6464
6441 * Rewrote a much nicer README, updated INSTALL, cleaned up
6465 * Rewrote a much nicer README, updated INSTALL, cleaned up
6442 ipythonrc-* samples.
6466 ipythonrc-* samples.
6443
6467
6444 * Overall code/documentation cleanup. Basically ready for
6468 * Overall code/documentation cleanup. Basically ready for
6445 release. Only remaining thing: licence decision (LGPL?).
6469 release. Only remaining thing: licence decision (LGPL?).
6446
6470
6447 * Converted load_config to a class, ConfigLoader. Now recursion
6471 * Converted load_config to a class, ConfigLoader. Now recursion
6448 control is better organized. Doesn't include the same file twice.
6472 control is better organized. Doesn't include the same file twice.
6449
6473
6450 2001-11-29 Fernando Perez <fperez@colorado.edu>
6474 2001-11-29 Fernando Perez <fperez@colorado.edu>
6451
6475
6452 * Got input history working. Changed output history variables from
6476 * Got input history working. Changed output history variables from
6453 _p to _o so that _i is for input and _o for output. Just cleaner
6477 _p to _o so that _i is for input and _o for output. Just cleaner
6454 convention.
6478 convention.
6455
6479
6456 * Implemented parametric aliases. This pretty much allows the
6480 * Implemented parametric aliases. This pretty much allows the
6457 alias system to offer full-blown shell convenience, I think.
6481 alias system to offer full-blown shell convenience, I think.
6458
6482
6459 * Version 0.1.17 released, 0.1.18 opened.
6483 * Version 0.1.17 released, 0.1.18 opened.
6460
6484
6461 * dot_ipython/ipythonrc (alias): added documentation.
6485 * dot_ipython/ipythonrc (alias): added documentation.
6462 (xcolor): Fixed small bug (xcolors -> xcolor)
6486 (xcolor): Fixed small bug (xcolors -> xcolor)
6463
6487
6464 * Changed the alias system. Now alias is a magic command to define
6488 * Changed the alias system. Now alias is a magic command to define
6465 aliases just like the shell. Rationale: the builtin magics should
6489 aliases just like the shell. Rationale: the builtin magics should
6466 be there for things deeply connected to IPython's
6490 be there for things deeply connected to IPython's
6467 architecture. And this is a much lighter system for what I think
6491 architecture. And this is a much lighter system for what I think
6468 is the really important feature: allowing users to define quickly
6492 is the really important feature: allowing users to define quickly
6469 magics that will do shell things for them, so they can customize
6493 magics that will do shell things for them, so they can customize
6470 IPython easily to match their work habits. If someone is really
6494 IPython easily to match their work habits. If someone is really
6471 desperate to have another name for a builtin alias, they can
6495 desperate to have another name for a builtin alias, they can
6472 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6496 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6473 works.
6497 works.
6474
6498
6475 2001-11-28 Fernando Perez <fperez@colorado.edu>
6499 2001-11-28 Fernando Perez <fperez@colorado.edu>
6476
6500
6477 * Changed @file so that it opens the source file at the proper
6501 * Changed @file so that it opens the source file at the proper
6478 line. Since it uses less, if your EDITOR environment is
6502 line. Since it uses less, if your EDITOR environment is
6479 configured, typing v will immediately open your editor of choice
6503 configured, typing v will immediately open your editor of choice
6480 right at the line where the object is defined. Not as quick as
6504 right at the line where the object is defined. Not as quick as
6481 having a direct @edit command, but for all intents and purposes it
6505 having a direct @edit command, but for all intents and purposes it
6482 works. And I don't have to worry about writing @edit to deal with
6506 works. And I don't have to worry about writing @edit to deal with
6483 all the editors, less does that.
6507 all the editors, less does that.
6484
6508
6485 * Version 0.1.16 released, 0.1.17 opened.
6509 * Version 0.1.16 released, 0.1.17 opened.
6486
6510
6487 * Fixed some nasty bugs in the page/page_dumb combo that could
6511 * Fixed some nasty bugs in the page/page_dumb combo that could
6488 crash IPython.
6512 crash IPython.
6489
6513
6490 2001-11-27 Fernando Perez <fperez@colorado.edu>
6514 2001-11-27 Fernando Perez <fperez@colorado.edu>
6491
6515
6492 * Version 0.1.15 released, 0.1.16 opened.
6516 * Version 0.1.15 released, 0.1.16 opened.
6493
6517
6494 * Finally got ? and ?? to work for undefined things: now it's
6518 * Finally got ? and ?? to work for undefined things: now it's
6495 possible to type {}.get? and get information about the get method
6519 possible to type {}.get? and get information about the get method
6496 of dicts, or os.path? even if only os is defined (so technically
6520 of dicts, or os.path? even if only os is defined (so technically
6497 os.path isn't). Works at any level. For example, after import os,
6521 os.path isn't). Works at any level. For example, after import os,
6498 os?, os.path?, os.path.abspath? all work. This is great, took some
6522 os?, os.path?, os.path.abspath? all work. This is great, took some
6499 work in _ofind.
6523 work in _ofind.
6500
6524
6501 * Fixed more bugs with logging. The sanest way to do it was to add
6525 * Fixed more bugs with logging. The sanest way to do it was to add
6502 to @log a 'mode' parameter. Killed two in one shot (this mode
6526 to @log a 'mode' parameter. Killed two in one shot (this mode
6503 option was a request of Janko's). I think it's finally clean
6527 option was a request of Janko's). I think it's finally clean
6504 (famous last words).
6528 (famous last words).
6505
6529
6506 * Added a page_dumb() pager which does a decent job of paging on
6530 * Added a page_dumb() pager which does a decent job of paging on
6507 screen, if better things (like less) aren't available. One less
6531 screen, if better things (like less) aren't available. One less
6508 unix dependency (someday maybe somebody will port this to
6532 unix dependency (someday maybe somebody will port this to
6509 windows).
6533 windows).
6510
6534
6511 * Fixed problem in magic_log: would lock of logging out if log
6535 * Fixed problem in magic_log: would lock of logging out if log
6512 creation failed (because it would still think it had succeeded).
6536 creation failed (because it would still think it had succeeded).
6513
6537
6514 * Improved the page() function using curses to auto-detect screen
6538 * Improved the page() function using curses to auto-detect screen
6515 size. Now it can make a much better decision on whether to print
6539 size. Now it can make a much better decision on whether to print
6516 or page a string. Option screen_length was modified: a value 0
6540 or page a string. Option screen_length was modified: a value 0
6517 means auto-detect, and that's the default now.
6541 means auto-detect, and that's the default now.
6518
6542
6519 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6543 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6520 go out. I'll test it for a few days, then talk to Janko about
6544 go out. I'll test it for a few days, then talk to Janko about
6521 licences and announce it.
6545 licences and announce it.
6522
6546
6523 * Fixed the length of the auto-generated ---> prompt which appears
6547 * Fixed the length of the auto-generated ---> prompt which appears
6524 for auto-parens and auto-quotes. Getting this right isn't trivial,
6548 for auto-parens and auto-quotes. Getting this right isn't trivial,
6525 with all the color escapes, different prompt types and optional
6549 with all the color escapes, different prompt types and optional
6526 separators. But it seems to be working in all the combinations.
6550 separators. But it seems to be working in all the combinations.
6527
6551
6528 2001-11-26 Fernando Perez <fperez@colorado.edu>
6552 2001-11-26 Fernando Perez <fperez@colorado.edu>
6529
6553
6530 * Wrote a regexp filter to get option types from the option names
6554 * Wrote a regexp filter to get option types from the option names
6531 string. This eliminates the need to manually keep two duplicate
6555 string. This eliminates the need to manually keep two duplicate
6532 lists.
6556 lists.
6533
6557
6534 * Removed the unneeded check_option_names. Now options are handled
6558 * Removed the unneeded check_option_names. Now options are handled
6535 in a much saner manner and it's easy to visually check that things
6559 in a much saner manner and it's easy to visually check that things
6536 are ok.
6560 are ok.
6537
6561
6538 * Updated version numbers on all files I modified to carry a
6562 * Updated version numbers on all files I modified to carry a
6539 notice so Janko and Nathan have clear version markers.
6563 notice so Janko and Nathan have clear version markers.
6540
6564
6541 * Updated docstring for ultraTB with my changes. I should send
6565 * Updated docstring for ultraTB with my changes. I should send
6542 this to Nathan.
6566 this to Nathan.
6543
6567
6544 * Lots of small fixes. Ran everything through pychecker again.
6568 * Lots of small fixes. Ran everything through pychecker again.
6545
6569
6546 * Made loading of deep_reload an cmd line option. If it's not too
6570 * Made loading of deep_reload an cmd line option. If it's not too
6547 kosher, now people can just disable it. With -nodeep_reload it's
6571 kosher, now people can just disable it. With -nodeep_reload it's
6548 still available as dreload(), it just won't overwrite reload().
6572 still available as dreload(), it just won't overwrite reload().
6549
6573
6550 * Moved many options to the no| form (-opt and -noopt
6574 * Moved many options to the no| form (-opt and -noopt
6551 accepted). Cleaner.
6575 accepted). Cleaner.
6552
6576
6553 * Changed magic_log so that if called with no parameters, it uses
6577 * Changed magic_log so that if called with no parameters, it uses
6554 'rotate' mode. That way auto-generated logs aren't automatically
6578 'rotate' mode. That way auto-generated logs aren't automatically
6555 over-written. For normal logs, now a backup is made if it exists
6579 over-written. For normal logs, now a backup is made if it exists
6556 (only 1 level of backups). A new 'backup' mode was added to the
6580 (only 1 level of backups). A new 'backup' mode was added to the
6557 Logger class to support this. This was a request by Janko.
6581 Logger class to support this. This was a request by Janko.
6558
6582
6559 * Added @logoff/@logon to stop/restart an active log.
6583 * Added @logoff/@logon to stop/restart an active log.
6560
6584
6561 * Fixed a lot of bugs in log saving/replay. It was pretty
6585 * Fixed a lot of bugs in log saving/replay. It was pretty
6562 broken. Now special lines (!@,/) appear properly in the command
6586 broken. Now special lines (!@,/) appear properly in the command
6563 history after a log replay.
6587 history after a log replay.
6564
6588
6565 * Tried and failed to implement full session saving via pickle. My
6589 * Tried and failed to implement full session saving via pickle. My
6566 idea was to pickle __main__.__dict__, but modules can't be
6590 idea was to pickle __main__.__dict__, but modules can't be
6567 pickled. This would be a better alternative to replaying logs, but
6591 pickled. This would be a better alternative to replaying logs, but
6568 seems quite tricky to get to work. Changed -session to be called
6592 seems quite tricky to get to work. Changed -session to be called
6569 -logplay, which more accurately reflects what it does. And if we
6593 -logplay, which more accurately reflects what it does. And if we
6570 ever get real session saving working, -session is now available.
6594 ever get real session saving working, -session is now available.
6571
6595
6572 * Implemented color schemes for prompts also. As for tracebacks,
6596 * Implemented color schemes for prompts also. As for tracebacks,
6573 currently only NoColor and Linux are supported. But now the
6597 currently only NoColor and Linux are supported. But now the
6574 infrastructure is in place, based on a generic ColorScheme
6598 infrastructure is in place, based on a generic ColorScheme
6575 class. So writing and activating new schemes both for the prompts
6599 class. So writing and activating new schemes both for the prompts
6576 and the tracebacks should be straightforward.
6600 and the tracebacks should be straightforward.
6577
6601
6578 * Version 0.1.13 released, 0.1.14 opened.
6602 * Version 0.1.13 released, 0.1.14 opened.
6579
6603
6580 * Changed handling of options for output cache. Now counter is
6604 * Changed handling of options for output cache. Now counter is
6581 hardwired starting at 1 and one specifies the maximum number of
6605 hardwired starting at 1 and one specifies the maximum number of
6582 entries *in the outcache* (not the max prompt counter). This is
6606 entries *in the outcache* (not the max prompt counter). This is
6583 much better, since many statements won't increase the cache
6607 much better, since many statements won't increase the cache
6584 count. It also eliminated some confusing options, now there's only
6608 count. It also eliminated some confusing options, now there's only
6585 one: cache_size.
6609 one: cache_size.
6586
6610
6587 * Added 'alias' magic function and magic_alias option in the
6611 * Added 'alias' magic function and magic_alias option in the
6588 ipythonrc file. Now the user can easily define whatever names he
6612 ipythonrc file. Now the user can easily define whatever names he
6589 wants for the magic functions without having to play weird
6613 wants for the magic functions without having to play weird
6590 namespace games. This gives IPython a real shell-like feel.
6614 namespace games. This gives IPython a real shell-like feel.
6591
6615
6592 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6616 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6593 @ or not).
6617 @ or not).
6594
6618
6595 This was one of the last remaining 'visible' bugs (that I know
6619 This was one of the last remaining 'visible' bugs (that I know
6596 of). I think if I can clean up the session loading so it works
6620 of). I think if I can clean up the session loading so it works
6597 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6621 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6598 about licensing).
6622 about licensing).
6599
6623
6600 2001-11-25 Fernando Perez <fperez@colorado.edu>
6624 2001-11-25 Fernando Perez <fperez@colorado.edu>
6601
6625
6602 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6626 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6603 there's a cleaner distinction between what ? and ?? show.
6627 there's a cleaner distinction between what ? and ?? show.
6604
6628
6605 * Added screen_length option. Now the user can define his own
6629 * Added screen_length option. Now the user can define his own
6606 screen size for page() operations.
6630 screen size for page() operations.
6607
6631
6608 * Implemented magic shell-like functions with automatic code
6632 * Implemented magic shell-like functions with automatic code
6609 generation. Now adding another function is just a matter of adding
6633 generation. Now adding another function is just a matter of adding
6610 an entry to a dict, and the function is dynamically generated at
6634 an entry to a dict, and the function is dynamically generated at
6611 run-time. Python has some really cool features!
6635 run-time. Python has some really cool features!
6612
6636
6613 * Renamed many options to cleanup conventions a little. Now all
6637 * Renamed many options to cleanup conventions a little. Now all
6614 are lowercase, and only underscores where needed. Also in the code
6638 are lowercase, and only underscores where needed. Also in the code
6615 option name tables are clearer.
6639 option name tables are clearer.
6616
6640
6617 * Changed prompts a little. Now input is 'In [n]:' instead of
6641 * Changed prompts a little. Now input is 'In [n]:' instead of
6618 'In[n]:='. This allows it the numbers to be aligned with the
6642 'In[n]:='. This allows it the numbers to be aligned with the
6619 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6643 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6620 Python (it was a Mathematica thing). The '...' continuation prompt
6644 Python (it was a Mathematica thing). The '...' continuation prompt
6621 was also changed a little to align better.
6645 was also changed a little to align better.
6622
6646
6623 * Fixed bug when flushing output cache. Not all _p<n> variables
6647 * Fixed bug when flushing output cache. Not all _p<n> variables
6624 exist, so their deletion needs to be wrapped in a try:
6648 exist, so their deletion needs to be wrapped in a try:
6625
6649
6626 * Figured out how to properly use inspect.formatargspec() (it
6650 * Figured out how to properly use inspect.formatargspec() (it
6627 requires the args preceded by *). So I removed all the code from
6651 requires the args preceded by *). So I removed all the code from
6628 _get_pdef in Magic, which was just replicating that.
6652 _get_pdef in Magic, which was just replicating that.
6629
6653
6630 * Added test to prefilter to allow redefining magic function names
6654 * Added test to prefilter to allow redefining magic function names
6631 as variables. This is ok, since the @ form is always available,
6655 as variables. This is ok, since the @ form is always available,
6632 but whe should allow the user to define a variable called 'ls' if
6656 but whe should allow the user to define a variable called 'ls' if
6633 he needs it.
6657 he needs it.
6634
6658
6635 * Moved the ToDo information from README into a separate ToDo.
6659 * Moved the ToDo information from README into a separate ToDo.
6636
6660
6637 * General code cleanup and small bugfixes. I think it's close to a
6661 * General code cleanup and small bugfixes. I think it's close to a
6638 state where it can be released, obviously with a big 'beta'
6662 state where it can be released, obviously with a big 'beta'
6639 warning on it.
6663 warning on it.
6640
6664
6641 * Got the magic function split to work. Now all magics are defined
6665 * Got the magic function split to work. Now all magics are defined
6642 in a separate class. It just organizes things a bit, and now
6666 in a separate class. It just organizes things a bit, and now
6643 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6667 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6644 was too long).
6668 was too long).
6645
6669
6646 * Changed @clear to @reset to avoid potential confusions with
6670 * Changed @clear to @reset to avoid potential confusions with
6647 the shell command clear. Also renamed @cl to @clear, which does
6671 the shell command clear. Also renamed @cl to @clear, which does
6648 exactly what people expect it to from their shell experience.
6672 exactly what people expect it to from their shell experience.
6649
6673
6650 Added a check to the @reset command (since it's so
6674 Added a check to the @reset command (since it's so
6651 destructive, it's probably a good idea to ask for confirmation).
6675 destructive, it's probably a good idea to ask for confirmation).
6652 But now reset only works for full namespace resetting. Since the
6676 But now reset only works for full namespace resetting. Since the
6653 del keyword is already there for deleting a few specific
6677 del keyword is already there for deleting a few specific
6654 variables, I don't see the point of having a redundant magic
6678 variables, I don't see the point of having a redundant magic
6655 function for the same task.
6679 function for the same task.
6656
6680
6657 2001-11-24 Fernando Perez <fperez@colorado.edu>
6681 2001-11-24 Fernando Perez <fperez@colorado.edu>
6658
6682
6659 * Updated the builtin docs (esp. the ? ones).
6683 * Updated the builtin docs (esp. the ? ones).
6660
6684
6661 * Ran all the code through pychecker. Not terribly impressed with
6685 * Ran all the code through pychecker. Not terribly impressed with
6662 it: lots of spurious warnings and didn't really find anything of
6686 it: lots of spurious warnings and didn't really find anything of
6663 substance (just a few modules being imported and not used).
6687 substance (just a few modules being imported and not used).
6664
6688
6665 * Implemented the new ultraTB functionality into IPython. New
6689 * Implemented the new ultraTB functionality into IPython. New
6666 option: xcolors. This chooses color scheme. xmode now only selects
6690 option: xcolors. This chooses color scheme. xmode now only selects
6667 between Plain and Verbose. Better orthogonality.
6691 between Plain and Verbose. Better orthogonality.
6668
6692
6669 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6693 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6670 mode and color scheme for the exception handlers. Now it's
6694 mode and color scheme for the exception handlers. Now it's
6671 possible to have the verbose traceback with no coloring.
6695 possible to have the verbose traceback with no coloring.
6672
6696
6673 2001-11-23 Fernando Perez <fperez@colorado.edu>
6697 2001-11-23 Fernando Perez <fperez@colorado.edu>
6674
6698
6675 * Version 0.1.12 released, 0.1.13 opened.
6699 * Version 0.1.12 released, 0.1.13 opened.
6676
6700
6677 * Removed option to set auto-quote and auto-paren escapes by
6701 * Removed option to set auto-quote and auto-paren escapes by
6678 user. The chances of breaking valid syntax are just too high. If
6702 user. The chances of breaking valid syntax are just too high. If
6679 someone *really* wants, they can always dig into the code.
6703 someone *really* wants, they can always dig into the code.
6680
6704
6681 * Made prompt separators configurable.
6705 * Made prompt separators configurable.
6682
6706
6683 2001-11-22 Fernando Perez <fperez@colorado.edu>
6707 2001-11-22 Fernando Perez <fperez@colorado.edu>
6684
6708
6685 * Small bugfixes in many places.
6709 * Small bugfixes in many places.
6686
6710
6687 * Removed the MyCompleter class from ipplib. It seemed redundant
6711 * Removed the MyCompleter class from ipplib. It seemed redundant
6688 with the C-p,C-n history search functionality. Less code to
6712 with the C-p,C-n history search functionality. Less code to
6689 maintain.
6713 maintain.
6690
6714
6691 * Moved all the original ipython.py code into ipythonlib.py. Right
6715 * Moved all the original ipython.py code into ipythonlib.py. Right
6692 now it's just one big dump into a function called make_IPython, so
6716 now it's just one big dump into a function called make_IPython, so
6693 no real modularity has been gained. But at least it makes the
6717 no real modularity has been gained. But at least it makes the
6694 wrapper script tiny, and since ipythonlib is a module, it gets
6718 wrapper script tiny, and since ipythonlib is a module, it gets
6695 compiled and startup is much faster.
6719 compiled and startup is much faster.
6696
6720
6697 This is a reasobably 'deep' change, so we should test it for a
6721 This is a reasobably 'deep' change, so we should test it for a
6698 while without messing too much more with the code.
6722 while without messing too much more with the code.
6699
6723
6700 2001-11-21 Fernando Perez <fperez@colorado.edu>
6724 2001-11-21 Fernando Perez <fperez@colorado.edu>
6701
6725
6702 * Version 0.1.11 released, 0.1.12 opened for further work.
6726 * Version 0.1.11 released, 0.1.12 opened for further work.
6703
6727
6704 * Removed dependency on Itpl. It was only needed in one place. It
6728 * Removed dependency on Itpl. It was only needed in one place. It
6705 would be nice if this became part of python, though. It makes life
6729 would be nice if this became part of python, though. It makes life
6706 *a lot* easier in some cases.
6730 *a lot* easier in some cases.
6707
6731
6708 * Simplified the prefilter code a bit. Now all handlers are
6732 * Simplified the prefilter code a bit. Now all handlers are
6709 expected to explicitly return a value (at least a blank string).
6733 expected to explicitly return a value (at least a blank string).
6710
6734
6711 * Heavy edits in ipplib. Removed the help system altogether. Now
6735 * Heavy edits in ipplib. Removed the help system altogether. Now
6712 obj?/?? is used for inspecting objects, a magic @doc prints
6736 obj?/?? is used for inspecting objects, a magic @doc prints
6713 docstrings, and full-blown Python help is accessed via the 'help'
6737 docstrings, and full-blown Python help is accessed via the 'help'
6714 keyword. This cleans up a lot of code (less to maintain) and does
6738 keyword. This cleans up a lot of code (less to maintain) and does
6715 the job. Since 'help' is now a standard Python component, might as
6739 the job. Since 'help' is now a standard Python component, might as
6716 well use it and remove duplicate functionality.
6740 well use it and remove duplicate functionality.
6717
6741
6718 Also removed the option to use ipplib as a standalone program. By
6742 Also removed the option to use ipplib as a standalone program. By
6719 now it's too dependent on other parts of IPython to function alone.
6743 now it's too dependent on other parts of IPython to function alone.
6720
6744
6721 * Fixed bug in genutils.pager. It would crash if the pager was
6745 * Fixed bug in genutils.pager. It would crash if the pager was
6722 exited immediately after opening (broken pipe).
6746 exited immediately after opening (broken pipe).
6723
6747
6724 * Trimmed down the VerboseTB reporting a little. The header is
6748 * Trimmed down the VerboseTB reporting a little. The header is
6725 much shorter now and the repeated exception arguments at the end
6749 much shorter now and the repeated exception arguments at the end
6726 have been removed. For interactive use the old header seemed a bit
6750 have been removed. For interactive use the old header seemed a bit
6727 excessive.
6751 excessive.
6728
6752
6729 * Fixed small bug in output of @whos for variables with multi-word
6753 * Fixed small bug in output of @whos for variables with multi-word
6730 types (only first word was displayed).
6754 types (only first word was displayed).
6731
6755
6732 2001-11-17 Fernando Perez <fperez@colorado.edu>
6756 2001-11-17 Fernando Perez <fperez@colorado.edu>
6733
6757
6734 * Version 0.1.10 released, 0.1.11 opened for further work.
6758 * Version 0.1.10 released, 0.1.11 opened for further work.
6735
6759
6736 * Modified dirs and friends. dirs now *returns* the stack (not
6760 * Modified dirs and friends. dirs now *returns* the stack (not
6737 prints), so one can manipulate it as a variable. Convenient to
6761 prints), so one can manipulate it as a variable. Convenient to
6738 travel along many directories.
6762 travel along many directories.
6739
6763
6740 * Fixed bug in magic_pdef: would only work with functions with
6764 * Fixed bug in magic_pdef: would only work with functions with
6741 arguments with default values.
6765 arguments with default values.
6742
6766
6743 2001-11-14 Fernando Perez <fperez@colorado.edu>
6767 2001-11-14 Fernando Perez <fperez@colorado.edu>
6744
6768
6745 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6769 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6746 example with IPython. Various other minor fixes and cleanups.
6770 example with IPython. Various other minor fixes and cleanups.
6747
6771
6748 * Version 0.1.9 released, 0.1.10 opened for further work.
6772 * Version 0.1.9 released, 0.1.10 opened for further work.
6749
6773
6750 * Added sys.path to the list of directories searched in the
6774 * Added sys.path to the list of directories searched in the
6751 execfile= option. It used to be the current directory and the
6775 execfile= option. It used to be the current directory and the
6752 user's IPYTHONDIR only.
6776 user's IPYTHONDIR only.
6753
6777
6754 2001-11-13 Fernando Perez <fperez@colorado.edu>
6778 2001-11-13 Fernando Perez <fperez@colorado.edu>
6755
6779
6756 * Reinstated the raw_input/prefilter separation that Janko had
6780 * Reinstated the raw_input/prefilter separation that Janko had
6757 initially. This gives a more convenient setup for extending the
6781 initially. This gives a more convenient setup for extending the
6758 pre-processor from the outside: raw_input always gets a string,
6782 pre-processor from the outside: raw_input always gets a string,
6759 and prefilter has to process it. We can then redefine prefilter
6783 and prefilter has to process it. We can then redefine prefilter
6760 from the outside and implement extensions for special
6784 from the outside and implement extensions for special
6761 purposes.
6785 purposes.
6762
6786
6763 Today I got one for inputting PhysicalQuantity objects
6787 Today I got one for inputting PhysicalQuantity objects
6764 (from Scientific) without needing any function calls at
6788 (from Scientific) without needing any function calls at
6765 all. Extremely convenient, and it's all done as a user-level
6789 all. Extremely convenient, and it's all done as a user-level
6766 extension (no IPython code was touched). Now instead of:
6790 extension (no IPython code was touched). Now instead of:
6767 a = PhysicalQuantity(4.2,'m/s**2')
6791 a = PhysicalQuantity(4.2,'m/s**2')
6768 one can simply say
6792 one can simply say
6769 a = 4.2 m/s**2
6793 a = 4.2 m/s**2
6770 or even
6794 or even
6771 a = 4.2 m/s^2
6795 a = 4.2 m/s^2
6772
6796
6773 I use this, but it's also a proof of concept: IPython really is
6797 I use this, but it's also a proof of concept: IPython really is
6774 fully user-extensible, even at the level of the parsing of the
6798 fully user-extensible, even at the level of the parsing of the
6775 command line. It's not trivial, but it's perfectly doable.
6799 command line. It's not trivial, but it's perfectly doable.
6776
6800
6777 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6801 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6778 the problem of modules being loaded in the inverse order in which
6802 the problem of modules being loaded in the inverse order in which
6779 they were defined in
6803 they were defined in
6780
6804
6781 * Version 0.1.8 released, 0.1.9 opened for further work.
6805 * Version 0.1.8 released, 0.1.9 opened for further work.
6782
6806
6783 * Added magics pdef, source and file. They respectively show the
6807 * Added magics pdef, source and file. They respectively show the
6784 definition line ('prototype' in C), source code and full python
6808 definition line ('prototype' in C), source code and full python
6785 file for any callable object. The object inspector oinfo uses
6809 file for any callable object. The object inspector oinfo uses
6786 these to show the same information.
6810 these to show the same information.
6787
6811
6788 * Version 0.1.7 released, 0.1.8 opened for further work.
6812 * Version 0.1.7 released, 0.1.8 opened for further work.
6789
6813
6790 * Separated all the magic functions into a class called Magic. The
6814 * Separated all the magic functions into a class called Magic. The
6791 InteractiveShell class was becoming too big for Xemacs to handle
6815 InteractiveShell class was becoming too big for Xemacs to handle
6792 (de-indenting a line would lock it up for 10 seconds while it
6816 (de-indenting a line would lock it up for 10 seconds while it
6793 backtracked on the whole class!)
6817 backtracked on the whole class!)
6794
6818
6795 FIXME: didn't work. It can be done, but right now namespaces are
6819 FIXME: didn't work. It can be done, but right now namespaces are
6796 all messed up. Do it later (reverted it for now, so at least
6820 all messed up. Do it later (reverted it for now, so at least
6797 everything works as before).
6821 everything works as before).
6798
6822
6799 * Got the object introspection system (magic_oinfo) working! I
6823 * Got the object introspection system (magic_oinfo) working! I
6800 think this is pretty much ready for release to Janko, so he can
6824 think this is pretty much ready for release to Janko, so he can
6801 test it for a while and then announce it. Pretty much 100% of what
6825 test it for a while and then announce it. Pretty much 100% of what
6802 I wanted for the 'phase 1' release is ready. Happy, tired.
6826 I wanted for the 'phase 1' release is ready. Happy, tired.
6803
6827
6804 2001-11-12 Fernando Perez <fperez@colorado.edu>
6828 2001-11-12 Fernando Perez <fperez@colorado.edu>
6805
6829
6806 * Version 0.1.6 released, 0.1.7 opened for further work.
6830 * Version 0.1.6 released, 0.1.7 opened for further work.
6807
6831
6808 * Fixed bug in printing: it used to test for truth before
6832 * Fixed bug in printing: it used to test for truth before
6809 printing, so 0 wouldn't print. Now checks for None.
6833 printing, so 0 wouldn't print. Now checks for None.
6810
6834
6811 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6835 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6812 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6836 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6813 reaches by hand into the outputcache. Think of a better way to do
6837 reaches by hand into the outputcache. Think of a better way to do
6814 this later.
6838 this later.
6815
6839
6816 * Various small fixes thanks to Nathan's comments.
6840 * Various small fixes thanks to Nathan's comments.
6817
6841
6818 * Changed magic_pprint to magic_Pprint. This way it doesn't
6842 * Changed magic_pprint to magic_Pprint. This way it doesn't
6819 collide with pprint() and the name is consistent with the command
6843 collide with pprint() and the name is consistent with the command
6820 line option.
6844 line option.
6821
6845
6822 * Changed prompt counter behavior to be fully like
6846 * Changed prompt counter behavior to be fully like
6823 Mathematica's. That is, even input that doesn't return a result
6847 Mathematica's. That is, even input that doesn't return a result
6824 raises the prompt counter. The old behavior was kind of confusing
6848 raises the prompt counter. The old behavior was kind of confusing
6825 (getting the same prompt number several times if the operation
6849 (getting the same prompt number several times if the operation
6826 didn't return a result).
6850 didn't return a result).
6827
6851
6828 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6852 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6829
6853
6830 * Fixed -Classic mode (wasn't working anymore).
6854 * Fixed -Classic mode (wasn't working anymore).
6831
6855
6832 * Added colored prompts using Nathan's new code. Colors are
6856 * Added colored prompts using Nathan's new code. Colors are
6833 currently hardwired, they can be user-configurable. For
6857 currently hardwired, they can be user-configurable. For
6834 developers, they can be chosen in file ipythonlib.py, at the
6858 developers, they can be chosen in file ipythonlib.py, at the
6835 beginning of the CachedOutput class def.
6859 beginning of the CachedOutput class def.
6836
6860
6837 2001-11-11 Fernando Perez <fperez@colorado.edu>
6861 2001-11-11 Fernando Perez <fperez@colorado.edu>
6838
6862
6839 * Version 0.1.5 released, 0.1.6 opened for further work.
6863 * Version 0.1.5 released, 0.1.6 opened for further work.
6840
6864
6841 * Changed magic_env to *return* the environment as a dict (not to
6865 * Changed magic_env to *return* the environment as a dict (not to
6842 print it). This way it prints, but it can also be processed.
6866 print it). This way it prints, but it can also be processed.
6843
6867
6844 * Added Verbose exception reporting to interactive
6868 * Added Verbose exception reporting to interactive
6845 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6869 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6846 traceback. Had to make some changes to the ultraTB file. This is
6870 traceback. Had to make some changes to the ultraTB file. This is
6847 probably the last 'big' thing in my mental todo list. This ties
6871 probably the last 'big' thing in my mental todo list. This ties
6848 in with the next entry:
6872 in with the next entry:
6849
6873
6850 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6874 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6851 has to specify is Plain, Color or Verbose for all exception
6875 has to specify is Plain, Color or Verbose for all exception
6852 handling.
6876 handling.
6853
6877
6854 * Removed ShellServices option. All this can really be done via
6878 * Removed ShellServices option. All this can really be done via
6855 the magic system. It's easier to extend, cleaner and has automatic
6879 the magic system. It's easier to extend, cleaner and has automatic
6856 namespace protection and documentation.
6880 namespace protection and documentation.
6857
6881
6858 2001-11-09 Fernando Perez <fperez@colorado.edu>
6882 2001-11-09 Fernando Perez <fperez@colorado.edu>
6859
6883
6860 * Fixed bug in output cache flushing (missing parameter to
6884 * Fixed bug in output cache flushing (missing parameter to
6861 __init__). Other small bugs fixed (found using pychecker).
6885 __init__). Other small bugs fixed (found using pychecker).
6862
6886
6863 * Version 0.1.4 opened for bugfixing.
6887 * Version 0.1.4 opened for bugfixing.
6864
6888
6865 2001-11-07 Fernando Perez <fperez@colorado.edu>
6889 2001-11-07 Fernando Perez <fperez@colorado.edu>
6866
6890
6867 * Version 0.1.3 released, mainly because of the raw_input bug.
6891 * Version 0.1.3 released, mainly because of the raw_input bug.
6868
6892
6869 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6893 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6870 and when testing for whether things were callable, a call could
6894 and when testing for whether things were callable, a call could
6871 actually be made to certain functions. They would get called again
6895 actually be made to certain functions. They would get called again
6872 once 'really' executed, with a resulting double call. A disaster
6896 once 'really' executed, with a resulting double call. A disaster
6873 in many cases (list.reverse() would never work!).
6897 in many cases (list.reverse() would never work!).
6874
6898
6875 * Removed prefilter() function, moved its code to raw_input (which
6899 * Removed prefilter() function, moved its code to raw_input (which
6876 after all was just a near-empty caller for prefilter). This saves
6900 after all was just a near-empty caller for prefilter). This saves
6877 a function call on every prompt, and simplifies the class a tiny bit.
6901 a function call on every prompt, and simplifies the class a tiny bit.
6878
6902
6879 * Fix _ip to __ip name in magic example file.
6903 * Fix _ip to __ip name in magic example file.
6880
6904
6881 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6905 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6882 work with non-gnu versions of tar.
6906 work with non-gnu versions of tar.
6883
6907
6884 2001-11-06 Fernando Perez <fperez@colorado.edu>
6908 2001-11-06 Fernando Perez <fperez@colorado.edu>
6885
6909
6886 * Version 0.1.2. Just to keep track of the recent changes.
6910 * Version 0.1.2. Just to keep track of the recent changes.
6887
6911
6888 * Fixed nasty bug in output prompt routine. It used to check 'if
6912 * Fixed nasty bug in output prompt routine. It used to check 'if
6889 arg != None...'. Problem is, this fails if arg implements a
6913 arg != None...'. Problem is, this fails if arg implements a
6890 special comparison (__cmp__) which disallows comparing to
6914 special comparison (__cmp__) which disallows comparing to
6891 None. Found it when trying to use the PhysicalQuantity module from
6915 None. Found it when trying to use the PhysicalQuantity module from
6892 ScientificPython.
6916 ScientificPython.
6893
6917
6894 2001-11-05 Fernando Perez <fperez@colorado.edu>
6918 2001-11-05 Fernando Perez <fperez@colorado.edu>
6895
6919
6896 * Also added dirs. Now the pushd/popd/dirs family functions
6920 * Also added dirs. Now the pushd/popd/dirs family functions
6897 basically like the shell, with the added convenience of going home
6921 basically like the shell, with the added convenience of going home
6898 when called with no args.
6922 when called with no args.
6899
6923
6900 * pushd/popd slightly modified to mimic shell behavior more
6924 * pushd/popd slightly modified to mimic shell behavior more
6901 closely.
6925 closely.
6902
6926
6903 * Added env,pushd,popd from ShellServices as magic functions. I
6927 * Added env,pushd,popd from ShellServices as magic functions. I
6904 think the cleanest will be to port all desired functions from
6928 think the cleanest will be to port all desired functions from
6905 ShellServices as magics and remove ShellServices altogether. This
6929 ShellServices as magics and remove ShellServices altogether. This
6906 will provide a single, clean way of adding functionality
6930 will provide a single, clean way of adding functionality
6907 (shell-type or otherwise) to IP.
6931 (shell-type or otherwise) to IP.
6908
6932
6909 2001-11-04 Fernando Perez <fperez@colorado.edu>
6933 2001-11-04 Fernando Perez <fperez@colorado.edu>
6910
6934
6911 * Added .ipython/ directory to sys.path. This way users can keep
6935 * Added .ipython/ directory to sys.path. This way users can keep
6912 customizations there and access them via import.
6936 customizations there and access them via import.
6913
6937
6914 2001-11-03 Fernando Perez <fperez@colorado.edu>
6938 2001-11-03 Fernando Perez <fperez@colorado.edu>
6915
6939
6916 * Opened version 0.1.1 for new changes.
6940 * Opened version 0.1.1 for new changes.
6917
6941
6918 * Changed version number to 0.1.0: first 'public' release, sent to
6942 * Changed version number to 0.1.0: first 'public' release, sent to
6919 Nathan and Janko.
6943 Nathan and Janko.
6920
6944
6921 * Lots of small fixes and tweaks.
6945 * Lots of small fixes and tweaks.
6922
6946
6923 * Minor changes to whos format. Now strings are shown, snipped if
6947 * Minor changes to whos format. Now strings are shown, snipped if
6924 too long.
6948 too long.
6925
6949
6926 * Changed ShellServices to work on __main__ so they show up in @who
6950 * Changed ShellServices to work on __main__ so they show up in @who
6927
6951
6928 * Help also works with ? at the end of a line:
6952 * Help also works with ? at the end of a line:
6929 ?sin and sin?
6953 ?sin and sin?
6930 both produce the same effect. This is nice, as often I use the
6954 both produce the same effect. This is nice, as often I use the
6931 tab-complete to find the name of a method, but I used to then have
6955 tab-complete to find the name of a method, but I used to then have
6932 to go to the beginning of the line to put a ? if I wanted more
6956 to go to the beginning of the line to put a ? if I wanted more
6933 info. Now I can just add the ? and hit return. Convenient.
6957 info. Now I can just add the ? and hit return. Convenient.
6934
6958
6935 2001-11-02 Fernando Perez <fperez@colorado.edu>
6959 2001-11-02 Fernando Perez <fperez@colorado.edu>
6936
6960
6937 * Python version check (>=2.1) added.
6961 * Python version check (>=2.1) added.
6938
6962
6939 * Added LazyPython documentation. At this point the docs are quite
6963 * Added LazyPython documentation. At this point the docs are quite
6940 a mess. A cleanup is in order.
6964 a mess. A cleanup is in order.
6941
6965
6942 * Auto-installer created. For some bizarre reason, the zipfiles
6966 * Auto-installer created. For some bizarre reason, the zipfiles
6943 module isn't working on my system. So I made a tar version
6967 module isn't working on my system. So I made a tar version
6944 (hopefully the command line options in various systems won't kill
6968 (hopefully the command line options in various systems won't kill
6945 me).
6969 me).
6946
6970
6947 * Fixes to Struct in genutils. Now all dictionary-like methods are
6971 * Fixes to Struct in genutils. Now all dictionary-like methods are
6948 protected (reasonably).
6972 protected (reasonably).
6949
6973
6950 * Added pager function to genutils and changed ? to print usage
6974 * Added pager function to genutils and changed ? to print usage
6951 note through it (it was too long).
6975 note through it (it was too long).
6952
6976
6953 * Added the LazyPython functionality. Works great! I changed the
6977 * Added the LazyPython functionality. Works great! I changed the
6954 auto-quote escape to ';', it's on home row and next to '. But
6978 auto-quote escape to ';', it's on home row and next to '. But
6955 both auto-quote and auto-paren (still /) escapes are command-line
6979 both auto-quote and auto-paren (still /) escapes are command-line
6956 parameters.
6980 parameters.
6957
6981
6958
6982
6959 2001-11-01 Fernando Perez <fperez@colorado.edu>
6983 2001-11-01 Fernando Perez <fperez@colorado.edu>
6960
6984
6961 * Version changed to 0.0.7. Fairly large change: configuration now
6985 * Version changed to 0.0.7. Fairly large change: configuration now
6962 is all stored in a directory, by default .ipython. There, all
6986 is all stored in a directory, by default .ipython. There, all
6963 config files have normal looking names (not .names)
6987 config files have normal looking names (not .names)
6964
6988
6965 * Version 0.0.6 Released first to Lucas and Archie as a test
6989 * Version 0.0.6 Released first to Lucas and Archie as a test
6966 run. Since it's the first 'semi-public' release, change version to
6990 run. Since it's the first 'semi-public' release, change version to
6967 > 0.0.6 for any changes now.
6991 > 0.0.6 for any changes now.
6968
6992
6969 * Stuff I had put in the ipplib.py changelog:
6993 * Stuff I had put in the ipplib.py changelog:
6970
6994
6971 Changes to InteractiveShell:
6995 Changes to InteractiveShell:
6972
6996
6973 - Made the usage message a parameter.
6997 - Made the usage message a parameter.
6974
6998
6975 - Require the name of the shell variable to be given. It's a bit
6999 - Require the name of the shell variable to be given. It's a bit
6976 of a hack, but allows the name 'shell' not to be hardwired in the
7000 of a hack, but allows the name 'shell' not to be hardwired in the
6977 magic (@) handler, which is problematic b/c it requires
7001 magic (@) handler, which is problematic b/c it requires
6978 polluting the global namespace with 'shell'. This in turn is
7002 polluting the global namespace with 'shell'. This in turn is
6979 fragile: if a user redefines a variable called shell, things
7003 fragile: if a user redefines a variable called shell, things
6980 break.
7004 break.
6981
7005
6982 - magic @: all functions available through @ need to be defined
7006 - magic @: all functions available through @ need to be defined
6983 as magic_<name>, even though they can be called simply as
7007 as magic_<name>, even though they can be called simply as
6984 @<name>. This allows the special command @magic to gather
7008 @<name>. This allows the special command @magic to gather
6985 information automatically about all existing magic functions,
7009 information automatically about all existing magic functions,
6986 even if they are run-time user extensions, by parsing the shell
7010 even if they are run-time user extensions, by parsing the shell
6987 instance __dict__ looking for special magic_ names.
7011 instance __dict__ looking for special magic_ names.
6988
7012
6989 - mainloop: added *two* local namespace parameters. This allows
7013 - mainloop: added *two* local namespace parameters. This allows
6990 the class to differentiate between parameters which were there
7014 the class to differentiate between parameters which were there
6991 before and after command line initialization was processed. This
7015 before and after command line initialization was processed. This
6992 way, later @who can show things loaded at startup by the
7016 way, later @who can show things loaded at startup by the
6993 user. This trick was necessary to make session saving/reloading
7017 user. This trick was necessary to make session saving/reloading
6994 really work: ideally after saving/exiting/reloading a session,
7018 really work: ideally after saving/exiting/reloading a session,
6995 *everything* should look the same, including the output of @who. I
7019 *everything* should look the same, including the output of @who. I
6996 was only able to make this work with this double namespace
7020 was only able to make this work with this double namespace
6997 trick.
7021 trick.
6998
7022
6999 - added a header to the logfile which allows (almost) full
7023 - added a header to the logfile which allows (almost) full
7000 session restoring.
7024 session restoring.
7001
7025
7002 - prepend lines beginning with @ or !, with a and log
7026 - prepend lines beginning with @ or !, with a and log
7003 them. Why? !lines: may be useful to know what you did @lines:
7027 them. Why? !lines: may be useful to know what you did @lines:
7004 they may affect session state. So when restoring a session, at
7028 they may affect session state. So when restoring a session, at
7005 least inform the user of their presence. I couldn't quite get
7029 least inform the user of their presence. I couldn't quite get
7006 them to properly re-execute, but at least the user is warned.
7030 them to properly re-execute, but at least the user is warned.
7007
7031
7008 * Started ChangeLog.
7032 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now