##// END OF EJS Templates
- Add %logstop functionality to fully stop logger after turning it on....
fperez -
Show More
@@ -1,261 +1,271 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 Logger class for IPython's logging facilities.
3 Logger class for IPython's logging facilities.
4
4
5 $Id: Logger.py 2653 2007-08-22 18:01:09Z vivainio $
5 $Id: Logger.py 2874 2007-11-26 06:50:42Z fperez $
6 """
6 """
7
7
8 #*****************************************************************************
8 #*****************************************************************************
9 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
9 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
11 #
11 #
12 # Distributed under the terms of the BSD License. The full license is in
12 # Distributed under the terms of the BSD License. The full license is in
13 # the file COPYING, distributed as part of this software.
13 # the file COPYING, distributed as part of this software.
14 #*****************************************************************************
14 #*****************************************************************************
15
15
16 #****************************************************************************
16 #****************************************************************************
17 # Modules and globals
17 # Modules and globals
18
18
19 from IPython import Release
19 from IPython import Release
20 __author__ = '%s <%s>\n%s <%s>' % \
20 __author__ = '%s <%s>\n%s <%s>' % \
21 ( Release.authors['Janko'] + Release.authors['Fernando'] )
21 ( Release.authors['Janko'] + Release.authors['Fernando'] )
22 __license__ = Release.license
22 __license__ = Release.license
23
23
24 # Python standard modules
24 # Python standard modules
25 import glob
25 import glob
26 import os
26 import os
27 import time
27 import time
28
28
29 #****************************************************************************
29 #****************************************************************************
30 # FIXME: This class isn't a mixin anymore, but it still needs attributes from
30 # FIXME: This class isn't a mixin anymore, but it still needs attributes from
31 # ipython and does input cache management. Finish cleanup later...
31 # ipython and does input cache management. Finish cleanup later...
32
32
33 class Logger(object):
33 class Logger(object):
34 """A Logfile class with different policies for file creation"""
34 """A Logfile class with different policies for file creation"""
35
35
36 def __init__(self,shell,logfname='Logger.log',loghead='',logmode='over'):
36 def __init__(self,shell,logfname='Logger.log',loghead='',logmode='over'):
37
37
38 self._i00,self._i,self._ii,self._iii = '','','',''
38 self._i00,self._i,self._ii,self._iii = '','','',''
39
39
40 # this is the full ipython instance, we need some attributes from it
40 # this is the full ipython instance, we need some attributes from it
41 # which won't exist until later. What a mess, clean up later...
41 # which won't exist until later. What a mess, clean up later...
42 self.shell = shell
42 self.shell = shell
43
43
44 self.logfname = logfname
44 self.logfname = logfname
45 self.loghead = loghead
45 self.loghead = loghead
46 self.logmode = logmode
46 self.logmode = logmode
47 self.logfile = None
47 self.logfile = None
48
48
49 # Whether to log raw or processed input
49 # Whether to log raw or processed input
50 self.log_raw_input = False
50 self.log_raw_input = False
51
51
52 # whether to also log output
52 # whether to also log output
53 self.log_output = False
53 self.log_output = False
54
54
55 # whether to put timestamps before each log entry
55 # whether to put timestamps before each log entry
56 self.timestamp = False
56 self.timestamp = False
57
57
58 # activity control flags
58 # activity control flags
59 self.log_active = False
59 self.log_active = False
60
60
61 # logmode is a validated property
61 # logmode is a validated property
62 def _set_mode(self,mode):
62 def _set_mode(self,mode):
63 if mode not in ['append','backup','global','over','rotate']:
63 if mode not in ['append','backup','global','over','rotate']:
64 raise ValueError,'invalid log mode %s given' % mode
64 raise ValueError,'invalid log mode %s given' % mode
65 self._logmode = mode
65 self._logmode = mode
66
66
67 def _get_mode(self):
67 def _get_mode(self):
68 return self._logmode
68 return self._logmode
69
69
70 logmode = property(_get_mode,_set_mode)
70 logmode = property(_get_mode,_set_mode)
71
71
72 def logstart(self,logfname=None,loghead=None,logmode=None,
72 def logstart(self,logfname=None,loghead=None,logmode=None,
73 log_output=False,timestamp=False,log_raw_input=False):
73 log_output=False,timestamp=False,log_raw_input=False):
74 """Generate a new log-file with a default header.
74 """Generate a new log-file with a default header.
75
75
76 Raises RuntimeError if the log has already been started"""
76 Raises RuntimeError if the log has already been started"""
77
77
78 if self.logfile is not None:
78 if self.logfile is not None:
79 raise RuntimeError('Log file is already active: %s' %
79 raise RuntimeError('Log file is already active: %s' %
80 self.logfname)
80 self.logfname)
81
81
82 self.log_active = True
82 self.log_active = True
83
83
84 # The parameters can override constructor defaults
84 # The parameters can override constructor defaults
85 if logfname is not None: self.logfname = logfname
85 if logfname is not None: self.logfname = logfname
86 if loghead is not None: self.loghead = loghead
86 if loghead is not None: self.loghead = loghead
87 if logmode is not None: self.logmode = logmode
87 if logmode is not None: self.logmode = logmode
88
88
89 # Parameters not part of the constructor
89 # Parameters not part of the constructor
90 self.timestamp = timestamp
90 self.timestamp = timestamp
91 self.log_output = log_output
91 self.log_output = log_output
92 self.log_raw_input = log_raw_input
92 self.log_raw_input = log_raw_input
93
93
94 # init depending on the log mode requested
94 # init depending on the log mode requested
95 isfile = os.path.isfile
95 isfile = os.path.isfile
96 logmode = self.logmode
96 logmode = self.logmode
97
97
98 if logmode == 'append':
98 if logmode == 'append':
99 self.logfile = open(self.logfname,'a')
99 self.logfile = open(self.logfname,'a')
100
100
101 elif logmode == 'backup':
101 elif logmode == 'backup':
102 if isfile(self.logfname):
102 if isfile(self.logfname):
103 backup_logname = self.logfname+'~'
103 backup_logname = self.logfname+'~'
104 # Manually remove any old backup, since os.rename may fail
104 # Manually remove any old backup, since os.rename may fail
105 # under Windows.
105 # under Windows.
106 if isfile(backup_logname):
106 if isfile(backup_logname):
107 os.remove(backup_logname)
107 os.remove(backup_logname)
108 os.rename(self.logfname,backup_logname)
108 os.rename(self.logfname,backup_logname)
109 self.logfile = open(self.logfname,'w')
109 self.logfile = open(self.logfname,'w')
110
110
111 elif logmode == 'global':
111 elif logmode == 'global':
112 self.logfname = os.path.join(self.shell.home_dir,self.logfname)
112 self.logfname = os.path.join(self.shell.home_dir,self.logfname)
113 self.logfile = open(self.logfname, 'a')
113 self.logfile = open(self.logfname, 'a')
114
114
115 elif logmode == 'over':
115 elif logmode == 'over':
116 if isfile(self.logfname):
116 if isfile(self.logfname):
117 os.remove(self.logfname)
117 os.remove(self.logfname)
118 self.logfile = open(self.logfname,'w')
118 self.logfile = open(self.logfname,'w')
119
119
120 elif logmode == 'rotate':
120 elif logmode == 'rotate':
121 if isfile(self.logfname):
121 if isfile(self.logfname):
122 if isfile(self.logfname+'.001~'):
122 if isfile(self.logfname+'.001~'):
123 old = glob.glob(self.logfname+'.*~')
123 old = glob.glob(self.logfname+'.*~')
124 old.sort()
124 old.sort()
125 old.reverse()
125 old.reverse()
126 for f in old:
126 for f in old:
127 root, ext = os.path.splitext(f)
127 root, ext = os.path.splitext(f)
128 num = int(ext[1:-1])+1
128 num = int(ext[1:-1])+1
129 os.rename(f, root+'.'+`num`.zfill(3)+'~')
129 os.rename(f, root+'.'+`num`.zfill(3)+'~')
130 os.rename(self.logfname, self.logfname+'.001~')
130 os.rename(self.logfname, self.logfname+'.001~')
131 self.logfile = open(self.logfname,'w')
131 self.logfile = open(self.logfname,'w')
132
132
133 if logmode != 'append':
133 if logmode != 'append':
134 self.logfile.write(self.loghead)
134 self.logfile.write(self.loghead)
135
135
136 self.logfile.flush()
136 self.logfile.flush()
137
137
138 def switch_log(self,val):
138 def switch_log(self,val):
139 """Switch logging on/off. val should be ONLY a boolean."""
139 """Switch logging on/off. val should be ONLY a boolean."""
140
140
141 if val not in [False,True,0,1]:
141 if val not in [False,True,0,1]:
142 raise ValueError, \
142 raise ValueError, \
143 'Call switch_log ONLY with a boolean argument, not with:',val
143 'Call switch_log ONLY with a boolean argument, not with:',val
144
144
145 label = {0:'OFF',1:'ON',False:'OFF',True:'ON'}
145 label = {0:'OFF',1:'ON',False:'OFF',True:'ON'}
146
146
147 if self.logfile is None:
147 if self.logfile is None:
148 print """
148 print """
149 Logging hasn't been started yet (use logstart for that).
149 Logging hasn't been started yet (use logstart for that).
150
150
151 %logon/%logoff are for temporarily starting and stopping logging for a logfile
151 %logon/%logoff are for temporarily starting and stopping logging for a logfile
152 which already exists. But you must first start the logging process with
152 which already exists. But you must first start the logging process with
153 %logstart (optionally giving a logfile name)."""
153 %logstart (optionally giving a logfile name)."""
154
154
155 else:
155 else:
156 if self.log_active == val:
156 if self.log_active == val:
157 print 'Logging is already',label[val]
157 print 'Logging is already',label[val]
158 else:
158 else:
159 print 'Switching logging',label[val]
159 print 'Switching logging',label[val]
160 self.log_active = not self.log_active
160 self.log_active = not self.log_active
161 self.log_active_out = self.log_active
161 self.log_active_out = self.log_active
162
162
163 def logstate(self):
163 def logstate(self):
164 """Print a status message about the logger."""
164 """Print a status message about the logger."""
165 if self.logfile is None:
165 if self.logfile is None:
166 print 'Logging has not been activated.'
166 print 'Logging has not been activated.'
167 else:
167 else:
168 state = self.log_active and 'active' or 'temporarily suspended'
168 state = self.log_active and 'active' or 'temporarily suspended'
169 print 'Filename :',self.logfname
169 print 'Filename :',self.logfname
170 print 'Mode :',self.logmode
170 print 'Mode :',self.logmode
171 print 'Output logging :',self.log_output
171 print 'Output logging :',self.log_output
172 print 'Raw input log :',self.log_raw_input
172 print 'Raw input log :',self.log_raw_input
173 print 'Timestamping :',self.timestamp
173 print 'Timestamping :',self.timestamp
174 print 'State :',state
174 print 'State :',state
175
175
176 def log(self,line_ori,line_mod,continuation=None):
176 def log(self,line_ori,line_mod,continuation=None):
177 """Write the line to a log and create input cache variables _i*.
177 """Write the line to a log and create input cache variables _i*.
178
178
179 Inputs:
179 Inputs:
180
180
181 - line_ori: unmodified input line from the user. This is not
181 - line_ori: unmodified input line from the user. This is not
182 necessarily valid Python.
182 necessarily valid Python.
183
183
184 - line_mod: possibly modified input, such as the transformations made
184 - line_mod: possibly modified input, such as the transformations made
185 by input prefilters or input handlers of various kinds. This should
185 by input prefilters or input handlers of various kinds. This should
186 always be valid Python.
186 always be valid Python.
187
187
188 - continuation: if True, indicates this is part of multi-line input."""
188 - continuation: if True, indicates this is part of multi-line input."""
189
189
190 # update the auto _i tables
190 # update the auto _i tables
191 #print '***logging line',line_mod # dbg
191 #print '***logging line',line_mod # dbg
192 #print '***cache_count', self.shell.outputcache.prompt_count # dbg
192 #print '***cache_count', self.shell.outputcache.prompt_count # dbg
193 try:
193 try:
194 input_hist = self.shell.user_ns['_ih']
194 input_hist = self.shell.user_ns['_ih']
195 except:
195 except:
196 print 'userns:',self.shell.user_ns.keys()
196 print 'userns:',self.shell.user_ns.keys()
197 return
197 return
198
198
199 out_cache = self.shell.outputcache
199 out_cache = self.shell.outputcache
200
200
201 # add blank lines if the input cache fell out of sync.
201 # add blank lines if the input cache fell out of sync.
202 if out_cache.do_full_cache and \
202 if out_cache.do_full_cache and \
203 out_cache.prompt_count +1 > len(input_hist):
203 out_cache.prompt_count +1 > len(input_hist):
204 input_hist.extend(['\n'] * (out_cache.prompt_count - len(input_hist)))
204 input_hist.extend(['\n'] * (out_cache.prompt_count - len(input_hist)))
205
205
206 if not continuation and line_mod:
206 if not continuation and line_mod:
207 self._iii = self._ii
207 self._iii = self._ii
208 self._ii = self._i
208 self._ii = self._i
209 self._i = self._i00
209 self._i = self._i00
210 # put back the final \n of every input line
210 # put back the final \n of every input line
211 self._i00 = line_mod+'\n'
211 self._i00 = line_mod+'\n'
212 #print 'Logging input:<%s>' % line_mod # dbg
212 #print 'Logging input:<%s>' % line_mod # dbg
213 input_hist.append(self._i00)
213 input_hist.append(self._i00)
214 #print '---[%s]' % (len(input_hist)-1,) # dbg
214 #print '---[%s]' % (len(input_hist)-1,) # dbg
215
215
216 # hackish access to top-level namespace to create _i1,_i2... dynamically
216 # hackish access to top-level namespace to create _i1,_i2... dynamically
217 to_main = {'_i':self._i,'_ii':self._ii,'_iii':self._iii}
217 to_main = {'_i':self._i,'_ii':self._ii,'_iii':self._iii}
218 if self.shell.outputcache.do_full_cache:
218 if self.shell.outputcache.do_full_cache:
219 in_num = self.shell.outputcache.prompt_count
219 in_num = self.shell.outputcache.prompt_count
220
220
221 # but if the opposite is true (a macro can produce multiple inputs
221 # but if the opposite is true (a macro can produce multiple inputs
222 # with no output display called), then bring the output counter in
222 # with no output display called), then bring the output counter in
223 # sync:
223 # sync:
224 last_num = len(input_hist)-1
224 last_num = len(input_hist)-1
225 if in_num != last_num:
225 if in_num != last_num:
226 in_num = self.shell.outputcache.prompt_count = last_num
226 in_num = self.shell.outputcache.prompt_count = last_num
227 new_i = '_i%s' % in_num
227 new_i = '_i%s' % in_num
228 if continuation:
228 if continuation:
229 self._i00 = '%s%s\n' % (self.shell.user_ns[new_i],line_mod)
229 self._i00 = '%s%s\n' % (self.shell.user_ns[new_i],line_mod)
230 input_hist[in_num] = self._i00
230 input_hist[in_num] = self._i00
231 to_main[new_i] = self._i00
231 to_main[new_i] = self._i00
232 self.shell.user_ns.update(to_main)
232 self.shell.user_ns.update(to_main)
233
233
234 # Write the log line, but decide which one according to the
234 # Write the log line, but decide which one according to the
235 # log_raw_input flag, set when the log is started.
235 # log_raw_input flag, set when the log is started.
236 if self.log_raw_input:
236 if self.log_raw_input:
237 self.log_write(line_ori)
237 self.log_write(line_ori)
238 else:
238 else:
239 self.log_write(line_mod)
239 self.log_write(line_mod)
240
240
241 def log_write(self,data,kind='input'):
241 def log_write(self,data,kind='input'):
242 """Write data to the log file, if active"""
242 """Write data to the log file, if active"""
243
243
244 #print 'data: %r' % data # dbg
244 #print 'data: %r' % data # dbg
245 if self.log_active and data:
245 if self.log_active and data:
246 write = self.logfile.write
246 write = self.logfile.write
247 if kind=='input':
247 if kind=='input':
248 if self.timestamp:
248 if self.timestamp:
249 write(time.strftime('# %a, %d %b %Y %H:%M:%S\n',
249 write(time.strftime('# %a, %d %b %Y %H:%M:%S\n',
250 time.localtime()))
250 time.localtime()))
251 write('%s\n' % data)
251 write('%s\n' % data)
252 elif kind=='output' and self.log_output:
252 elif kind=='output' and self.log_output:
253 odata = '\n'.join(['#[Out]# %s' % s
253 odata = '\n'.join(['#[Out]# %s' % s
254 for s in data.split('\n')])
254 for s in data.split('\n')])
255 write('%s\n' % odata)
255 write('%s\n' % odata)
256 self.logfile.flush()
256 self.logfile.flush()
257
257
258 def close_log(self):
258 def logstop(self):
259 """Fully stop logging and close log file.
260
261 In order to start logging again, a new logstart() call needs to be
262 made, possibly (though not necessarily) with a new filename, mode and
263 other options."""
264
259 self.logfile.close()
265 self.logfile.close()
260 self.logfile = None
266 self.logfile = None
261 self.logfname = ''
267 self.logfname = ''
268 self.log_active = False
269
270 # For backwards compatibility, in case anyone was using this.
271 close_log = logstop
@@ -1,3265 +1,3273 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Magic functions for InteractiveShell.
2 """Magic functions for InteractiveShell.
3
3
4 $Id: Magic.py 2872 2007-11-25 17:58:05Z fperez $"""
4 $Id: Magic.py 2874 2007-11-26 06:50:42Z fperez $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
8 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
8 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
9 #
9 #
10 # Distributed under the terms of the BSD License. The full license is in
10 # Distributed under the terms of the BSD License. The full license is in
11 # the file COPYING, distributed as part of this software.
11 # the file COPYING, distributed as part of this software.
12 #*****************************************************************************
12 #*****************************************************************************
13
13
14 #****************************************************************************
14 #****************************************************************************
15 # Modules and globals
15 # Modules and globals
16
16
17 from IPython import Release
17 from IPython import Release
18 __author__ = '%s <%s>\n%s <%s>' % \
18 __author__ = '%s <%s>\n%s <%s>' % \
19 ( Release.authors['Janko'] + Release.authors['Fernando'] )
19 ( Release.authors['Janko'] + Release.authors['Fernando'] )
20 __license__ = Release.license
20 __license__ = Release.license
21
21
22 # Python standard modules
22 # Python standard modules
23 import __builtin__
23 import __builtin__
24 import bdb
24 import bdb
25 import inspect
25 import inspect
26 import os
26 import os
27 import pdb
27 import pdb
28 import pydoc
28 import pydoc
29 import sys
29 import sys
30 import re
30 import re
31 import tempfile
31 import tempfile
32 import time
32 import time
33 import cPickle as pickle
33 import cPickle as pickle
34 import textwrap
34 import textwrap
35 from cStringIO import StringIO
35 from cStringIO import StringIO
36 from getopt import getopt,GetoptError
36 from getopt import getopt,GetoptError
37 from pprint import pprint, pformat
37 from pprint import pprint, pformat
38 from sets import Set
38 from sets import Set
39
39
40 # cProfile was added in Python2.5
40 # cProfile was added in Python2.5
41 try:
41 try:
42 import cProfile as profile
42 import cProfile as profile
43 import pstats
43 import pstats
44 except ImportError:
44 except ImportError:
45 # profile isn't bundled by default in Debian for license reasons
45 # profile isn't bundled by default in Debian for license reasons
46 try:
46 try:
47 import profile,pstats
47 import profile,pstats
48 except ImportError:
48 except ImportError:
49 profile = pstats = None
49 profile = pstats = None
50
50
51 # Homebrewed
51 # Homebrewed
52 import IPython
52 import IPython
53 from IPython import Debugger, OInspect, wildcard
53 from IPython import Debugger, OInspect, wildcard
54 from IPython.FakeModule import FakeModule
54 from IPython.FakeModule import FakeModule
55 from IPython.Itpl import Itpl, itpl, printpl,itplns
55 from IPython.Itpl import Itpl, itpl, printpl,itplns
56 from IPython.PyColorize import Parser
56 from IPython.PyColorize import Parser
57 from IPython.ipstruct import Struct
57 from IPython.ipstruct import Struct
58 from IPython.macro import Macro
58 from IPython.macro import Macro
59 from IPython.genutils import *
59 from IPython.genutils import *
60 from IPython import platutils
60 from IPython import platutils
61 import IPython.generics
61 import IPython.generics
62 import IPython.ipapi
62 import IPython.ipapi
63 from IPython.ipapi import UsageError
63 from IPython.ipapi import UsageError
64 #***************************************************************************
64 #***************************************************************************
65 # Utility functions
65 # Utility functions
66 def on_off(tag):
66 def on_off(tag):
67 """Return an ON/OFF string for a 1/0 input. Simple utility function."""
67 """Return an ON/OFF string for a 1/0 input. Simple utility function."""
68 return ['OFF','ON'][tag]
68 return ['OFF','ON'][tag]
69
69
70 class Bunch: pass
70 class Bunch: pass
71
71
72 def compress_dhist(dh):
72 def compress_dhist(dh):
73 head, tail = dh[:-10], dh[-10:]
73 head, tail = dh[:-10], dh[-10:]
74
74
75 newhead = []
75 newhead = []
76 done = Set()
76 done = Set()
77 for h in head:
77 for h in head:
78 if h in done:
78 if h in done:
79 continue
79 continue
80 newhead.append(h)
80 newhead.append(h)
81 done.add(h)
81 done.add(h)
82
82
83 return newhead + tail
83 return newhead + tail
84
84
85
85
86 #***************************************************************************
86 #***************************************************************************
87 # Main class implementing Magic functionality
87 # Main class implementing Magic functionality
88 class Magic:
88 class Magic:
89 """Magic functions for InteractiveShell.
89 """Magic functions for InteractiveShell.
90
90
91 Shell functions which can be reached as %function_name. All magic
91 Shell functions which can be reached as %function_name. All magic
92 functions should accept a string, which they can parse for their own
92 functions should accept a string, which they can parse for their own
93 needs. This can make some functions easier to type, eg `%cd ../`
93 needs. This can make some functions easier to type, eg `%cd ../`
94 vs. `%cd("../")`
94 vs. `%cd("../")`
95
95
96 ALL definitions MUST begin with the prefix magic_. The user won't need it
96 ALL definitions MUST begin with the prefix magic_. The user won't need it
97 at the command line, but it is is needed in the definition. """
97 at the command line, but it is is needed in the definition. """
98
98
99 # class globals
99 # class globals
100 auto_status = ['Automagic is OFF, % prefix IS needed for magic functions.',
100 auto_status = ['Automagic is OFF, % prefix IS needed for magic functions.',
101 'Automagic is ON, % prefix NOT needed for magic functions.']
101 'Automagic is ON, % prefix NOT needed for magic functions.']
102
102
103 #......................................................................
103 #......................................................................
104 # some utility functions
104 # some utility functions
105
105
106 def __init__(self,shell):
106 def __init__(self,shell):
107
107
108 self.options_table = {}
108 self.options_table = {}
109 if profile is None:
109 if profile is None:
110 self.magic_prun = self.profile_missing_notice
110 self.magic_prun = self.profile_missing_notice
111 self.shell = shell
111 self.shell = shell
112
112
113 # namespace for holding state we may need
113 # namespace for holding state we may need
114 self._magic_state = Bunch()
114 self._magic_state = Bunch()
115
115
116 def profile_missing_notice(self, *args, **kwargs):
116 def profile_missing_notice(self, *args, **kwargs):
117 error("""\
117 error("""\
118 The profile module could not be found. If you are a Debian user,
118 The profile module could not be found. If you are a Debian user,
119 it has been removed from the standard Debian package because of its non-free
119 it has been removed from the standard Debian package because of its non-free
120 license. To use profiling, please install"python2.3-profiler" from non-free.""")
120 license. To use profiling, please install"python2.3-profiler" from non-free.""")
121
121
122 def default_option(self,fn,optstr):
122 def default_option(self,fn,optstr):
123 """Make an entry in the options_table for fn, with value optstr"""
123 """Make an entry in the options_table for fn, with value optstr"""
124
124
125 if fn not in self.lsmagic():
125 if fn not in self.lsmagic():
126 error("%s is not a magic function" % fn)
126 error("%s is not a magic function" % fn)
127 self.options_table[fn] = optstr
127 self.options_table[fn] = optstr
128
128
129 def lsmagic(self):
129 def lsmagic(self):
130 """Return a list of currently available magic functions.
130 """Return a list of currently available magic functions.
131
131
132 Gives a list of the bare names after mangling (['ls','cd', ...], not
132 Gives a list of the bare names after mangling (['ls','cd', ...], not
133 ['magic_ls','magic_cd',...]"""
133 ['magic_ls','magic_cd',...]"""
134
134
135 # FIXME. This needs a cleanup, in the way the magics list is built.
135 # FIXME. This needs a cleanup, in the way the magics list is built.
136
136
137 # magics in class definition
137 # magics in class definition
138 class_magic = lambda fn: fn.startswith('magic_') and \
138 class_magic = lambda fn: fn.startswith('magic_') and \
139 callable(Magic.__dict__[fn])
139 callable(Magic.__dict__[fn])
140 # in instance namespace (run-time user additions)
140 # in instance namespace (run-time user additions)
141 inst_magic = lambda fn: fn.startswith('magic_') and \
141 inst_magic = lambda fn: fn.startswith('magic_') and \
142 callable(self.__dict__[fn])
142 callable(self.__dict__[fn])
143 # and bound magics by user (so they can access self):
143 # and bound magics by user (so they can access self):
144 inst_bound_magic = lambda fn: fn.startswith('magic_') and \
144 inst_bound_magic = lambda fn: fn.startswith('magic_') and \
145 callable(self.__class__.__dict__[fn])
145 callable(self.__class__.__dict__[fn])
146 magics = filter(class_magic,Magic.__dict__.keys()) + \
146 magics = filter(class_magic,Magic.__dict__.keys()) + \
147 filter(inst_magic,self.__dict__.keys()) + \
147 filter(inst_magic,self.__dict__.keys()) + \
148 filter(inst_bound_magic,self.__class__.__dict__.keys())
148 filter(inst_bound_magic,self.__class__.__dict__.keys())
149 out = []
149 out = []
150 for fn in magics:
150 for fn in magics:
151 out.append(fn.replace('magic_','',1))
151 out.append(fn.replace('magic_','',1))
152 out.sort()
152 out.sort()
153 return out
153 return out
154
154
155 def extract_input_slices(self,slices,raw=False):
155 def extract_input_slices(self,slices,raw=False):
156 """Return as a string a set of input history slices.
156 """Return as a string a set of input history slices.
157
157
158 Inputs:
158 Inputs:
159
159
160 - slices: the set of slices is given as a list of strings (like
160 - slices: the set of slices is given as a list of strings (like
161 ['1','4:8','9'], since this function is for use by magic functions
161 ['1','4:8','9'], since this function is for use by magic functions
162 which get their arguments as strings.
162 which get their arguments as strings.
163
163
164 Optional inputs:
164 Optional inputs:
165
165
166 - raw(False): by default, the processed input is used. If this is
166 - raw(False): by default, the processed input is used. If this is
167 true, the raw input history is used instead.
167 true, the raw input history is used instead.
168
168
169 Note that slices can be called with two notations:
169 Note that slices can be called with two notations:
170
170
171 N:M -> standard python form, means including items N...(M-1).
171 N:M -> standard python form, means including items N...(M-1).
172
172
173 N-M -> include items N..M (closed endpoint)."""
173 N-M -> include items N..M (closed endpoint)."""
174
174
175 if raw:
175 if raw:
176 hist = self.shell.input_hist_raw
176 hist = self.shell.input_hist_raw
177 else:
177 else:
178 hist = self.shell.input_hist
178 hist = self.shell.input_hist
179
179
180 cmds = []
180 cmds = []
181 for chunk in slices:
181 for chunk in slices:
182 if ':' in chunk:
182 if ':' in chunk:
183 ini,fin = map(int,chunk.split(':'))
183 ini,fin = map(int,chunk.split(':'))
184 elif '-' in chunk:
184 elif '-' in chunk:
185 ini,fin = map(int,chunk.split('-'))
185 ini,fin = map(int,chunk.split('-'))
186 fin += 1
186 fin += 1
187 else:
187 else:
188 ini = int(chunk)
188 ini = int(chunk)
189 fin = ini+1
189 fin = ini+1
190 cmds.append(hist[ini:fin])
190 cmds.append(hist[ini:fin])
191 return cmds
191 return cmds
192
192
193 def _ofind(self, oname, namespaces=None):
193 def _ofind(self, oname, namespaces=None):
194 """Find an object in the available namespaces.
194 """Find an object in the available namespaces.
195
195
196 self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic
196 self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic
197
197
198 Has special code to detect magic functions.
198 Has special code to detect magic functions.
199 """
199 """
200
200
201 oname = oname.strip()
201 oname = oname.strip()
202
202
203 alias_ns = None
203 alias_ns = None
204 if namespaces is None:
204 if namespaces is None:
205 # Namespaces to search in:
205 # Namespaces to search in:
206 # Put them in a list. The order is important so that we
206 # Put them in a list. The order is important so that we
207 # find things in the same order that Python finds them.
207 # find things in the same order that Python finds them.
208 namespaces = [ ('Interactive', self.shell.user_ns),
208 namespaces = [ ('Interactive', self.shell.user_ns),
209 ('IPython internal', self.shell.internal_ns),
209 ('IPython internal', self.shell.internal_ns),
210 ('Python builtin', __builtin__.__dict__),
210 ('Python builtin', __builtin__.__dict__),
211 ('Alias', self.shell.alias_table),
211 ('Alias', self.shell.alias_table),
212 ]
212 ]
213 alias_ns = self.shell.alias_table
213 alias_ns = self.shell.alias_table
214
214
215 # initialize results to 'null'
215 # initialize results to 'null'
216 found = 0; obj = None; ospace = None; ds = None;
216 found = 0; obj = None; ospace = None; ds = None;
217 ismagic = 0; isalias = 0; parent = None
217 ismagic = 0; isalias = 0; parent = None
218
218
219 # Look for the given name by splitting it in parts. If the head is
219 # Look for the given name by splitting it in parts. If the head is
220 # found, then we look for all the remaining parts as members, and only
220 # found, then we look for all the remaining parts as members, and only
221 # declare success if we can find them all.
221 # declare success if we can find them all.
222 oname_parts = oname.split('.')
222 oname_parts = oname.split('.')
223 oname_head, oname_rest = oname_parts[0],oname_parts[1:]
223 oname_head, oname_rest = oname_parts[0],oname_parts[1:]
224 for nsname,ns in namespaces:
224 for nsname,ns in namespaces:
225 try:
225 try:
226 obj = ns[oname_head]
226 obj = ns[oname_head]
227 except KeyError:
227 except KeyError:
228 continue
228 continue
229 else:
229 else:
230 #print 'oname_rest:', oname_rest # dbg
230 #print 'oname_rest:', oname_rest # dbg
231 for part in oname_rest:
231 for part in oname_rest:
232 try:
232 try:
233 parent = obj
233 parent = obj
234 obj = getattr(obj,part)
234 obj = getattr(obj,part)
235 except:
235 except:
236 # Blanket except b/c some badly implemented objects
236 # Blanket except b/c some badly implemented objects
237 # allow __getattr__ to raise exceptions other than
237 # allow __getattr__ to raise exceptions other than
238 # AttributeError, which then crashes IPython.
238 # AttributeError, which then crashes IPython.
239 break
239 break
240 else:
240 else:
241 # If we finish the for loop (no break), we got all members
241 # If we finish the for loop (no break), we got all members
242 found = 1
242 found = 1
243 ospace = nsname
243 ospace = nsname
244 if ns == alias_ns:
244 if ns == alias_ns:
245 isalias = 1
245 isalias = 1
246 break # namespace loop
246 break # namespace loop
247
247
248 # Try to see if it's magic
248 # Try to see if it's magic
249 if not found:
249 if not found:
250 if oname.startswith(self.shell.ESC_MAGIC):
250 if oname.startswith(self.shell.ESC_MAGIC):
251 oname = oname[1:]
251 oname = oname[1:]
252 obj = getattr(self,'magic_'+oname,None)
252 obj = getattr(self,'magic_'+oname,None)
253 if obj is not None:
253 if obj is not None:
254 found = 1
254 found = 1
255 ospace = 'IPython internal'
255 ospace = 'IPython internal'
256 ismagic = 1
256 ismagic = 1
257
257
258 # Last try: special-case some literals like '', [], {}, etc:
258 # Last try: special-case some literals like '', [], {}, etc:
259 if not found and oname_head in ["''",'""','[]','{}','()']:
259 if not found and oname_head in ["''",'""','[]','{}','()']:
260 obj = eval(oname_head)
260 obj = eval(oname_head)
261 found = 1
261 found = 1
262 ospace = 'Interactive'
262 ospace = 'Interactive'
263
263
264 return {'found':found, 'obj':obj, 'namespace':ospace,
264 return {'found':found, 'obj':obj, 'namespace':ospace,
265 'ismagic':ismagic, 'isalias':isalias, 'parent':parent}
265 'ismagic':ismagic, 'isalias':isalias, 'parent':parent}
266
266
267 def arg_err(self,func):
267 def arg_err(self,func):
268 """Print docstring if incorrect arguments were passed"""
268 """Print docstring if incorrect arguments were passed"""
269 print 'Error in arguments:'
269 print 'Error in arguments:'
270 print OInspect.getdoc(func)
270 print OInspect.getdoc(func)
271
271
272 def format_latex(self,strng):
272 def format_latex(self,strng):
273 """Format a string for latex inclusion."""
273 """Format a string for latex inclusion."""
274
274
275 # Characters that need to be escaped for latex:
275 # Characters that need to be escaped for latex:
276 escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE)
276 escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE)
277 # Magic command names as headers:
277 # Magic command names as headers:
278 cmd_name_re = re.compile(r'^(%s.*?):' % self.shell.ESC_MAGIC,
278 cmd_name_re = re.compile(r'^(%s.*?):' % self.shell.ESC_MAGIC,
279 re.MULTILINE)
279 re.MULTILINE)
280 # Magic commands
280 # Magic commands
281 cmd_re = re.compile(r'(?P<cmd>%s.+?\b)(?!\}\}:)' % self.shell.ESC_MAGIC,
281 cmd_re = re.compile(r'(?P<cmd>%s.+?\b)(?!\}\}:)' % self.shell.ESC_MAGIC,
282 re.MULTILINE)
282 re.MULTILINE)
283 # Paragraph continue
283 # Paragraph continue
284 par_re = re.compile(r'\\$',re.MULTILINE)
284 par_re = re.compile(r'\\$',re.MULTILINE)
285
285
286 # The "\n" symbol
286 # The "\n" symbol
287 newline_re = re.compile(r'\\n')
287 newline_re = re.compile(r'\\n')
288
288
289 # Now build the string for output:
289 # Now build the string for output:
290 #strng = cmd_name_re.sub(r'\n\\texttt{\\textsl{\\large \1}}:',strng)
290 #strng = cmd_name_re.sub(r'\n\\texttt{\\textsl{\\large \1}}:',strng)
291 strng = cmd_name_re.sub(r'\n\\bigskip\n\\texttt{\\textbf{ \1}}:',
291 strng = cmd_name_re.sub(r'\n\\bigskip\n\\texttt{\\textbf{ \1}}:',
292 strng)
292 strng)
293 strng = cmd_re.sub(r'\\texttt{\g<cmd>}',strng)
293 strng = cmd_re.sub(r'\\texttt{\g<cmd>}',strng)
294 strng = par_re.sub(r'\\\\',strng)
294 strng = par_re.sub(r'\\\\',strng)
295 strng = escape_re.sub(r'\\\1',strng)
295 strng = escape_re.sub(r'\\\1',strng)
296 strng = newline_re.sub(r'\\textbackslash{}n',strng)
296 strng = newline_re.sub(r'\\textbackslash{}n',strng)
297 return strng
297 return strng
298
298
299 def format_screen(self,strng):
299 def format_screen(self,strng):
300 """Format a string for screen printing.
300 """Format a string for screen printing.
301
301
302 This removes some latex-type format codes."""
302 This removes some latex-type format codes."""
303 # Paragraph continue
303 # Paragraph continue
304 par_re = re.compile(r'\\$',re.MULTILINE)
304 par_re = re.compile(r'\\$',re.MULTILINE)
305 strng = par_re.sub('',strng)
305 strng = par_re.sub('',strng)
306 return strng
306 return strng
307
307
308 def parse_options(self,arg_str,opt_str,*long_opts,**kw):
308 def parse_options(self,arg_str,opt_str,*long_opts,**kw):
309 """Parse options passed to an argument string.
309 """Parse options passed to an argument string.
310
310
311 The interface is similar to that of getopt(), but it returns back a
311 The interface is similar to that of getopt(), but it returns back a
312 Struct with the options as keys and the stripped argument string still
312 Struct with the options as keys and the stripped argument string still
313 as a string.
313 as a string.
314
314
315 arg_str is quoted as a true sys.argv vector by using shlex.split.
315 arg_str is quoted as a true sys.argv vector by using shlex.split.
316 This allows us to easily expand variables, glob files, quote
316 This allows us to easily expand variables, glob files, quote
317 arguments, etc.
317 arguments, etc.
318
318
319 Options:
319 Options:
320 -mode: default 'string'. If given as 'list', the argument string is
320 -mode: default 'string'. If given as 'list', the argument string is
321 returned as a list (split on whitespace) instead of a string.
321 returned as a list (split on whitespace) instead of a string.
322
322
323 -list_all: put all option values in lists. Normally only options
323 -list_all: put all option values in lists. Normally only options
324 appearing more than once are put in a list.
324 appearing more than once are put in a list.
325
325
326 -posix (True): whether to split the input line in POSIX mode or not,
326 -posix (True): whether to split the input line in POSIX mode or not,
327 as per the conventions outlined in the shlex module from the
327 as per the conventions outlined in the shlex module from the
328 standard library."""
328 standard library."""
329
329
330 # inject default options at the beginning of the input line
330 # inject default options at the beginning of the input line
331 caller = sys._getframe(1).f_code.co_name.replace('magic_','')
331 caller = sys._getframe(1).f_code.co_name.replace('magic_','')
332 arg_str = '%s %s' % (self.options_table.get(caller,''),arg_str)
332 arg_str = '%s %s' % (self.options_table.get(caller,''),arg_str)
333
333
334 mode = kw.get('mode','string')
334 mode = kw.get('mode','string')
335 if mode not in ['string','list']:
335 if mode not in ['string','list']:
336 raise ValueError,'incorrect mode given: %s' % mode
336 raise ValueError,'incorrect mode given: %s' % mode
337 # Get options
337 # Get options
338 list_all = kw.get('list_all',0)
338 list_all = kw.get('list_all',0)
339 posix = kw.get('posix',True)
339 posix = kw.get('posix',True)
340
340
341 # Check if we have more than one argument to warrant extra processing:
341 # Check if we have more than one argument to warrant extra processing:
342 odict = {} # Dictionary with options
342 odict = {} # Dictionary with options
343 args = arg_str.split()
343 args = arg_str.split()
344 if len(args) >= 1:
344 if len(args) >= 1:
345 # If the list of inputs only has 0 or 1 thing in it, there's no
345 # If the list of inputs only has 0 or 1 thing in it, there's no
346 # need to look for options
346 # need to look for options
347 argv = arg_split(arg_str,posix)
347 argv = arg_split(arg_str,posix)
348 # Do regular option processing
348 # Do regular option processing
349 try:
349 try:
350 opts,args = getopt(argv,opt_str,*long_opts)
350 opts,args = getopt(argv,opt_str,*long_opts)
351 except GetoptError,e:
351 except GetoptError,e:
352 raise UsageError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
352 raise UsageError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
353 " ".join(long_opts)))
353 " ".join(long_opts)))
354 for o,a in opts:
354 for o,a in opts:
355 if o.startswith('--'):
355 if o.startswith('--'):
356 o = o[2:]
356 o = o[2:]
357 else:
357 else:
358 o = o[1:]
358 o = o[1:]
359 try:
359 try:
360 odict[o].append(a)
360 odict[o].append(a)
361 except AttributeError:
361 except AttributeError:
362 odict[o] = [odict[o],a]
362 odict[o] = [odict[o],a]
363 except KeyError:
363 except KeyError:
364 if list_all:
364 if list_all:
365 odict[o] = [a]
365 odict[o] = [a]
366 else:
366 else:
367 odict[o] = a
367 odict[o] = a
368
368
369 # Prepare opts,args for return
369 # Prepare opts,args for return
370 opts = Struct(odict)
370 opts = Struct(odict)
371 if mode == 'string':
371 if mode == 'string':
372 args = ' '.join(args)
372 args = ' '.join(args)
373
373
374 return opts,args
374 return opts,args
375
375
376 #......................................................................
376 #......................................................................
377 # And now the actual magic functions
377 # And now the actual magic functions
378
378
379 # Functions for IPython shell work (vars,funcs, config, etc)
379 # Functions for IPython shell work (vars,funcs, config, etc)
380 def magic_lsmagic(self, parameter_s = ''):
380 def magic_lsmagic(self, parameter_s = ''):
381 """List currently available magic functions."""
381 """List currently available magic functions."""
382 mesc = self.shell.ESC_MAGIC
382 mesc = self.shell.ESC_MAGIC
383 print 'Available magic functions:\n'+mesc+\
383 print 'Available magic functions:\n'+mesc+\
384 (' '+mesc).join(self.lsmagic())
384 (' '+mesc).join(self.lsmagic())
385 print '\n' + Magic.auto_status[self.shell.rc.automagic]
385 print '\n' + Magic.auto_status[self.shell.rc.automagic]
386 return None
386 return None
387
387
388 def magic_magic(self, parameter_s = ''):
388 def magic_magic(self, parameter_s = ''):
389 """Print information about the magic function system."""
389 """Print information about the magic function system."""
390
390
391 mode = ''
391 mode = ''
392 try:
392 try:
393 if parameter_s.split()[0] == '-latex':
393 if parameter_s.split()[0] == '-latex':
394 mode = 'latex'
394 mode = 'latex'
395 if parameter_s.split()[0] == '-brief':
395 if parameter_s.split()[0] == '-brief':
396 mode = 'brief'
396 mode = 'brief'
397 except:
397 except:
398 pass
398 pass
399
399
400 magic_docs = []
400 magic_docs = []
401 for fname in self.lsmagic():
401 for fname in self.lsmagic():
402 mname = 'magic_' + fname
402 mname = 'magic_' + fname
403 for space in (Magic,self,self.__class__):
403 for space in (Magic,self,self.__class__):
404 try:
404 try:
405 fn = space.__dict__[mname]
405 fn = space.__dict__[mname]
406 except KeyError:
406 except KeyError:
407 pass
407 pass
408 else:
408 else:
409 break
409 break
410 if mode == 'brief':
410 if mode == 'brief':
411 # only first line
411 # only first line
412 fndoc = fn.__doc__.split('\n',1)[0]
412 fndoc = fn.__doc__.split('\n',1)[0]
413 else:
413 else:
414 fndoc = fn.__doc__
414 fndoc = fn.__doc__
415
415
416 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
416 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
417 fname,fndoc))
417 fname,fndoc))
418 magic_docs = ''.join(magic_docs)
418 magic_docs = ''.join(magic_docs)
419
419
420 if mode == 'latex':
420 if mode == 'latex':
421 print self.format_latex(magic_docs)
421 print self.format_latex(magic_docs)
422 return
422 return
423 else:
423 else:
424 magic_docs = self.format_screen(magic_docs)
424 magic_docs = self.format_screen(magic_docs)
425 if mode == 'brief':
425 if mode == 'brief':
426 return magic_docs
426 return magic_docs
427
427
428 outmsg = """
428 outmsg = """
429 IPython's 'magic' functions
429 IPython's 'magic' functions
430 ===========================
430 ===========================
431
431
432 The magic function system provides a series of functions which allow you to
432 The magic function system provides a series of functions which allow you to
433 control the behavior of IPython itself, plus a lot of system-type
433 control the behavior of IPython itself, plus a lot of system-type
434 features. All these functions are prefixed with a % character, but parameters
434 features. All these functions are prefixed with a % character, but parameters
435 are given without parentheses or quotes.
435 are given without parentheses or quotes.
436
436
437 NOTE: If you have 'automagic' enabled (via the command line option or with the
437 NOTE: If you have 'automagic' enabled (via the command line option or with the
438 %automagic function), you don't need to type in the % explicitly. By default,
438 %automagic function), you don't need to type in the % explicitly. By default,
439 IPython ships with automagic on, so you should only rarely need the % escape.
439 IPython ships with automagic on, so you should only rarely need the % escape.
440
440
441 Example: typing '%cd mydir' (without the quotes) changes you working directory
441 Example: typing '%cd mydir' (without the quotes) changes you working directory
442 to 'mydir', if it exists.
442 to 'mydir', if it exists.
443
443
444 You can define your own magic functions to extend the system. See the supplied
444 You can define your own magic functions to extend the system. See the supplied
445 ipythonrc and example-magic.py files for details (in your ipython
445 ipythonrc and example-magic.py files for details (in your ipython
446 configuration directory, typically $HOME/.ipython/).
446 configuration directory, typically $HOME/.ipython/).
447
447
448 You can also define your own aliased names for magic functions. In your
448 You can also define your own aliased names for magic functions. In your
449 ipythonrc file, placing a line like:
449 ipythonrc file, placing a line like:
450
450
451 execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
451 execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
452
452
453 will define %pf as a new name for %profile.
453 will define %pf as a new name for %profile.
454
454
455 You can also call magics in code using the ipmagic() function, which IPython
455 You can also call magics in code using the ipmagic() function, which IPython
456 automatically adds to the builtin namespace. Type 'ipmagic?' for details.
456 automatically adds to the builtin namespace. Type 'ipmagic?' for details.
457
457
458 For a list of the available magic functions, use %lsmagic. For a description
458 For a list of the available magic functions, use %lsmagic. For a description
459 of any of them, type %magic_name?, e.g. '%cd?'.
459 of any of them, type %magic_name?, e.g. '%cd?'.
460
460
461 Currently the magic system has the following functions:\n"""
461 Currently the magic system has the following functions:\n"""
462
462
463 mesc = self.shell.ESC_MAGIC
463 mesc = self.shell.ESC_MAGIC
464 outmsg = ("%s\n%s\n\nSummary of magic functions (from %slsmagic):"
464 outmsg = ("%s\n%s\n\nSummary of magic functions (from %slsmagic):"
465 "\n\n%s%s\n\n%s" % (outmsg,
465 "\n\n%s%s\n\n%s" % (outmsg,
466 magic_docs,mesc,mesc,
466 magic_docs,mesc,mesc,
467 (' '+mesc).join(self.lsmagic()),
467 (' '+mesc).join(self.lsmagic()),
468 Magic.auto_status[self.shell.rc.automagic] ) )
468 Magic.auto_status[self.shell.rc.automagic] ) )
469
469
470 page(outmsg,screen_lines=self.shell.rc.screen_length)
470 page(outmsg,screen_lines=self.shell.rc.screen_length)
471
471
472
472
473 def magic_autoindent(self, parameter_s = ''):
473 def magic_autoindent(self, parameter_s = ''):
474 """Toggle autoindent on/off (if available)."""
474 """Toggle autoindent on/off (if available)."""
475
475
476 self.shell.set_autoindent()
476 self.shell.set_autoindent()
477 print "Automatic indentation is:",['OFF','ON'][self.shell.autoindent]
477 print "Automatic indentation is:",['OFF','ON'][self.shell.autoindent]
478
478
479
479
480 def magic_automagic(self, parameter_s = ''):
480 def magic_automagic(self, parameter_s = ''):
481 """Make magic functions callable without having to type the initial %.
481 """Make magic functions callable without having to type the initial %.
482
482
483 Without argumentsl toggles on/off (when off, you must call it as
483 Without argumentsl toggles on/off (when off, you must call it as
484 %automagic, of course). With arguments it sets the value, and you can
484 %automagic, of course). With arguments it sets the value, and you can
485 use any of (case insensitive):
485 use any of (case insensitive):
486
486
487 - on,1,True: to activate
487 - on,1,True: to activate
488
488
489 - off,0,False: to deactivate.
489 - off,0,False: to deactivate.
490
490
491 Note that magic functions have lowest priority, so if there's a
491 Note that magic functions have lowest priority, so if there's a
492 variable whose name collides with that of a magic fn, automagic won't
492 variable whose name collides with that of a magic fn, automagic won't
493 work for that function (you get the variable instead). However, if you
493 work for that function (you get the variable instead). However, if you
494 delete the variable (del var), the previously shadowed magic function
494 delete the variable (del var), the previously shadowed magic function
495 becomes visible to automagic again."""
495 becomes visible to automagic again."""
496
496
497 rc = self.shell.rc
497 rc = self.shell.rc
498 arg = parameter_s.lower()
498 arg = parameter_s.lower()
499 if parameter_s in ('on','1','true'):
499 if parameter_s in ('on','1','true'):
500 rc.automagic = True
500 rc.automagic = True
501 elif parameter_s in ('off','0','false'):
501 elif parameter_s in ('off','0','false'):
502 rc.automagic = False
502 rc.automagic = False
503 else:
503 else:
504 rc.automagic = not rc.automagic
504 rc.automagic = not rc.automagic
505 print '\n' + Magic.auto_status[rc.automagic]
505 print '\n' + Magic.auto_status[rc.automagic]
506
506
507
507
508 def magic_autocall(self, parameter_s = ''):
508 def magic_autocall(self, parameter_s = ''):
509 """Make functions callable without having to type parentheses.
509 """Make functions callable without having to type parentheses.
510
510
511 Usage:
511 Usage:
512
512
513 %autocall [mode]
513 %autocall [mode]
514
514
515 The mode can be one of: 0->Off, 1->Smart, 2->Full. If not given, the
515 The mode can be one of: 0->Off, 1->Smart, 2->Full. If not given, the
516 value is toggled on and off (remembering the previous state).
516 value is toggled on and off (remembering the previous state).
517
517
518 In more detail, these values mean:
518 In more detail, these values mean:
519
519
520 0 -> fully disabled
520 0 -> fully disabled
521
521
522 1 -> active, but do not apply if there are no arguments on the line.
522 1 -> active, but do not apply if there are no arguments on the line.
523
523
524 In this mode, you get:
524 In this mode, you get:
525
525
526 In [1]: callable
526 In [1]: callable
527 Out[1]: <built-in function callable>
527 Out[1]: <built-in function callable>
528
528
529 In [2]: callable 'hello'
529 In [2]: callable 'hello'
530 ------> callable('hello')
530 ------> callable('hello')
531 Out[2]: False
531 Out[2]: False
532
532
533 2 -> Active always. Even if no arguments are present, the callable
533 2 -> Active always. Even if no arguments are present, the callable
534 object is called:
534 object is called:
535
535
536 In [4]: callable
536 In [4]: callable
537 ------> callable()
537 ------> callable()
538
538
539 Note that even with autocall off, you can still use '/' at the start of
539 Note that even with autocall off, you can still use '/' at the start of
540 a line to treat the first argument on the command line as a function
540 a line to treat the first argument on the command line as a function
541 and add parentheses to it:
541 and add parentheses to it:
542
542
543 In [8]: /str 43
543 In [8]: /str 43
544 ------> str(43)
544 ------> str(43)
545 Out[8]: '43'
545 Out[8]: '43'
546 """
546 """
547
547
548 rc = self.shell.rc
548 rc = self.shell.rc
549
549
550 if parameter_s:
550 if parameter_s:
551 arg = int(parameter_s)
551 arg = int(parameter_s)
552 else:
552 else:
553 arg = 'toggle'
553 arg = 'toggle'
554
554
555 if not arg in (0,1,2,'toggle'):
555 if not arg in (0,1,2,'toggle'):
556 error('Valid modes: (0->Off, 1->Smart, 2->Full')
556 error('Valid modes: (0->Off, 1->Smart, 2->Full')
557 return
557 return
558
558
559 if arg in (0,1,2):
559 if arg in (0,1,2):
560 rc.autocall = arg
560 rc.autocall = arg
561 else: # toggle
561 else: # toggle
562 if rc.autocall:
562 if rc.autocall:
563 self._magic_state.autocall_save = rc.autocall
563 self._magic_state.autocall_save = rc.autocall
564 rc.autocall = 0
564 rc.autocall = 0
565 else:
565 else:
566 try:
566 try:
567 rc.autocall = self._magic_state.autocall_save
567 rc.autocall = self._magic_state.autocall_save
568 except AttributeError:
568 except AttributeError:
569 rc.autocall = self._magic_state.autocall_save = 1
569 rc.autocall = self._magic_state.autocall_save = 1
570
570
571 print "Automatic calling is:",['OFF','Smart','Full'][rc.autocall]
571 print "Automatic calling is:",['OFF','Smart','Full'][rc.autocall]
572
572
573 def magic_system_verbose(self, parameter_s = ''):
573 def magic_system_verbose(self, parameter_s = ''):
574 """Set verbose printing of system calls.
574 """Set verbose printing of system calls.
575
575
576 If called without an argument, act as a toggle"""
576 If called without an argument, act as a toggle"""
577
577
578 if parameter_s:
578 if parameter_s:
579 val = bool(eval(parameter_s))
579 val = bool(eval(parameter_s))
580 else:
580 else:
581 val = None
581 val = None
582
582
583 self.shell.rc_set_toggle('system_verbose',val)
583 self.shell.rc_set_toggle('system_verbose',val)
584 print "System verbose printing is:",\
584 print "System verbose printing is:",\
585 ['OFF','ON'][self.shell.rc.system_verbose]
585 ['OFF','ON'][self.shell.rc.system_verbose]
586
586
587
587
588 def magic_page(self, parameter_s=''):
588 def magic_page(self, parameter_s=''):
589 """Pretty print the object and display it through a pager.
589 """Pretty print the object and display it through a pager.
590
590
591 %page [options] OBJECT
591 %page [options] OBJECT
592
592
593 If no object is given, use _ (last output).
593 If no object is given, use _ (last output).
594
594
595 Options:
595 Options:
596
596
597 -r: page str(object), don't pretty-print it."""
597 -r: page str(object), don't pretty-print it."""
598
598
599 # After a function contributed by Olivier Aubert, slightly modified.
599 # After a function contributed by Olivier Aubert, slightly modified.
600
600
601 # Process options/args
601 # Process options/args
602 opts,args = self.parse_options(parameter_s,'r')
602 opts,args = self.parse_options(parameter_s,'r')
603 raw = 'r' in opts
603 raw = 'r' in opts
604
604
605 oname = args and args or '_'
605 oname = args and args or '_'
606 info = self._ofind(oname)
606 info = self._ofind(oname)
607 if info['found']:
607 if info['found']:
608 txt = (raw and str or pformat)( info['obj'] )
608 txt = (raw and str or pformat)( info['obj'] )
609 page(txt)
609 page(txt)
610 else:
610 else:
611 print 'Object `%s` not found' % oname
611 print 'Object `%s` not found' % oname
612
612
613 def magic_profile(self, parameter_s=''):
613 def magic_profile(self, parameter_s=''):
614 """Print your currently active IPyhton profile."""
614 """Print your currently active IPyhton profile."""
615 if self.shell.rc.profile:
615 if self.shell.rc.profile:
616 printpl('Current IPython profile: $self.shell.rc.profile.')
616 printpl('Current IPython profile: $self.shell.rc.profile.')
617 else:
617 else:
618 print 'No profile active.'
618 print 'No profile active.'
619
619
620 def magic_pinfo(self, parameter_s='', namespaces=None):
620 def magic_pinfo(self, parameter_s='', namespaces=None):
621 """Provide detailed information about an object.
621 """Provide detailed information about an object.
622
622
623 '%pinfo object' is just a synonym for object? or ?object."""
623 '%pinfo object' is just a synonym for object? or ?object."""
624
624
625 #print 'pinfo par: <%s>' % parameter_s # dbg
625 #print 'pinfo par: <%s>' % parameter_s # dbg
626
626
627
627
628 # detail_level: 0 -> obj? , 1 -> obj??
628 # detail_level: 0 -> obj? , 1 -> obj??
629 detail_level = 0
629 detail_level = 0
630 # We need to detect if we got called as 'pinfo pinfo foo', which can
630 # We need to detect if we got called as 'pinfo pinfo foo', which can
631 # happen if the user types 'pinfo foo?' at the cmd line.
631 # happen if the user types 'pinfo foo?' at the cmd line.
632 pinfo,qmark1,oname,qmark2 = \
632 pinfo,qmark1,oname,qmark2 = \
633 re.match('(pinfo )?(\?*)(.*?)(\??$)',parameter_s).groups()
633 re.match('(pinfo )?(\?*)(.*?)(\??$)',parameter_s).groups()
634 if pinfo or qmark1 or qmark2:
634 if pinfo or qmark1 or qmark2:
635 detail_level = 1
635 detail_level = 1
636 if "*" in oname:
636 if "*" in oname:
637 self.magic_psearch(oname)
637 self.magic_psearch(oname)
638 else:
638 else:
639 self._inspect('pinfo', oname, detail_level=detail_level,
639 self._inspect('pinfo', oname, detail_level=detail_level,
640 namespaces=namespaces)
640 namespaces=namespaces)
641
641
642 def magic_pdef(self, parameter_s='', namespaces=None):
642 def magic_pdef(self, parameter_s='', namespaces=None):
643 """Print the definition header for any callable object.
643 """Print the definition header for any callable object.
644
644
645 If the object is a class, print the constructor information."""
645 If the object is a class, print the constructor information."""
646 self._inspect('pdef',parameter_s, namespaces)
646 self._inspect('pdef',parameter_s, namespaces)
647
647
648 def magic_pdoc(self, parameter_s='', namespaces=None):
648 def magic_pdoc(self, parameter_s='', namespaces=None):
649 """Print the docstring for an object.
649 """Print the docstring for an object.
650
650
651 If the given object is a class, it will print both the class and the
651 If the given object is a class, it will print both the class and the
652 constructor docstrings."""
652 constructor docstrings."""
653 self._inspect('pdoc',parameter_s, namespaces)
653 self._inspect('pdoc',parameter_s, namespaces)
654
654
655 def magic_psource(self, parameter_s='', namespaces=None):
655 def magic_psource(self, parameter_s='', namespaces=None):
656 """Print (or run through pager) the source code for an object."""
656 """Print (or run through pager) the source code for an object."""
657 self._inspect('psource',parameter_s, namespaces)
657 self._inspect('psource',parameter_s, namespaces)
658
658
659 def magic_pfile(self, parameter_s=''):
659 def magic_pfile(self, parameter_s=''):
660 """Print (or run through pager) the file where an object is defined.
660 """Print (or run through pager) the file where an object is defined.
661
661
662 The file opens at the line where the object definition begins. IPython
662 The file opens at the line where the object definition begins. IPython
663 will honor the environment variable PAGER if set, and otherwise will
663 will honor the environment variable PAGER if set, and otherwise will
664 do its best to print the file in a convenient form.
664 do its best to print the file in a convenient form.
665
665
666 If the given argument is not an object currently defined, IPython will
666 If the given argument is not an object currently defined, IPython will
667 try to interpret it as a filename (automatically adding a .py extension
667 try to interpret it as a filename (automatically adding a .py extension
668 if needed). You can thus use %pfile as a syntax highlighting code
668 if needed). You can thus use %pfile as a syntax highlighting code
669 viewer."""
669 viewer."""
670
670
671 # first interpret argument as an object name
671 # first interpret argument as an object name
672 out = self._inspect('pfile',parameter_s)
672 out = self._inspect('pfile',parameter_s)
673 # if not, try the input as a filename
673 # if not, try the input as a filename
674 if out == 'not found':
674 if out == 'not found':
675 try:
675 try:
676 filename = get_py_filename(parameter_s)
676 filename = get_py_filename(parameter_s)
677 except IOError,msg:
677 except IOError,msg:
678 print msg
678 print msg
679 return
679 return
680 page(self.shell.inspector.format(file(filename).read()))
680 page(self.shell.inspector.format(file(filename).read()))
681
681
682 def _inspect(self,meth,oname,namespaces=None,**kw):
682 def _inspect(self,meth,oname,namespaces=None,**kw):
683 """Generic interface to the inspector system.
683 """Generic interface to the inspector system.
684
684
685 This function is meant to be called by pdef, pdoc & friends."""
685 This function is meant to be called by pdef, pdoc & friends."""
686
686
687 #oname = oname.strip()
687 #oname = oname.strip()
688 #print '1- oname: <%r>' % oname # dbg
688 #print '1- oname: <%r>' % oname # dbg
689 try:
689 try:
690 oname = oname.strip().encode('ascii')
690 oname = oname.strip().encode('ascii')
691 #print '2- oname: <%r>' % oname # dbg
691 #print '2- oname: <%r>' % oname # dbg
692 except UnicodeEncodeError:
692 except UnicodeEncodeError:
693 print 'Python identifiers can only contain ascii characters.'
693 print 'Python identifiers can only contain ascii characters.'
694 return 'not found'
694 return 'not found'
695
695
696 info = Struct(self._ofind(oname, namespaces))
696 info = Struct(self._ofind(oname, namespaces))
697
697
698 if info.found:
698 if info.found:
699 try:
699 try:
700 IPython.generics.inspect_object(info.obj)
700 IPython.generics.inspect_object(info.obj)
701 return
701 return
702 except IPython.ipapi.TryNext:
702 except IPython.ipapi.TryNext:
703 pass
703 pass
704 # Get the docstring of the class property if it exists.
704 # Get the docstring of the class property if it exists.
705 path = oname.split('.')
705 path = oname.split('.')
706 root = '.'.join(path[:-1])
706 root = '.'.join(path[:-1])
707 if info.parent is not None:
707 if info.parent is not None:
708 try:
708 try:
709 target = getattr(info.parent, '__class__')
709 target = getattr(info.parent, '__class__')
710 # The object belongs to a class instance.
710 # The object belongs to a class instance.
711 try:
711 try:
712 target = getattr(target, path[-1])
712 target = getattr(target, path[-1])
713 # The class defines the object.
713 # The class defines the object.
714 if isinstance(target, property):
714 if isinstance(target, property):
715 oname = root + '.__class__.' + path[-1]
715 oname = root + '.__class__.' + path[-1]
716 info = Struct(self._ofind(oname))
716 info = Struct(self._ofind(oname))
717 except AttributeError: pass
717 except AttributeError: pass
718 except AttributeError: pass
718 except AttributeError: pass
719
719
720 pmethod = getattr(self.shell.inspector,meth)
720 pmethod = getattr(self.shell.inspector,meth)
721 formatter = info.ismagic and self.format_screen or None
721 formatter = info.ismagic and self.format_screen or None
722 if meth == 'pdoc':
722 if meth == 'pdoc':
723 pmethod(info.obj,oname,formatter)
723 pmethod(info.obj,oname,formatter)
724 elif meth == 'pinfo':
724 elif meth == 'pinfo':
725 pmethod(info.obj,oname,formatter,info,**kw)
725 pmethod(info.obj,oname,formatter,info,**kw)
726 else:
726 else:
727 pmethod(info.obj,oname)
727 pmethod(info.obj,oname)
728 else:
728 else:
729 print 'Object `%s` not found.' % oname
729 print 'Object `%s` not found.' % oname
730 return 'not found' # so callers can take other action
730 return 'not found' # so callers can take other action
731
731
732 def magic_psearch(self, parameter_s=''):
732 def magic_psearch(self, parameter_s=''):
733 """Search for object in namespaces by wildcard.
733 """Search for object in namespaces by wildcard.
734
734
735 %psearch [options] PATTERN [OBJECT TYPE]
735 %psearch [options] PATTERN [OBJECT TYPE]
736
736
737 Note: ? can be used as a synonym for %psearch, at the beginning or at
737 Note: ? can be used as a synonym for %psearch, at the beginning or at
738 the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the
738 the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the
739 rest of the command line must be unchanged (options come first), so
739 rest of the command line must be unchanged (options come first), so
740 for example the following forms are equivalent
740 for example the following forms are equivalent
741
741
742 %psearch -i a* function
742 %psearch -i a* function
743 -i a* function?
743 -i a* function?
744 ?-i a* function
744 ?-i a* function
745
745
746 Arguments:
746 Arguments:
747
747
748 PATTERN
748 PATTERN
749
749
750 where PATTERN is a string containing * as a wildcard similar to its
750 where PATTERN is a string containing * as a wildcard similar to its
751 use in a shell. The pattern is matched in all namespaces on the
751 use in a shell. The pattern is matched in all namespaces on the
752 search path. By default objects starting with a single _ are not
752 search path. By default objects starting with a single _ are not
753 matched, many IPython generated objects have a single
753 matched, many IPython generated objects have a single
754 underscore. The default is case insensitive matching. Matching is
754 underscore. The default is case insensitive matching. Matching is
755 also done on the attributes of objects and not only on the objects
755 also done on the attributes of objects and not only on the objects
756 in a module.
756 in a module.
757
757
758 [OBJECT TYPE]
758 [OBJECT TYPE]
759
759
760 Is the name of a python type from the types module. The name is
760 Is the name of a python type from the types module. The name is
761 given in lowercase without the ending type, ex. StringType is
761 given in lowercase without the ending type, ex. StringType is
762 written string. By adding a type here only objects matching the
762 written string. By adding a type here only objects matching the
763 given type are matched. Using all here makes the pattern match all
763 given type are matched. Using all here makes the pattern match all
764 types (this is the default).
764 types (this is the default).
765
765
766 Options:
766 Options:
767
767
768 -a: makes the pattern match even objects whose names start with a
768 -a: makes the pattern match even objects whose names start with a
769 single underscore. These names are normally ommitted from the
769 single underscore. These names are normally ommitted from the
770 search.
770 search.
771
771
772 -i/-c: make the pattern case insensitive/sensitive. If neither of
772 -i/-c: make the pattern case insensitive/sensitive. If neither of
773 these options is given, the default is read from your ipythonrc
773 these options is given, the default is read from your ipythonrc
774 file. The option name which sets this value is
774 file. The option name which sets this value is
775 'wildcards_case_sensitive'. If this option is not specified in your
775 'wildcards_case_sensitive'. If this option is not specified in your
776 ipythonrc file, IPython's internal default is to do a case sensitive
776 ipythonrc file, IPython's internal default is to do a case sensitive
777 search.
777 search.
778
778
779 -e/-s NAMESPACE: exclude/search a given namespace. The pattern you
779 -e/-s NAMESPACE: exclude/search a given namespace. The pattern you
780 specifiy can be searched in any of the following namespaces:
780 specifiy can be searched in any of the following namespaces:
781 'builtin', 'user', 'user_global','internal', 'alias', where
781 'builtin', 'user', 'user_global','internal', 'alias', where
782 'builtin' and 'user' are the search defaults. Note that you should
782 'builtin' and 'user' are the search defaults. Note that you should
783 not use quotes when specifying namespaces.
783 not use quotes when specifying namespaces.
784
784
785 'Builtin' contains the python module builtin, 'user' contains all
785 'Builtin' contains the python module builtin, 'user' contains all
786 user data, 'alias' only contain the shell aliases and no python
786 user data, 'alias' only contain the shell aliases and no python
787 objects, 'internal' contains objects used by IPython. The
787 objects, 'internal' contains objects used by IPython. The
788 'user_global' namespace is only used by embedded IPython instances,
788 'user_global' namespace is only used by embedded IPython instances,
789 and it contains module-level globals. You can add namespaces to the
789 and it contains module-level globals. You can add namespaces to the
790 search with -s or exclude them with -e (these options can be given
790 search with -s or exclude them with -e (these options can be given
791 more than once).
791 more than once).
792
792
793 Examples:
793 Examples:
794
794
795 %psearch a* -> objects beginning with an a
795 %psearch a* -> objects beginning with an a
796 %psearch -e builtin a* -> objects NOT in the builtin space starting in a
796 %psearch -e builtin a* -> objects NOT in the builtin space starting in a
797 %psearch a* function -> all functions beginning with an a
797 %psearch a* function -> all functions beginning with an a
798 %psearch re.e* -> objects beginning with an e in module re
798 %psearch re.e* -> objects beginning with an e in module re
799 %psearch r*.e* -> objects that start with e in modules starting in r
799 %psearch r*.e* -> objects that start with e in modules starting in r
800 %psearch r*.* string -> all strings in modules beginning with r
800 %psearch r*.* string -> all strings in modules beginning with r
801
801
802 Case sensitve search:
802 Case sensitve search:
803
803
804 %psearch -c a* list all object beginning with lower case a
804 %psearch -c a* list all object beginning with lower case a
805
805
806 Show objects beginning with a single _:
806 Show objects beginning with a single _:
807
807
808 %psearch -a _* list objects beginning with a single underscore"""
808 %psearch -a _* list objects beginning with a single underscore"""
809 try:
809 try:
810 parameter_s = parameter_s.encode('ascii')
810 parameter_s = parameter_s.encode('ascii')
811 except UnicodeEncodeError:
811 except UnicodeEncodeError:
812 print 'Python identifiers can only contain ascii characters.'
812 print 'Python identifiers can only contain ascii characters.'
813 return
813 return
814
814
815 # default namespaces to be searched
815 # default namespaces to be searched
816 def_search = ['user','builtin']
816 def_search = ['user','builtin']
817
817
818 # Process options/args
818 # Process options/args
819 opts,args = self.parse_options(parameter_s,'cias:e:',list_all=True)
819 opts,args = self.parse_options(parameter_s,'cias:e:',list_all=True)
820 opt = opts.get
820 opt = opts.get
821 shell = self.shell
821 shell = self.shell
822 psearch = shell.inspector.psearch
822 psearch = shell.inspector.psearch
823
823
824 # select case options
824 # select case options
825 if opts.has_key('i'):
825 if opts.has_key('i'):
826 ignore_case = True
826 ignore_case = True
827 elif opts.has_key('c'):
827 elif opts.has_key('c'):
828 ignore_case = False
828 ignore_case = False
829 else:
829 else:
830 ignore_case = not shell.rc.wildcards_case_sensitive
830 ignore_case = not shell.rc.wildcards_case_sensitive
831
831
832 # Build list of namespaces to search from user options
832 # Build list of namespaces to search from user options
833 def_search.extend(opt('s',[]))
833 def_search.extend(opt('s',[]))
834 ns_exclude = ns_exclude=opt('e',[])
834 ns_exclude = ns_exclude=opt('e',[])
835 ns_search = [nm for nm in def_search if nm not in ns_exclude]
835 ns_search = [nm for nm in def_search if nm not in ns_exclude]
836
836
837 # Call the actual search
837 # Call the actual search
838 try:
838 try:
839 psearch(args,shell.ns_table,ns_search,
839 psearch(args,shell.ns_table,ns_search,
840 show_all=opt('a'),ignore_case=ignore_case)
840 show_all=opt('a'),ignore_case=ignore_case)
841 except:
841 except:
842 shell.showtraceback()
842 shell.showtraceback()
843
843
844 def magic_who_ls(self, parameter_s=''):
844 def magic_who_ls(self, parameter_s=''):
845 """Return a sorted list of all interactive variables.
845 """Return a sorted list of all interactive variables.
846
846
847 If arguments are given, only variables of types matching these
847 If arguments are given, only variables of types matching these
848 arguments are returned."""
848 arguments are returned."""
849
849
850 user_ns = self.shell.user_ns
850 user_ns = self.shell.user_ns
851 internal_ns = self.shell.internal_ns
851 internal_ns = self.shell.internal_ns
852 user_config_ns = self.shell.user_config_ns
852 user_config_ns = self.shell.user_config_ns
853 out = []
853 out = []
854 typelist = parameter_s.split()
854 typelist = parameter_s.split()
855
855
856 for i in user_ns:
856 for i in user_ns:
857 if not (i.startswith('_') or i.startswith('_i')) \
857 if not (i.startswith('_') or i.startswith('_i')) \
858 and not (i in internal_ns or i in user_config_ns):
858 and not (i in internal_ns or i in user_config_ns):
859 if typelist:
859 if typelist:
860 if type(user_ns[i]).__name__ in typelist:
860 if type(user_ns[i]).__name__ in typelist:
861 out.append(i)
861 out.append(i)
862 else:
862 else:
863 out.append(i)
863 out.append(i)
864 out.sort()
864 out.sort()
865 return out
865 return out
866
866
867 def magic_who(self, parameter_s=''):
867 def magic_who(self, parameter_s=''):
868 """Print all interactive variables, with some minimal formatting.
868 """Print all interactive variables, with some minimal formatting.
869
869
870 If any arguments are given, only variables whose type matches one of
870 If any arguments are given, only variables whose type matches one of
871 these are printed. For example:
871 these are printed. For example:
872
872
873 %who function str
873 %who function str
874
874
875 will only list functions and strings, excluding all other types of
875 will only list functions and strings, excluding all other types of
876 variables. To find the proper type names, simply use type(var) at a
876 variables. To find the proper type names, simply use type(var) at a
877 command line to see how python prints type names. For example:
877 command line to see how python prints type names. For example:
878
878
879 In [1]: type('hello')\\
879 In [1]: type('hello')\\
880 Out[1]: <type 'str'>
880 Out[1]: <type 'str'>
881
881
882 indicates that the type name for strings is 'str'.
882 indicates that the type name for strings is 'str'.
883
883
884 %who always excludes executed names loaded through your configuration
884 %who always excludes executed names loaded through your configuration
885 file and things which are internal to IPython.
885 file and things which are internal to IPython.
886
886
887 This is deliberate, as typically you may load many modules and the
887 This is deliberate, as typically you may load many modules and the
888 purpose of %who is to show you only what you've manually defined."""
888 purpose of %who is to show you only what you've manually defined."""
889
889
890 varlist = self.magic_who_ls(parameter_s)
890 varlist = self.magic_who_ls(parameter_s)
891 if not varlist:
891 if not varlist:
892 if parameter_s:
892 if parameter_s:
893 print 'No variables match your requested type.'
893 print 'No variables match your requested type.'
894 else:
894 else:
895 print 'Interactive namespace is empty.'
895 print 'Interactive namespace is empty.'
896 return
896 return
897
897
898 # if we have variables, move on...
898 # if we have variables, move on...
899 count = 0
899 count = 0
900 for i in varlist:
900 for i in varlist:
901 print i+'\t',
901 print i+'\t',
902 count += 1
902 count += 1
903 if count > 8:
903 if count > 8:
904 count = 0
904 count = 0
905 print
905 print
906 print
906 print
907
907
908 def magic_whos(self, parameter_s=''):
908 def magic_whos(self, parameter_s=''):
909 """Like %who, but gives some extra information about each variable.
909 """Like %who, but gives some extra information about each variable.
910
910
911 The same type filtering of %who can be applied here.
911 The same type filtering of %who can be applied here.
912
912
913 For all variables, the type is printed. Additionally it prints:
913 For all variables, the type is printed. Additionally it prints:
914
914
915 - For {},[],(): their length.
915 - For {},[],(): their length.
916
916
917 - For numpy and Numeric arrays, a summary with shape, number of
917 - For numpy and Numeric arrays, a summary with shape, number of
918 elements, typecode and size in memory.
918 elements, typecode and size in memory.
919
919
920 - Everything else: a string representation, snipping their middle if
920 - Everything else: a string representation, snipping their middle if
921 too long."""
921 too long."""
922
922
923 varnames = self.magic_who_ls(parameter_s)
923 varnames = self.magic_who_ls(parameter_s)
924 if not varnames:
924 if not varnames:
925 if parameter_s:
925 if parameter_s:
926 print 'No variables match your requested type.'
926 print 'No variables match your requested type.'
927 else:
927 else:
928 print 'Interactive namespace is empty.'
928 print 'Interactive namespace is empty.'
929 return
929 return
930
930
931 # if we have variables, move on...
931 # if we have variables, move on...
932
932
933 # for these types, show len() instead of data:
933 # for these types, show len() instead of data:
934 seq_types = [types.DictType,types.ListType,types.TupleType]
934 seq_types = [types.DictType,types.ListType,types.TupleType]
935
935
936 # for numpy/Numeric arrays, display summary info
936 # for numpy/Numeric arrays, display summary info
937 try:
937 try:
938 import numpy
938 import numpy
939 except ImportError:
939 except ImportError:
940 ndarray_type = None
940 ndarray_type = None
941 else:
941 else:
942 ndarray_type = numpy.ndarray.__name__
942 ndarray_type = numpy.ndarray.__name__
943 try:
943 try:
944 import Numeric
944 import Numeric
945 except ImportError:
945 except ImportError:
946 array_type = None
946 array_type = None
947 else:
947 else:
948 array_type = Numeric.ArrayType.__name__
948 array_type = Numeric.ArrayType.__name__
949
949
950 # Find all variable names and types so we can figure out column sizes
950 # Find all variable names and types so we can figure out column sizes
951 def get_vars(i):
951 def get_vars(i):
952 return self.shell.user_ns[i]
952 return self.shell.user_ns[i]
953
953
954 # some types are well known and can be shorter
954 # some types are well known and can be shorter
955 abbrevs = {'IPython.macro.Macro' : 'Macro'}
955 abbrevs = {'IPython.macro.Macro' : 'Macro'}
956 def type_name(v):
956 def type_name(v):
957 tn = type(v).__name__
957 tn = type(v).__name__
958 return abbrevs.get(tn,tn)
958 return abbrevs.get(tn,tn)
959
959
960 varlist = map(get_vars,varnames)
960 varlist = map(get_vars,varnames)
961
961
962 typelist = []
962 typelist = []
963 for vv in varlist:
963 for vv in varlist:
964 tt = type_name(vv)
964 tt = type_name(vv)
965
965
966 if tt=='instance':
966 if tt=='instance':
967 typelist.append( abbrevs.get(str(vv.__class__),
967 typelist.append( abbrevs.get(str(vv.__class__),
968 str(vv.__class__)))
968 str(vv.__class__)))
969 else:
969 else:
970 typelist.append(tt)
970 typelist.append(tt)
971
971
972 # column labels and # of spaces as separator
972 # column labels and # of spaces as separator
973 varlabel = 'Variable'
973 varlabel = 'Variable'
974 typelabel = 'Type'
974 typelabel = 'Type'
975 datalabel = 'Data/Info'
975 datalabel = 'Data/Info'
976 colsep = 3
976 colsep = 3
977 # variable format strings
977 # variable format strings
978 vformat = "$vname.ljust(varwidth)$vtype.ljust(typewidth)"
978 vformat = "$vname.ljust(varwidth)$vtype.ljust(typewidth)"
979 vfmt_short = '$vstr[:25]<...>$vstr[-25:]'
979 vfmt_short = '$vstr[:25]<...>$vstr[-25:]'
980 aformat = "%s: %s elems, type `%s`, %s bytes"
980 aformat = "%s: %s elems, type `%s`, %s bytes"
981 # find the size of the columns to format the output nicely
981 # find the size of the columns to format the output nicely
982 varwidth = max(max(map(len,varnames)), len(varlabel)) + colsep
982 varwidth = max(max(map(len,varnames)), len(varlabel)) + colsep
983 typewidth = max(max(map(len,typelist)), len(typelabel)) + colsep
983 typewidth = max(max(map(len,typelist)), len(typelabel)) + colsep
984 # table header
984 # table header
985 print varlabel.ljust(varwidth) + typelabel.ljust(typewidth) + \
985 print varlabel.ljust(varwidth) + typelabel.ljust(typewidth) + \
986 ' '+datalabel+'\n' + '-'*(varwidth+typewidth+len(datalabel)+1)
986 ' '+datalabel+'\n' + '-'*(varwidth+typewidth+len(datalabel)+1)
987 # and the table itself
987 # and the table itself
988 kb = 1024
988 kb = 1024
989 Mb = 1048576 # kb**2
989 Mb = 1048576 # kb**2
990 for vname,var,vtype in zip(varnames,varlist,typelist):
990 for vname,var,vtype in zip(varnames,varlist,typelist):
991 print itpl(vformat),
991 print itpl(vformat),
992 if vtype in seq_types:
992 if vtype in seq_types:
993 print len(var)
993 print len(var)
994 elif vtype in [array_type,ndarray_type]:
994 elif vtype in [array_type,ndarray_type]:
995 vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1]
995 vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1]
996 if vtype==ndarray_type:
996 if vtype==ndarray_type:
997 # numpy
997 # numpy
998 vsize = var.size
998 vsize = var.size
999 vbytes = vsize*var.itemsize
999 vbytes = vsize*var.itemsize
1000 vdtype = var.dtype
1000 vdtype = var.dtype
1001 else:
1001 else:
1002 # Numeric
1002 # Numeric
1003 vsize = Numeric.size(var)
1003 vsize = Numeric.size(var)
1004 vbytes = vsize*var.itemsize()
1004 vbytes = vsize*var.itemsize()
1005 vdtype = var.typecode()
1005 vdtype = var.typecode()
1006
1006
1007 if vbytes < 100000:
1007 if vbytes < 100000:
1008 print aformat % (vshape,vsize,vdtype,vbytes)
1008 print aformat % (vshape,vsize,vdtype,vbytes)
1009 else:
1009 else:
1010 print aformat % (vshape,vsize,vdtype,vbytes),
1010 print aformat % (vshape,vsize,vdtype,vbytes),
1011 if vbytes < Mb:
1011 if vbytes < Mb:
1012 print '(%s kb)' % (vbytes/kb,)
1012 print '(%s kb)' % (vbytes/kb,)
1013 else:
1013 else:
1014 print '(%s Mb)' % (vbytes/Mb,)
1014 print '(%s Mb)' % (vbytes/Mb,)
1015 else:
1015 else:
1016 try:
1016 try:
1017 vstr = str(var)
1017 vstr = str(var)
1018 except UnicodeEncodeError:
1018 except UnicodeEncodeError:
1019 vstr = unicode(var).encode(sys.getdefaultencoding(),
1019 vstr = unicode(var).encode(sys.getdefaultencoding(),
1020 'backslashreplace')
1020 'backslashreplace')
1021 vstr = vstr.replace('\n','\\n')
1021 vstr = vstr.replace('\n','\\n')
1022 if len(vstr) < 50:
1022 if len(vstr) < 50:
1023 print vstr
1023 print vstr
1024 else:
1024 else:
1025 printpl(vfmt_short)
1025 printpl(vfmt_short)
1026
1026
1027 def magic_reset(self, parameter_s=''):
1027 def magic_reset(self, parameter_s=''):
1028 """Resets the namespace by removing all names defined by the user.
1028 """Resets the namespace by removing all names defined by the user.
1029
1029
1030 Input/Output history are left around in case you need them."""
1030 Input/Output history are left around in case you need them."""
1031
1031
1032 ans = self.shell.ask_yes_no(
1032 ans = self.shell.ask_yes_no(
1033 "Once deleted, variables cannot be recovered. Proceed (y/[n])? ")
1033 "Once deleted, variables cannot be recovered. Proceed (y/[n])? ")
1034 if not ans:
1034 if not ans:
1035 print 'Nothing done.'
1035 print 'Nothing done.'
1036 return
1036 return
1037 user_ns = self.shell.user_ns
1037 user_ns = self.shell.user_ns
1038 for i in self.magic_who_ls():
1038 for i in self.magic_who_ls():
1039 del(user_ns[i])
1039 del(user_ns[i])
1040
1040
1041 # Also flush the private list of module references kept for script
1041 # Also flush the private list of module references kept for script
1042 # execution protection
1042 # execution protection
1043 self.shell._user_main_modules[:] = []
1043 self.shell._user_main_modules[:] = []
1044
1044
1045 def magic_logstart(self,parameter_s=''):
1045 def magic_logstart(self,parameter_s=''):
1046 """Start logging anywhere in a session.
1046 """Start logging anywhere in a session.
1047
1047
1048 %logstart [-o|-r|-t] [log_name [log_mode]]
1048 %logstart [-o|-r|-t] [log_name [log_mode]]
1049
1049
1050 If no name is given, it defaults to a file named 'ipython_log.py' in your
1050 If no name is given, it defaults to a file named 'ipython_log.py' in your
1051 current directory, in 'rotate' mode (see below).
1051 current directory, in 'rotate' mode (see below).
1052
1052
1053 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
1053 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
1054 history up to that point and then continues logging.
1054 history up to that point and then continues logging.
1055
1055
1056 %logstart takes a second optional parameter: logging mode. This can be one
1056 %logstart takes a second optional parameter: logging mode. This can be one
1057 of (note that the modes are given unquoted):\\
1057 of (note that the modes are given unquoted):\\
1058 append: well, that says it.\\
1058 append: well, that says it.\\
1059 backup: rename (if exists) to name~ and start name.\\
1059 backup: rename (if exists) to name~ and start name.\\
1060 global: single logfile in your home dir, appended to.\\
1060 global: single logfile in your home dir, appended to.\\
1061 over : overwrite existing log.\\
1061 over : overwrite existing log.\\
1062 rotate: create rotating logs name.1~, name.2~, etc.
1062 rotate: create rotating logs name.1~, name.2~, etc.
1063
1063
1064 Options:
1064 Options:
1065
1065
1066 -o: log also IPython's output. In this mode, all commands which
1066 -o: log also IPython's output. In this mode, all commands which
1067 generate an Out[NN] prompt are recorded to the logfile, right after
1067 generate an Out[NN] prompt are recorded to the logfile, right after
1068 their corresponding input line. The output lines are always
1068 their corresponding input line. The output lines are always
1069 prepended with a '#[Out]# ' marker, so that the log remains valid
1069 prepended with a '#[Out]# ' marker, so that the log remains valid
1070 Python code.
1070 Python code.
1071
1071
1072 Since this marker is always the same, filtering only the output from
1072 Since this marker is always the same, filtering only the output from
1073 a log is very easy, using for example a simple awk call:
1073 a log is very easy, using for example a simple awk call:
1074
1074
1075 awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py
1075 awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py
1076
1076
1077 -r: log 'raw' input. Normally, IPython's logs contain the processed
1077 -r: log 'raw' input. Normally, IPython's logs contain the processed
1078 input, so that user lines are logged in their final form, converted
1078 input, so that user lines are logged in their final form, converted
1079 into valid Python. For example, %Exit is logged as
1079 into valid Python. For example, %Exit is logged as
1080 '_ip.magic("Exit"). If the -r flag is given, all input is logged
1080 '_ip.magic("Exit"). If the -r flag is given, all input is logged
1081 exactly as typed, with no transformations applied.
1081 exactly as typed, with no transformations applied.
1082
1082
1083 -t: put timestamps before each input line logged (these are put in
1083 -t: put timestamps before each input line logged (these are put in
1084 comments)."""
1084 comments)."""
1085
1085
1086 opts,par = self.parse_options(parameter_s,'ort')
1086 opts,par = self.parse_options(parameter_s,'ort')
1087 log_output = 'o' in opts
1087 log_output = 'o' in opts
1088 log_raw_input = 'r' in opts
1088 log_raw_input = 'r' in opts
1089 timestamp = 't' in opts
1089 timestamp = 't' in opts
1090
1090
1091 rc = self.shell.rc
1091 rc = self.shell.rc
1092 logger = self.shell.logger
1092 logger = self.shell.logger
1093
1093
1094 # if no args are given, the defaults set in the logger constructor by
1094 # if no args are given, the defaults set in the logger constructor by
1095 # ipytohn remain valid
1095 # ipytohn remain valid
1096 if par:
1096 if par:
1097 try:
1097 try:
1098 logfname,logmode = par.split()
1098 logfname,logmode = par.split()
1099 except:
1099 except:
1100 logfname = par
1100 logfname = par
1101 logmode = 'backup'
1101 logmode = 'backup'
1102 else:
1102 else:
1103 logfname = logger.logfname
1103 logfname = logger.logfname
1104 logmode = logger.logmode
1104 logmode = logger.logmode
1105 # put logfname into rc struct as if it had been called on the command
1105 # put logfname into rc struct as if it had been called on the command
1106 # line, so it ends up saved in the log header Save it in case we need
1106 # line, so it ends up saved in the log header Save it in case we need
1107 # to restore it...
1107 # to restore it...
1108 old_logfile = rc.opts.get('logfile','')
1108 old_logfile = rc.opts.get('logfile','')
1109 if logfname:
1109 if logfname:
1110 logfname = os.path.expanduser(logfname)
1110 logfname = os.path.expanduser(logfname)
1111 rc.opts.logfile = logfname
1111 rc.opts.logfile = logfname
1112 loghead = self.shell.loghead_tpl % (rc.opts,rc.args)
1112 loghead = self.shell.loghead_tpl % (rc.opts,rc.args)
1113 try:
1113 try:
1114 started = logger.logstart(logfname,loghead,logmode,
1114 started = logger.logstart(logfname,loghead,logmode,
1115 log_output,timestamp,log_raw_input)
1115 log_output,timestamp,log_raw_input)
1116 except:
1116 except:
1117 rc.opts.logfile = old_logfile
1117 rc.opts.logfile = old_logfile
1118 warn("Couldn't start log: %s" % sys.exc_info()[1])
1118 warn("Couldn't start log: %s" % sys.exc_info()[1])
1119 else:
1119 else:
1120 # log input history up to this point, optionally interleaving
1120 # log input history up to this point, optionally interleaving
1121 # output if requested
1121 # output if requested
1122
1122
1123 if timestamp:
1123 if timestamp:
1124 # disable timestamping for the previous history, since we've
1124 # disable timestamping for the previous history, since we've
1125 # lost those already (no time machine here).
1125 # lost those already (no time machine here).
1126 logger.timestamp = False
1126 logger.timestamp = False
1127
1127
1128 if log_raw_input:
1128 if log_raw_input:
1129 input_hist = self.shell.input_hist_raw
1129 input_hist = self.shell.input_hist_raw
1130 else:
1130 else:
1131 input_hist = self.shell.input_hist
1131 input_hist = self.shell.input_hist
1132
1132
1133 if log_output:
1133 if log_output:
1134 log_write = logger.log_write
1134 log_write = logger.log_write
1135 output_hist = self.shell.output_hist
1135 output_hist = self.shell.output_hist
1136 for n in range(1,len(input_hist)-1):
1136 for n in range(1,len(input_hist)-1):
1137 log_write(input_hist[n].rstrip())
1137 log_write(input_hist[n].rstrip())
1138 if n in output_hist:
1138 if n in output_hist:
1139 log_write(repr(output_hist[n]),'output')
1139 log_write(repr(output_hist[n]),'output')
1140 else:
1140 else:
1141 logger.log_write(input_hist[1:])
1141 logger.log_write(input_hist[1:])
1142 if timestamp:
1142 if timestamp:
1143 # re-enable timestamping
1143 # re-enable timestamping
1144 logger.timestamp = True
1144 logger.timestamp = True
1145
1145
1146 print ('Activating auto-logging. '
1146 print ('Activating auto-logging. '
1147 'Current session state plus future input saved.')
1147 'Current session state plus future input saved.')
1148 logger.logstate()
1148 logger.logstate()
1149
1149
1150 def magic_logstop(self,parameter_s=''):
1151 """Fully stop logging and close log file.
1152
1153 In order to start logging again, a new %logstart call needs to be made,
1154 possibly (though not necessarily) with a new filename, mode and other
1155 options."""
1156 self.logger.logstop()
1157
1150 def magic_logoff(self,parameter_s=''):
1158 def magic_logoff(self,parameter_s=''):
1151 """Temporarily stop logging.
1159 """Temporarily stop logging.
1152
1160
1153 You must have previously started logging."""
1161 You must have previously started logging."""
1154 self.shell.logger.switch_log(0)
1162 self.shell.logger.switch_log(0)
1155
1163
1156 def magic_logon(self,parameter_s=''):
1164 def magic_logon(self,parameter_s=''):
1157 """Restart logging.
1165 """Restart logging.
1158
1166
1159 This function is for restarting logging which you've temporarily
1167 This function is for restarting logging which you've temporarily
1160 stopped with %logoff. For starting logging for the first time, you
1168 stopped with %logoff. For starting logging for the first time, you
1161 must use the %logstart function, which allows you to specify an
1169 must use the %logstart function, which allows you to specify an
1162 optional log filename."""
1170 optional log filename."""
1163
1171
1164 self.shell.logger.switch_log(1)
1172 self.shell.logger.switch_log(1)
1165
1173
1166 def magic_logstate(self,parameter_s=''):
1174 def magic_logstate(self,parameter_s=''):
1167 """Print the status of the logging system."""
1175 """Print the status of the logging system."""
1168
1176
1169 self.shell.logger.logstate()
1177 self.shell.logger.logstate()
1170
1178
1171 def magic_pdb(self, parameter_s=''):
1179 def magic_pdb(self, parameter_s=''):
1172 """Control the automatic calling of the pdb interactive debugger.
1180 """Control the automatic calling of the pdb interactive debugger.
1173
1181
1174 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
1182 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
1175 argument it works as a toggle.
1183 argument it works as a toggle.
1176
1184
1177 When an exception is triggered, IPython can optionally call the
1185 When an exception is triggered, IPython can optionally call the
1178 interactive pdb debugger after the traceback printout. %pdb toggles
1186 interactive pdb debugger after the traceback printout. %pdb toggles
1179 this feature on and off.
1187 this feature on and off.
1180
1188
1181 The initial state of this feature is set in your ipythonrc
1189 The initial state of this feature is set in your ipythonrc
1182 configuration file (the variable is called 'pdb').
1190 configuration file (the variable is called 'pdb').
1183
1191
1184 If you want to just activate the debugger AFTER an exception has fired,
1192 If you want to just activate the debugger AFTER an exception has fired,
1185 without having to type '%pdb on' and rerunning your code, you can use
1193 without having to type '%pdb on' and rerunning your code, you can use
1186 the %debug magic."""
1194 the %debug magic."""
1187
1195
1188 par = parameter_s.strip().lower()
1196 par = parameter_s.strip().lower()
1189
1197
1190 if par:
1198 if par:
1191 try:
1199 try:
1192 new_pdb = {'off':0,'0':0,'on':1,'1':1}[par]
1200 new_pdb = {'off':0,'0':0,'on':1,'1':1}[par]
1193 except KeyError:
1201 except KeyError:
1194 print ('Incorrect argument. Use on/1, off/0, '
1202 print ('Incorrect argument. Use on/1, off/0, '
1195 'or nothing for a toggle.')
1203 'or nothing for a toggle.')
1196 return
1204 return
1197 else:
1205 else:
1198 # toggle
1206 # toggle
1199 new_pdb = not self.shell.call_pdb
1207 new_pdb = not self.shell.call_pdb
1200
1208
1201 # set on the shell
1209 # set on the shell
1202 self.shell.call_pdb = new_pdb
1210 self.shell.call_pdb = new_pdb
1203 print 'Automatic pdb calling has been turned',on_off(new_pdb)
1211 print 'Automatic pdb calling has been turned',on_off(new_pdb)
1204
1212
1205 def magic_debug(self, parameter_s=''):
1213 def magic_debug(self, parameter_s=''):
1206 """Activate the interactive debugger in post-mortem mode.
1214 """Activate the interactive debugger in post-mortem mode.
1207
1215
1208 If an exception has just occurred, this lets you inspect its stack
1216 If an exception has just occurred, this lets you inspect its stack
1209 frames interactively. Note that this will always work only on the last
1217 frames interactively. Note that this will always work only on the last
1210 traceback that occurred, so you must call this quickly after an
1218 traceback that occurred, so you must call this quickly after an
1211 exception that you wish to inspect has fired, because if another one
1219 exception that you wish to inspect has fired, because if another one
1212 occurs, it clobbers the previous one.
1220 occurs, it clobbers the previous one.
1213
1221
1214 If you want IPython to automatically do this on every exception, see
1222 If you want IPython to automatically do this on every exception, see
1215 the %pdb magic for more details.
1223 the %pdb magic for more details.
1216 """
1224 """
1217
1225
1218 self.shell.debugger(force=True)
1226 self.shell.debugger(force=True)
1219
1227
1220 def magic_prun(self, parameter_s ='',user_mode=1,
1228 def magic_prun(self, parameter_s ='',user_mode=1,
1221 opts=None,arg_lst=None,prog_ns=None):
1229 opts=None,arg_lst=None,prog_ns=None):
1222
1230
1223 """Run a statement through the python code profiler.
1231 """Run a statement through the python code profiler.
1224
1232
1225 Usage:\\
1233 Usage:\\
1226 %prun [options] statement
1234 %prun [options] statement
1227
1235
1228 The given statement (which doesn't require quote marks) is run via the
1236 The given statement (which doesn't require quote marks) is run via the
1229 python profiler in a manner similar to the profile.run() function.
1237 python profiler in a manner similar to the profile.run() function.
1230 Namespaces are internally managed to work correctly; profile.run
1238 Namespaces are internally managed to work correctly; profile.run
1231 cannot be used in IPython because it makes certain assumptions about
1239 cannot be used in IPython because it makes certain assumptions about
1232 namespaces which do not hold under IPython.
1240 namespaces which do not hold under IPython.
1233
1241
1234 Options:
1242 Options:
1235
1243
1236 -l <limit>: you can place restrictions on what or how much of the
1244 -l <limit>: you can place restrictions on what or how much of the
1237 profile gets printed. The limit value can be:
1245 profile gets printed. The limit value can be:
1238
1246
1239 * A string: only information for function names containing this string
1247 * A string: only information for function names containing this string
1240 is printed.
1248 is printed.
1241
1249
1242 * An integer: only these many lines are printed.
1250 * An integer: only these many lines are printed.
1243
1251
1244 * A float (between 0 and 1): this fraction of the report is printed
1252 * A float (between 0 and 1): this fraction of the report is printed
1245 (for example, use a limit of 0.4 to see the topmost 40% only).
1253 (for example, use a limit of 0.4 to see the topmost 40% only).
1246
1254
1247 You can combine several limits with repeated use of the option. For
1255 You can combine several limits with repeated use of the option. For
1248 example, '-l __init__ -l 5' will print only the topmost 5 lines of
1256 example, '-l __init__ -l 5' will print only the topmost 5 lines of
1249 information about class constructors.
1257 information about class constructors.
1250
1258
1251 -r: return the pstats.Stats object generated by the profiling. This
1259 -r: return the pstats.Stats object generated by the profiling. This
1252 object has all the information about the profile in it, and you can
1260 object has all the information about the profile in it, and you can
1253 later use it for further analysis or in other functions.
1261 later use it for further analysis or in other functions.
1254
1262
1255 -s <key>: sort profile by given key. You can provide more than one key
1263 -s <key>: sort profile by given key. You can provide more than one key
1256 by using the option several times: '-s key1 -s key2 -s key3...'. The
1264 by using the option several times: '-s key1 -s key2 -s key3...'. The
1257 default sorting key is 'time'.
1265 default sorting key is 'time'.
1258
1266
1259 The following is copied verbatim from the profile documentation
1267 The following is copied verbatim from the profile documentation
1260 referenced below:
1268 referenced below:
1261
1269
1262 When more than one key is provided, additional keys are used as
1270 When more than one key is provided, additional keys are used as
1263 secondary criteria when the there is equality in all keys selected
1271 secondary criteria when the there is equality in all keys selected
1264 before them.
1272 before them.
1265
1273
1266 Abbreviations can be used for any key names, as long as the
1274 Abbreviations can be used for any key names, as long as the
1267 abbreviation is unambiguous. The following are the keys currently
1275 abbreviation is unambiguous. The following are the keys currently
1268 defined:
1276 defined:
1269
1277
1270 Valid Arg Meaning\\
1278 Valid Arg Meaning\\
1271 "calls" call count\\
1279 "calls" call count\\
1272 "cumulative" cumulative time\\
1280 "cumulative" cumulative time\\
1273 "file" file name\\
1281 "file" file name\\
1274 "module" file name\\
1282 "module" file name\\
1275 "pcalls" primitive call count\\
1283 "pcalls" primitive call count\\
1276 "line" line number\\
1284 "line" line number\\
1277 "name" function name\\
1285 "name" function name\\
1278 "nfl" name/file/line\\
1286 "nfl" name/file/line\\
1279 "stdname" standard name\\
1287 "stdname" standard name\\
1280 "time" internal time
1288 "time" internal time
1281
1289
1282 Note that all sorts on statistics are in descending order (placing
1290 Note that all sorts on statistics are in descending order (placing
1283 most time consuming items first), where as name, file, and line number
1291 most time consuming items first), where as name, file, and line number
1284 searches are in ascending order (i.e., alphabetical). The subtle
1292 searches are in ascending order (i.e., alphabetical). The subtle
1285 distinction between "nfl" and "stdname" is that the standard name is a
1293 distinction between "nfl" and "stdname" is that the standard name is a
1286 sort of the name as printed, which means that the embedded line
1294 sort of the name as printed, which means that the embedded line
1287 numbers get compared in an odd way. For example, lines 3, 20, and 40
1295 numbers get compared in an odd way. For example, lines 3, 20, and 40
1288 would (if the file names were the same) appear in the string order
1296 would (if the file names were the same) appear in the string order
1289 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
1297 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
1290 line numbers. In fact, sort_stats("nfl") is the same as
1298 line numbers. In fact, sort_stats("nfl") is the same as
1291 sort_stats("name", "file", "line").
1299 sort_stats("name", "file", "line").
1292
1300
1293 -T <filename>: save profile results as shown on screen to a text
1301 -T <filename>: save profile results as shown on screen to a text
1294 file. The profile is still shown on screen.
1302 file. The profile is still shown on screen.
1295
1303
1296 -D <filename>: save (via dump_stats) profile statistics to given
1304 -D <filename>: save (via dump_stats) profile statistics to given
1297 filename. This data is in a format understod by the pstats module, and
1305 filename. This data is in a format understod by the pstats module, and
1298 is generated by a call to the dump_stats() method of profile
1306 is generated by a call to the dump_stats() method of profile
1299 objects. The profile is still shown on screen.
1307 objects. The profile is still shown on screen.
1300
1308
1301 If you want to run complete programs under the profiler's control, use
1309 If you want to run complete programs under the profiler's control, use
1302 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
1310 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
1303 contains profiler specific options as described here.
1311 contains profiler specific options as described here.
1304
1312
1305 You can read the complete documentation for the profile module with:\\
1313 You can read the complete documentation for the profile module with:\\
1306 In [1]: import profile; profile.help() """
1314 In [1]: import profile; profile.help() """
1307
1315
1308 opts_def = Struct(D=[''],l=[],s=['time'],T=[''])
1316 opts_def = Struct(D=[''],l=[],s=['time'],T=[''])
1309 # protect user quote marks
1317 # protect user quote marks
1310 parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'")
1318 parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'")
1311
1319
1312 if user_mode: # regular user call
1320 if user_mode: # regular user call
1313 opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:',
1321 opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:',
1314 list_all=1)
1322 list_all=1)
1315 namespace = self.shell.user_ns
1323 namespace = self.shell.user_ns
1316 else: # called to run a program by %run -p
1324 else: # called to run a program by %run -p
1317 try:
1325 try:
1318 filename = get_py_filename(arg_lst[0])
1326 filename = get_py_filename(arg_lst[0])
1319 except IOError,msg:
1327 except IOError,msg:
1320 error(msg)
1328 error(msg)
1321 return
1329 return
1322
1330
1323 arg_str = 'execfile(filename,prog_ns)'
1331 arg_str = 'execfile(filename,prog_ns)'
1324 namespace = locals()
1332 namespace = locals()
1325
1333
1326 opts.merge(opts_def)
1334 opts.merge(opts_def)
1327
1335
1328 prof = profile.Profile()
1336 prof = profile.Profile()
1329 try:
1337 try:
1330 prof = prof.runctx(arg_str,namespace,namespace)
1338 prof = prof.runctx(arg_str,namespace,namespace)
1331 sys_exit = ''
1339 sys_exit = ''
1332 except SystemExit:
1340 except SystemExit:
1333 sys_exit = """*** SystemExit exception caught in code being profiled."""
1341 sys_exit = """*** SystemExit exception caught in code being profiled."""
1334
1342
1335 stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s)
1343 stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s)
1336
1344
1337 lims = opts.l
1345 lims = opts.l
1338 if lims:
1346 if lims:
1339 lims = [] # rebuild lims with ints/floats/strings
1347 lims = [] # rebuild lims with ints/floats/strings
1340 for lim in opts.l:
1348 for lim in opts.l:
1341 try:
1349 try:
1342 lims.append(int(lim))
1350 lims.append(int(lim))
1343 except ValueError:
1351 except ValueError:
1344 try:
1352 try:
1345 lims.append(float(lim))
1353 lims.append(float(lim))
1346 except ValueError:
1354 except ValueError:
1347 lims.append(lim)
1355 lims.append(lim)
1348
1356
1349 # Trap output.
1357 # Trap output.
1350 stdout_trap = StringIO()
1358 stdout_trap = StringIO()
1351
1359
1352 if hasattr(stats,'stream'):
1360 if hasattr(stats,'stream'):
1353 # In newer versions of python, the stats object has a 'stream'
1361 # In newer versions of python, the stats object has a 'stream'
1354 # attribute to write into.
1362 # attribute to write into.
1355 stats.stream = stdout_trap
1363 stats.stream = stdout_trap
1356 stats.print_stats(*lims)
1364 stats.print_stats(*lims)
1357 else:
1365 else:
1358 # For older versions, we manually redirect stdout during printing
1366 # For older versions, we manually redirect stdout during printing
1359 sys_stdout = sys.stdout
1367 sys_stdout = sys.stdout
1360 try:
1368 try:
1361 sys.stdout = stdout_trap
1369 sys.stdout = stdout_trap
1362 stats.print_stats(*lims)
1370 stats.print_stats(*lims)
1363 finally:
1371 finally:
1364 sys.stdout = sys_stdout
1372 sys.stdout = sys_stdout
1365
1373
1366 output = stdout_trap.getvalue()
1374 output = stdout_trap.getvalue()
1367 output = output.rstrip()
1375 output = output.rstrip()
1368
1376
1369 page(output,screen_lines=self.shell.rc.screen_length)
1377 page(output,screen_lines=self.shell.rc.screen_length)
1370 print sys_exit,
1378 print sys_exit,
1371
1379
1372 dump_file = opts.D[0]
1380 dump_file = opts.D[0]
1373 text_file = opts.T[0]
1381 text_file = opts.T[0]
1374 if dump_file:
1382 if dump_file:
1375 prof.dump_stats(dump_file)
1383 prof.dump_stats(dump_file)
1376 print '\n*** Profile stats marshalled to file',\
1384 print '\n*** Profile stats marshalled to file',\
1377 `dump_file`+'.',sys_exit
1385 `dump_file`+'.',sys_exit
1378 if text_file:
1386 if text_file:
1379 pfile = file(text_file,'w')
1387 pfile = file(text_file,'w')
1380 pfile.write(output)
1388 pfile.write(output)
1381 pfile.close()
1389 pfile.close()
1382 print '\n*** Profile printout saved to text file',\
1390 print '\n*** Profile printout saved to text file',\
1383 `text_file`+'.',sys_exit
1391 `text_file`+'.',sys_exit
1384
1392
1385 if opts.has_key('r'):
1393 if opts.has_key('r'):
1386 return stats
1394 return stats
1387 else:
1395 else:
1388 return None
1396 return None
1389
1397
1390 def magic_run(self, parameter_s ='',runner=None):
1398 def magic_run(self, parameter_s ='',runner=None):
1391 """Run the named file inside IPython as a program.
1399 """Run the named file inside IPython as a program.
1392
1400
1393 Usage:\\
1401 Usage:\\
1394 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
1402 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
1395
1403
1396 Parameters after the filename are passed as command-line arguments to
1404 Parameters after the filename are passed as command-line arguments to
1397 the program (put in sys.argv). Then, control returns to IPython's
1405 the program (put in sys.argv). Then, control returns to IPython's
1398 prompt.
1406 prompt.
1399
1407
1400 This is similar to running at a system prompt:\\
1408 This is similar to running at a system prompt:\\
1401 $ python file args\\
1409 $ python file args\\
1402 but with the advantage of giving you IPython's tracebacks, and of
1410 but with the advantage of giving you IPython's tracebacks, and of
1403 loading all variables into your interactive namespace for further use
1411 loading all variables into your interactive namespace for further use
1404 (unless -p is used, see below).
1412 (unless -p is used, see below).
1405
1413
1406 The file is executed in a namespace initially consisting only of
1414 The file is executed in a namespace initially consisting only of
1407 __name__=='__main__' and sys.argv constructed as indicated. It thus
1415 __name__=='__main__' and sys.argv constructed as indicated. It thus
1408 sees its environment as if it were being run as a stand-alone program
1416 sees its environment as if it were being run as a stand-alone program
1409 (except for sharing global objects such as previously imported
1417 (except for sharing global objects such as previously imported
1410 modules). But after execution, the IPython interactive namespace gets
1418 modules). But after execution, the IPython interactive namespace gets
1411 updated with all variables defined in the program (except for __name__
1419 updated with all variables defined in the program (except for __name__
1412 and sys.argv). This allows for very convenient loading of code for
1420 and sys.argv). This allows for very convenient loading of code for
1413 interactive work, while giving each program a 'clean sheet' to run in.
1421 interactive work, while giving each program a 'clean sheet' to run in.
1414
1422
1415 Options:
1423 Options:
1416
1424
1417 -n: __name__ is NOT set to '__main__', but to the running file's name
1425 -n: __name__ is NOT set to '__main__', but to the running file's name
1418 without extension (as python does under import). This allows running
1426 without extension (as python does under import). This allows running
1419 scripts and reloading the definitions in them without calling code
1427 scripts and reloading the definitions in them without calling code
1420 protected by an ' if __name__ == "__main__" ' clause.
1428 protected by an ' if __name__ == "__main__" ' clause.
1421
1429
1422 -i: run the file in IPython's namespace instead of an empty one. This
1430 -i: run the file in IPython's namespace instead of an empty one. This
1423 is useful if you are experimenting with code written in a text editor
1431 is useful if you are experimenting with code written in a text editor
1424 which depends on variables defined interactively.
1432 which depends on variables defined interactively.
1425
1433
1426 -e: ignore sys.exit() calls or SystemExit exceptions in the script
1434 -e: ignore sys.exit() calls or SystemExit exceptions in the script
1427 being run. This is particularly useful if IPython is being used to
1435 being run. This is particularly useful if IPython is being used to
1428 run unittests, which always exit with a sys.exit() call. In such
1436 run unittests, which always exit with a sys.exit() call. In such
1429 cases you are interested in the output of the test results, not in
1437 cases you are interested in the output of the test results, not in
1430 seeing a traceback of the unittest module.
1438 seeing a traceback of the unittest module.
1431
1439
1432 -t: print timing information at the end of the run. IPython will give
1440 -t: print timing information at the end of the run. IPython will give
1433 you an estimated CPU time consumption for your script, which under
1441 you an estimated CPU time consumption for your script, which under
1434 Unix uses the resource module to avoid the wraparound problems of
1442 Unix uses the resource module to avoid the wraparound problems of
1435 time.clock(). Under Unix, an estimate of time spent on system tasks
1443 time.clock(). Under Unix, an estimate of time spent on system tasks
1436 is also given (for Windows platforms this is reported as 0.0).
1444 is also given (for Windows platforms this is reported as 0.0).
1437
1445
1438 If -t is given, an additional -N<N> option can be given, where <N>
1446 If -t is given, an additional -N<N> option can be given, where <N>
1439 must be an integer indicating how many times you want the script to
1447 must be an integer indicating how many times you want the script to
1440 run. The final timing report will include total and per run results.
1448 run. The final timing report will include total and per run results.
1441
1449
1442 For example (testing the script uniq_stable.py):
1450 For example (testing the script uniq_stable.py):
1443
1451
1444 In [1]: run -t uniq_stable
1452 In [1]: run -t uniq_stable
1445
1453
1446 IPython CPU timings (estimated):\\
1454 IPython CPU timings (estimated):\\
1447 User : 0.19597 s.\\
1455 User : 0.19597 s.\\
1448 System: 0.0 s.\\
1456 System: 0.0 s.\\
1449
1457
1450 In [2]: run -t -N5 uniq_stable
1458 In [2]: run -t -N5 uniq_stable
1451
1459
1452 IPython CPU timings (estimated):\\
1460 IPython CPU timings (estimated):\\
1453 Total runs performed: 5\\
1461 Total runs performed: 5\\
1454 Times : Total Per run\\
1462 Times : Total Per run\\
1455 User : 0.910862 s, 0.1821724 s.\\
1463 User : 0.910862 s, 0.1821724 s.\\
1456 System: 0.0 s, 0.0 s.
1464 System: 0.0 s, 0.0 s.
1457
1465
1458 -d: run your program under the control of pdb, the Python debugger.
1466 -d: run your program under the control of pdb, the Python debugger.
1459 This allows you to execute your program step by step, watch variables,
1467 This allows you to execute your program step by step, watch variables,
1460 etc. Internally, what IPython does is similar to calling:
1468 etc. Internally, what IPython does is similar to calling:
1461
1469
1462 pdb.run('execfile("YOURFILENAME")')
1470 pdb.run('execfile("YOURFILENAME")')
1463
1471
1464 with a breakpoint set on line 1 of your file. You can change the line
1472 with a breakpoint set on line 1 of your file. You can change the line
1465 number for this automatic breakpoint to be <N> by using the -bN option
1473 number for this automatic breakpoint to be <N> by using the -bN option
1466 (where N must be an integer). For example:
1474 (where N must be an integer). For example:
1467
1475
1468 %run -d -b40 myscript
1476 %run -d -b40 myscript
1469
1477
1470 will set the first breakpoint at line 40 in myscript.py. Note that
1478 will set the first breakpoint at line 40 in myscript.py. Note that
1471 the first breakpoint must be set on a line which actually does
1479 the first breakpoint must be set on a line which actually does
1472 something (not a comment or docstring) for it to stop execution.
1480 something (not a comment or docstring) for it to stop execution.
1473
1481
1474 When the pdb debugger starts, you will see a (Pdb) prompt. You must
1482 When the pdb debugger starts, you will see a (Pdb) prompt. You must
1475 first enter 'c' (without qoutes) to start execution up to the first
1483 first enter 'c' (without qoutes) to start execution up to the first
1476 breakpoint.
1484 breakpoint.
1477
1485
1478 Entering 'help' gives information about the use of the debugger. You
1486 Entering 'help' gives information about the use of the debugger. You
1479 can easily see pdb's full documentation with "import pdb;pdb.help()"
1487 can easily see pdb's full documentation with "import pdb;pdb.help()"
1480 at a prompt.
1488 at a prompt.
1481
1489
1482 -p: run program under the control of the Python profiler module (which
1490 -p: run program under the control of the Python profiler module (which
1483 prints a detailed report of execution times, function calls, etc).
1491 prints a detailed report of execution times, function calls, etc).
1484
1492
1485 You can pass other options after -p which affect the behavior of the
1493 You can pass other options after -p which affect the behavior of the
1486 profiler itself. See the docs for %prun for details.
1494 profiler itself. See the docs for %prun for details.
1487
1495
1488 In this mode, the program's variables do NOT propagate back to the
1496 In this mode, the program's variables do NOT propagate back to the
1489 IPython interactive namespace (because they remain in the namespace
1497 IPython interactive namespace (because they remain in the namespace
1490 where the profiler executes them).
1498 where the profiler executes them).
1491
1499
1492 Internally this triggers a call to %prun, see its documentation for
1500 Internally this triggers a call to %prun, see its documentation for
1493 details on the options available specifically for profiling.
1501 details on the options available specifically for profiling.
1494
1502
1495 There is one special usage for which the text above doesn't apply:
1503 There is one special usage for which the text above doesn't apply:
1496 if the filename ends with .ipy, the file is run as ipython script,
1504 if the filename ends with .ipy, the file is run as ipython script,
1497 just as if the commands were written on IPython prompt.
1505 just as if the commands were written on IPython prompt.
1498 """
1506 """
1499
1507
1500 # get arguments and set sys.argv for program to be run.
1508 # get arguments and set sys.argv for program to be run.
1501 opts,arg_lst = self.parse_options(parameter_s,'nidtN:b:pD:l:rs:T:e',
1509 opts,arg_lst = self.parse_options(parameter_s,'nidtN:b:pD:l:rs:T:e',
1502 mode='list',list_all=1)
1510 mode='list',list_all=1)
1503
1511
1504 try:
1512 try:
1505 filename = get_py_filename(arg_lst[0])
1513 filename = get_py_filename(arg_lst[0])
1506 except IndexError:
1514 except IndexError:
1507 warn('you must provide at least a filename.')
1515 warn('you must provide at least a filename.')
1508 print '\n%run:\n',OInspect.getdoc(self.magic_run)
1516 print '\n%run:\n',OInspect.getdoc(self.magic_run)
1509 return
1517 return
1510 except IOError,msg:
1518 except IOError,msg:
1511 error(msg)
1519 error(msg)
1512 return
1520 return
1513
1521
1514 if filename.lower().endswith('.ipy'):
1522 if filename.lower().endswith('.ipy'):
1515 self.api.runlines(open(filename).read())
1523 self.api.runlines(open(filename).read())
1516 return
1524 return
1517
1525
1518 # Control the response to exit() calls made by the script being run
1526 # Control the response to exit() calls made by the script being run
1519 exit_ignore = opts.has_key('e')
1527 exit_ignore = opts.has_key('e')
1520
1528
1521 # Make sure that the running script gets a proper sys.argv as if it
1529 # Make sure that the running script gets a proper sys.argv as if it
1522 # were run from a system shell.
1530 # were run from a system shell.
1523 save_argv = sys.argv # save it for later restoring
1531 save_argv = sys.argv # save it for later restoring
1524 sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
1532 sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
1525
1533
1526 if opts.has_key('i'):
1534 if opts.has_key('i'):
1527 # Run in user's interactive namespace
1535 # Run in user's interactive namespace
1528 prog_ns = self.shell.user_ns
1536 prog_ns = self.shell.user_ns
1529 __name__save = self.shell.user_ns['__name__']
1537 __name__save = self.shell.user_ns['__name__']
1530 prog_ns['__name__'] = '__main__'
1538 prog_ns['__name__'] = '__main__'
1531 main_mod = FakeModule(prog_ns)
1539 main_mod = FakeModule(prog_ns)
1532 else:
1540 else:
1533 # Run in a fresh, empty namespace
1541 # Run in a fresh, empty namespace
1534 if opts.has_key('n'):
1542 if opts.has_key('n'):
1535 name = os.path.splitext(os.path.basename(filename))[0]
1543 name = os.path.splitext(os.path.basename(filename))[0]
1536 else:
1544 else:
1537 name = '__main__'
1545 name = '__main__'
1538 main_mod = FakeModule()
1546 main_mod = FakeModule()
1539 prog_ns = main_mod.__dict__
1547 prog_ns = main_mod.__dict__
1540 prog_ns['__name__'] = name
1548 prog_ns['__name__'] = name
1541 # The shell MUST hold a reference to main_mod so after %run exits,
1549 # The shell MUST hold a reference to main_mod so after %run exits,
1542 # the python deletion mechanism doesn't zero it out (leaving
1550 # the python deletion mechanism doesn't zero it out (leaving
1543 # dangling references)
1551 # dangling references)
1544 self.shell._user_main_modules.append(main_mod)
1552 self.shell._user_main_modules.append(main_mod)
1545
1553
1546 # Since '%run foo' emulates 'python foo.py' at the cmd line, we must
1554 # Since '%run foo' emulates 'python foo.py' at the cmd line, we must
1547 # set the __file__ global in the script's namespace
1555 # set the __file__ global in the script's namespace
1548 prog_ns['__file__'] = filename
1556 prog_ns['__file__'] = filename
1549
1557
1550 # pickle fix. See iplib for an explanation. But we need to make sure
1558 # pickle fix. See iplib for an explanation. But we need to make sure
1551 # that, if we overwrite __main__, we replace it at the end
1559 # that, if we overwrite __main__, we replace it at the end
1552 if prog_ns['__name__'] == '__main__':
1560 if prog_ns['__name__'] == '__main__':
1553 restore_main = sys.modules['__main__']
1561 restore_main = sys.modules['__main__']
1554 else:
1562 else:
1555 restore_main = False
1563 restore_main = False
1556
1564
1557 sys.modules[prog_ns['__name__']] = main_mod
1565 sys.modules[prog_ns['__name__']] = main_mod
1558
1566
1559 stats = None
1567 stats = None
1560 try:
1568 try:
1561 if self.shell.has_readline:
1569 if self.shell.has_readline:
1562 self.shell.savehist()
1570 self.shell.savehist()
1563
1571
1564 if opts.has_key('p'):
1572 if opts.has_key('p'):
1565 stats = self.magic_prun('',0,opts,arg_lst,prog_ns)
1573 stats = self.magic_prun('',0,opts,arg_lst,prog_ns)
1566 else:
1574 else:
1567 if opts.has_key('d'):
1575 if opts.has_key('d'):
1568 deb = Debugger.Pdb(self.shell.rc.colors)
1576 deb = Debugger.Pdb(self.shell.rc.colors)
1569 # reset Breakpoint state, which is moronically kept
1577 # reset Breakpoint state, which is moronically kept
1570 # in a class
1578 # in a class
1571 bdb.Breakpoint.next = 1
1579 bdb.Breakpoint.next = 1
1572 bdb.Breakpoint.bplist = {}
1580 bdb.Breakpoint.bplist = {}
1573 bdb.Breakpoint.bpbynumber = [None]
1581 bdb.Breakpoint.bpbynumber = [None]
1574 # Set an initial breakpoint to stop execution
1582 # Set an initial breakpoint to stop execution
1575 maxtries = 10
1583 maxtries = 10
1576 bp = int(opts.get('b',[1])[0])
1584 bp = int(opts.get('b',[1])[0])
1577 checkline = deb.checkline(filename,bp)
1585 checkline = deb.checkline(filename,bp)
1578 if not checkline:
1586 if not checkline:
1579 for bp in range(bp+1,bp+maxtries+1):
1587 for bp in range(bp+1,bp+maxtries+1):
1580 if deb.checkline(filename,bp):
1588 if deb.checkline(filename,bp):
1581 break
1589 break
1582 else:
1590 else:
1583 msg = ("\nI failed to find a valid line to set "
1591 msg = ("\nI failed to find a valid line to set "
1584 "a breakpoint\n"
1592 "a breakpoint\n"
1585 "after trying up to line: %s.\n"
1593 "after trying up to line: %s.\n"
1586 "Please set a valid breakpoint manually "
1594 "Please set a valid breakpoint manually "
1587 "with the -b option." % bp)
1595 "with the -b option." % bp)
1588 error(msg)
1596 error(msg)
1589 return
1597 return
1590 # if we find a good linenumber, set the breakpoint
1598 # if we find a good linenumber, set the breakpoint
1591 deb.do_break('%s:%s' % (filename,bp))
1599 deb.do_break('%s:%s' % (filename,bp))
1592 # Start file run
1600 # Start file run
1593 print "NOTE: Enter 'c' at the",
1601 print "NOTE: Enter 'c' at the",
1594 print "%s prompt to start your script." % deb.prompt
1602 print "%s prompt to start your script." % deb.prompt
1595 try:
1603 try:
1596 deb.run('execfile("%s")' % filename,prog_ns)
1604 deb.run('execfile("%s")' % filename,prog_ns)
1597
1605
1598 except:
1606 except:
1599 etype, value, tb = sys.exc_info()
1607 etype, value, tb = sys.exc_info()
1600 # Skip three frames in the traceback: the %run one,
1608 # Skip three frames in the traceback: the %run one,
1601 # one inside bdb.py, and the command-line typed by the
1609 # one inside bdb.py, and the command-line typed by the
1602 # user (run by exec in pdb itself).
1610 # user (run by exec in pdb itself).
1603 self.shell.InteractiveTB(etype,value,tb,tb_offset=3)
1611 self.shell.InteractiveTB(etype,value,tb,tb_offset=3)
1604 else:
1612 else:
1605 if runner is None:
1613 if runner is None:
1606 runner = self.shell.safe_execfile
1614 runner = self.shell.safe_execfile
1607 if opts.has_key('t'):
1615 if opts.has_key('t'):
1608 # timed execution
1616 # timed execution
1609 try:
1617 try:
1610 nruns = int(opts['N'][0])
1618 nruns = int(opts['N'][0])
1611 if nruns < 1:
1619 if nruns < 1:
1612 error('Number of runs must be >=1')
1620 error('Number of runs must be >=1')
1613 return
1621 return
1614 except (KeyError):
1622 except (KeyError):
1615 nruns = 1
1623 nruns = 1
1616 if nruns == 1:
1624 if nruns == 1:
1617 t0 = clock2()
1625 t0 = clock2()
1618 runner(filename,prog_ns,prog_ns,
1626 runner(filename,prog_ns,prog_ns,
1619 exit_ignore=exit_ignore)
1627 exit_ignore=exit_ignore)
1620 t1 = clock2()
1628 t1 = clock2()
1621 t_usr = t1[0]-t0[0]
1629 t_usr = t1[0]-t0[0]
1622 t_sys = t1[1]-t1[1]
1630 t_sys = t1[1]-t1[1]
1623 print "\nIPython CPU timings (estimated):"
1631 print "\nIPython CPU timings (estimated):"
1624 print " User : %10s s." % t_usr
1632 print " User : %10s s." % t_usr
1625 print " System: %10s s." % t_sys
1633 print " System: %10s s." % t_sys
1626 else:
1634 else:
1627 runs = range(nruns)
1635 runs = range(nruns)
1628 t0 = clock2()
1636 t0 = clock2()
1629 for nr in runs:
1637 for nr in runs:
1630 runner(filename,prog_ns,prog_ns,
1638 runner(filename,prog_ns,prog_ns,
1631 exit_ignore=exit_ignore)
1639 exit_ignore=exit_ignore)
1632 t1 = clock2()
1640 t1 = clock2()
1633 t_usr = t1[0]-t0[0]
1641 t_usr = t1[0]-t0[0]
1634 t_sys = t1[1]-t1[1]
1642 t_sys = t1[1]-t1[1]
1635 print "\nIPython CPU timings (estimated):"
1643 print "\nIPython CPU timings (estimated):"
1636 print "Total runs performed:",nruns
1644 print "Total runs performed:",nruns
1637 print " Times : %10s %10s" % ('Total','Per run')
1645 print " Times : %10s %10s" % ('Total','Per run')
1638 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1646 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1639 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1647 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1640
1648
1641 else:
1649 else:
1642 # regular execution
1650 # regular execution
1643 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
1651 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
1644 if opts.has_key('i'):
1652 if opts.has_key('i'):
1645 self.shell.user_ns['__name__'] = __name__save
1653 self.shell.user_ns['__name__'] = __name__save
1646 else:
1654 else:
1647 # update IPython interactive namespace
1655 # update IPython interactive namespace
1648 del prog_ns['__name__']
1656 del prog_ns['__name__']
1649 self.shell.user_ns.update(prog_ns)
1657 self.shell.user_ns.update(prog_ns)
1650 finally:
1658 finally:
1651 sys.argv = save_argv
1659 sys.argv = save_argv
1652 if restore_main:
1660 if restore_main:
1653 sys.modules['__main__'] = restore_main
1661 sys.modules['__main__'] = restore_main
1654 self.shell.reloadhist()
1662 self.shell.reloadhist()
1655
1663
1656 return stats
1664 return stats
1657
1665
1658 def magic_runlog(self, parameter_s =''):
1666 def magic_runlog(self, parameter_s =''):
1659 """Run files as logs.
1667 """Run files as logs.
1660
1668
1661 Usage:\\
1669 Usage:\\
1662 %runlog file1 file2 ...
1670 %runlog file1 file2 ...
1663
1671
1664 Run the named files (treating them as log files) in sequence inside
1672 Run the named files (treating them as log files) in sequence inside
1665 the interpreter, and return to the prompt. This is much slower than
1673 the interpreter, and return to the prompt. This is much slower than
1666 %run because each line is executed in a try/except block, but it
1674 %run because each line is executed in a try/except block, but it
1667 allows running files with syntax errors in them.
1675 allows running files with syntax errors in them.
1668
1676
1669 Normally IPython will guess when a file is one of its own logfiles, so
1677 Normally IPython will guess when a file is one of its own logfiles, so
1670 you can typically use %run even for logs. This shorthand allows you to
1678 you can typically use %run even for logs. This shorthand allows you to
1671 force any file to be treated as a log file."""
1679 force any file to be treated as a log file."""
1672
1680
1673 for f in parameter_s.split():
1681 for f in parameter_s.split():
1674 self.shell.safe_execfile(f,self.shell.user_ns,
1682 self.shell.safe_execfile(f,self.shell.user_ns,
1675 self.shell.user_ns,islog=1)
1683 self.shell.user_ns,islog=1)
1676
1684
1677 def magic_timeit(self, parameter_s =''):
1685 def magic_timeit(self, parameter_s =''):
1678 """Time execution of a Python statement or expression
1686 """Time execution of a Python statement or expression
1679
1687
1680 Usage:\\
1688 Usage:\\
1681 %timeit [-n<N> -r<R> [-t|-c]] statement
1689 %timeit [-n<N> -r<R> [-t|-c]] statement
1682
1690
1683 Time execution of a Python statement or expression using the timeit
1691 Time execution of a Python statement or expression using the timeit
1684 module.
1692 module.
1685
1693
1686 Options:
1694 Options:
1687 -n<N>: execute the given statement <N> times in a loop. If this value
1695 -n<N>: execute the given statement <N> times in a loop. If this value
1688 is not given, a fitting value is chosen.
1696 is not given, a fitting value is chosen.
1689
1697
1690 -r<R>: repeat the loop iteration <R> times and take the best result.
1698 -r<R>: repeat the loop iteration <R> times and take the best result.
1691 Default: 3
1699 Default: 3
1692
1700
1693 -t: use time.time to measure the time, which is the default on Unix.
1701 -t: use time.time to measure the time, which is the default on Unix.
1694 This function measures wall time.
1702 This function measures wall time.
1695
1703
1696 -c: use time.clock to measure the time, which is the default on
1704 -c: use time.clock to measure the time, which is the default on
1697 Windows and measures wall time. On Unix, resource.getrusage is used
1705 Windows and measures wall time. On Unix, resource.getrusage is used
1698 instead and returns the CPU user time.
1706 instead and returns the CPU user time.
1699
1707
1700 -p<P>: use a precision of <P> digits to display the timing result.
1708 -p<P>: use a precision of <P> digits to display the timing result.
1701 Default: 3
1709 Default: 3
1702
1710
1703
1711
1704 Examples:\\
1712 Examples:\\
1705 In [1]: %timeit pass
1713 In [1]: %timeit pass
1706 10000000 loops, best of 3: 53.3 ns per loop
1714 10000000 loops, best of 3: 53.3 ns per loop
1707
1715
1708 In [2]: u = None
1716 In [2]: u = None
1709
1717
1710 In [3]: %timeit u is None
1718 In [3]: %timeit u is None
1711 10000000 loops, best of 3: 184 ns per loop
1719 10000000 loops, best of 3: 184 ns per loop
1712
1720
1713 In [4]: %timeit -r 4 u == None
1721 In [4]: %timeit -r 4 u == None
1714 1000000 loops, best of 4: 242 ns per loop
1722 1000000 loops, best of 4: 242 ns per loop
1715
1723
1716 In [5]: import time
1724 In [5]: import time
1717
1725
1718 In [6]: %timeit -n1 time.sleep(2)
1726 In [6]: %timeit -n1 time.sleep(2)
1719 1 loops, best of 3: 2 s per loop
1727 1 loops, best of 3: 2 s per loop
1720
1728
1721
1729
1722 The times reported by %timeit will be slightly higher than those
1730 The times reported by %timeit will be slightly higher than those
1723 reported by the timeit.py script when variables are accessed. This is
1731 reported by the timeit.py script when variables are accessed. This is
1724 due to the fact that %timeit executes the statement in the namespace
1732 due to the fact that %timeit executes the statement in the namespace
1725 of the shell, compared with timeit.py, which uses a single setup
1733 of the shell, compared with timeit.py, which uses a single setup
1726 statement to import function or create variables. Generally, the bias
1734 statement to import function or create variables. Generally, the bias
1727 does not matter as long as results from timeit.py are not mixed with
1735 does not matter as long as results from timeit.py are not mixed with
1728 those from %timeit."""
1736 those from %timeit."""
1729
1737
1730 import timeit
1738 import timeit
1731 import math
1739 import math
1732
1740
1733 units = ["s", "ms", "\xc2\xb5s", "ns"]
1741 units = ["s", "ms", "\xc2\xb5s", "ns"]
1734 scaling = [1, 1e3, 1e6, 1e9]
1742 scaling = [1, 1e3, 1e6, 1e9]
1735
1743
1736 opts, stmt = self.parse_options(parameter_s,'n:r:tcp:',
1744 opts, stmt = self.parse_options(parameter_s,'n:r:tcp:',
1737 posix=False)
1745 posix=False)
1738 if stmt == "":
1746 if stmt == "":
1739 return
1747 return
1740 timefunc = timeit.default_timer
1748 timefunc = timeit.default_timer
1741 number = int(getattr(opts, "n", 0))
1749 number = int(getattr(opts, "n", 0))
1742 repeat = int(getattr(opts, "r", timeit.default_repeat))
1750 repeat = int(getattr(opts, "r", timeit.default_repeat))
1743 precision = int(getattr(opts, "p", 3))
1751 precision = int(getattr(opts, "p", 3))
1744 if hasattr(opts, "t"):
1752 if hasattr(opts, "t"):
1745 timefunc = time.time
1753 timefunc = time.time
1746 if hasattr(opts, "c"):
1754 if hasattr(opts, "c"):
1747 timefunc = clock
1755 timefunc = clock
1748
1756
1749 timer = timeit.Timer(timer=timefunc)
1757 timer = timeit.Timer(timer=timefunc)
1750 # this code has tight coupling to the inner workings of timeit.Timer,
1758 # this code has tight coupling to the inner workings of timeit.Timer,
1751 # but is there a better way to achieve that the code stmt has access
1759 # but is there a better way to achieve that the code stmt has access
1752 # to the shell namespace?
1760 # to the shell namespace?
1753
1761
1754 src = timeit.template % {'stmt': timeit.reindent(stmt, 8),
1762 src = timeit.template % {'stmt': timeit.reindent(stmt, 8),
1755 'setup': "pass"}
1763 'setup': "pass"}
1756 # Track compilation time so it can be reported if too long
1764 # Track compilation time so it can be reported if too long
1757 # Minimum time above which compilation time will be reported
1765 # Minimum time above which compilation time will be reported
1758 tc_min = 0.1
1766 tc_min = 0.1
1759
1767
1760 t0 = clock()
1768 t0 = clock()
1761 code = compile(src, "<magic-timeit>", "exec")
1769 code = compile(src, "<magic-timeit>", "exec")
1762 tc = clock()-t0
1770 tc = clock()-t0
1763
1771
1764 ns = {}
1772 ns = {}
1765 exec code in self.shell.user_ns, ns
1773 exec code in self.shell.user_ns, ns
1766 timer.inner = ns["inner"]
1774 timer.inner = ns["inner"]
1767
1775
1768 if number == 0:
1776 if number == 0:
1769 # determine number so that 0.2 <= total time < 2.0
1777 # determine number so that 0.2 <= total time < 2.0
1770 number = 1
1778 number = 1
1771 for i in range(1, 10):
1779 for i in range(1, 10):
1772 number *= 10
1780 number *= 10
1773 if timer.timeit(number) >= 0.2:
1781 if timer.timeit(number) >= 0.2:
1774 break
1782 break
1775
1783
1776 best = min(timer.repeat(repeat, number)) / number
1784 best = min(timer.repeat(repeat, number)) / number
1777
1785
1778 if best > 0.0:
1786 if best > 0.0:
1779 order = min(-int(math.floor(math.log10(best)) // 3), 3)
1787 order = min(-int(math.floor(math.log10(best)) // 3), 3)
1780 else:
1788 else:
1781 order = 3
1789 order = 3
1782 print "%d loops, best of %d: %.*g %s per loop" % (number, repeat,
1790 print "%d loops, best of %d: %.*g %s per loop" % (number, repeat,
1783 precision,
1791 precision,
1784 best * scaling[order],
1792 best * scaling[order],
1785 units[order])
1793 units[order])
1786 if tc > tc_min:
1794 if tc > tc_min:
1787 print "Compiler time: %.2f s" % tc
1795 print "Compiler time: %.2f s" % tc
1788
1796
1789 def magic_time(self,parameter_s = ''):
1797 def magic_time(self,parameter_s = ''):
1790 """Time execution of a Python statement or expression.
1798 """Time execution of a Python statement or expression.
1791
1799
1792 The CPU and wall clock times are printed, and the value of the
1800 The CPU and wall clock times are printed, and the value of the
1793 expression (if any) is returned. Note that under Win32, system time
1801 expression (if any) is returned. Note that under Win32, system time
1794 is always reported as 0, since it can not be measured.
1802 is always reported as 0, since it can not be measured.
1795
1803
1796 This function provides very basic timing functionality. In Python
1804 This function provides very basic timing functionality. In Python
1797 2.3, the timeit module offers more control and sophistication, so this
1805 2.3, the timeit module offers more control and sophistication, so this
1798 could be rewritten to use it (patches welcome).
1806 could be rewritten to use it (patches welcome).
1799
1807
1800 Some examples:
1808 Some examples:
1801
1809
1802 In [1]: time 2**128
1810 In [1]: time 2**128
1803 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1811 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1804 Wall time: 0.00
1812 Wall time: 0.00
1805 Out[1]: 340282366920938463463374607431768211456L
1813 Out[1]: 340282366920938463463374607431768211456L
1806
1814
1807 In [2]: n = 1000000
1815 In [2]: n = 1000000
1808
1816
1809 In [3]: time sum(range(n))
1817 In [3]: time sum(range(n))
1810 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
1818 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
1811 Wall time: 1.37
1819 Wall time: 1.37
1812 Out[3]: 499999500000L
1820 Out[3]: 499999500000L
1813
1821
1814 In [4]: time print 'hello world'
1822 In [4]: time print 'hello world'
1815 hello world
1823 hello world
1816 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1824 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1817 Wall time: 0.00
1825 Wall time: 0.00
1818
1826
1819 Note that the time needed by Python to compile the given expression
1827 Note that the time needed by Python to compile the given expression
1820 will be reported if it is more than 0.1s. In this example, the
1828 will be reported if it is more than 0.1s. In this example, the
1821 actual exponentiation is done by Python at compilation time, so while
1829 actual exponentiation is done by Python at compilation time, so while
1822 the expression can take a noticeable amount of time to compute, that
1830 the expression can take a noticeable amount of time to compute, that
1823 time is purely due to the compilation:
1831 time is purely due to the compilation:
1824
1832
1825 In [5]: time 3**9999;
1833 In [5]: time 3**9999;
1826 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1834 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1827 Wall time: 0.00 s
1835 Wall time: 0.00 s
1828
1836
1829 In [6]: time 3**999999;
1837 In [6]: time 3**999999;
1830 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1838 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1831 Wall time: 0.00 s
1839 Wall time: 0.00 s
1832 Compiler : 0.78 s
1840 Compiler : 0.78 s
1833 """
1841 """
1834
1842
1835 # fail immediately if the given expression can't be compiled
1843 # fail immediately if the given expression can't be compiled
1836
1844
1837 expr = self.shell.prefilter(parameter_s,False)
1845 expr = self.shell.prefilter(parameter_s,False)
1838
1846
1839 # Minimum time above which compilation time will be reported
1847 # Minimum time above which compilation time will be reported
1840 tc_min = 0.1
1848 tc_min = 0.1
1841
1849
1842 try:
1850 try:
1843 mode = 'eval'
1851 mode = 'eval'
1844 t0 = clock()
1852 t0 = clock()
1845 code = compile(expr,'<timed eval>',mode)
1853 code = compile(expr,'<timed eval>',mode)
1846 tc = clock()-t0
1854 tc = clock()-t0
1847 except SyntaxError:
1855 except SyntaxError:
1848 mode = 'exec'
1856 mode = 'exec'
1849 t0 = clock()
1857 t0 = clock()
1850 code = compile(expr,'<timed exec>',mode)
1858 code = compile(expr,'<timed exec>',mode)
1851 tc = clock()-t0
1859 tc = clock()-t0
1852 # skew measurement as little as possible
1860 # skew measurement as little as possible
1853 glob = self.shell.user_ns
1861 glob = self.shell.user_ns
1854 clk = clock2
1862 clk = clock2
1855 wtime = time.time
1863 wtime = time.time
1856 # time execution
1864 # time execution
1857 wall_st = wtime()
1865 wall_st = wtime()
1858 if mode=='eval':
1866 if mode=='eval':
1859 st = clk()
1867 st = clk()
1860 out = eval(code,glob)
1868 out = eval(code,glob)
1861 end = clk()
1869 end = clk()
1862 else:
1870 else:
1863 st = clk()
1871 st = clk()
1864 exec code in glob
1872 exec code in glob
1865 end = clk()
1873 end = clk()
1866 out = None
1874 out = None
1867 wall_end = wtime()
1875 wall_end = wtime()
1868 # Compute actual times and report
1876 # Compute actual times and report
1869 wall_time = wall_end-wall_st
1877 wall_time = wall_end-wall_st
1870 cpu_user = end[0]-st[0]
1878 cpu_user = end[0]-st[0]
1871 cpu_sys = end[1]-st[1]
1879 cpu_sys = end[1]-st[1]
1872 cpu_tot = cpu_user+cpu_sys
1880 cpu_tot = cpu_user+cpu_sys
1873 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1881 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1874 (cpu_user,cpu_sys,cpu_tot)
1882 (cpu_user,cpu_sys,cpu_tot)
1875 print "Wall time: %.2f s" % wall_time
1883 print "Wall time: %.2f s" % wall_time
1876 if tc > tc_min:
1884 if tc > tc_min:
1877 print "Compiler : %.2f s" % tc
1885 print "Compiler : %.2f s" % tc
1878 return out
1886 return out
1879
1887
1880 def magic_macro(self,parameter_s = ''):
1888 def magic_macro(self,parameter_s = ''):
1881 """Define a set of input lines as a macro for future re-execution.
1889 """Define a set of input lines as a macro for future re-execution.
1882
1890
1883 Usage:\\
1891 Usage:\\
1884 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1892 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1885
1893
1886 Options:
1894 Options:
1887
1895
1888 -r: use 'raw' input. By default, the 'processed' history is used,
1896 -r: use 'raw' input. By default, the 'processed' history is used,
1889 so that magics are loaded in their transformed version to valid
1897 so that magics are loaded in their transformed version to valid
1890 Python. If this option is given, the raw input as typed as the
1898 Python. If this option is given, the raw input as typed as the
1891 command line is used instead.
1899 command line is used instead.
1892
1900
1893 This will define a global variable called `name` which is a string
1901 This will define a global variable called `name` which is a string
1894 made of joining the slices and lines you specify (n1,n2,... numbers
1902 made of joining the slices and lines you specify (n1,n2,... numbers
1895 above) from your input history into a single string. This variable
1903 above) from your input history into a single string. This variable
1896 acts like an automatic function which re-executes those lines as if
1904 acts like an automatic function which re-executes those lines as if
1897 you had typed them. You just type 'name' at the prompt and the code
1905 you had typed them. You just type 'name' at the prompt and the code
1898 executes.
1906 executes.
1899
1907
1900 The notation for indicating number ranges is: n1-n2 means 'use line
1908 The notation for indicating number ranges is: n1-n2 means 'use line
1901 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1909 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1902 using the lines numbered 5,6 and 7.
1910 using the lines numbered 5,6 and 7.
1903
1911
1904 Note: as a 'hidden' feature, you can also use traditional python slice
1912 Note: as a 'hidden' feature, you can also use traditional python slice
1905 notation, where N:M means numbers N through M-1.
1913 notation, where N:M means numbers N through M-1.
1906
1914
1907 For example, if your history contains (%hist prints it):
1915 For example, if your history contains (%hist prints it):
1908
1916
1909 44: x=1\\
1917 44: x=1\\
1910 45: y=3\\
1918 45: y=3\\
1911 46: z=x+y\\
1919 46: z=x+y\\
1912 47: print x\\
1920 47: print x\\
1913 48: a=5\\
1921 48: a=5\\
1914 49: print 'x',x,'y',y\\
1922 49: print 'x',x,'y',y\\
1915
1923
1916 you can create a macro with lines 44 through 47 (included) and line 49
1924 you can create a macro with lines 44 through 47 (included) and line 49
1917 called my_macro with:
1925 called my_macro with:
1918
1926
1919 In [51]: %macro my_macro 44-47 49
1927 In [51]: %macro my_macro 44-47 49
1920
1928
1921 Now, typing `my_macro` (without quotes) will re-execute all this code
1929 Now, typing `my_macro` (without quotes) will re-execute all this code
1922 in one pass.
1930 in one pass.
1923
1931
1924 You don't need to give the line-numbers in order, and any given line
1932 You don't need to give the line-numbers in order, and any given line
1925 number can appear multiple times. You can assemble macros with any
1933 number can appear multiple times. You can assemble macros with any
1926 lines from your input history in any order.
1934 lines from your input history in any order.
1927
1935
1928 The macro is a simple object which holds its value in an attribute,
1936 The macro is a simple object which holds its value in an attribute,
1929 but IPython's display system checks for macros and executes them as
1937 but IPython's display system checks for macros and executes them as
1930 code instead of printing them when you type their name.
1938 code instead of printing them when you type their name.
1931
1939
1932 You can view a macro's contents by explicitly printing it with:
1940 You can view a macro's contents by explicitly printing it with:
1933
1941
1934 'print macro_name'.
1942 'print macro_name'.
1935
1943
1936 For one-off cases which DON'T contain magic function calls in them you
1944 For one-off cases which DON'T contain magic function calls in them you
1937 can obtain similar results by explicitly executing slices from your
1945 can obtain similar results by explicitly executing slices from your
1938 input history with:
1946 input history with:
1939
1947
1940 In [60]: exec In[44:48]+In[49]"""
1948 In [60]: exec In[44:48]+In[49]"""
1941
1949
1942 opts,args = self.parse_options(parameter_s,'r',mode='list')
1950 opts,args = self.parse_options(parameter_s,'r',mode='list')
1943 if not args:
1951 if not args:
1944 macs = [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)]
1952 macs = [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)]
1945 macs.sort()
1953 macs.sort()
1946 return macs
1954 return macs
1947 if len(args) == 1:
1955 if len(args) == 1:
1948 raise UsageError(
1956 raise UsageError(
1949 "%macro insufficient args; usage '%macro name n1-n2 n3-4...")
1957 "%macro insufficient args; usage '%macro name n1-n2 n3-4...")
1950 name,ranges = args[0], args[1:]
1958 name,ranges = args[0], args[1:]
1951
1959
1952 #print 'rng',ranges # dbg
1960 #print 'rng',ranges # dbg
1953 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1961 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1954 macro = Macro(lines)
1962 macro = Macro(lines)
1955 self.shell.user_ns.update({name:macro})
1963 self.shell.user_ns.update({name:macro})
1956 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1964 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1957 print 'Macro contents:'
1965 print 'Macro contents:'
1958 print macro,
1966 print macro,
1959
1967
1960 def magic_save(self,parameter_s = ''):
1968 def magic_save(self,parameter_s = ''):
1961 """Save a set of lines to a given filename.
1969 """Save a set of lines to a given filename.
1962
1970
1963 Usage:\\
1971 Usage:\\
1964 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1972 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1965
1973
1966 Options:
1974 Options:
1967
1975
1968 -r: use 'raw' input. By default, the 'processed' history is used,
1976 -r: use 'raw' input. By default, the 'processed' history is used,
1969 so that magics are loaded in their transformed version to valid
1977 so that magics are loaded in their transformed version to valid
1970 Python. If this option is given, the raw input as typed as the
1978 Python. If this option is given, the raw input as typed as the
1971 command line is used instead.
1979 command line is used instead.
1972
1980
1973 This function uses the same syntax as %macro for line extraction, but
1981 This function uses the same syntax as %macro for line extraction, but
1974 instead of creating a macro it saves the resulting string to the
1982 instead of creating a macro it saves the resulting string to the
1975 filename you specify.
1983 filename you specify.
1976
1984
1977 It adds a '.py' extension to the file if you don't do so yourself, and
1985 It adds a '.py' extension to the file if you don't do so yourself, and
1978 it asks for confirmation before overwriting existing files."""
1986 it asks for confirmation before overwriting existing files."""
1979
1987
1980 opts,args = self.parse_options(parameter_s,'r',mode='list')
1988 opts,args = self.parse_options(parameter_s,'r',mode='list')
1981 fname,ranges = args[0], args[1:]
1989 fname,ranges = args[0], args[1:]
1982 if not fname.endswith('.py'):
1990 if not fname.endswith('.py'):
1983 fname += '.py'
1991 fname += '.py'
1984 if os.path.isfile(fname):
1992 if os.path.isfile(fname):
1985 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1993 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1986 if ans.lower() not in ['y','yes']:
1994 if ans.lower() not in ['y','yes']:
1987 print 'Operation cancelled.'
1995 print 'Operation cancelled.'
1988 return
1996 return
1989 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1997 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1990 f = file(fname,'w')
1998 f = file(fname,'w')
1991 f.write(cmds)
1999 f.write(cmds)
1992 f.close()
2000 f.close()
1993 print 'The following commands were written to file `%s`:' % fname
2001 print 'The following commands were written to file `%s`:' % fname
1994 print cmds
2002 print cmds
1995
2003
1996 def _edit_macro(self,mname,macro):
2004 def _edit_macro(self,mname,macro):
1997 """open an editor with the macro data in a file"""
2005 """open an editor with the macro data in a file"""
1998 filename = self.shell.mktempfile(macro.value)
2006 filename = self.shell.mktempfile(macro.value)
1999 self.shell.hooks.editor(filename)
2007 self.shell.hooks.editor(filename)
2000
2008
2001 # and make a new macro object, to replace the old one
2009 # and make a new macro object, to replace the old one
2002 mfile = open(filename)
2010 mfile = open(filename)
2003 mvalue = mfile.read()
2011 mvalue = mfile.read()
2004 mfile.close()
2012 mfile.close()
2005 self.shell.user_ns[mname] = Macro(mvalue)
2013 self.shell.user_ns[mname] = Macro(mvalue)
2006
2014
2007 def magic_ed(self,parameter_s=''):
2015 def magic_ed(self,parameter_s=''):
2008 """Alias to %edit."""
2016 """Alias to %edit."""
2009 return self.magic_edit(parameter_s)
2017 return self.magic_edit(parameter_s)
2010
2018
2011 def magic_edit(self,parameter_s='',last_call=['','']):
2019 def magic_edit(self,parameter_s='',last_call=['','']):
2012 """Bring up an editor and execute the resulting code.
2020 """Bring up an editor and execute the resulting code.
2013
2021
2014 Usage:
2022 Usage:
2015 %edit [options] [args]
2023 %edit [options] [args]
2016
2024
2017 %edit runs IPython's editor hook. The default version of this hook is
2025 %edit runs IPython's editor hook. The default version of this hook is
2018 set to call the __IPYTHON__.rc.editor command. This is read from your
2026 set to call the __IPYTHON__.rc.editor command. This is read from your
2019 environment variable $EDITOR. If this isn't found, it will default to
2027 environment variable $EDITOR. If this isn't found, it will default to
2020 vi under Linux/Unix and to notepad under Windows. See the end of this
2028 vi under Linux/Unix and to notepad under Windows. See the end of this
2021 docstring for how to change the editor hook.
2029 docstring for how to change the editor hook.
2022
2030
2023 You can also set the value of this editor via the command line option
2031 You can also set the value of this editor via the command line option
2024 '-editor' or in your ipythonrc file. This is useful if you wish to use
2032 '-editor' or in your ipythonrc file. This is useful if you wish to use
2025 specifically for IPython an editor different from your typical default
2033 specifically for IPython an editor different from your typical default
2026 (and for Windows users who typically don't set environment variables).
2034 (and for Windows users who typically don't set environment variables).
2027
2035
2028 This command allows you to conveniently edit multi-line code right in
2036 This command allows you to conveniently edit multi-line code right in
2029 your IPython session.
2037 your IPython session.
2030
2038
2031 If called without arguments, %edit opens up an empty editor with a
2039 If called without arguments, %edit opens up an empty editor with a
2032 temporary file and will execute the contents of this file when you
2040 temporary file and will execute the contents of this file when you
2033 close it (don't forget to save it!).
2041 close it (don't forget to save it!).
2034
2042
2035
2043
2036 Options:
2044 Options:
2037
2045
2038 -n <number>: open the editor at a specified line number. By default,
2046 -n <number>: open the editor at a specified line number. By default,
2039 the IPython editor hook uses the unix syntax 'editor +N filename', but
2047 the IPython editor hook uses the unix syntax 'editor +N filename', but
2040 you can configure this by providing your own modified hook if your
2048 you can configure this by providing your own modified hook if your
2041 favorite editor supports line-number specifications with a different
2049 favorite editor supports line-number specifications with a different
2042 syntax.
2050 syntax.
2043
2051
2044 -p: this will call the editor with the same data as the previous time
2052 -p: this will call the editor with the same data as the previous time
2045 it was used, regardless of how long ago (in your current session) it
2053 it was used, regardless of how long ago (in your current session) it
2046 was.
2054 was.
2047
2055
2048 -r: use 'raw' input. This option only applies to input taken from the
2056 -r: use 'raw' input. This option only applies to input taken from the
2049 user's history. By default, the 'processed' history is used, so that
2057 user's history. By default, the 'processed' history is used, so that
2050 magics are loaded in their transformed version to valid Python. If
2058 magics are loaded in their transformed version to valid Python. If
2051 this option is given, the raw input as typed as the command line is
2059 this option is given, the raw input as typed as the command line is
2052 used instead. When you exit the editor, it will be executed by
2060 used instead. When you exit the editor, it will be executed by
2053 IPython's own processor.
2061 IPython's own processor.
2054
2062
2055 -x: do not execute the edited code immediately upon exit. This is
2063 -x: do not execute the edited code immediately upon exit. This is
2056 mainly useful if you are editing programs which need to be called with
2064 mainly useful if you are editing programs which need to be called with
2057 command line arguments, which you can then do using %run.
2065 command line arguments, which you can then do using %run.
2058
2066
2059
2067
2060 Arguments:
2068 Arguments:
2061
2069
2062 If arguments are given, the following possibilites exist:
2070 If arguments are given, the following possibilites exist:
2063
2071
2064 - The arguments are numbers or pairs of colon-separated numbers (like
2072 - The arguments are numbers or pairs of colon-separated numbers (like
2065 1 4:8 9). These are interpreted as lines of previous input to be
2073 1 4:8 9). These are interpreted as lines of previous input to be
2066 loaded into the editor. The syntax is the same of the %macro command.
2074 loaded into the editor. The syntax is the same of the %macro command.
2067
2075
2068 - If the argument doesn't start with a number, it is evaluated as a
2076 - If the argument doesn't start with a number, it is evaluated as a
2069 variable and its contents loaded into the editor. You can thus edit
2077 variable and its contents loaded into the editor. You can thus edit
2070 any string which contains python code (including the result of
2078 any string which contains python code (including the result of
2071 previous edits).
2079 previous edits).
2072
2080
2073 - If the argument is the name of an object (other than a string),
2081 - If the argument is the name of an object (other than a string),
2074 IPython will try to locate the file where it was defined and open the
2082 IPython will try to locate the file where it was defined and open the
2075 editor at the point where it is defined. You can use `%edit function`
2083 editor at the point where it is defined. You can use `%edit function`
2076 to load an editor exactly at the point where 'function' is defined,
2084 to load an editor exactly at the point where 'function' is defined,
2077 edit it and have the file be executed automatically.
2085 edit it and have the file be executed automatically.
2078
2086
2079 If the object is a macro (see %macro for details), this opens up your
2087 If the object is a macro (see %macro for details), this opens up your
2080 specified editor with a temporary file containing the macro's data.
2088 specified editor with a temporary file containing the macro's data.
2081 Upon exit, the macro is reloaded with the contents of the file.
2089 Upon exit, the macro is reloaded with the contents of the file.
2082
2090
2083 Note: opening at an exact line is only supported under Unix, and some
2091 Note: opening at an exact line is only supported under Unix, and some
2084 editors (like kedit and gedit up to Gnome 2.8) do not understand the
2092 editors (like kedit and gedit up to Gnome 2.8) do not understand the
2085 '+NUMBER' parameter necessary for this feature. Good editors like
2093 '+NUMBER' parameter necessary for this feature. Good editors like
2086 (X)Emacs, vi, jed, pico and joe all do.
2094 (X)Emacs, vi, jed, pico and joe all do.
2087
2095
2088 - If the argument is not found as a variable, IPython will look for a
2096 - If the argument is not found as a variable, IPython will look for a
2089 file with that name (adding .py if necessary) and load it into the
2097 file with that name (adding .py if necessary) and load it into the
2090 editor. It will execute its contents with execfile() when you exit,
2098 editor. It will execute its contents with execfile() when you exit,
2091 loading any code in the file into your interactive namespace.
2099 loading any code in the file into your interactive namespace.
2092
2100
2093 After executing your code, %edit will return as output the code you
2101 After executing your code, %edit will return as output the code you
2094 typed in the editor (except when it was an existing file). This way
2102 typed in the editor (except when it was an existing file). This way
2095 you can reload the code in further invocations of %edit as a variable,
2103 you can reload the code in further invocations of %edit as a variable,
2096 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
2104 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
2097 the output.
2105 the output.
2098
2106
2099 Note that %edit is also available through the alias %ed.
2107 Note that %edit is also available through the alias %ed.
2100
2108
2101 This is an example of creating a simple function inside the editor and
2109 This is an example of creating a simple function inside the editor and
2102 then modifying it. First, start up the editor:
2110 then modifying it. First, start up the editor:
2103
2111
2104 In [1]: ed\\
2112 In [1]: ed\\
2105 Editing... done. Executing edited code...\\
2113 Editing... done. Executing edited code...\\
2106 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
2114 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
2107
2115
2108 We can then call the function foo():
2116 We can then call the function foo():
2109
2117
2110 In [2]: foo()\\
2118 In [2]: foo()\\
2111 foo() was defined in an editing session
2119 foo() was defined in an editing session
2112
2120
2113 Now we edit foo. IPython automatically loads the editor with the
2121 Now we edit foo. IPython automatically loads the editor with the
2114 (temporary) file where foo() was previously defined:
2122 (temporary) file where foo() was previously defined:
2115
2123
2116 In [3]: ed foo\\
2124 In [3]: ed foo\\
2117 Editing... done. Executing edited code...
2125 Editing... done. Executing edited code...
2118
2126
2119 And if we call foo() again we get the modified version:
2127 And if we call foo() again we get the modified version:
2120
2128
2121 In [4]: foo()\\
2129 In [4]: foo()\\
2122 foo() has now been changed!
2130 foo() has now been changed!
2123
2131
2124 Here is an example of how to edit a code snippet successive
2132 Here is an example of how to edit a code snippet successive
2125 times. First we call the editor:
2133 times. First we call the editor:
2126
2134
2127 In [8]: ed\\
2135 In [8]: ed\\
2128 Editing... done. Executing edited code...\\
2136 Editing... done. Executing edited code...\\
2129 hello\\
2137 hello\\
2130 Out[8]: "print 'hello'\\n"
2138 Out[8]: "print 'hello'\\n"
2131
2139
2132 Now we call it again with the previous output (stored in _):
2140 Now we call it again with the previous output (stored in _):
2133
2141
2134 In [9]: ed _\\
2142 In [9]: ed _\\
2135 Editing... done. Executing edited code...\\
2143 Editing... done. Executing edited code...\\
2136 hello world\\
2144 hello world\\
2137 Out[9]: "print 'hello world'\\n"
2145 Out[9]: "print 'hello world'\\n"
2138
2146
2139 Now we call it with the output #8 (stored in _8, also as Out[8]):
2147 Now we call it with the output #8 (stored in _8, also as Out[8]):
2140
2148
2141 In [10]: ed _8\\
2149 In [10]: ed _8\\
2142 Editing... done. Executing edited code...\\
2150 Editing... done. Executing edited code...\\
2143 hello again\\
2151 hello again\\
2144 Out[10]: "print 'hello again'\\n"
2152 Out[10]: "print 'hello again'\\n"
2145
2153
2146
2154
2147 Changing the default editor hook:
2155 Changing the default editor hook:
2148
2156
2149 If you wish to write your own editor hook, you can put it in a
2157 If you wish to write your own editor hook, you can put it in a
2150 configuration file which you load at startup time. The default hook
2158 configuration file which you load at startup time. The default hook
2151 is defined in the IPython.hooks module, and you can use that as a
2159 is defined in the IPython.hooks module, and you can use that as a
2152 starting example for further modifications. That file also has
2160 starting example for further modifications. That file also has
2153 general instructions on how to set a new hook for use once you've
2161 general instructions on how to set a new hook for use once you've
2154 defined it."""
2162 defined it."""
2155
2163
2156 # FIXME: This function has become a convoluted mess. It needs a
2164 # FIXME: This function has become a convoluted mess. It needs a
2157 # ground-up rewrite with clean, simple logic.
2165 # ground-up rewrite with clean, simple logic.
2158
2166
2159 def make_filename(arg):
2167 def make_filename(arg):
2160 "Make a filename from the given args"
2168 "Make a filename from the given args"
2161 try:
2169 try:
2162 filename = get_py_filename(arg)
2170 filename = get_py_filename(arg)
2163 except IOError:
2171 except IOError:
2164 if args.endswith('.py'):
2172 if args.endswith('.py'):
2165 filename = arg
2173 filename = arg
2166 else:
2174 else:
2167 filename = None
2175 filename = None
2168 return filename
2176 return filename
2169
2177
2170 # custom exceptions
2178 # custom exceptions
2171 class DataIsObject(Exception): pass
2179 class DataIsObject(Exception): pass
2172
2180
2173 opts,args = self.parse_options(parameter_s,'prxn:')
2181 opts,args = self.parse_options(parameter_s,'prxn:')
2174 # Set a few locals from the options for convenience:
2182 # Set a few locals from the options for convenience:
2175 opts_p = opts.has_key('p')
2183 opts_p = opts.has_key('p')
2176 opts_r = opts.has_key('r')
2184 opts_r = opts.has_key('r')
2177
2185
2178 # Default line number value
2186 # Default line number value
2179 lineno = opts.get('n',None)
2187 lineno = opts.get('n',None)
2180
2188
2181 if opts_p:
2189 if opts_p:
2182 args = '_%s' % last_call[0]
2190 args = '_%s' % last_call[0]
2183 if not self.shell.user_ns.has_key(args):
2191 if not self.shell.user_ns.has_key(args):
2184 args = last_call[1]
2192 args = last_call[1]
2185
2193
2186 # use last_call to remember the state of the previous call, but don't
2194 # use last_call to remember the state of the previous call, but don't
2187 # let it be clobbered by successive '-p' calls.
2195 # let it be clobbered by successive '-p' calls.
2188 try:
2196 try:
2189 last_call[0] = self.shell.outputcache.prompt_count
2197 last_call[0] = self.shell.outputcache.prompt_count
2190 if not opts_p:
2198 if not opts_p:
2191 last_call[1] = parameter_s
2199 last_call[1] = parameter_s
2192 except:
2200 except:
2193 pass
2201 pass
2194
2202
2195 # by default this is done with temp files, except when the given
2203 # by default this is done with temp files, except when the given
2196 # arg is a filename
2204 # arg is a filename
2197 use_temp = 1
2205 use_temp = 1
2198
2206
2199 if re.match(r'\d',args):
2207 if re.match(r'\d',args):
2200 # Mode where user specifies ranges of lines, like in %macro.
2208 # Mode where user specifies ranges of lines, like in %macro.
2201 # This means that you can't edit files whose names begin with
2209 # This means that you can't edit files whose names begin with
2202 # numbers this way. Tough.
2210 # numbers this way. Tough.
2203 ranges = args.split()
2211 ranges = args.split()
2204 data = ''.join(self.extract_input_slices(ranges,opts_r))
2212 data = ''.join(self.extract_input_slices(ranges,opts_r))
2205 elif args.endswith('.py'):
2213 elif args.endswith('.py'):
2206 filename = make_filename(args)
2214 filename = make_filename(args)
2207 data = ''
2215 data = ''
2208 use_temp = 0
2216 use_temp = 0
2209 elif args:
2217 elif args:
2210 try:
2218 try:
2211 # Load the parameter given as a variable. If not a string,
2219 # Load the parameter given as a variable. If not a string,
2212 # process it as an object instead (below)
2220 # process it as an object instead (below)
2213
2221
2214 #print '*** args',args,'type',type(args) # dbg
2222 #print '*** args',args,'type',type(args) # dbg
2215 data = eval(args,self.shell.user_ns)
2223 data = eval(args,self.shell.user_ns)
2216 if not type(data) in StringTypes:
2224 if not type(data) in StringTypes:
2217 raise DataIsObject
2225 raise DataIsObject
2218
2226
2219 except (NameError,SyntaxError):
2227 except (NameError,SyntaxError):
2220 # given argument is not a variable, try as a filename
2228 # given argument is not a variable, try as a filename
2221 filename = make_filename(args)
2229 filename = make_filename(args)
2222 if filename is None:
2230 if filename is None:
2223 warn("Argument given (%s) can't be found as a variable "
2231 warn("Argument given (%s) can't be found as a variable "
2224 "or as a filename." % args)
2232 "or as a filename." % args)
2225 return
2233 return
2226
2234
2227 data = ''
2235 data = ''
2228 use_temp = 0
2236 use_temp = 0
2229 except DataIsObject:
2237 except DataIsObject:
2230
2238
2231 # macros have a special edit function
2239 # macros have a special edit function
2232 if isinstance(data,Macro):
2240 if isinstance(data,Macro):
2233 self._edit_macro(args,data)
2241 self._edit_macro(args,data)
2234 return
2242 return
2235
2243
2236 # For objects, try to edit the file where they are defined
2244 # For objects, try to edit the file where they are defined
2237 try:
2245 try:
2238 filename = inspect.getabsfile(data)
2246 filename = inspect.getabsfile(data)
2239 datafile = 1
2247 datafile = 1
2240 except TypeError:
2248 except TypeError:
2241 filename = make_filename(args)
2249 filename = make_filename(args)
2242 datafile = 1
2250 datafile = 1
2243 warn('Could not find file where `%s` is defined.\n'
2251 warn('Could not find file where `%s` is defined.\n'
2244 'Opening a file named `%s`' % (args,filename))
2252 'Opening a file named `%s`' % (args,filename))
2245 # Now, make sure we can actually read the source (if it was in
2253 # Now, make sure we can actually read the source (if it was in
2246 # a temp file it's gone by now).
2254 # a temp file it's gone by now).
2247 if datafile:
2255 if datafile:
2248 try:
2256 try:
2249 if lineno is None:
2257 if lineno is None:
2250 lineno = inspect.getsourcelines(data)[1]
2258 lineno = inspect.getsourcelines(data)[1]
2251 except IOError:
2259 except IOError:
2252 filename = make_filename(args)
2260 filename = make_filename(args)
2253 if filename is None:
2261 if filename is None:
2254 warn('The file `%s` where `%s` was defined cannot '
2262 warn('The file `%s` where `%s` was defined cannot '
2255 'be read.' % (filename,data))
2263 'be read.' % (filename,data))
2256 return
2264 return
2257 use_temp = 0
2265 use_temp = 0
2258 else:
2266 else:
2259 data = ''
2267 data = ''
2260
2268
2261 if use_temp:
2269 if use_temp:
2262 filename = self.shell.mktempfile(data)
2270 filename = self.shell.mktempfile(data)
2263 print 'IPython will make a temporary file named:',filename
2271 print 'IPython will make a temporary file named:',filename
2264
2272
2265 # do actual editing here
2273 # do actual editing here
2266 print 'Editing...',
2274 print 'Editing...',
2267 sys.stdout.flush()
2275 sys.stdout.flush()
2268 self.shell.hooks.editor(filename,lineno)
2276 self.shell.hooks.editor(filename,lineno)
2269 if opts.has_key('x'): # -x prevents actual execution
2277 if opts.has_key('x'): # -x prevents actual execution
2270 print
2278 print
2271 else:
2279 else:
2272 print 'done. Executing edited code...'
2280 print 'done. Executing edited code...'
2273 if opts_r:
2281 if opts_r:
2274 self.shell.runlines(file_read(filename))
2282 self.shell.runlines(file_read(filename))
2275 else:
2283 else:
2276 self.shell.safe_execfile(filename,self.shell.user_ns,
2284 self.shell.safe_execfile(filename,self.shell.user_ns,
2277 self.shell.user_ns)
2285 self.shell.user_ns)
2278 if use_temp:
2286 if use_temp:
2279 try:
2287 try:
2280 return open(filename).read()
2288 return open(filename).read()
2281 except IOError,msg:
2289 except IOError,msg:
2282 if msg.filename == filename:
2290 if msg.filename == filename:
2283 warn('File not found. Did you forget to save?')
2291 warn('File not found. Did you forget to save?')
2284 return
2292 return
2285 else:
2293 else:
2286 self.shell.showtraceback()
2294 self.shell.showtraceback()
2287
2295
2288 def magic_xmode(self,parameter_s = ''):
2296 def magic_xmode(self,parameter_s = ''):
2289 """Switch modes for the exception handlers.
2297 """Switch modes for the exception handlers.
2290
2298
2291 Valid modes: Plain, Context and Verbose.
2299 Valid modes: Plain, Context and Verbose.
2292
2300
2293 If called without arguments, acts as a toggle."""
2301 If called without arguments, acts as a toggle."""
2294
2302
2295 def xmode_switch_err(name):
2303 def xmode_switch_err(name):
2296 warn('Error changing %s exception modes.\n%s' %
2304 warn('Error changing %s exception modes.\n%s' %
2297 (name,sys.exc_info()[1]))
2305 (name,sys.exc_info()[1]))
2298
2306
2299 shell = self.shell
2307 shell = self.shell
2300 new_mode = parameter_s.strip().capitalize()
2308 new_mode = parameter_s.strip().capitalize()
2301 try:
2309 try:
2302 shell.InteractiveTB.set_mode(mode=new_mode)
2310 shell.InteractiveTB.set_mode(mode=new_mode)
2303 print 'Exception reporting mode:',shell.InteractiveTB.mode
2311 print 'Exception reporting mode:',shell.InteractiveTB.mode
2304 except:
2312 except:
2305 xmode_switch_err('user')
2313 xmode_switch_err('user')
2306
2314
2307 # threaded shells use a special handler in sys.excepthook
2315 # threaded shells use a special handler in sys.excepthook
2308 if shell.isthreaded:
2316 if shell.isthreaded:
2309 try:
2317 try:
2310 shell.sys_excepthook.set_mode(mode=new_mode)
2318 shell.sys_excepthook.set_mode(mode=new_mode)
2311 except:
2319 except:
2312 xmode_switch_err('threaded')
2320 xmode_switch_err('threaded')
2313
2321
2314 def magic_colors(self,parameter_s = ''):
2322 def magic_colors(self,parameter_s = ''):
2315 """Switch color scheme for prompts, info system and exception handlers.
2323 """Switch color scheme for prompts, info system and exception handlers.
2316
2324
2317 Currently implemented schemes: NoColor, Linux, LightBG.
2325 Currently implemented schemes: NoColor, Linux, LightBG.
2318
2326
2319 Color scheme names are not case-sensitive."""
2327 Color scheme names are not case-sensitive."""
2320
2328
2321 def color_switch_err(name):
2329 def color_switch_err(name):
2322 warn('Error changing %s color schemes.\n%s' %
2330 warn('Error changing %s color schemes.\n%s' %
2323 (name,sys.exc_info()[1]))
2331 (name,sys.exc_info()[1]))
2324
2332
2325
2333
2326 new_scheme = parameter_s.strip()
2334 new_scheme = parameter_s.strip()
2327 if not new_scheme:
2335 if not new_scheme:
2328 raise UsageError(
2336 raise UsageError(
2329 "%colors: you must specify a color scheme. See '%colors?'")
2337 "%colors: you must specify a color scheme. See '%colors?'")
2330 return
2338 return
2331 # local shortcut
2339 # local shortcut
2332 shell = self.shell
2340 shell = self.shell
2333
2341
2334 import IPython.rlineimpl as readline
2342 import IPython.rlineimpl as readline
2335
2343
2336 if not readline.have_readline and sys.platform == "win32":
2344 if not readline.have_readline and sys.platform == "win32":
2337 msg = """\
2345 msg = """\
2338 Proper color support under MS Windows requires the pyreadline library.
2346 Proper color support under MS Windows requires the pyreadline library.
2339 You can find it at:
2347 You can find it at:
2340 http://ipython.scipy.org/moin/PyReadline/Intro
2348 http://ipython.scipy.org/moin/PyReadline/Intro
2341 Gary's readline needs the ctypes module, from:
2349 Gary's readline needs the ctypes module, from:
2342 http://starship.python.net/crew/theller/ctypes
2350 http://starship.python.net/crew/theller/ctypes
2343 (Note that ctypes is already part of Python versions 2.5 and newer).
2351 (Note that ctypes is already part of Python versions 2.5 and newer).
2344
2352
2345 Defaulting color scheme to 'NoColor'"""
2353 Defaulting color scheme to 'NoColor'"""
2346 new_scheme = 'NoColor'
2354 new_scheme = 'NoColor'
2347 warn(msg)
2355 warn(msg)
2348
2356
2349 # readline option is 0
2357 # readline option is 0
2350 if not shell.has_readline:
2358 if not shell.has_readline:
2351 new_scheme = 'NoColor'
2359 new_scheme = 'NoColor'
2352
2360
2353 # Set prompt colors
2361 # Set prompt colors
2354 try:
2362 try:
2355 shell.outputcache.set_colors(new_scheme)
2363 shell.outputcache.set_colors(new_scheme)
2356 except:
2364 except:
2357 color_switch_err('prompt')
2365 color_switch_err('prompt')
2358 else:
2366 else:
2359 shell.rc.colors = \
2367 shell.rc.colors = \
2360 shell.outputcache.color_table.active_scheme_name
2368 shell.outputcache.color_table.active_scheme_name
2361 # Set exception colors
2369 # Set exception colors
2362 try:
2370 try:
2363 shell.InteractiveTB.set_colors(scheme = new_scheme)
2371 shell.InteractiveTB.set_colors(scheme = new_scheme)
2364 shell.SyntaxTB.set_colors(scheme = new_scheme)
2372 shell.SyntaxTB.set_colors(scheme = new_scheme)
2365 except:
2373 except:
2366 color_switch_err('exception')
2374 color_switch_err('exception')
2367
2375
2368 # threaded shells use a verbose traceback in sys.excepthook
2376 # threaded shells use a verbose traceback in sys.excepthook
2369 if shell.isthreaded:
2377 if shell.isthreaded:
2370 try:
2378 try:
2371 shell.sys_excepthook.set_colors(scheme=new_scheme)
2379 shell.sys_excepthook.set_colors(scheme=new_scheme)
2372 except:
2380 except:
2373 color_switch_err('system exception handler')
2381 color_switch_err('system exception handler')
2374
2382
2375 # Set info (for 'object?') colors
2383 # Set info (for 'object?') colors
2376 if shell.rc.color_info:
2384 if shell.rc.color_info:
2377 try:
2385 try:
2378 shell.inspector.set_active_scheme(new_scheme)
2386 shell.inspector.set_active_scheme(new_scheme)
2379 except:
2387 except:
2380 color_switch_err('object inspector')
2388 color_switch_err('object inspector')
2381 else:
2389 else:
2382 shell.inspector.set_active_scheme('NoColor')
2390 shell.inspector.set_active_scheme('NoColor')
2383
2391
2384 def magic_color_info(self,parameter_s = ''):
2392 def magic_color_info(self,parameter_s = ''):
2385 """Toggle color_info.
2393 """Toggle color_info.
2386
2394
2387 The color_info configuration parameter controls whether colors are
2395 The color_info configuration parameter controls whether colors are
2388 used for displaying object details (by things like %psource, %pfile or
2396 used for displaying object details (by things like %psource, %pfile or
2389 the '?' system). This function toggles this value with each call.
2397 the '?' system). This function toggles this value with each call.
2390
2398
2391 Note that unless you have a fairly recent pager (less works better
2399 Note that unless you have a fairly recent pager (less works better
2392 than more) in your system, using colored object information displays
2400 than more) in your system, using colored object information displays
2393 will not work properly. Test it and see."""
2401 will not work properly. Test it and see."""
2394
2402
2395 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2403 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2396 self.magic_colors(self.shell.rc.colors)
2404 self.magic_colors(self.shell.rc.colors)
2397 print 'Object introspection functions have now coloring:',
2405 print 'Object introspection functions have now coloring:',
2398 print ['OFF','ON'][self.shell.rc.color_info]
2406 print ['OFF','ON'][self.shell.rc.color_info]
2399
2407
2400 def magic_Pprint(self, parameter_s=''):
2408 def magic_Pprint(self, parameter_s=''):
2401 """Toggle pretty printing on/off."""
2409 """Toggle pretty printing on/off."""
2402
2410
2403 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2411 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2404 print 'Pretty printing has been turned', \
2412 print 'Pretty printing has been turned', \
2405 ['OFF','ON'][self.shell.rc.pprint]
2413 ['OFF','ON'][self.shell.rc.pprint]
2406
2414
2407 def magic_exit(self, parameter_s=''):
2415 def magic_exit(self, parameter_s=''):
2408 """Exit IPython, confirming if configured to do so.
2416 """Exit IPython, confirming if configured to do so.
2409
2417
2410 You can configure whether IPython asks for confirmation upon exit by
2418 You can configure whether IPython asks for confirmation upon exit by
2411 setting the confirm_exit flag in the ipythonrc file."""
2419 setting the confirm_exit flag in the ipythonrc file."""
2412
2420
2413 self.shell.exit()
2421 self.shell.exit()
2414
2422
2415 def magic_quit(self, parameter_s=''):
2423 def magic_quit(self, parameter_s=''):
2416 """Exit IPython, confirming if configured to do so (like %exit)"""
2424 """Exit IPython, confirming if configured to do so (like %exit)"""
2417
2425
2418 self.shell.exit()
2426 self.shell.exit()
2419
2427
2420 def magic_Exit(self, parameter_s=''):
2428 def magic_Exit(self, parameter_s=''):
2421 """Exit IPython without confirmation."""
2429 """Exit IPython without confirmation."""
2422
2430
2423 self.shell.exit_now = True
2431 self.shell.exit_now = True
2424
2432
2425 #......................................................................
2433 #......................................................................
2426 # Functions to implement unix shell-type things
2434 # Functions to implement unix shell-type things
2427
2435
2428 def magic_alias(self, parameter_s = ''):
2436 def magic_alias(self, parameter_s = ''):
2429 """Define an alias for a system command.
2437 """Define an alias for a system command.
2430
2438
2431 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2439 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2432
2440
2433 Then, typing 'alias_name params' will execute the system command 'cmd
2441 Then, typing 'alias_name params' will execute the system command 'cmd
2434 params' (from your underlying operating system).
2442 params' (from your underlying operating system).
2435
2443
2436 Aliases have lower precedence than magic functions and Python normal
2444 Aliases have lower precedence than magic functions and Python normal
2437 variables, so if 'foo' is both a Python variable and an alias, the
2445 variables, so if 'foo' is both a Python variable and an alias, the
2438 alias can not be executed until 'del foo' removes the Python variable.
2446 alias can not be executed until 'del foo' removes the Python variable.
2439
2447
2440 You can use the %l specifier in an alias definition to represent the
2448 You can use the %l specifier in an alias definition to represent the
2441 whole line when the alias is called. For example:
2449 whole line when the alias is called. For example:
2442
2450
2443 In [2]: alias all echo "Input in brackets: <%l>"\\
2451 In [2]: alias all echo "Input in brackets: <%l>"\\
2444 In [3]: all hello world\\
2452 In [3]: all hello world\\
2445 Input in brackets: <hello world>
2453 Input in brackets: <hello world>
2446
2454
2447 You can also define aliases with parameters using %s specifiers (one
2455 You can also define aliases with parameters using %s specifiers (one
2448 per parameter):
2456 per parameter):
2449
2457
2450 In [1]: alias parts echo first %s second %s\\
2458 In [1]: alias parts echo first %s second %s\\
2451 In [2]: %parts A B\\
2459 In [2]: %parts A B\\
2452 first A second B\\
2460 first A second B\\
2453 In [3]: %parts A\\
2461 In [3]: %parts A\\
2454 Incorrect number of arguments: 2 expected.\\
2462 Incorrect number of arguments: 2 expected.\\
2455 parts is an alias to: 'echo first %s second %s'
2463 parts is an alias to: 'echo first %s second %s'
2456
2464
2457 Note that %l and %s are mutually exclusive. You can only use one or
2465 Note that %l and %s are mutually exclusive. You can only use one or
2458 the other in your aliases.
2466 the other in your aliases.
2459
2467
2460 Aliases expand Python variables just like system calls using ! or !!
2468 Aliases expand Python variables just like system calls using ! or !!
2461 do: all expressions prefixed with '$' get expanded. For details of
2469 do: all expressions prefixed with '$' get expanded. For details of
2462 the semantic rules, see PEP-215:
2470 the semantic rules, see PEP-215:
2463 http://www.python.org/peps/pep-0215.html. This is the library used by
2471 http://www.python.org/peps/pep-0215.html. This is the library used by
2464 IPython for variable expansion. If you want to access a true shell
2472 IPython for variable expansion. If you want to access a true shell
2465 variable, an extra $ is necessary to prevent its expansion by IPython:
2473 variable, an extra $ is necessary to prevent its expansion by IPython:
2466
2474
2467 In [6]: alias show echo\\
2475 In [6]: alias show echo\\
2468 In [7]: PATH='A Python string'\\
2476 In [7]: PATH='A Python string'\\
2469 In [8]: show $PATH\\
2477 In [8]: show $PATH\\
2470 A Python string\\
2478 A Python string\\
2471 In [9]: show $$PATH\\
2479 In [9]: show $$PATH\\
2472 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2480 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2473
2481
2474 You can use the alias facility to acess all of $PATH. See the %rehash
2482 You can use the alias facility to acess all of $PATH. See the %rehash
2475 and %rehashx functions, which automatically create aliases for the
2483 and %rehashx functions, which automatically create aliases for the
2476 contents of your $PATH.
2484 contents of your $PATH.
2477
2485
2478 If called with no parameters, %alias prints the current alias table."""
2486 If called with no parameters, %alias prints the current alias table."""
2479
2487
2480 par = parameter_s.strip()
2488 par = parameter_s.strip()
2481 if not par:
2489 if not par:
2482 stored = self.db.get('stored_aliases', {} )
2490 stored = self.db.get('stored_aliases', {} )
2483 atab = self.shell.alias_table
2491 atab = self.shell.alias_table
2484 aliases = atab.keys()
2492 aliases = atab.keys()
2485 aliases.sort()
2493 aliases.sort()
2486 res = []
2494 res = []
2487 showlast = []
2495 showlast = []
2488 for alias in aliases:
2496 for alias in aliases:
2489 special = False
2497 special = False
2490 try:
2498 try:
2491 tgt = atab[alias][1]
2499 tgt = atab[alias][1]
2492 except (TypeError, AttributeError):
2500 except (TypeError, AttributeError):
2493 # unsubscriptable? probably a callable
2501 # unsubscriptable? probably a callable
2494 tgt = atab[alias]
2502 tgt = atab[alias]
2495 special = True
2503 special = True
2496 # 'interesting' aliases
2504 # 'interesting' aliases
2497 if (alias in stored or
2505 if (alias in stored or
2498 special or
2506 special or
2499 alias.lower() != os.path.splitext(tgt)[0].lower() or
2507 alias.lower() != os.path.splitext(tgt)[0].lower() or
2500 ' ' in tgt):
2508 ' ' in tgt):
2501 showlast.append((alias, tgt))
2509 showlast.append((alias, tgt))
2502 else:
2510 else:
2503 res.append((alias, tgt ))
2511 res.append((alias, tgt ))
2504
2512
2505 # show most interesting aliases last
2513 # show most interesting aliases last
2506 res.extend(showlast)
2514 res.extend(showlast)
2507 print "Total number of aliases:",len(aliases)
2515 print "Total number of aliases:",len(aliases)
2508 return res
2516 return res
2509 try:
2517 try:
2510 alias,cmd = par.split(None,1)
2518 alias,cmd = par.split(None,1)
2511 except:
2519 except:
2512 print OInspect.getdoc(self.magic_alias)
2520 print OInspect.getdoc(self.magic_alias)
2513 else:
2521 else:
2514 nargs = cmd.count('%s')
2522 nargs = cmd.count('%s')
2515 if nargs>0 and cmd.find('%l')>=0:
2523 if nargs>0 and cmd.find('%l')>=0:
2516 error('The %s and %l specifiers are mutually exclusive '
2524 error('The %s and %l specifiers are mutually exclusive '
2517 'in alias definitions.')
2525 'in alias definitions.')
2518 else: # all looks OK
2526 else: # all looks OK
2519 self.shell.alias_table[alias] = (nargs,cmd)
2527 self.shell.alias_table[alias] = (nargs,cmd)
2520 self.shell.alias_table_validate(verbose=0)
2528 self.shell.alias_table_validate(verbose=0)
2521 # end magic_alias
2529 # end magic_alias
2522
2530
2523 def magic_unalias(self, parameter_s = ''):
2531 def magic_unalias(self, parameter_s = ''):
2524 """Remove an alias"""
2532 """Remove an alias"""
2525
2533
2526 aname = parameter_s.strip()
2534 aname = parameter_s.strip()
2527 if aname in self.shell.alias_table:
2535 if aname in self.shell.alias_table:
2528 del self.shell.alias_table[aname]
2536 del self.shell.alias_table[aname]
2529 stored = self.db.get('stored_aliases', {} )
2537 stored = self.db.get('stored_aliases', {} )
2530 if aname in stored:
2538 if aname in stored:
2531 print "Removing %stored alias",aname
2539 print "Removing %stored alias",aname
2532 del stored[aname]
2540 del stored[aname]
2533 self.db['stored_aliases'] = stored
2541 self.db['stored_aliases'] = stored
2534
2542
2535
2543
2536 def magic_rehashx(self, parameter_s = ''):
2544 def magic_rehashx(self, parameter_s = ''):
2537 """Update the alias table with all executable files in $PATH.
2545 """Update the alias table with all executable files in $PATH.
2538
2546
2539 This version explicitly checks that every entry in $PATH is a file
2547 This version explicitly checks that every entry in $PATH is a file
2540 with execute access (os.X_OK), so it is much slower than %rehash.
2548 with execute access (os.X_OK), so it is much slower than %rehash.
2541
2549
2542 Under Windows, it checks executability as a match agains a
2550 Under Windows, it checks executability as a match agains a
2543 '|'-separated string of extensions, stored in the IPython config
2551 '|'-separated string of extensions, stored in the IPython config
2544 variable win_exec_ext. This defaults to 'exe|com|bat'.
2552 variable win_exec_ext. This defaults to 'exe|com|bat'.
2545
2553
2546 This function also resets the root module cache of module completer,
2554 This function also resets the root module cache of module completer,
2547 used on slow filesystems.
2555 used on slow filesystems.
2548 """
2556 """
2549
2557
2550
2558
2551 ip = self.api
2559 ip = self.api
2552
2560
2553 # for the benefit of module completer in ipy_completers.py
2561 # for the benefit of module completer in ipy_completers.py
2554 del ip.db['rootmodules']
2562 del ip.db['rootmodules']
2555
2563
2556 path = [os.path.abspath(os.path.expanduser(p)) for p in
2564 path = [os.path.abspath(os.path.expanduser(p)) for p in
2557 os.environ.get('PATH','').split(os.pathsep)]
2565 os.environ.get('PATH','').split(os.pathsep)]
2558 path = filter(os.path.isdir,path)
2566 path = filter(os.path.isdir,path)
2559
2567
2560 alias_table = self.shell.alias_table
2568 alias_table = self.shell.alias_table
2561 syscmdlist = []
2569 syscmdlist = []
2562 if os.name == 'posix':
2570 if os.name == 'posix':
2563 isexec = lambda fname:os.path.isfile(fname) and \
2571 isexec = lambda fname:os.path.isfile(fname) and \
2564 os.access(fname,os.X_OK)
2572 os.access(fname,os.X_OK)
2565 else:
2573 else:
2566
2574
2567 try:
2575 try:
2568 winext = os.environ['pathext'].replace(';','|').replace('.','')
2576 winext = os.environ['pathext'].replace(';','|').replace('.','')
2569 except KeyError:
2577 except KeyError:
2570 winext = 'exe|com|bat|py'
2578 winext = 'exe|com|bat|py'
2571 if 'py' not in winext:
2579 if 'py' not in winext:
2572 winext += '|py'
2580 winext += '|py'
2573 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2581 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2574 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2582 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2575 savedir = os.getcwd()
2583 savedir = os.getcwd()
2576 try:
2584 try:
2577 # write the whole loop for posix/Windows so we don't have an if in
2585 # write the whole loop for posix/Windows so we don't have an if in
2578 # the innermost part
2586 # the innermost part
2579 if os.name == 'posix':
2587 if os.name == 'posix':
2580 for pdir in path:
2588 for pdir in path:
2581 os.chdir(pdir)
2589 os.chdir(pdir)
2582 for ff in os.listdir(pdir):
2590 for ff in os.listdir(pdir):
2583 if isexec(ff) and ff not in self.shell.no_alias:
2591 if isexec(ff) and ff not in self.shell.no_alias:
2584 # each entry in the alias table must be (N,name),
2592 # each entry in the alias table must be (N,name),
2585 # where N is the number of positional arguments of the
2593 # where N is the number of positional arguments of the
2586 # alias.
2594 # alias.
2587 alias_table[ff] = (0,ff)
2595 alias_table[ff] = (0,ff)
2588 syscmdlist.append(ff)
2596 syscmdlist.append(ff)
2589 else:
2597 else:
2590 for pdir in path:
2598 for pdir in path:
2591 os.chdir(pdir)
2599 os.chdir(pdir)
2592 for ff in os.listdir(pdir):
2600 for ff in os.listdir(pdir):
2593 base, ext = os.path.splitext(ff)
2601 base, ext = os.path.splitext(ff)
2594 if isexec(ff) and base not in self.shell.no_alias:
2602 if isexec(ff) and base not in self.shell.no_alias:
2595 if ext.lower() == '.exe':
2603 if ext.lower() == '.exe':
2596 ff = base
2604 ff = base
2597 alias_table[base.lower()] = (0,ff)
2605 alias_table[base.lower()] = (0,ff)
2598 syscmdlist.append(ff)
2606 syscmdlist.append(ff)
2599 # Make sure the alias table doesn't contain keywords or builtins
2607 # Make sure the alias table doesn't contain keywords or builtins
2600 self.shell.alias_table_validate()
2608 self.shell.alias_table_validate()
2601 # Call again init_auto_alias() so we get 'rm -i' and other
2609 # Call again init_auto_alias() so we get 'rm -i' and other
2602 # modified aliases since %rehashx will probably clobber them
2610 # modified aliases since %rehashx will probably clobber them
2603
2611
2604 # no, we don't want them. if %rehashx clobbers them, good,
2612 # no, we don't want them. if %rehashx clobbers them, good,
2605 # we'll probably get better versions
2613 # we'll probably get better versions
2606 # self.shell.init_auto_alias()
2614 # self.shell.init_auto_alias()
2607 db = ip.db
2615 db = ip.db
2608 db['syscmdlist'] = syscmdlist
2616 db['syscmdlist'] = syscmdlist
2609 finally:
2617 finally:
2610 os.chdir(savedir)
2618 os.chdir(savedir)
2611
2619
2612 def magic_pwd(self, parameter_s = ''):
2620 def magic_pwd(self, parameter_s = ''):
2613 """Return the current working directory path."""
2621 """Return the current working directory path."""
2614 return os.getcwd()
2622 return os.getcwd()
2615
2623
2616 def magic_cd(self, parameter_s=''):
2624 def magic_cd(self, parameter_s=''):
2617 """Change the current working directory.
2625 """Change the current working directory.
2618
2626
2619 This command automatically maintains an internal list of directories
2627 This command automatically maintains an internal list of directories
2620 you visit during your IPython session, in the variable _dh. The
2628 you visit during your IPython session, in the variable _dh. The
2621 command %dhist shows this history nicely formatted. You can also
2629 command %dhist shows this history nicely formatted. You can also
2622 do 'cd -<tab>' to see directory history conveniently.
2630 do 'cd -<tab>' to see directory history conveniently.
2623
2631
2624 Usage:
2632 Usage:
2625
2633
2626 cd 'dir': changes to directory 'dir'.
2634 cd 'dir': changes to directory 'dir'.
2627
2635
2628 cd -: changes to the last visited directory.
2636 cd -: changes to the last visited directory.
2629
2637
2630 cd -<n>: changes to the n-th directory in the directory history.
2638 cd -<n>: changes to the n-th directory in the directory history.
2631
2639
2632 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2640 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2633 (note: cd <bookmark_name> is enough if there is no
2641 (note: cd <bookmark_name> is enough if there is no
2634 directory <bookmark_name>, but a bookmark with the name exists.)
2642 directory <bookmark_name>, but a bookmark with the name exists.)
2635 'cd -b <tab>' allows you to tab-complete bookmark names.
2643 'cd -b <tab>' allows you to tab-complete bookmark names.
2636
2644
2637 Options:
2645 Options:
2638
2646
2639 -q: quiet. Do not print the working directory after the cd command is
2647 -q: quiet. Do not print the working directory after the cd command is
2640 executed. By default IPython's cd command does print this directory,
2648 executed. By default IPython's cd command does print this directory,
2641 since the default prompts do not display path information.
2649 since the default prompts do not display path information.
2642
2650
2643 Note that !cd doesn't work for this purpose because the shell where
2651 Note that !cd doesn't work for this purpose because the shell where
2644 !command runs is immediately discarded after executing 'command'."""
2652 !command runs is immediately discarded after executing 'command'."""
2645
2653
2646 parameter_s = parameter_s.strip()
2654 parameter_s = parameter_s.strip()
2647 #bkms = self.shell.persist.get("bookmarks",{})
2655 #bkms = self.shell.persist.get("bookmarks",{})
2648
2656
2649 numcd = re.match(r'(-)(\d+)$',parameter_s)
2657 numcd = re.match(r'(-)(\d+)$',parameter_s)
2650 # jump in directory history by number
2658 # jump in directory history by number
2651 if numcd:
2659 if numcd:
2652 nn = int(numcd.group(2))
2660 nn = int(numcd.group(2))
2653 try:
2661 try:
2654 ps = self.shell.user_ns['_dh'][nn]
2662 ps = self.shell.user_ns['_dh'][nn]
2655 except IndexError:
2663 except IndexError:
2656 print 'The requested directory does not exist in history.'
2664 print 'The requested directory does not exist in history.'
2657 return
2665 return
2658 else:
2666 else:
2659 opts = {}
2667 opts = {}
2660 else:
2668 else:
2661 #turn all non-space-escaping backslashes to slashes,
2669 #turn all non-space-escaping backslashes to slashes,
2662 # for c:\windows\directory\names\
2670 # for c:\windows\directory\names\
2663 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2671 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2664 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2672 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2665 # jump to previous
2673 # jump to previous
2666 if ps == '-':
2674 if ps == '-':
2667 try:
2675 try:
2668 ps = self.shell.user_ns['_dh'][-2]
2676 ps = self.shell.user_ns['_dh'][-2]
2669 except IndexError:
2677 except IndexError:
2670 raise UsageError('%cd -: No previous directory to change to.')
2678 raise UsageError('%cd -: No previous directory to change to.')
2671 # jump to bookmark if needed
2679 # jump to bookmark if needed
2672 else:
2680 else:
2673 if not os.path.isdir(ps) or opts.has_key('b'):
2681 if not os.path.isdir(ps) or opts.has_key('b'):
2674 bkms = self.db.get('bookmarks', {})
2682 bkms = self.db.get('bookmarks', {})
2675
2683
2676 if bkms.has_key(ps):
2684 if bkms.has_key(ps):
2677 target = bkms[ps]
2685 target = bkms[ps]
2678 print '(bookmark:%s) -> %s' % (ps,target)
2686 print '(bookmark:%s) -> %s' % (ps,target)
2679 ps = target
2687 ps = target
2680 else:
2688 else:
2681 if opts.has_key('b'):
2689 if opts.has_key('b'):
2682 raise UsageError("Bookmark '%s' not found. "
2690 raise UsageError("Bookmark '%s' not found. "
2683 "Use '%%bookmark -l' to see your bookmarks." % ps)
2691 "Use '%%bookmark -l' to see your bookmarks." % ps)
2684
2692
2685 # at this point ps should point to the target dir
2693 # at this point ps should point to the target dir
2686 if ps:
2694 if ps:
2687 try:
2695 try:
2688 os.chdir(os.path.expanduser(ps))
2696 os.chdir(os.path.expanduser(ps))
2689 if self.shell.rc.term_title:
2697 if self.shell.rc.term_title:
2690 #print 'set term title:',self.shell.rc.term_title # dbg
2698 #print 'set term title:',self.shell.rc.term_title # dbg
2691 ttitle = 'IPy ' + abbrev_cwd()
2699 ttitle = 'IPy ' + abbrev_cwd()
2692 platutils.set_term_title(ttitle)
2700 platutils.set_term_title(ttitle)
2693 except OSError:
2701 except OSError:
2694 print sys.exc_info()[1]
2702 print sys.exc_info()[1]
2695 else:
2703 else:
2696 cwd = os.getcwd()
2704 cwd = os.getcwd()
2697 dhist = self.shell.user_ns['_dh']
2705 dhist = self.shell.user_ns['_dh']
2698 dhist.append(cwd)
2706 dhist.append(cwd)
2699 self.db['dhist'] = compress_dhist(dhist)[-100:]
2707 self.db['dhist'] = compress_dhist(dhist)[-100:]
2700
2708
2701 else:
2709 else:
2702 os.chdir(self.shell.home_dir)
2710 os.chdir(self.shell.home_dir)
2703 if self.shell.rc.term_title:
2711 if self.shell.rc.term_title:
2704 platutils.set_term_title("IPy ~")
2712 platutils.set_term_title("IPy ~")
2705 cwd = os.getcwd()
2713 cwd = os.getcwd()
2706 dhist = self.shell.user_ns['_dh']
2714 dhist = self.shell.user_ns['_dh']
2707 dhist.append(cwd)
2715 dhist.append(cwd)
2708 self.db['dhist'] = compress_dhist(dhist)[-100:]
2716 self.db['dhist'] = compress_dhist(dhist)[-100:]
2709 if not 'q' in opts and self.shell.user_ns['_dh']:
2717 if not 'q' in opts and self.shell.user_ns['_dh']:
2710 print self.shell.user_ns['_dh'][-1]
2718 print self.shell.user_ns['_dh'][-1]
2711
2719
2712
2720
2713 def magic_env(self, parameter_s=''):
2721 def magic_env(self, parameter_s=''):
2714 """List environment variables."""
2722 """List environment variables."""
2715
2723
2716 return os.environ.data
2724 return os.environ.data
2717
2725
2718 def magic_pushd(self, parameter_s=''):
2726 def magic_pushd(self, parameter_s=''):
2719 """Place the current dir on stack and change directory.
2727 """Place the current dir on stack and change directory.
2720
2728
2721 Usage:\\
2729 Usage:\\
2722 %pushd ['dirname']
2730 %pushd ['dirname']
2723 """
2731 """
2724
2732
2725 dir_s = self.shell.dir_stack
2733 dir_s = self.shell.dir_stack
2726 tgt = os.path.expanduser(parameter_s)
2734 tgt = os.path.expanduser(parameter_s)
2727 cwd = os.getcwd().replace(self.home_dir,'~')
2735 cwd = os.getcwd().replace(self.home_dir,'~')
2728 if tgt:
2736 if tgt:
2729 self.magic_cd(parameter_s)
2737 self.magic_cd(parameter_s)
2730 dir_s.insert(0,cwd)
2738 dir_s.insert(0,cwd)
2731 return self.magic_dirs()
2739 return self.magic_dirs()
2732
2740
2733 def magic_popd(self, parameter_s=''):
2741 def magic_popd(self, parameter_s=''):
2734 """Change to directory popped off the top of the stack.
2742 """Change to directory popped off the top of the stack.
2735 """
2743 """
2736 if not self.shell.dir_stack:
2744 if not self.shell.dir_stack:
2737 raise UsageError("%popd on empty stack")
2745 raise UsageError("%popd on empty stack")
2738 top = self.shell.dir_stack.pop(0)
2746 top = self.shell.dir_stack.pop(0)
2739 self.magic_cd(top)
2747 self.magic_cd(top)
2740 print "popd ->",top
2748 print "popd ->",top
2741
2749
2742 def magic_dirs(self, parameter_s=''):
2750 def magic_dirs(self, parameter_s=''):
2743 """Return the current directory stack."""
2751 """Return the current directory stack."""
2744
2752
2745 return self.shell.dir_stack
2753 return self.shell.dir_stack
2746
2754
2747 def magic_dhist(self, parameter_s=''):
2755 def magic_dhist(self, parameter_s=''):
2748 """Print your history of visited directories.
2756 """Print your history of visited directories.
2749
2757
2750 %dhist -> print full history\\
2758 %dhist -> print full history\\
2751 %dhist n -> print last n entries only\\
2759 %dhist n -> print last n entries only\\
2752 %dhist n1 n2 -> print entries between n1 and n2 (n1 not included)\\
2760 %dhist n1 n2 -> print entries between n1 and n2 (n1 not included)\\
2753
2761
2754 This history is automatically maintained by the %cd command, and
2762 This history is automatically maintained by the %cd command, and
2755 always available as the global list variable _dh. You can use %cd -<n>
2763 always available as the global list variable _dh. You can use %cd -<n>
2756 to go to directory number <n>.
2764 to go to directory number <n>.
2757
2765
2758 Note that most of time, you should view directory history by entering
2766 Note that most of time, you should view directory history by entering
2759 cd -<TAB>.
2767 cd -<TAB>.
2760
2768
2761 """
2769 """
2762
2770
2763 dh = self.shell.user_ns['_dh']
2771 dh = self.shell.user_ns['_dh']
2764 if parameter_s:
2772 if parameter_s:
2765 try:
2773 try:
2766 args = map(int,parameter_s.split())
2774 args = map(int,parameter_s.split())
2767 except:
2775 except:
2768 self.arg_err(Magic.magic_dhist)
2776 self.arg_err(Magic.magic_dhist)
2769 return
2777 return
2770 if len(args) == 1:
2778 if len(args) == 1:
2771 ini,fin = max(len(dh)-(args[0]),0),len(dh)
2779 ini,fin = max(len(dh)-(args[0]),0),len(dh)
2772 elif len(args) == 2:
2780 elif len(args) == 2:
2773 ini,fin = args
2781 ini,fin = args
2774 else:
2782 else:
2775 self.arg_err(Magic.magic_dhist)
2783 self.arg_err(Magic.magic_dhist)
2776 return
2784 return
2777 else:
2785 else:
2778 ini,fin = 0,len(dh)
2786 ini,fin = 0,len(dh)
2779 nlprint(dh,
2787 nlprint(dh,
2780 header = 'Directory history (kept in _dh)',
2788 header = 'Directory history (kept in _dh)',
2781 start=ini,stop=fin)
2789 start=ini,stop=fin)
2782
2790
2783
2791
2784 def magic_sc(self, parameter_s=''):
2792 def magic_sc(self, parameter_s=''):
2785 """Shell capture - execute a shell command and capture its output.
2793 """Shell capture - execute a shell command and capture its output.
2786
2794
2787 DEPRECATED. Suboptimal, retained for backwards compatibility.
2795 DEPRECATED. Suboptimal, retained for backwards compatibility.
2788
2796
2789 You should use the form 'var = !command' instead. Example:
2797 You should use the form 'var = !command' instead. Example:
2790
2798
2791 "%sc -l myfiles = ls ~" should now be written as
2799 "%sc -l myfiles = ls ~" should now be written as
2792
2800
2793 "myfiles = !ls ~"
2801 "myfiles = !ls ~"
2794
2802
2795 myfiles.s, myfiles.l and myfiles.n still apply as documented
2803 myfiles.s, myfiles.l and myfiles.n still apply as documented
2796 below.
2804 below.
2797
2805
2798 --
2806 --
2799 %sc [options] varname=command
2807 %sc [options] varname=command
2800
2808
2801 IPython will run the given command using commands.getoutput(), and
2809 IPython will run the given command using commands.getoutput(), and
2802 will then update the user's interactive namespace with a variable
2810 will then update the user's interactive namespace with a variable
2803 called varname, containing the value of the call. Your command can
2811 called varname, containing the value of the call. Your command can
2804 contain shell wildcards, pipes, etc.
2812 contain shell wildcards, pipes, etc.
2805
2813
2806 The '=' sign in the syntax is mandatory, and the variable name you
2814 The '=' sign in the syntax is mandatory, and the variable name you
2807 supply must follow Python's standard conventions for valid names.
2815 supply must follow Python's standard conventions for valid names.
2808
2816
2809 (A special format without variable name exists for internal use)
2817 (A special format without variable name exists for internal use)
2810
2818
2811 Options:
2819 Options:
2812
2820
2813 -l: list output. Split the output on newlines into a list before
2821 -l: list output. Split the output on newlines into a list before
2814 assigning it to the given variable. By default the output is stored
2822 assigning it to the given variable. By default the output is stored
2815 as a single string.
2823 as a single string.
2816
2824
2817 -v: verbose. Print the contents of the variable.
2825 -v: verbose. Print the contents of the variable.
2818
2826
2819 In most cases you should not need to split as a list, because the
2827 In most cases you should not need to split as a list, because the
2820 returned value is a special type of string which can automatically
2828 returned value is a special type of string which can automatically
2821 provide its contents either as a list (split on newlines) or as a
2829 provide its contents either as a list (split on newlines) or as a
2822 space-separated string. These are convenient, respectively, either
2830 space-separated string. These are convenient, respectively, either
2823 for sequential processing or to be passed to a shell command.
2831 for sequential processing or to be passed to a shell command.
2824
2832
2825 For example:
2833 For example:
2826
2834
2827 # Capture into variable a
2835 # Capture into variable a
2828 In [9]: sc a=ls *py
2836 In [9]: sc a=ls *py
2829
2837
2830 # a is a string with embedded newlines
2838 # a is a string with embedded newlines
2831 In [10]: a
2839 In [10]: a
2832 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2840 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2833
2841
2834 # which can be seen as a list:
2842 # which can be seen as a list:
2835 In [11]: a.l
2843 In [11]: a.l
2836 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2844 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2837
2845
2838 # or as a whitespace-separated string:
2846 # or as a whitespace-separated string:
2839 In [12]: a.s
2847 In [12]: a.s
2840 Out[12]: 'setup.py win32_manual_post_install.py'
2848 Out[12]: 'setup.py win32_manual_post_install.py'
2841
2849
2842 # a.s is useful to pass as a single command line:
2850 # a.s is useful to pass as a single command line:
2843 In [13]: !wc -l $a.s
2851 In [13]: !wc -l $a.s
2844 146 setup.py
2852 146 setup.py
2845 130 win32_manual_post_install.py
2853 130 win32_manual_post_install.py
2846 276 total
2854 276 total
2847
2855
2848 # while the list form is useful to loop over:
2856 # while the list form is useful to loop over:
2849 In [14]: for f in a.l:
2857 In [14]: for f in a.l:
2850 ....: !wc -l $f
2858 ....: !wc -l $f
2851 ....:
2859 ....:
2852 146 setup.py
2860 146 setup.py
2853 130 win32_manual_post_install.py
2861 130 win32_manual_post_install.py
2854
2862
2855 Similiarly, the lists returned by the -l option are also special, in
2863 Similiarly, the lists returned by the -l option are also special, in
2856 the sense that you can equally invoke the .s attribute on them to
2864 the sense that you can equally invoke the .s attribute on them to
2857 automatically get a whitespace-separated string from their contents:
2865 automatically get a whitespace-separated string from their contents:
2858
2866
2859 In [1]: sc -l b=ls *py
2867 In [1]: sc -l b=ls *py
2860
2868
2861 In [2]: b
2869 In [2]: b
2862 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2870 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2863
2871
2864 In [3]: b.s
2872 In [3]: b.s
2865 Out[3]: 'setup.py win32_manual_post_install.py'
2873 Out[3]: 'setup.py win32_manual_post_install.py'
2866
2874
2867 In summary, both the lists and strings used for ouptut capture have
2875 In summary, both the lists and strings used for ouptut capture have
2868 the following special attributes:
2876 the following special attributes:
2869
2877
2870 .l (or .list) : value as list.
2878 .l (or .list) : value as list.
2871 .n (or .nlstr): value as newline-separated string.
2879 .n (or .nlstr): value as newline-separated string.
2872 .s (or .spstr): value as space-separated string.
2880 .s (or .spstr): value as space-separated string.
2873 """
2881 """
2874
2882
2875 opts,args = self.parse_options(parameter_s,'lv')
2883 opts,args = self.parse_options(parameter_s,'lv')
2876 # Try to get a variable name and command to run
2884 # Try to get a variable name and command to run
2877 try:
2885 try:
2878 # the variable name must be obtained from the parse_options
2886 # the variable name must be obtained from the parse_options
2879 # output, which uses shlex.split to strip options out.
2887 # output, which uses shlex.split to strip options out.
2880 var,_ = args.split('=',1)
2888 var,_ = args.split('=',1)
2881 var = var.strip()
2889 var = var.strip()
2882 # But the the command has to be extracted from the original input
2890 # But the the command has to be extracted from the original input
2883 # parameter_s, not on what parse_options returns, to avoid the
2891 # parameter_s, not on what parse_options returns, to avoid the
2884 # quote stripping which shlex.split performs on it.
2892 # quote stripping which shlex.split performs on it.
2885 _,cmd = parameter_s.split('=',1)
2893 _,cmd = parameter_s.split('=',1)
2886 except ValueError:
2894 except ValueError:
2887 var,cmd = '',''
2895 var,cmd = '',''
2888 # If all looks ok, proceed
2896 # If all looks ok, proceed
2889 out,err = self.shell.getoutputerror(cmd)
2897 out,err = self.shell.getoutputerror(cmd)
2890 if err:
2898 if err:
2891 print >> Term.cerr,err
2899 print >> Term.cerr,err
2892 if opts.has_key('l'):
2900 if opts.has_key('l'):
2893 out = SList(out.split('\n'))
2901 out = SList(out.split('\n'))
2894 else:
2902 else:
2895 out = LSString(out)
2903 out = LSString(out)
2896 if opts.has_key('v'):
2904 if opts.has_key('v'):
2897 print '%s ==\n%s' % (var,pformat(out))
2905 print '%s ==\n%s' % (var,pformat(out))
2898 if var:
2906 if var:
2899 self.shell.user_ns.update({var:out})
2907 self.shell.user_ns.update({var:out})
2900 else:
2908 else:
2901 return out
2909 return out
2902
2910
2903 def magic_sx(self, parameter_s=''):
2911 def magic_sx(self, parameter_s=''):
2904 """Shell execute - run a shell command and capture its output.
2912 """Shell execute - run a shell command and capture its output.
2905
2913
2906 %sx command
2914 %sx command
2907
2915
2908 IPython will run the given command using commands.getoutput(), and
2916 IPython will run the given command using commands.getoutput(), and
2909 return the result formatted as a list (split on '\\n'). Since the
2917 return the result formatted as a list (split on '\\n'). Since the
2910 output is _returned_, it will be stored in ipython's regular output
2918 output is _returned_, it will be stored in ipython's regular output
2911 cache Out[N] and in the '_N' automatic variables.
2919 cache Out[N] and in the '_N' automatic variables.
2912
2920
2913 Notes:
2921 Notes:
2914
2922
2915 1) If an input line begins with '!!', then %sx is automatically
2923 1) If an input line begins with '!!', then %sx is automatically
2916 invoked. That is, while:
2924 invoked. That is, while:
2917 !ls
2925 !ls
2918 causes ipython to simply issue system('ls'), typing
2926 causes ipython to simply issue system('ls'), typing
2919 !!ls
2927 !!ls
2920 is a shorthand equivalent to:
2928 is a shorthand equivalent to:
2921 %sx ls
2929 %sx ls
2922
2930
2923 2) %sx differs from %sc in that %sx automatically splits into a list,
2931 2) %sx differs from %sc in that %sx automatically splits into a list,
2924 like '%sc -l'. The reason for this is to make it as easy as possible
2932 like '%sc -l'. The reason for this is to make it as easy as possible
2925 to process line-oriented shell output via further python commands.
2933 to process line-oriented shell output via further python commands.
2926 %sc is meant to provide much finer control, but requires more
2934 %sc is meant to provide much finer control, but requires more
2927 typing.
2935 typing.
2928
2936
2929 3) Just like %sc -l, this is a list with special attributes:
2937 3) Just like %sc -l, this is a list with special attributes:
2930
2938
2931 .l (or .list) : value as list.
2939 .l (or .list) : value as list.
2932 .n (or .nlstr): value as newline-separated string.
2940 .n (or .nlstr): value as newline-separated string.
2933 .s (or .spstr): value as whitespace-separated string.
2941 .s (or .spstr): value as whitespace-separated string.
2934
2942
2935 This is very useful when trying to use such lists as arguments to
2943 This is very useful when trying to use such lists as arguments to
2936 system commands."""
2944 system commands."""
2937
2945
2938 if parameter_s:
2946 if parameter_s:
2939 out,err = self.shell.getoutputerror(parameter_s)
2947 out,err = self.shell.getoutputerror(parameter_s)
2940 if err:
2948 if err:
2941 print >> Term.cerr,err
2949 print >> Term.cerr,err
2942 return SList(out.split('\n'))
2950 return SList(out.split('\n'))
2943
2951
2944 def magic_bg(self, parameter_s=''):
2952 def magic_bg(self, parameter_s=''):
2945 """Run a job in the background, in a separate thread.
2953 """Run a job in the background, in a separate thread.
2946
2954
2947 For example,
2955 For example,
2948
2956
2949 %bg myfunc(x,y,z=1)
2957 %bg myfunc(x,y,z=1)
2950
2958
2951 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2959 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2952 execution starts, a message will be printed indicating the job
2960 execution starts, a message will be printed indicating the job
2953 number. If your job number is 5, you can use
2961 number. If your job number is 5, you can use
2954
2962
2955 myvar = jobs.result(5) or myvar = jobs[5].result
2963 myvar = jobs.result(5) or myvar = jobs[5].result
2956
2964
2957 to assign this result to variable 'myvar'.
2965 to assign this result to variable 'myvar'.
2958
2966
2959 IPython has a job manager, accessible via the 'jobs' object. You can
2967 IPython has a job manager, accessible via the 'jobs' object. You can
2960 type jobs? to get more information about it, and use jobs.<TAB> to see
2968 type jobs? to get more information about it, and use jobs.<TAB> to see
2961 its attributes. All attributes not starting with an underscore are
2969 its attributes. All attributes not starting with an underscore are
2962 meant for public use.
2970 meant for public use.
2963
2971
2964 In particular, look at the jobs.new() method, which is used to create
2972 In particular, look at the jobs.new() method, which is used to create
2965 new jobs. This magic %bg function is just a convenience wrapper
2973 new jobs. This magic %bg function is just a convenience wrapper
2966 around jobs.new(), for expression-based jobs. If you want to create a
2974 around jobs.new(), for expression-based jobs. If you want to create a
2967 new job with an explicit function object and arguments, you must call
2975 new job with an explicit function object and arguments, you must call
2968 jobs.new() directly.
2976 jobs.new() directly.
2969
2977
2970 The jobs.new docstring also describes in detail several important
2978 The jobs.new docstring also describes in detail several important
2971 caveats associated with a thread-based model for background job
2979 caveats associated with a thread-based model for background job
2972 execution. Type jobs.new? for details.
2980 execution. Type jobs.new? for details.
2973
2981
2974 You can check the status of all jobs with jobs.status().
2982 You can check the status of all jobs with jobs.status().
2975
2983
2976 The jobs variable is set by IPython into the Python builtin namespace.
2984 The jobs variable is set by IPython into the Python builtin namespace.
2977 If you ever declare a variable named 'jobs', you will shadow this
2985 If you ever declare a variable named 'jobs', you will shadow this
2978 name. You can either delete your global jobs variable to regain
2986 name. You can either delete your global jobs variable to regain
2979 access to the job manager, or make a new name and assign it manually
2987 access to the job manager, or make a new name and assign it manually
2980 to the manager (stored in IPython's namespace). For example, to
2988 to the manager (stored in IPython's namespace). For example, to
2981 assign the job manager to the Jobs name, use:
2989 assign the job manager to the Jobs name, use:
2982
2990
2983 Jobs = __builtins__.jobs"""
2991 Jobs = __builtins__.jobs"""
2984
2992
2985 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2993 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2986
2994
2987 def magic_r(self, parameter_s=''):
2995 def magic_r(self, parameter_s=''):
2988 """Repeat previous input.
2996 """Repeat previous input.
2989
2997
2990 Note: Consider using the more powerfull %rep instead!
2998 Note: Consider using the more powerfull %rep instead!
2991
2999
2992 If given an argument, repeats the previous command which starts with
3000 If given an argument, repeats the previous command which starts with
2993 the same string, otherwise it just repeats the previous input.
3001 the same string, otherwise it just repeats the previous input.
2994
3002
2995 Shell escaped commands (with ! as first character) are not recognized
3003 Shell escaped commands (with ! as first character) are not recognized
2996 by this system, only pure python code and magic commands.
3004 by this system, only pure python code and magic commands.
2997 """
3005 """
2998
3006
2999 start = parameter_s.strip()
3007 start = parameter_s.strip()
3000 esc_magic = self.shell.ESC_MAGIC
3008 esc_magic = self.shell.ESC_MAGIC
3001 # Identify magic commands even if automagic is on (which means
3009 # Identify magic commands even if automagic is on (which means
3002 # the in-memory version is different from that typed by the user).
3010 # the in-memory version is different from that typed by the user).
3003 if self.shell.rc.automagic:
3011 if self.shell.rc.automagic:
3004 start_magic = esc_magic+start
3012 start_magic = esc_magic+start
3005 else:
3013 else:
3006 start_magic = start
3014 start_magic = start
3007 # Look through the input history in reverse
3015 # Look through the input history in reverse
3008 for n in range(len(self.shell.input_hist)-2,0,-1):
3016 for n in range(len(self.shell.input_hist)-2,0,-1):
3009 input = self.shell.input_hist[n]
3017 input = self.shell.input_hist[n]
3010 # skip plain 'r' lines so we don't recurse to infinity
3018 # skip plain 'r' lines so we don't recurse to infinity
3011 if input != '_ip.magic("r")\n' and \
3019 if input != '_ip.magic("r")\n' and \
3012 (input.startswith(start) or input.startswith(start_magic)):
3020 (input.startswith(start) or input.startswith(start_magic)):
3013 #print 'match',`input` # dbg
3021 #print 'match',`input` # dbg
3014 print 'Executing:',input,
3022 print 'Executing:',input,
3015 self.shell.runlines(input)
3023 self.shell.runlines(input)
3016 return
3024 return
3017 print 'No previous input matching `%s` found.' % start
3025 print 'No previous input matching `%s` found.' % start
3018
3026
3019
3027
3020 def magic_bookmark(self, parameter_s=''):
3028 def magic_bookmark(self, parameter_s=''):
3021 """Manage IPython's bookmark system.
3029 """Manage IPython's bookmark system.
3022
3030
3023 %bookmark <name> - set bookmark to current dir
3031 %bookmark <name> - set bookmark to current dir
3024 %bookmark <name> <dir> - set bookmark to <dir>
3032 %bookmark <name> <dir> - set bookmark to <dir>
3025 %bookmark -l - list all bookmarks
3033 %bookmark -l - list all bookmarks
3026 %bookmark -d <name> - remove bookmark
3034 %bookmark -d <name> - remove bookmark
3027 %bookmark -r - remove all bookmarks
3035 %bookmark -r - remove all bookmarks
3028
3036
3029 You can later on access a bookmarked folder with:
3037 You can later on access a bookmarked folder with:
3030 %cd -b <name>
3038 %cd -b <name>
3031 or simply '%cd <name>' if there is no directory called <name> AND
3039 or simply '%cd <name>' if there is no directory called <name> AND
3032 there is such a bookmark defined.
3040 there is such a bookmark defined.
3033
3041
3034 Your bookmarks persist through IPython sessions, but they are
3042 Your bookmarks persist through IPython sessions, but they are
3035 associated with each profile."""
3043 associated with each profile."""
3036
3044
3037 opts,args = self.parse_options(parameter_s,'drl',mode='list')
3045 opts,args = self.parse_options(parameter_s,'drl',mode='list')
3038 if len(args) > 2:
3046 if len(args) > 2:
3039 raise UsageError("%bookmark: too many arguments")
3047 raise UsageError("%bookmark: too many arguments")
3040
3048
3041 bkms = self.db.get('bookmarks',{})
3049 bkms = self.db.get('bookmarks',{})
3042
3050
3043 if opts.has_key('d'):
3051 if opts.has_key('d'):
3044 try:
3052 try:
3045 todel = args[0]
3053 todel = args[0]
3046 except IndexError:
3054 except IndexError:
3047 raise UsageError(
3055 raise UsageError(
3048 "%bookmark -d: must provide a bookmark to delete")
3056 "%bookmark -d: must provide a bookmark to delete")
3049 else:
3057 else:
3050 try:
3058 try:
3051 del bkms[todel]
3059 del bkms[todel]
3052 except KeyError:
3060 except KeyError:
3053 raise UsageError(
3061 raise UsageError(
3054 "%%bookmark -d: Can't delete bookmark '%s'" % todel)
3062 "%%bookmark -d: Can't delete bookmark '%s'" % todel)
3055
3063
3056 elif opts.has_key('r'):
3064 elif opts.has_key('r'):
3057 bkms = {}
3065 bkms = {}
3058 elif opts.has_key('l'):
3066 elif opts.has_key('l'):
3059 bks = bkms.keys()
3067 bks = bkms.keys()
3060 bks.sort()
3068 bks.sort()
3061 if bks:
3069 if bks:
3062 size = max(map(len,bks))
3070 size = max(map(len,bks))
3063 else:
3071 else:
3064 size = 0
3072 size = 0
3065 fmt = '%-'+str(size)+'s -> %s'
3073 fmt = '%-'+str(size)+'s -> %s'
3066 print 'Current bookmarks:'
3074 print 'Current bookmarks:'
3067 for bk in bks:
3075 for bk in bks:
3068 print fmt % (bk,bkms[bk])
3076 print fmt % (bk,bkms[bk])
3069 else:
3077 else:
3070 if not args:
3078 if not args:
3071 raise UsageError("%bookmark: You must specify the bookmark name")
3079 raise UsageError("%bookmark: You must specify the bookmark name")
3072 elif len(args)==1:
3080 elif len(args)==1:
3073 bkms[args[0]] = os.getcwd()
3081 bkms[args[0]] = os.getcwd()
3074 elif len(args)==2:
3082 elif len(args)==2:
3075 bkms[args[0]] = args[1]
3083 bkms[args[0]] = args[1]
3076 self.db['bookmarks'] = bkms
3084 self.db['bookmarks'] = bkms
3077
3085
3078 def magic_pycat(self, parameter_s=''):
3086 def magic_pycat(self, parameter_s=''):
3079 """Show a syntax-highlighted file through a pager.
3087 """Show a syntax-highlighted file through a pager.
3080
3088
3081 This magic is similar to the cat utility, but it will assume the file
3089 This magic is similar to the cat utility, but it will assume the file
3082 to be Python source and will show it with syntax highlighting. """
3090 to be Python source and will show it with syntax highlighting. """
3083
3091
3084 try:
3092 try:
3085 filename = get_py_filename(parameter_s)
3093 filename = get_py_filename(parameter_s)
3086 cont = file_read(filename)
3094 cont = file_read(filename)
3087 except IOError:
3095 except IOError:
3088 try:
3096 try:
3089 cont = eval(parameter_s,self.user_ns)
3097 cont = eval(parameter_s,self.user_ns)
3090 except NameError:
3098 except NameError:
3091 cont = None
3099 cont = None
3092 if cont is None:
3100 if cont is None:
3093 print "Error: no such file or variable"
3101 print "Error: no such file or variable"
3094 return
3102 return
3095
3103
3096 page(self.shell.pycolorize(cont),
3104 page(self.shell.pycolorize(cont),
3097 screen_lines=self.shell.rc.screen_length)
3105 screen_lines=self.shell.rc.screen_length)
3098
3106
3099 def magic_cpaste(self, parameter_s=''):
3107 def magic_cpaste(self, parameter_s=''):
3100 """Allows you to paste & execute a pre-formatted code block from clipboard
3108 """Allows you to paste & execute a pre-formatted code block from clipboard
3101
3109
3102 You must terminate the block with '--' (two minus-signs) alone on the
3110 You must terminate the block with '--' (two minus-signs) alone on the
3103 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
3111 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
3104 is the new sentinel for this operation)
3112 is the new sentinel for this operation)
3105
3113
3106 The block is dedented prior to execution to enable execution of method
3114 The block is dedented prior to execution to enable execution of method
3107 definitions. '>' and '+' characters at the beginning of a line are
3115 definitions. '>' and '+' characters at the beginning of a line are
3108 ignored, to allow pasting directly from e-mails or diff files. The
3116 ignored, to allow pasting directly from e-mails or diff files. The
3109 executed block is also assigned to variable named 'pasted_block' for
3117 executed block is also assigned to variable named 'pasted_block' for
3110 later editing with '%edit pasted_block'.
3118 later editing with '%edit pasted_block'.
3111
3119
3112 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
3120 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
3113 This assigns the pasted block to variable 'foo' as string, without
3121 This assigns the pasted block to variable 'foo' as string, without
3114 dedenting or executing it.
3122 dedenting or executing it.
3115
3123
3116 Do not be alarmed by garbled output on Windows (it's a readline bug).
3124 Do not be alarmed by garbled output on Windows (it's a readline bug).
3117 Just press enter and type -- (and press enter again) and the block
3125 Just press enter and type -- (and press enter again) and the block
3118 will be what was just pasted.
3126 will be what was just pasted.
3119
3127
3120 IPython statements (magics, shell escapes) are not supported (yet).
3128 IPython statements (magics, shell escapes) are not supported (yet).
3121 """
3129 """
3122 opts,args = self.parse_options(parameter_s,'s:',mode='string')
3130 opts,args = self.parse_options(parameter_s,'s:',mode='string')
3123 par = args.strip()
3131 par = args.strip()
3124 sentinel = opts.get('s','--')
3132 sentinel = opts.get('s','--')
3125
3133
3126 from IPython import iplib
3134 from IPython import iplib
3127 lines = []
3135 lines = []
3128 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
3136 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
3129 while 1:
3137 while 1:
3130 l = iplib.raw_input_original(':')
3138 l = iplib.raw_input_original(':')
3131 if l ==sentinel:
3139 if l ==sentinel:
3132 break
3140 break
3133 lines.append(l.lstrip('>').lstrip('+'))
3141 lines.append(l.lstrip('>').lstrip('+'))
3134 block = "\n".join(lines) + '\n'
3142 block = "\n".join(lines) + '\n'
3135 #print "block:\n",block
3143 #print "block:\n",block
3136 if not par:
3144 if not par:
3137 b = textwrap.dedent(block)
3145 b = textwrap.dedent(block)
3138 exec b in self.user_ns
3146 exec b in self.user_ns
3139 self.user_ns['pasted_block'] = b
3147 self.user_ns['pasted_block'] = b
3140 else:
3148 else:
3141 self.user_ns[par] = block
3149 self.user_ns[par] = block
3142 print "Block assigned to '%s'" % par
3150 print "Block assigned to '%s'" % par
3143
3151
3144 def magic_quickref(self,arg):
3152 def magic_quickref(self,arg):
3145 """ Show a quick reference sheet """
3153 """ Show a quick reference sheet """
3146 import IPython.usage
3154 import IPython.usage
3147 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
3155 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
3148
3156
3149 page(qr)
3157 page(qr)
3150
3158
3151 def magic_upgrade(self,arg):
3159 def magic_upgrade(self,arg):
3152 """ Upgrade your IPython installation
3160 """ Upgrade your IPython installation
3153
3161
3154 This will copy the config files that don't yet exist in your
3162 This will copy the config files that don't yet exist in your
3155 ipython dir from the system config dir. Use this after upgrading
3163 ipython dir from the system config dir. Use this after upgrading
3156 IPython if you don't wish to delete your .ipython dir.
3164 IPython if you don't wish to delete your .ipython dir.
3157
3165
3158 Call with -nolegacy to get rid of ipythonrc* files (recommended for
3166 Call with -nolegacy to get rid of ipythonrc* files (recommended for
3159 new users)
3167 new users)
3160
3168
3161 """
3169 """
3162 ip = self.getapi()
3170 ip = self.getapi()
3163 ipinstallation = path(IPython.__file__).dirname()
3171 ipinstallation = path(IPython.__file__).dirname()
3164 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
3172 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
3165 src_config = ipinstallation / 'UserConfig'
3173 src_config = ipinstallation / 'UserConfig'
3166 userdir = path(ip.options.ipythondir)
3174 userdir = path(ip.options.ipythondir)
3167 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
3175 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
3168 print ">",cmd
3176 print ">",cmd
3169 shell(cmd)
3177 shell(cmd)
3170 if arg == '-nolegacy':
3178 if arg == '-nolegacy':
3171 legacy = userdir.files('ipythonrc*')
3179 legacy = userdir.files('ipythonrc*')
3172 print "Nuking legacy files:",legacy
3180 print "Nuking legacy files:",legacy
3173
3181
3174 [p.remove() for p in legacy]
3182 [p.remove() for p in legacy]
3175 suffix = (sys.platform == 'win32' and '.ini' or '')
3183 suffix = (sys.platform == 'win32' and '.ini' or '')
3176 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
3184 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
3177
3185
3178
3186
3179 def magic_doctest_mode(self,parameter_s=''):
3187 def magic_doctest_mode(self,parameter_s=''):
3180 """Toggle doctest mode on and off.
3188 """Toggle doctest mode on and off.
3181
3189
3182 This mode allows you to toggle the prompt behavior between normal
3190 This mode allows you to toggle the prompt behavior between normal
3183 IPython prompts and ones that are as similar to the default IPython
3191 IPython prompts and ones that are as similar to the default IPython
3184 interpreter as possible.
3192 interpreter as possible.
3185
3193
3186 It also supports the pasting of code snippets that have leading '>>>'
3194 It also supports the pasting of code snippets that have leading '>>>'
3187 and '...' prompts in them. This means that you can paste doctests from
3195 and '...' prompts in them. This means that you can paste doctests from
3188 files or docstrings (even if they have leading whitespace), and the
3196 files or docstrings (even if they have leading whitespace), and the
3189 code will execute correctly. You can then use '%history -tn' to see
3197 code will execute correctly. You can then use '%history -tn' to see
3190 the translated history without line numbers; this will give you the
3198 the translated history without line numbers; this will give you the
3191 input after removal of all the leading prompts and whitespace, which
3199 input after removal of all the leading prompts and whitespace, which
3192 can be pasted back into an editor.
3200 can be pasted back into an editor.
3193
3201
3194 With these features, you can switch into this mode easily whenever you
3202 With these features, you can switch into this mode easily whenever you
3195 need to do testing and changes to doctests, without having to leave
3203 need to do testing and changes to doctests, without having to leave
3196 your existing IPython session.
3204 your existing IPython session.
3197 """
3205 """
3198
3206
3199 # XXX - Fix this to have cleaner activate/deactivate calls.
3207 # XXX - Fix this to have cleaner activate/deactivate calls.
3200 from IPython.Extensions import InterpreterPasteInput as ipaste
3208 from IPython.Extensions import InterpreterPasteInput as ipaste
3201 from IPython.ipstruct import Struct
3209 from IPython.ipstruct import Struct
3202
3210
3203 # Shorthands
3211 # Shorthands
3204 shell = self.shell
3212 shell = self.shell
3205 oc = shell.outputcache
3213 oc = shell.outputcache
3206 rc = shell.rc
3214 rc = shell.rc
3207 meta = shell.meta
3215 meta = shell.meta
3208 # dstore is a data store kept in the instance metadata bag to track any
3216 # dstore is a data store kept in the instance metadata bag to track any
3209 # changes we make, so we can undo them later.
3217 # changes we make, so we can undo them later.
3210 dstore = meta.setdefault('doctest_mode',Struct())
3218 dstore = meta.setdefault('doctest_mode',Struct())
3211 save_dstore = dstore.setdefault
3219 save_dstore = dstore.setdefault
3212
3220
3213 # save a few values we'll need to recover later
3221 # save a few values we'll need to recover later
3214 mode = save_dstore('mode',False)
3222 mode = save_dstore('mode',False)
3215 save_dstore('rc_pprint',rc.pprint)
3223 save_dstore('rc_pprint',rc.pprint)
3216 save_dstore('xmode',shell.InteractiveTB.mode)
3224 save_dstore('xmode',shell.InteractiveTB.mode)
3217 save_dstore('rc_separate_in',rc.separate_in)
3225 save_dstore('rc_separate_in',rc.separate_in)
3218 save_dstore('rc_separate_out',rc.separate_out)
3226 save_dstore('rc_separate_out',rc.separate_out)
3219 save_dstore('rc_separate_out2',rc.separate_out2)
3227 save_dstore('rc_separate_out2',rc.separate_out2)
3220 save_dstore('rc_prompts_pad_left',rc.prompts_pad_left)
3228 save_dstore('rc_prompts_pad_left',rc.prompts_pad_left)
3221
3229
3222 if mode == False:
3230 if mode == False:
3223 # turn on
3231 # turn on
3224 ipaste.activate_prefilter()
3232 ipaste.activate_prefilter()
3225
3233
3226 oc.prompt1.p_template = '>>> '
3234 oc.prompt1.p_template = '>>> '
3227 oc.prompt2.p_template = '... '
3235 oc.prompt2.p_template = '... '
3228 oc.prompt_out.p_template = ''
3236 oc.prompt_out.p_template = ''
3229
3237
3230 oc.prompt1.sep = '\n'
3238 oc.prompt1.sep = '\n'
3231 oc.output_sep = ''
3239 oc.output_sep = ''
3232 oc.output_sep2 = ''
3240 oc.output_sep2 = ''
3233
3241
3234 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3242 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3235 oc.prompt_out.pad_left = False
3243 oc.prompt_out.pad_left = False
3236
3244
3237 rc.pprint = False
3245 rc.pprint = False
3238
3246
3239 shell.magic_xmode('Plain')
3247 shell.magic_xmode('Plain')
3240
3248
3241 else:
3249 else:
3242 # turn off
3250 # turn off
3243 ipaste.deactivate_prefilter()
3251 ipaste.deactivate_prefilter()
3244
3252
3245 oc.prompt1.p_template = rc.prompt_in1
3253 oc.prompt1.p_template = rc.prompt_in1
3246 oc.prompt2.p_template = rc.prompt_in2
3254 oc.prompt2.p_template = rc.prompt_in2
3247 oc.prompt_out.p_template = rc.prompt_out
3255 oc.prompt_out.p_template = rc.prompt_out
3248
3256
3249 oc.prompt1.sep = dstore.rc_separate_in
3257 oc.prompt1.sep = dstore.rc_separate_in
3250 oc.output_sep = dstore.rc_separate_out
3258 oc.output_sep = dstore.rc_separate_out
3251 oc.output_sep2 = dstore.rc_separate_out2
3259 oc.output_sep2 = dstore.rc_separate_out2
3252
3260
3253 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3261 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3254 oc.prompt_out.pad_left = dstore.rc_prompts_pad_left
3262 oc.prompt_out.pad_left = dstore.rc_prompts_pad_left
3255
3263
3256 rc.pprint = dstore.rc_pprint
3264 rc.pprint = dstore.rc_pprint
3257
3265
3258 shell.magic_xmode(dstore.xmode)
3266 shell.magic_xmode(dstore.xmode)
3259
3267
3260 # Store new mode and inform
3268 # Store new mode and inform
3261 dstore.mode = bool(1-int(mode))
3269 dstore.mode = bool(1-int(mode))
3262 print 'Doctest mode is:',
3270 print 'Doctest mode is:',
3263 print ['OFF','ON'][dstore.mode]
3271 print ['OFF','ON'][dstore.mode]
3264
3272
3265 # end Magic
3273 # end Magic
@@ -1,75 +1,82 b''
1 """ User configuration file for IPython
1 """ User configuration file for IPython
2
2
3 This is a more flexible and safe way to configure ipython than *rc files
3 This is a more flexible and safe way to configure ipython than *rc files
4 (ipythonrc, ipythonrc-pysh etc.)
4 (ipythonrc, ipythonrc-pysh etc.)
5
5
6 This file is always imported on ipython startup. You can import the
6 This file is always imported on ipython startup. You can import the
7 ipython extensions you need here (see IPython/Extensions directory).
7 ipython extensions you need here (see IPython/Extensions directory).
8
8
9 Feel free to edit this file to customize your ipython experience.
9 Feel free to edit this file to customize your ipython experience.
10
10
11 Note that as such this file does nothing, for backwards compatibility.
11 Note that as such this file does nothing, for backwards compatibility.
12 Consult e.g. file 'ipy_profile_sh.py' for an example of the things
12 Consult e.g. file 'ipy_profile_sh.py' for an example of the things
13 you can do here.
13 you can do here.
14
14
15 See http://ipython.scipy.org/moin/IpythonExtensionApi for detailed
15 See http://ipython.scipy.org/moin/IpythonExtensionApi for detailed
16 description on what you could do here.
16 description on what you could do here.
17 """
17 """
18
18
19 # Most of your config files and extensions will probably start with this import
19 # Most of your config files and extensions will probably start with this import
20
20
21 import IPython.ipapi
21 import IPython.ipapi
22 ip = IPython.ipapi.get()
22 ip = IPython.ipapi.get()
23
23
24 # You probably want to uncomment this if you did %upgrade -nolegacy
24 # You probably want to uncomment this if you did %upgrade -nolegacy
25 # import ipy_defaults
25 # import ipy_defaults
26
26
27 import os
27 import os
28
28
29 def main():
29 def main():
30 # Handy tab-completers for %cd, %run, import etc.
30 # Handy tab-completers for %cd, %run, import etc.
31 # Try commenting this out if you have completion problems/slowness
31 # Try commenting this out if you have completion problems/slowness
32 # import ipy_stock_completers
32 # import ipy_stock_completers
33
33
34 # uncomment if you want to get ipython -p sh behaviour
34 # uncomment if you want to get ipython -p sh behaviour
35 # without having to use command line switches
35 # without having to use command line switches
36
36
37 # import ipy_profile_sh
37 # import ipy_profile_sh
38
38
39
39
40 # Configure your favourite editor?
40 # Configure your favourite editor?
41 # Good idea e.g. for %edit os.path.isfile
41 # Good idea e.g. for %edit os.path.isfile
42
42
43 #import ipy_editors
43 #import ipy_editors
44
44
45 # Choose one of these:
45 # Choose one of these:
46
46
47 #ipy_editors.scite()
47 #ipy_editors.scite()
48 #ipy_editors.scite('c:/opt/scite/scite.exe')
48 #ipy_editors.scite('c:/opt/scite/scite.exe')
49 #ipy_editors.komodo()
49 #ipy_editors.komodo()
50 #ipy_editors.idle()
50 #ipy_editors.idle()
51 # ... or many others, try 'ipy_editors??' after import to see them
51 # ... or many others, try 'ipy_editors??' after import to see them
52
52
53 # Or roll your own:
53 # Or roll your own:
54 #ipy_editors.install_editor("c:/opt/jed +$line $file")
54 #ipy_editors.install_editor("c:/opt/jed +$line $file")
55
55
56
56
57 o = ip.options
57 o = ip.options
58 # An example on how to set options
58 # An example on how to set options
59 #o.autocall = 1
59 #o.autocall = 1
60 o.system_verbose = 0
60 o.system_verbose = 0
61
61
62 #import_all("os sys")
62 #import_all("os sys")
63 #execf('~/_ipython/ns.py')
63 #execf('~/_ipython/ns.py')
64
64
65 # A different, more compact set of prompts from the default ones, that
66 # always show your current location in the filesystem:
67
68 #o.prompt_in1 = r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Normal\n\C_Green|\#>'
69 #o.prompt_in2 = r'.\D: '
70 #o.prompt_out = r'[\#] '
71
65 # some config helper functions you can use
72 # some config helper functions you can use
66 def import_all(modules):
73 def import_all(modules):
67 """ Usage: import_all("os sys") """
74 """ Usage: import_all("os sys") """
68 for m in modules.split():
75 for m in modules.split():
69 ip.ex("from %s import *" % m)
76 ip.ex("from %s import *" % m)
70
77
71 def execf(fname):
78 def execf(fname):
72 """ Execute a file in user namespace """
79 """ Execute a file in user namespace """
73 ip.ex('execfile("%s")' % os.path.expanduser(fname))
80 ip.ex('execfile("%s")' % os.path.expanduser(fname))
74
81
75 main()
82 main()
@@ -1,7241 +1,7251 b''
1 2007-11-25 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * IPython/Logger.py (Logger.logstop): add a proper logstop()
4 method to fully stop the logger, along with a corresponding
5 %logstop magic for interactive use.
6
7 * IPython/Extensions/ipy_host_completers.py: added new host
8 completers functionality, contributed by Gael Pasgrimaud
9 <gawel-AT-afpy.org>.
10
1 2007-11-24 Fernando Perez <Fernando.Perez@colorado.edu>
11 2007-11-24 Fernando Perez <Fernando.Perez@colorado.edu>
2
12
3 * IPython/DPyGetOpt.py (ArgumentError): Apply patch by Paul Mueller
13 * IPython/DPyGetOpt.py (ArgumentError): Apply patch by Paul Mueller
4 <gakusei-AT-dakotacom.net>, to fix deprecated string exceptions in
14 <gakusei-AT-dakotacom.net>, to fix deprecated string exceptions in
5 options handling. Unicode fix in %whos (committed a while ago)
15 options handling. Unicode fix in %whos (committed a while ago)
6 was also contributed by Paul.
16 was also contributed by Paul.
7
17
8 2007-11-23 Darren Dale <darren.dale@cornell.edu>
18 2007-11-23 Darren Dale <darren.dale@cornell.edu>
9 * ipy_traits_completer.py: let traits_completer respect the user's
19 * ipy_traits_completer.py: let traits_completer respect the user's
10 readline_omit__names setting.
20 readline_omit__names setting.
11
21
12 2007-11-08 Ville Vainio <vivainio@gmail.com>
22 2007-11-08 Ville Vainio <vivainio@gmail.com>
13 * ipy_completers.py (import completer): assume 'xml' module exists.
23 * ipy_completers.py (import completer): assume 'xml' module exists.
14 Do not add every module twice anymore. Closes #196.
24 Do not add every module twice anymore. Closes #196.
15
25
16 * ipy_completers.py, ipy_app_completers.py: Add proper apt-get
26 * ipy_completers.py, ipy_app_completers.py: Add proper apt-get
17 completer that uses apt-cache to search for existing packages.
27 completer that uses apt-cache to search for existing packages.
18
28
19 2007-11-06 Ville Vainio <vivainio@gmail.com>
29 2007-11-06 Ville Vainio <vivainio@gmail.com>
20
30
21 * Prompts.py: Do not update _oh and _123 when do_full_cache is not
31 * Prompts.py: Do not update _oh and _123 when do_full_cache is not
22 true. Closes #194.
32 true. Closes #194.
23
33
24 2007-11-01 Brian Granger <ellisonbg@gmail.com>
34 2007-11-01 Brian Granger <ellisonbg@gmail.com>
25
35
26 * iplib.py, rlineimpl.py: Applied Body Water's patches to get IPython
36 * iplib.py, rlineimpl.py: Applied Body Water's patches to get IPython
27 working with OS X 10.5 libedit implementation of readline.
37 working with OS X 10.5 libedit implementation of readline.
28
38
29 2007-10-24 Ville Vainio <vivainio@gmail.com>
39 2007-10-24 Ville Vainio <vivainio@gmail.com>
30
40
31 * iplib.py(user_setup): To route around buggy installations where
41 * iplib.py(user_setup): To route around buggy installations where
32 UserConfig is not available, create a minimal _ipython.
42 UserConfig is not available, create a minimal _ipython.
33
43
34 * iplib.py: Unicode fixes from Jorgen.
44 * iplib.py: Unicode fixes from Jorgen.
35
45
36 * genutils.py: Slist now has new method 'fields()' for extraction of
46 * genutils.py: Slist now has new method 'fields()' for extraction of
37 whitespace-separated fields from line-oriented data.
47 whitespace-separated fields from line-oriented data.
38
48
39 2007-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
49 2007-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
40
50
41 * IPython/OInspect.py (Inspector.pinfo): fix bug that could arise
51 * IPython/OInspect.py (Inspector.pinfo): fix bug that could arise
42 when querying objects with no __class__ attribute (such as
52 when querying objects with no __class__ attribute (such as
43 f2py-generated modules).
53 f2py-generated modules).
44
54
45 2007-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
55 2007-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
46
56
47 * IPython/Magic.py (magic_time): track compilation time and report
57 * IPython/Magic.py (magic_time): track compilation time and report
48 it if longer than 0.1s (fix done to %time and %timeit). After a
58 it if longer than 0.1s (fix done to %time and %timeit). After a
49 SAGE bug report: http://trac.sagemath.org/sage_trac/ticket/632.
59 SAGE bug report: http://trac.sagemath.org/sage_trac/ticket/632.
50
60
51 2007-09-18 Ville Vainio <vivainio@gmail.com>
61 2007-09-18 Ville Vainio <vivainio@gmail.com>
52
62
53 * genutils.py(make_quoted_expr): Do not use Itpl, it does
63 * genutils.py(make_quoted_expr): Do not use Itpl, it does
54 not support unicode at the moment. Fixes (many) magic calls with
64 not support unicode at the moment. Fixes (many) magic calls with
55 special characters.
65 special characters.
56
66
57 2007-09-14 Fernando Perez <Fernando.Perez@colorado.edu>
67 2007-09-14 Fernando Perez <Fernando.Perez@colorado.edu>
58
68
59 * IPython/genutils.py (doctest_reload): expose the doctest
69 * IPython/genutils.py (doctest_reload): expose the doctest
60 reloader to the user so that people can easily reset doctest while
70 reloader to the user so that people can easily reset doctest while
61 using it interactively. Fixes a problem reported by Jorgen.
71 using it interactively. Fixes a problem reported by Jorgen.
62
72
63 * IPython/iplib.py (InteractiveShell.__init__): protect the
73 * IPython/iplib.py (InteractiveShell.__init__): protect the
64 FakeModule instances used for __main__ in %run calls from
74 FakeModule instances used for __main__ in %run calls from
65 deletion, so that user code defined in them isn't left with
75 deletion, so that user code defined in them isn't left with
66 dangling references due to the Python module deletion machinery.
76 dangling references due to the Python module deletion machinery.
67 This should fix the problems reported by Darren.
77 This should fix the problems reported by Darren.
68
78
69 2007-09-10 Darren Dale <dd55@cornell.edu>
79 2007-09-10 Darren Dale <dd55@cornell.edu>
70
80
71 * Cleanup of IPShellQt and IPShellQt4
81 * Cleanup of IPShellQt and IPShellQt4
72
82
73 2007-09-09 Fernando Perez <Fernando.Perez@colorado.edu>
83 2007-09-09 Fernando Perez <Fernando.Perez@colorado.edu>
74
84
75 * IPython/FakeModule.py (FakeModule.__init__): further fixes for
85 * IPython/FakeModule.py (FakeModule.__init__): further fixes for
76 doctest support.
86 doctest support.
77
87
78 * IPython/iplib.py (safe_execfile): minor docstring improvements.
88 * IPython/iplib.py (safe_execfile): minor docstring improvements.
79
89
80 2007-09-08 Ville Vainio <vivainio@gmail.com>
90 2007-09-08 Ville Vainio <vivainio@gmail.com>
81
91
82 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
92 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
83 directory, not the target directory.
93 directory, not the target directory.
84
94
85 * ipapi.py, Magic.py, iplib.py: Add ipapi.UsageError, a lighter weight
95 * ipapi.py, Magic.py, iplib.py: Add ipapi.UsageError, a lighter weight
86 exception that won't print the tracebacks. Switched many magics to
96 exception that won't print the tracebacks. Switched many magics to
87 raise them on error situations, also GetoptError is not printed
97 raise them on error situations, also GetoptError is not printed
88 anymore.
98 anymore.
89
99
90 2007-09-07 Ville Vainio <vivainio@gmail.com>
100 2007-09-07 Ville Vainio <vivainio@gmail.com>
91
101
92 * iplib.py: do not auto-alias "dir", it screws up other dir auto
102 * iplib.py: do not auto-alias "dir", it screws up other dir auto
93 aliases.
103 aliases.
94
104
95 * genutils.py: SList.grep() implemented.
105 * genutils.py: SList.grep() implemented.
96
106
97 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
107 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
98 for easy "out of the box" setup of several common editors, so that
108 for easy "out of the box" setup of several common editors, so that
99 e.g. '%edit os.path.isfile' will jump to the correct line
109 e.g. '%edit os.path.isfile' will jump to the correct line
100 automatically. Contributions for command lines of your favourite
110 automatically. Contributions for command lines of your favourite
101 editors welcome.
111 editors welcome.
102
112
103 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
113 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
104
114
105 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
115 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
106 preventing source display in certain cases. In reality I think
116 preventing source display in certain cases. In reality I think
107 the problem is with Ubuntu's Python build, but this change works
117 the problem is with Ubuntu's Python build, but this change works
108 around the issue in some cases (not in all, unfortunately). I'd
118 around the issue in some cases (not in all, unfortunately). I'd
109 filed a Python bug on this with more details, but in the change of
119 filed a Python bug on this with more details, but in the change of
110 bug trackers it seems to have been lost.
120 bug trackers it seems to have been lost.
111
121
112 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
122 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
113 not the same, it's not self-documenting, doesn't allow range
123 not the same, it's not self-documenting, doesn't allow range
114 selection, and sorts alphabetically instead of numerically.
124 selection, and sorts alphabetically instead of numerically.
115 (magic_r): restore %r. No, "up + enter. One char magic" is not
125 (magic_r): restore %r. No, "up + enter. One char magic" is not
116 the same thing, since %r takes parameters to allow fast retrieval
126 the same thing, since %r takes parameters to allow fast retrieval
117 of old commands. I've received emails from users who use this a
127 of old commands. I've received emails from users who use this a
118 LOT, so it stays.
128 LOT, so it stays.
119 (magic_automagic): restore %automagic. "use _ip.option.automagic"
129 (magic_automagic): restore %automagic. "use _ip.option.automagic"
120 is not a valid replacement b/c it doesn't provide an complete
130 is not a valid replacement b/c it doesn't provide an complete
121 explanation (which the automagic docstring does).
131 explanation (which the automagic docstring does).
122 (magic_autocall): restore %autocall, with improved docstring.
132 (magic_autocall): restore %autocall, with improved docstring.
123 Same argument as for others, "use _ip.options.autocall" is not a
133 Same argument as for others, "use _ip.options.autocall" is not a
124 valid replacement.
134 valid replacement.
125 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
135 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
126 tutorials and online docs.
136 tutorials and online docs.
127
137
128 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
138 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
129
139
130 * IPython/usage.py (quick_reference): mention magics in quickref,
140 * IPython/usage.py (quick_reference): mention magics in quickref,
131 modified main banner to mention %quickref.
141 modified main banner to mention %quickref.
132
142
133 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
143 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
134
144
135 2007-09-06 Ville Vainio <vivainio@gmail.com>
145 2007-09-06 Ville Vainio <vivainio@gmail.com>
136
146
137 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
147 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
138 Callable aliases now pass the _ip as first arg. This breaks
148 Callable aliases now pass the _ip as first arg. This breaks
139 compatibility with earlier 0.8.2.svn series! (though they should
149 compatibility with earlier 0.8.2.svn series! (though they should
140 not have been in use yet outside these few extensions)
150 not have been in use yet outside these few extensions)
141
151
142 2007-09-05 Ville Vainio <vivainio@gmail.com>
152 2007-09-05 Ville Vainio <vivainio@gmail.com>
143
153
144 * external/mglob.py: expand('dirname') => ['dirname'], instead
154 * external/mglob.py: expand('dirname') => ['dirname'], instead
145 of ['dirname/foo','dirname/bar', ...].
155 of ['dirname/foo','dirname/bar', ...].
146
156
147 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
157 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
148 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
158 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
149 is useful for others as well).
159 is useful for others as well).
150
160
151 * iplib.py: on callable aliases (as opposed to old style aliases),
161 * iplib.py: on callable aliases (as opposed to old style aliases),
152 do var_expand() immediately, and use make_quoted_expr instead
162 do var_expand() immediately, and use make_quoted_expr instead
153 of hardcoded r"""
163 of hardcoded r"""
154
164
155 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
165 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
156 if not available load ipy_fsops.py for cp, mv, etc. replacements
166 if not available load ipy_fsops.py for cp, mv, etc. replacements
157
167
158 * OInspect.py, ipy_which.py: improve %which and obj? for callable
168 * OInspect.py, ipy_which.py: improve %which and obj? for callable
159 aliases
169 aliases
160
170
161 2007-09-04 Ville Vainio <vivainio@gmail.com>
171 2007-09-04 Ville Vainio <vivainio@gmail.com>
162
172
163 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
173 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
164 Relicensed under BSD with the authors approval.
174 Relicensed under BSD with the authors approval.
165
175
166 * ipmaker.py, usage.py: Remove %magic from default banner, improve
176 * ipmaker.py, usage.py: Remove %magic from default banner, improve
167 %quickref
177 %quickref
168
178
169 2007-09-03 Ville Vainio <vivainio@gmail.com>
179 2007-09-03 Ville Vainio <vivainio@gmail.com>
170
180
171 * Magic.py: %time now passes expression through prefilter,
181 * Magic.py: %time now passes expression through prefilter,
172 allowing IPython syntax.
182 allowing IPython syntax.
173
183
174 2007-09-01 Ville Vainio <vivainio@gmail.com>
184 2007-09-01 Ville Vainio <vivainio@gmail.com>
175
185
176 * ipmaker.py: Always show full traceback when newstyle config fails
186 * ipmaker.py: Always show full traceback when newstyle config fails
177
187
178 2007-08-27 Ville Vainio <vivainio@gmail.com>
188 2007-08-27 Ville Vainio <vivainio@gmail.com>
179
189
180 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
190 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
181
191
182 2007-08-26 Ville Vainio <vivainio@gmail.com>
192 2007-08-26 Ville Vainio <vivainio@gmail.com>
183
193
184 * ipmaker.py: Command line args have the highest priority again
194 * ipmaker.py: Command line args have the highest priority again
185
195
186 * iplib.py, ipmaker.py: -i command line argument now behaves as in
196 * iplib.py, ipmaker.py: -i command line argument now behaves as in
187 normal python, i.e. leaves the IPython session running after -c
197 normal python, i.e. leaves the IPython session running after -c
188 command or running a batch file from command line.
198 command or running a batch file from command line.
189
199
190 2007-08-22 Ville Vainio <vivainio@gmail.com>
200 2007-08-22 Ville Vainio <vivainio@gmail.com>
191
201
192 * iplib.py: no extra empty (last) line in raw hist w/ multiline
202 * iplib.py: no extra empty (last) line in raw hist w/ multiline
193 statements
203 statements
194
204
195 * logger.py: Fix bug where blank lines in history were not
205 * logger.py: Fix bug where blank lines in history were not
196 added until AFTER adding the current line; translated and raw
206 added until AFTER adding the current line; translated and raw
197 history should finally be in sync with prompt now.
207 history should finally be in sync with prompt now.
198
208
199 * ipy_completers.py: quick_completer now makes it easy to create
209 * ipy_completers.py: quick_completer now makes it easy to create
200 trivial custom completers
210 trivial custom completers
201
211
202 * clearcmd.py: shadow history compression & erasing, fixed input hist
212 * clearcmd.py: shadow history compression & erasing, fixed input hist
203 clearing.
213 clearing.
204
214
205 * envpersist.py, history.py: %env (sh profile only), %hist completers
215 * envpersist.py, history.py: %env (sh profile only), %hist completers
206
216
207 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
217 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
208 term title now include the drive letter, and always use / instead of
218 term title now include the drive letter, and always use / instead of
209 os.sep (as per recommended approach for win32 ipython in general).
219 os.sep (as per recommended approach for win32 ipython in general).
210
220
211 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
221 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
212 plain python scripts from ipykit command line by running
222 plain python scripts from ipykit command line by running
213 "py myscript.py", even w/o installed python.
223 "py myscript.py", even w/o installed python.
214
224
215 2007-08-21 Ville Vainio <vivainio@gmail.com>
225 2007-08-21 Ville Vainio <vivainio@gmail.com>
216
226
217 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
227 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
218 (for backwards compatibility)
228 (for backwards compatibility)
219
229
220 * history.py: switch back to %hist -t from %hist -r as default.
230 * history.py: switch back to %hist -t from %hist -r as default.
221 At least until raw history is fixed for good.
231 At least until raw history is fixed for good.
222
232
223 2007-08-20 Ville Vainio <vivainio@gmail.com>
233 2007-08-20 Ville Vainio <vivainio@gmail.com>
224
234
225 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
235 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
226 locate alias redeclarations etc. Also, avoid handling
236 locate alias redeclarations etc. Also, avoid handling
227 _ip.IP.alias_table directly, prefer using _ip.defalias.
237 _ip.IP.alias_table directly, prefer using _ip.defalias.
228
238
229
239
230 2007-08-15 Ville Vainio <vivainio@gmail.com>
240 2007-08-15 Ville Vainio <vivainio@gmail.com>
231
241
232 * prefilter.py: ! is now always served first
242 * prefilter.py: ! is now always served first
233
243
234 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
244 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
235
245
236 * IPython/iplib.py (safe_execfile): fix the SystemExit
246 * IPython/iplib.py (safe_execfile): fix the SystemExit
237 auto-suppression code to work in Python2.4 (the internal structure
247 auto-suppression code to work in Python2.4 (the internal structure
238 of that exception changed and I'd only tested the code with 2.5).
248 of that exception changed and I'd only tested the code with 2.5).
239 Bug reported by a SciPy attendee.
249 Bug reported by a SciPy attendee.
240
250
241 2007-08-13 Ville Vainio <vivainio@gmail.com>
251 2007-08-13 Ville Vainio <vivainio@gmail.com>
242
252
243 * prefilter.py: reverted !c:/bin/foo fix, made % in
253 * prefilter.py: reverted !c:/bin/foo fix, made % in
244 multiline specials work again
254 multiline specials work again
245
255
246 2007-08-13 Ville Vainio <vivainio@gmail.com>
256 2007-08-13 Ville Vainio <vivainio@gmail.com>
247
257
248 * prefilter.py: Take more care to special-case !, so that
258 * prefilter.py: Take more care to special-case !, so that
249 !c:/bin/foo.exe works.
259 !c:/bin/foo.exe works.
250
260
251 * setup.py: if we are building eggs, strip all docs and
261 * setup.py: if we are building eggs, strip all docs and
252 examples (it doesn't make sense to bytecompile examples,
262 examples (it doesn't make sense to bytecompile examples,
253 and docs would be in an awkward place anyway).
263 and docs would be in an awkward place anyway).
254
264
255 * Ryan Krauss' patch fixes start menu shortcuts when IPython
265 * Ryan Krauss' patch fixes start menu shortcuts when IPython
256 is installed into a directory that has spaces in the name.
266 is installed into a directory that has spaces in the name.
257
267
258 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
268 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
259
269
260 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
270 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
261 doctest profile and %doctest_mode, so they actually generate the
271 doctest profile and %doctest_mode, so they actually generate the
262 blank lines needed by doctest to separate individual tests.
272 blank lines needed by doctest to separate individual tests.
263
273
264 * IPython/iplib.py (safe_execfile): modify so that running code
274 * IPython/iplib.py (safe_execfile): modify so that running code
265 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
275 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
266 doesn't get a printed traceback. Any other value in sys.exit(),
276 doesn't get a printed traceback. Any other value in sys.exit(),
267 including the empty call, still generates a traceback. This
277 including the empty call, still generates a traceback. This
268 enables use of %run without having to pass '-e' for codes that
278 enables use of %run without having to pass '-e' for codes that
269 correctly set the exit status flag.
279 correctly set the exit status flag.
270
280
271 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
281 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
272
282
273 * IPython/iplib.py (InteractiveShell.post_config_initialization):
283 * IPython/iplib.py (InteractiveShell.post_config_initialization):
274 fix problems with doctests failing when run inside IPython due to
284 fix problems with doctests failing when run inside IPython due to
275 IPython's modifications of sys.displayhook.
285 IPython's modifications of sys.displayhook.
276
286
277 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
287 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
278
288
279 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
289 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
280 a string with names.
290 a string with names.
281
291
282 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
292 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
283
293
284 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
294 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
285 magic to toggle on/off the doctest pasting support without having
295 magic to toggle on/off the doctest pasting support without having
286 to leave a session to switch to a separate profile.
296 to leave a session to switch to a separate profile.
287
297
288 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
298 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
289
299
290 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
300 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
291 introduce a blank line between inputs, to conform to doctest
301 introduce a blank line between inputs, to conform to doctest
292 requirements.
302 requirements.
293
303
294 * IPython/OInspect.py (Inspector.pinfo): fix another part where
304 * IPython/OInspect.py (Inspector.pinfo): fix another part where
295 auto-generated docstrings for new-style classes were showing up.
305 auto-generated docstrings for new-style classes were showing up.
296
306
297 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
307 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
298
308
299 * api_changes: Add new file to track backward-incompatible
309 * api_changes: Add new file to track backward-incompatible
300 user-visible changes.
310 user-visible changes.
301
311
302 2007-08-06 Ville Vainio <vivainio@gmail.com>
312 2007-08-06 Ville Vainio <vivainio@gmail.com>
303
313
304 * ipmaker.py: fix bug where user_config_ns didn't exist at all
314 * ipmaker.py: fix bug where user_config_ns didn't exist at all
305 before all the config files were handled.
315 before all the config files were handled.
306
316
307 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
317 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
308
318
309 * IPython/irunner.py (RunnerFactory): Add new factory class for
319 * IPython/irunner.py (RunnerFactory): Add new factory class for
310 creating reusable runners based on filenames.
320 creating reusable runners based on filenames.
311
321
312 * IPython/Extensions/ipy_profile_doctest.py: New profile for
322 * IPython/Extensions/ipy_profile_doctest.py: New profile for
313 doctest support. It sets prompts/exceptions as similar to
323 doctest support. It sets prompts/exceptions as similar to
314 standard Python as possible, so that ipython sessions in this
324 standard Python as possible, so that ipython sessions in this
315 profile can be easily pasted as doctests with minimal
325 profile can be easily pasted as doctests with minimal
316 modifications. It also enables pasting of doctests from external
326 modifications. It also enables pasting of doctests from external
317 sources (even if they have leading whitespace), so that you can
327 sources (even if they have leading whitespace), so that you can
318 rerun doctests from existing sources.
328 rerun doctests from existing sources.
319
329
320 * IPython/iplib.py (_prefilter): fix a buglet where after entering
330 * IPython/iplib.py (_prefilter): fix a buglet where after entering
321 some whitespace, the prompt would become a continuation prompt
331 some whitespace, the prompt would become a continuation prompt
322 with no way of exiting it other than Ctrl-C. This fix brings us
332 with no way of exiting it other than Ctrl-C. This fix brings us
323 into conformity with how the default python prompt works.
333 into conformity with how the default python prompt works.
324
334
325 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
335 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
326 Add support for pasting not only lines that start with '>>>', but
336 Add support for pasting not only lines that start with '>>>', but
327 also with ' >>>'. That is, arbitrary whitespace can now precede
337 also with ' >>>'. That is, arbitrary whitespace can now precede
328 the prompts. This makes the system useful for pasting doctests
338 the prompts. This makes the system useful for pasting doctests
329 from docstrings back into a normal session.
339 from docstrings back into a normal session.
330
340
331 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
341 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
332
342
333 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
343 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
334 r1357, which had killed multiple invocations of an embedded
344 r1357, which had killed multiple invocations of an embedded
335 ipython (this means that example-embed has been broken for over 1
345 ipython (this means that example-embed has been broken for over 1
336 year!!!). Rather than possibly breaking the batch stuff for which
346 year!!!). Rather than possibly breaking the batch stuff for which
337 the code in iplib.py/interact was introduced, I worked around the
347 the code in iplib.py/interact was introduced, I worked around the
338 problem in the embedding class in Shell.py. We really need a
348 problem in the embedding class in Shell.py. We really need a
339 bloody test suite for this code, I'm sick of finding stuff that
349 bloody test suite for this code, I'm sick of finding stuff that
340 used to work breaking left and right every time I use an old
350 used to work breaking left and right every time I use an old
341 feature I hadn't touched in a few months.
351 feature I hadn't touched in a few months.
342 (kill_embedded): Add a new magic that only shows up in embedded
352 (kill_embedded): Add a new magic that only shows up in embedded
343 mode, to allow users to permanently deactivate an embedded instance.
353 mode, to allow users to permanently deactivate an embedded instance.
344
354
345 2007-08-01 Ville Vainio <vivainio@gmail.com>
355 2007-08-01 Ville Vainio <vivainio@gmail.com>
346
356
347 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
357 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
348 history gets out of sync on runlines (e.g. when running macros).
358 history gets out of sync on runlines (e.g. when running macros).
349
359
350 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
360 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
351
361
352 * IPython/Magic.py (magic_colors): fix win32-related error message
362 * IPython/Magic.py (magic_colors): fix win32-related error message
353 that could appear under *nix when readline was missing. Patch by
363 that could appear under *nix when readline was missing. Patch by
354 Scott Jackson, closes #175.
364 Scott Jackson, closes #175.
355
365
356 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
366 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
357
367
358 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
368 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
359 completer that it traits-aware, so that traits objects don't show
369 completer that it traits-aware, so that traits objects don't show
360 all of their internal attributes all the time.
370 all of their internal attributes all the time.
361
371
362 * IPython/genutils.py (dir2): moved this code from inside
372 * IPython/genutils.py (dir2): moved this code from inside
363 completer.py to expose it publicly, so I could use it in the
373 completer.py to expose it publicly, so I could use it in the
364 wildcards bugfix.
374 wildcards bugfix.
365
375
366 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
376 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
367 Stefan with Traits.
377 Stefan with Traits.
368
378
369 * IPython/completer.py (Completer.attr_matches): change internal
379 * IPython/completer.py (Completer.attr_matches): change internal
370 var name from 'object' to 'obj', since 'object' is now a builtin
380 var name from 'object' to 'obj', since 'object' is now a builtin
371 and this can lead to weird bugs if reusing this code elsewhere.
381 and this can lead to weird bugs if reusing this code elsewhere.
372
382
373 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
383 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
374
384
375 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
385 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
376 'foo?' and update the code to prevent printing of default
386 'foo?' and update the code to prevent printing of default
377 docstrings that started appearing after I added support for
387 docstrings that started appearing after I added support for
378 new-style classes. The approach I'm using isn't ideal (I just
388 new-style classes. The approach I'm using isn't ideal (I just
379 special-case those strings) but I'm not sure how to more robustly
389 special-case those strings) but I'm not sure how to more robustly
380 differentiate between truly user-written strings and Python's
390 differentiate between truly user-written strings and Python's
381 automatic ones.
391 automatic ones.
382
392
383 2007-07-09 Ville Vainio <vivainio@gmail.com>
393 2007-07-09 Ville Vainio <vivainio@gmail.com>
384
394
385 * completer.py: Applied Matthew Neeley's patch:
395 * completer.py: Applied Matthew Neeley's patch:
386 Dynamic attributes from trait_names and _getAttributeNames are added
396 Dynamic attributes from trait_names and _getAttributeNames are added
387 to the list of tab completions, but when this happens, the attribute
397 to the list of tab completions, but when this happens, the attribute
388 list is turned into a set, so the attributes are unordered when
398 list is turned into a set, so the attributes are unordered when
389 printed, which makes it hard to find the right completion. This patch
399 printed, which makes it hard to find the right completion. This patch
390 turns this set back into a list and sort it.
400 turns this set back into a list and sort it.
391
401
392 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
402 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
393
403
394 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
404 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
395 classes in various inspector functions.
405 classes in various inspector functions.
396
406
397 2007-06-28 Ville Vainio <vivainio@gmail.com>
407 2007-06-28 Ville Vainio <vivainio@gmail.com>
398
408
399 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
409 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
400 Implement "shadow" namespace, and callable aliases that reside there.
410 Implement "shadow" namespace, and callable aliases that reside there.
401 Use them by:
411 Use them by:
402
412
403 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
413 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
404
414
405 foo hello world
415 foo hello world
406 (gets translated to:)
416 (gets translated to:)
407 _sh.foo(r"""hello world""")
417 _sh.foo(r"""hello world""")
408
418
409 In practice, this kind of alias can take the role of a magic function
419 In practice, this kind of alias can take the role of a magic function
410
420
411 * New generic inspect_object, called on obj? and obj??
421 * New generic inspect_object, called on obj? and obj??
412
422
413 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
423 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
414
424
415 * IPython/ultraTB.py (findsource): fix a problem with
425 * IPython/ultraTB.py (findsource): fix a problem with
416 inspect.getfile that can cause crashes during traceback construction.
426 inspect.getfile that can cause crashes during traceback construction.
417
427
418 2007-06-14 Ville Vainio <vivainio@gmail.com>
428 2007-06-14 Ville Vainio <vivainio@gmail.com>
419
429
420 * iplib.py (handle_auto): Try to use ascii for printing "--->"
430 * iplib.py (handle_auto): Try to use ascii for printing "--->"
421 autocall rewrite indication, becausesometimes unicode fails to print
431 autocall rewrite indication, becausesometimes unicode fails to print
422 properly (and you get ' - - - '). Use plain uncoloured ---> for
432 properly (and you get ' - - - '). Use plain uncoloured ---> for
423 unicode.
433 unicode.
424
434
425 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
435 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
426
436
427 . pickleshare 'hash' commands (hget, hset, hcompress,
437 . pickleshare 'hash' commands (hget, hset, hcompress,
428 hdict) for efficient shadow history storage.
438 hdict) for efficient shadow history storage.
429
439
430 2007-06-13 Ville Vainio <vivainio@gmail.com>
440 2007-06-13 Ville Vainio <vivainio@gmail.com>
431
441
432 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
442 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
433 Added kw arg 'interactive', tell whether vars should be visible
443 Added kw arg 'interactive', tell whether vars should be visible
434 with %whos.
444 with %whos.
435
445
436 2007-06-11 Ville Vainio <vivainio@gmail.com>
446 2007-06-11 Ville Vainio <vivainio@gmail.com>
437
447
438 * pspersistence.py, Magic.py, iplib.py: directory history now saved
448 * pspersistence.py, Magic.py, iplib.py: directory history now saved
439 to db
449 to db
440
450
441 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
451 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
442 Also, it exits IPython immediately after evaluating the command (just like
452 Also, it exits IPython immediately after evaluating the command (just like
443 std python)
453 std python)
444
454
445 2007-06-05 Walter Doerwald <walter@livinglogic.de>
455 2007-06-05 Walter Doerwald <walter@livinglogic.de>
446
456
447 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
457 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
448 Python string and captures the output. (Idea and original patch by
458 Python string and captures the output. (Idea and original patch by
449 Stefan van der Walt)
459 Stefan van der Walt)
450
460
451 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
461 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
452
462
453 * IPython/ultraTB.py (VerboseTB.text): update printing of
463 * IPython/ultraTB.py (VerboseTB.text): update printing of
454 exception types for Python 2.5 (now all exceptions in the stdlib
464 exception types for Python 2.5 (now all exceptions in the stdlib
455 are new-style classes).
465 are new-style classes).
456
466
457 2007-05-31 Walter Doerwald <walter@livinglogic.de>
467 2007-05-31 Walter Doerwald <walter@livinglogic.de>
458
468
459 * IPython/Extensions/igrid.py: Add new commands refresh and
469 * IPython/Extensions/igrid.py: Add new commands refresh and
460 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
470 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
461 the iterator once (refresh) or after every x seconds (refresh_timer).
471 the iterator once (refresh) or after every x seconds (refresh_timer).
462 Add a working implementation of "searchexpression", where the text
472 Add a working implementation of "searchexpression", where the text
463 entered is not the text to search for, but an expression that must
473 entered is not the text to search for, but an expression that must
464 be true. Added display of shortcuts to the menu. Added commands "pickinput"
474 be true. Added display of shortcuts to the menu. Added commands "pickinput"
465 and "pickinputattr" that put the object or attribute under the cursor
475 and "pickinputattr" that put the object or attribute under the cursor
466 in the input line. Split the statusbar to be able to display the currently
476 in the input line. Split the statusbar to be able to display the currently
467 active refresh interval. (Patch by Nik Tautenhahn)
477 active refresh interval. (Patch by Nik Tautenhahn)
468
478
469 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
479 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
470
480
471 * fixing set_term_title to use ctypes as default
481 * fixing set_term_title to use ctypes as default
472
482
473 * fixing set_term_title fallback to work when curent dir
483 * fixing set_term_title fallback to work when curent dir
474 is on a windows network share
484 is on a windows network share
475
485
476 2007-05-28 Ville Vainio <vivainio@gmail.com>
486 2007-05-28 Ville Vainio <vivainio@gmail.com>
477
487
478 * %cpaste: strip + with > from left (diffs).
488 * %cpaste: strip + with > from left (diffs).
479
489
480 * iplib.py: Fix crash when readline not installed
490 * iplib.py: Fix crash when readline not installed
481
491
482 2007-05-26 Ville Vainio <vivainio@gmail.com>
492 2007-05-26 Ville Vainio <vivainio@gmail.com>
483
493
484 * generics.py: intruduce easy to extend result_display generic
494 * generics.py: intruduce easy to extend result_display generic
485 function (using simplegeneric.py).
495 function (using simplegeneric.py).
486
496
487 * Fixed the append functionality of %set.
497 * Fixed the append functionality of %set.
488
498
489 2007-05-25 Ville Vainio <vivainio@gmail.com>
499 2007-05-25 Ville Vainio <vivainio@gmail.com>
490
500
491 * New magic: %rep (fetch / run old commands from history)
501 * New magic: %rep (fetch / run old commands from history)
492
502
493 * New extension: mglob (%mglob magic), for powerful glob / find /filter
503 * New extension: mglob (%mglob magic), for powerful glob / find /filter
494 like functionality
504 like functionality
495
505
496 % maghistory.py: %hist -g PATTERM greps the history for pattern
506 % maghistory.py: %hist -g PATTERM greps the history for pattern
497
507
498 2007-05-24 Walter Doerwald <walter@livinglogic.de>
508 2007-05-24 Walter Doerwald <walter@livinglogic.de>
499
509
500 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
510 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
501 browse the IPython input history
511 browse the IPython input history
502
512
503 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
513 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
504 (mapped to "i") can be used to put the object under the curser in the input
514 (mapped to "i") can be used to put the object under the curser in the input
505 line. pickinputattr (mapped to "I") does the same for the attribute under
515 line. pickinputattr (mapped to "I") does the same for the attribute under
506 the cursor.
516 the cursor.
507
517
508 2007-05-24 Ville Vainio <vivainio@gmail.com>
518 2007-05-24 Ville Vainio <vivainio@gmail.com>
509
519
510 * Grand magic cleansing (changeset [2380]):
520 * Grand magic cleansing (changeset [2380]):
511
521
512 * Introduce ipy_legacy.py where the following magics were
522 * Introduce ipy_legacy.py where the following magics were
513 moved:
523 moved:
514
524
515 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
525 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
516
526
517 If you need them, either use default profile or "import ipy_legacy"
527 If you need them, either use default profile or "import ipy_legacy"
518 in your ipy_user_conf.py
528 in your ipy_user_conf.py
519
529
520 * Move sh and scipy profile to Extensions from UserConfig. this implies
530 * Move sh and scipy profile to Extensions from UserConfig. this implies
521 you should not edit them, but you don't need to run %upgrade when
531 you should not edit them, but you don't need to run %upgrade when
522 upgrading IPython anymore.
532 upgrading IPython anymore.
523
533
524 * %hist/%history now operates in "raw" mode by default. To get the old
534 * %hist/%history now operates in "raw" mode by default. To get the old
525 behaviour, run '%hist -n' (native mode).
535 behaviour, run '%hist -n' (native mode).
526
536
527 * split ipy_stock_completers.py to ipy_stock_completers.py and
537 * split ipy_stock_completers.py to ipy_stock_completers.py and
528 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
538 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
529 installed as default.
539 installed as default.
530
540
531 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
541 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
532 handling.
542 handling.
533
543
534 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
544 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
535 input if readline is available.
545 input if readline is available.
536
546
537 2007-05-23 Ville Vainio <vivainio@gmail.com>
547 2007-05-23 Ville Vainio <vivainio@gmail.com>
538
548
539 * macro.py: %store uses __getstate__ properly
549 * macro.py: %store uses __getstate__ properly
540
550
541 * exesetup.py: added new setup script for creating
551 * exesetup.py: added new setup script for creating
542 standalone IPython executables with py2exe (i.e.
552 standalone IPython executables with py2exe (i.e.
543 no python installation required).
553 no python installation required).
544
554
545 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
555 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
546 its place.
556 its place.
547
557
548 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
558 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
549
559
550 2007-05-21 Ville Vainio <vivainio@gmail.com>
560 2007-05-21 Ville Vainio <vivainio@gmail.com>
551
561
552 * platutil_win32.py (set_term_title): handle
562 * platutil_win32.py (set_term_title): handle
553 failure of 'title' system call properly.
563 failure of 'title' system call properly.
554
564
555 2007-05-17 Walter Doerwald <walter@livinglogic.de>
565 2007-05-17 Walter Doerwald <walter@livinglogic.de>
556
566
557 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
567 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
558 (Bug detected by Paul Mueller).
568 (Bug detected by Paul Mueller).
559
569
560 2007-05-16 Ville Vainio <vivainio@gmail.com>
570 2007-05-16 Ville Vainio <vivainio@gmail.com>
561
571
562 * ipy_profile_sci.py, ipython_win_post_install.py: Create
572 * ipy_profile_sci.py, ipython_win_post_install.py: Create
563 new "sci" profile, effectively a modern version of the old
573 new "sci" profile, effectively a modern version of the old
564 "scipy" profile (which is now slated for deprecation).
574 "scipy" profile (which is now slated for deprecation).
565
575
566 2007-05-15 Ville Vainio <vivainio@gmail.com>
576 2007-05-15 Ville Vainio <vivainio@gmail.com>
567
577
568 * pycolorize.py, pycolor.1: Paul Mueller's patches that
578 * pycolorize.py, pycolor.1: Paul Mueller's patches that
569 make pycolorize read input from stdin when run without arguments.
579 make pycolorize read input from stdin when run without arguments.
570
580
571 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
581 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
572
582
573 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
583 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
574 it in sh profile (instead of ipy_system_conf.py).
584 it in sh profile (instead of ipy_system_conf.py).
575
585
576 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
586 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
577 aliases are now lower case on windows (MyCommand.exe => mycommand).
587 aliases are now lower case on windows (MyCommand.exe => mycommand).
578
588
579 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
589 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
580 Macros are now callable objects that inherit from ipapi.IPyAutocall,
590 Macros are now callable objects that inherit from ipapi.IPyAutocall,
581 i.e. get autocalled regardless of system autocall setting.
591 i.e. get autocalled regardless of system autocall setting.
582
592
583 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
593 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
584
594
585 * IPython/rlineimpl.py: check for clear_history in readline and
595 * IPython/rlineimpl.py: check for clear_history in readline and
586 make it a dummy no-op if not available. This function isn't
596 make it a dummy no-op if not available. This function isn't
587 guaranteed to be in the API and appeared in Python 2.4, so we need
597 guaranteed to be in the API and appeared in Python 2.4, so we need
588 to check it ourselves. Also, clean up this file quite a bit.
598 to check it ourselves. Also, clean up this file quite a bit.
589
599
590 * ipython.1: update man page and full manual with information
600 * ipython.1: update man page and full manual with information
591 about threads (remove outdated warning). Closes #151.
601 about threads (remove outdated warning). Closes #151.
592
602
593 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
603 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
594
604
595 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
605 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
596 in trunk (note that this made it into the 0.8.1 release already,
606 in trunk (note that this made it into the 0.8.1 release already,
597 but the changelogs didn't get coordinated). Many thanks to Gael
607 but the changelogs didn't get coordinated). Many thanks to Gael
598 Varoquaux <gael.varoquaux-AT-normalesup.org>
608 Varoquaux <gael.varoquaux-AT-normalesup.org>
599
609
600 2007-05-09 *** Released version 0.8.1
610 2007-05-09 *** Released version 0.8.1
601
611
602 2007-05-10 Walter Doerwald <walter@livinglogic.de>
612 2007-05-10 Walter Doerwald <walter@livinglogic.de>
603
613
604 * IPython/Extensions/igrid.py: Incorporate html help into
614 * IPython/Extensions/igrid.py: Incorporate html help into
605 the module, so we don't have to search for the file.
615 the module, so we don't have to search for the file.
606
616
607 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
617 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
608
618
609 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
619 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
610
620
611 2007-04-30 Ville Vainio <vivainio@gmail.com>
621 2007-04-30 Ville Vainio <vivainio@gmail.com>
612
622
613 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
623 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
614 user has illegal (non-ascii) home directory name
624 user has illegal (non-ascii) home directory name
615
625
616 2007-04-27 Ville Vainio <vivainio@gmail.com>
626 2007-04-27 Ville Vainio <vivainio@gmail.com>
617
627
618 * platutils_win32.py: implement set_term_title for windows
628 * platutils_win32.py: implement set_term_title for windows
619
629
620 * Update version number
630 * Update version number
621
631
622 * ipy_profile_sh.py: more informative prompt (2 dir levels)
632 * ipy_profile_sh.py: more informative prompt (2 dir levels)
623
633
624 2007-04-26 Walter Doerwald <walter@livinglogic.de>
634 2007-04-26 Walter Doerwald <walter@livinglogic.de>
625
635
626 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
636 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
627 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
637 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
628 bug discovered by Ville).
638 bug discovered by Ville).
629
639
630 2007-04-26 Ville Vainio <vivainio@gmail.com>
640 2007-04-26 Ville Vainio <vivainio@gmail.com>
631
641
632 * Extensions/ipy_completers.py: Olivier's module completer now
642 * Extensions/ipy_completers.py: Olivier's module completer now
633 saves the list of root modules if it takes > 4 secs on the first run.
643 saves the list of root modules if it takes > 4 secs on the first run.
634
644
635 * Magic.py (%rehashx): %rehashx now clears the completer cache
645 * Magic.py (%rehashx): %rehashx now clears the completer cache
636
646
637
647
638 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
648 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
639
649
640 * ipython.el: fix incorrect color scheme, reported by Stefan.
650 * ipython.el: fix incorrect color scheme, reported by Stefan.
641 Closes #149.
651 Closes #149.
642
652
643 * IPython/PyColorize.py (Parser.format2): fix state-handling
653 * IPython/PyColorize.py (Parser.format2): fix state-handling
644 logic. I still don't like how that code handles state, but at
654 logic. I still don't like how that code handles state, but at
645 least now it should be correct, if inelegant. Closes #146.
655 least now it should be correct, if inelegant. Closes #146.
646
656
647 2007-04-25 Ville Vainio <vivainio@gmail.com>
657 2007-04-25 Ville Vainio <vivainio@gmail.com>
648
658
649 * Extensions/ipy_which.py: added extension for %which magic, works
659 * Extensions/ipy_which.py: added extension for %which magic, works
650 a lot like unix 'which' but also finds and expands aliases, and
660 a lot like unix 'which' but also finds and expands aliases, and
651 allows wildcards.
661 allows wildcards.
652
662
653 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
663 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
654 as opposed to returning nothing.
664 as opposed to returning nothing.
655
665
656 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
666 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
657 ipy_stock_completers on default profile, do import on sh profile.
667 ipy_stock_completers on default profile, do import on sh profile.
658
668
659 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
669 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
660
670
661 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
671 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
662 like ipython.py foo.py which raised a IndexError.
672 like ipython.py foo.py which raised a IndexError.
663
673
664 2007-04-21 Ville Vainio <vivainio@gmail.com>
674 2007-04-21 Ville Vainio <vivainio@gmail.com>
665
675
666 * Extensions/ipy_extutil.py: added extension to manage other ipython
676 * Extensions/ipy_extutil.py: added extension to manage other ipython
667 extensions. Now only supports 'ls' == list extensions.
677 extensions. Now only supports 'ls' == list extensions.
668
678
669 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
679 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
670
680
671 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
681 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
672 would prevent use of the exception system outside of a running
682 would prevent use of the exception system outside of a running
673 IPython instance.
683 IPython instance.
674
684
675 2007-04-20 Ville Vainio <vivainio@gmail.com>
685 2007-04-20 Ville Vainio <vivainio@gmail.com>
676
686
677 * Extensions/ipy_render.py: added extension for easy
687 * Extensions/ipy_render.py: added extension for easy
678 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
688 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
679 'Iptl' template notation,
689 'Iptl' template notation,
680
690
681 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
691 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
682 safer & faster 'import' completer.
692 safer & faster 'import' completer.
683
693
684 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
694 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
685 and _ip.defalias(name, command).
695 and _ip.defalias(name, command).
686
696
687 * Extensions/ipy_exportdb.py: New extension for exporting all the
697 * Extensions/ipy_exportdb.py: New extension for exporting all the
688 %store'd data in a portable format (normal ipapi calls like
698 %store'd data in a portable format (normal ipapi calls like
689 defmacro() etc.)
699 defmacro() etc.)
690
700
691 2007-04-19 Ville Vainio <vivainio@gmail.com>
701 2007-04-19 Ville Vainio <vivainio@gmail.com>
692
702
693 * upgrade_dir.py: skip junk files like *.pyc
703 * upgrade_dir.py: skip junk files like *.pyc
694
704
695 * Release.py: version number to 0.8.1
705 * Release.py: version number to 0.8.1
696
706
697 2007-04-18 Ville Vainio <vivainio@gmail.com>
707 2007-04-18 Ville Vainio <vivainio@gmail.com>
698
708
699 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
709 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
700 and later on win32.
710 and later on win32.
701
711
702 2007-04-16 Ville Vainio <vivainio@gmail.com>
712 2007-04-16 Ville Vainio <vivainio@gmail.com>
703
713
704 * iplib.py (showtraceback): Do not crash when running w/o readline.
714 * iplib.py (showtraceback): Do not crash when running w/o readline.
705
715
706 2007-04-12 Walter Doerwald <walter@livinglogic.de>
716 2007-04-12 Walter Doerwald <walter@livinglogic.de>
707
717
708 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
718 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
709 sorted (case sensitive with files and dirs mixed).
719 sorted (case sensitive with files and dirs mixed).
710
720
711 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
721 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
712
722
713 * IPython/Release.py (version): Open trunk for 0.8.1 development.
723 * IPython/Release.py (version): Open trunk for 0.8.1 development.
714
724
715 2007-04-10 *** Released version 0.8.0
725 2007-04-10 *** Released version 0.8.0
716
726
717 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
727 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
718
728
719 * Tag 0.8.0 for release.
729 * Tag 0.8.0 for release.
720
730
721 * IPython/iplib.py (reloadhist): add API function to cleanly
731 * IPython/iplib.py (reloadhist): add API function to cleanly
722 reload the readline history, which was growing inappropriately on
732 reload the readline history, which was growing inappropriately on
723 every %run call.
733 every %run call.
724
734
725 * win32_manual_post_install.py (run): apply last part of Nicolas
735 * win32_manual_post_install.py (run): apply last part of Nicolas
726 Pernetty's patch (I'd accidentally applied it in a different
736 Pernetty's patch (I'd accidentally applied it in a different
727 directory and this particular file didn't get patched).
737 directory and this particular file didn't get patched).
728
738
729 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
739 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
730
740
731 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
741 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
732 find the main thread id and use the proper API call. Thanks to
742 find the main thread id and use the proper API call. Thanks to
733 Stefan for the fix.
743 Stefan for the fix.
734
744
735 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
745 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
736 unit tests to reflect fixed ticket #52, and add more tests sent by
746 unit tests to reflect fixed ticket #52, and add more tests sent by
737 him.
747 him.
738
748
739 * IPython/iplib.py (raw_input): restore the readline completer
749 * IPython/iplib.py (raw_input): restore the readline completer
740 state on every input, in case third-party code messed it up.
750 state on every input, in case third-party code messed it up.
741 (_prefilter): revert recent addition of early-escape checks which
751 (_prefilter): revert recent addition of early-escape checks which
742 prevent many valid alias calls from working.
752 prevent many valid alias calls from working.
743
753
744 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
754 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
745 flag for sigint handler so we don't run a full signal() call on
755 flag for sigint handler so we don't run a full signal() call on
746 each runcode access.
756 each runcode access.
747
757
748 * IPython/Magic.py (magic_whos): small improvement to diagnostic
758 * IPython/Magic.py (magic_whos): small improvement to diagnostic
749 message.
759 message.
750
760
751 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
761 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
752
762
753 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
763 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
754 asynchronous exceptions working, i.e., Ctrl-C can actually
764 asynchronous exceptions working, i.e., Ctrl-C can actually
755 interrupt long-running code in the multithreaded shells.
765 interrupt long-running code in the multithreaded shells.
756
766
757 This is using Tomer Filiba's great ctypes-based trick:
767 This is using Tomer Filiba's great ctypes-based trick:
758 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
768 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
759 this in the past, but hadn't been able to make it work before. So
769 this in the past, but hadn't been able to make it work before. So
760 far it looks like it's actually running, but this needs more
770 far it looks like it's actually running, but this needs more
761 testing. If it really works, I'll be *very* happy, and we'll owe
771 testing. If it really works, I'll be *very* happy, and we'll owe
762 a huge thank you to Tomer. My current implementation is ugly,
772 a huge thank you to Tomer. My current implementation is ugly,
763 hackish and uses nasty globals, but I don't want to try and clean
773 hackish and uses nasty globals, but I don't want to try and clean
764 anything up until we know if it actually works.
774 anything up until we know if it actually works.
765
775
766 NOTE: this feature needs ctypes to work. ctypes is included in
776 NOTE: this feature needs ctypes to work. ctypes is included in
767 Python2.5, but 2.4 users will need to manually install it. This
777 Python2.5, but 2.4 users will need to manually install it. This
768 feature makes multi-threaded shells so much more usable that it's
778 feature makes multi-threaded shells so much more usable that it's
769 a minor price to pay (ctypes is very easy to install, already a
779 a minor price to pay (ctypes is very easy to install, already a
770 requirement for win32 and available in major linux distros).
780 requirement for win32 and available in major linux distros).
771
781
772 2007-04-04 Ville Vainio <vivainio@gmail.com>
782 2007-04-04 Ville Vainio <vivainio@gmail.com>
773
783
774 * Extensions/ipy_completers.py, ipy_stock_completers.py:
784 * Extensions/ipy_completers.py, ipy_stock_completers.py:
775 Moved implementations of 'bundled' completers to ipy_completers.py,
785 Moved implementations of 'bundled' completers to ipy_completers.py,
776 they are only enabled in ipy_stock_completers.py.
786 they are only enabled in ipy_stock_completers.py.
777
787
778 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
788 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
779
789
780 * IPython/PyColorize.py (Parser.format2): Fix identation of
790 * IPython/PyColorize.py (Parser.format2): Fix identation of
781 colorzied output and return early if color scheme is NoColor, to
791 colorzied output and return early if color scheme is NoColor, to
782 avoid unnecessary and expensive tokenization. Closes #131.
792 avoid unnecessary and expensive tokenization. Closes #131.
783
793
784 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
794 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
785
795
786 * IPython/Debugger.py: disable the use of pydb version 1.17. It
796 * IPython/Debugger.py: disable the use of pydb version 1.17. It
787 has a critical bug (a missing import that makes post-mortem not
797 has a critical bug (a missing import that makes post-mortem not
788 work at all). Unfortunately as of this time, this is the version
798 work at all). Unfortunately as of this time, this is the version
789 shipped with Ubuntu Edgy, so quite a few people have this one. I
799 shipped with Ubuntu Edgy, so quite a few people have this one. I
790 hope Edgy will update to a more recent package.
800 hope Edgy will update to a more recent package.
791
801
792 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
802 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
793
803
794 * IPython/iplib.py (_prefilter): close #52, second part of a patch
804 * IPython/iplib.py (_prefilter): close #52, second part of a patch
795 set by Stefan (only the first part had been applied before).
805 set by Stefan (only the first part had been applied before).
796
806
797 * IPython/Extensions/ipy_stock_completers.py (module_completer):
807 * IPython/Extensions/ipy_stock_completers.py (module_completer):
798 remove usage of the dangerous pkgutil.walk_packages(). See
808 remove usage of the dangerous pkgutil.walk_packages(). See
799 details in comments left in the code.
809 details in comments left in the code.
800
810
801 * IPython/Magic.py (magic_whos): add support for numpy arrays
811 * IPython/Magic.py (magic_whos): add support for numpy arrays
802 similar to what we had for Numeric.
812 similar to what we had for Numeric.
803
813
804 * IPython/completer.py (IPCompleter.complete): extend the
814 * IPython/completer.py (IPCompleter.complete): extend the
805 complete() call API to support completions by other mechanisms
815 complete() call API to support completions by other mechanisms
806 than readline. Closes #109.
816 than readline. Closes #109.
807
817
808 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
818 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
809 protect against a bug in Python's execfile(). Closes #123.
819 protect against a bug in Python's execfile(). Closes #123.
810
820
811 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
821 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
812
822
813 * IPython/iplib.py (split_user_input): ensure that when splitting
823 * IPython/iplib.py (split_user_input): ensure that when splitting
814 user input, the part that can be treated as a python name is pure
824 user input, the part that can be treated as a python name is pure
815 ascii (Python identifiers MUST be pure ascii). Part of the
825 ascii (Python identifiers MUST be pure ascii). Part of the
816 ongoing Unicode support work.
826 ongoing Unicode support work.
817
827
818 * IPython/Prompts.py (prompt_specials_color): Add \N for the
828 * IPython/Prompts.py (prompt_specials_color): Add \N for the
819 actual prompt number, without any coloring. This allows users to
829 actual prompt number, without any coloring. This allows users to
820 produce numbered prompts with their own colors. Added after a
830 produce numbered prompts with their own colors. Added after a
821 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
831 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
822
832
823 2007-03-31 Walter Doerwald <walter@livinglogic.de>
833 2007-03-31 Walter Doerwald <walter@livinglogic.de>
824
834
825 * IPython/Extensions/igrid.py: Map the return key
835 * IPython/Extensions/igrid.py: Map the return key
826 to enter() and shift-return to enterattr().
836 to enter() and shift-return to enterattr().
827
837
828 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
838 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
829
839
830 * IPython/Magic.py (magic_psearch): add unicode support by
840 * IPython/Magic.py (magic_psearch): add unicode support by
831 encoding to ascii the input, since this routine also only deals
841 encoding to ascii the input, since this routine also only deals
832 with valid Python names. Fixes a bug reported by Stefan.
842 with valid Python names. Fixes a bug reported by Stefan.
833
843
834 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
844 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
835
845
836 * IPython/Magic.py (_inspect): convert unicode input into ascii
846 * IPython/Magic.py (_inspect): convert unicode input into ascii
837 before trying to evaluate it as a Python identifier. This fixes a
847 before trying to evaluate it as a Python identifier. This fixes a
838 problem that the new unicode support had introduced when analyzing
848 problem that the new unicode support had introduced when analyzing
839 long definition lines for functions.
849 long definition lines for functions.
840
850
841 2007-03-24 Walter Doerwald <walter@livinglogic.de>
851 2007-03-24 Walter Doerwald <walter@livinglogic.de>
842
852
843 * IPython/Extensions/igrid.py: Fix picking. Using
853 * IPython/Extensions/igrid.py: Fix picking. Using
844 igrid with wxPython 2.6 and -wthread should work now.
854 igrid with wxPython 2.6 and -wthread should work now.
845 igrid.display() simply tries to create a frame without
855 igrid.display() simply tries to create a frame without
846 an application. Only if this fails an application is created.
856 an application. Only if this fails an application is created.
847
857
848 2007-03-23 Walter Doerwald <walter@livinglogic.de>
858 2007-03-23 Walter Doerwald <walter@livinglogic.de>
849
859
850 * IPython/Extensions/path.py: Updated to version 2.2.
860 * IPython/Extensions/path.py: Updated to version 2.2.
851
861
852 2007-03-23 Ville Vainio <vivainio@gmail.com>
862 2007-03-23 Ville Vainio <vivainio@gmail.com>
853
863
854 * iplib.py: recursive alias expansion now works better, so that
864 * iplib.py: recursive alias expansion now works better, so that
855 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
865 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
856 doesn't trip up the process, if 'd' has been aliased to 'ls'.
866 doesn't trip up the process, if 'd' has been aliased to 'ls'.
857
867
858 * Extensions/ipy_gnuglobal.py added, provides %global magic
868 * Extensions/ipy_gnuglobal.py added, provides %global magic
859 for users of http://www.gnu.org/software/global
869 for users of http://www.gnu.org/software/global
860
870
861 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
871 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
862 Closes #52. Patch by Stefan van der Walt.
872 Closes #52. Patch by Stefan van der Walt.
863
873
864 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
874 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
865
875
866 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
876 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
867 respect the __file__ attribute when using %run. Thanks to a bug
877 respect the __file__ attribute when using %run. Thanks to a bug
868 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
878 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
869
879
870 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
880 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
871
881
872 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
882 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
873 input. Patch sent by Stefan.
883 input. Patch sent by Stefan.
874
884
875 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
885 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
876 * IPython/Extensions/ipy_stock_completer.py
886 * IPython/Extensions/ipy_stock_completer.py
877 shlex_split, fix bug in shlex_split. len function
887 shlex_split, fix bug in shlex_split. len function
878 call was missing an if statement. Caused shlex_split to
888 call was missing an if statement. Caused shlex_split to
879 sometimes return "" as last element.
889 sometimes return "" as last element.
880
890
881 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
891 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
882
892
883 * IPython/completer.py
893 * IPython/completer.py
884 (IPCompleter.file_matches.single_dir_expand): fix a problem
894 (IPCompleter.file_matches.single_dir_expand): fix a problem
885 reported by Stefan, where directories containign a single subdir
895 reported by Stefan, where directories containign a single subdir
886 would be completed too early.
896 would be completed too early.
887
897
888 * IPython/Shell.py (_load_pylab): Make the execution of 'from
898 * IPython/Shell.py (_load_pylab): Make the execution of 'from
889 pylab import *' when -pylab is given be optional. A new flag,
899 pylab import *' when -pylab is given be optional. A new flag,
890 pylab_import_all controls this behavior, the default is True for
900 pylab_import_all controls this behavior, the default is True for
891 backwards compatibility.
901 backwards compatibility.
892
902
893 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
903 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
894 modified) R. Bernstein's patch for fully syntax highlighted
904 modified) R. Bernstein's patch for fully syntax highlighted
895 tracebacks. The functionality is also available under ultraTB for
905 tracebacks. The functionality is also available under ultraTB for
896 non-ipython users (someone using ultraTB but outside an ipython
906 non-ipython users (someone using ultraTB but outside an ipython
897 session). They can select the color scheme by setting the
907 session). They can select the color scheme by setting the
898 module-level global DEFAULT_SCHEME. The highlight functionality
908 module-level global DEFAULT_SCHEME. The highlight functionality
899 also works when debugging.
909 also works when debugging.
900
910
901 * IPython/genutils.py (IOStream.close): small patch by
911 * IPython/genutils.py (IOStream.close): small patch by
902 R. Bernstein for improved pydb support.
912 R. Bernstein for improved pydb support.
903
913
904 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
914 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
905 DaveS <davls@telus.net> to improve support of debugging under
915 DaveS <davls@telus.net> to improve support of debugging under
906 NTEmacs, including improved pydb behavior.
916 NTEmacs, including improved pydb behavior.
907
917
908 * IPython/Magic.py (magic_prun): Fix saving of profile info for
918 * IPython/Magic.py (magic_prun): Fix saving of profile info for
909 Python 2.5, where the stats object API changed a little. Thanks
919 Python 2.5, where the stats object API changed a little. Thanks
910 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
920 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
911
921
912 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
922 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
913 Pernetty's patch to improve support for (X)Emacs under Win32.
923 Pernetty's patch to improve support for (X)Emacs under Win32.
914
924
915 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
925 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
916
926
917 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
927 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
918 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
928 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
919 a report by Nik Tautenhahn.
929 a report by Nik Tautenhahn.
920
930
921 2007-03-16 Walter Doerwald <walter@livinglogic.de>
931 2007-03-16 Walter Doerwald <walter@livinglogic.de>
922
932
923 * setup.py: Add the igrid help files to the list of data files
933 * setup.py: Add the igrid help files to the list of data files
924 to be installed alongside igrid.
934 to be installed alongside igrid.
925 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
935 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
926 Show the input object of the igrid browser as the window tile.
936 Show the input object of the igrid browser as the window tile.
927 Show the object the cursor is on in the statusbar.
937 Show the object the cursor is on in the statusbar.
928
938
929 2007-03-15 Ville Vainio <vivainio@gmail.com>
939 2007-03-15 Ville Vainio <vivainio@gmail.com>
930
940
931 * Extensions/ipy_stock_completers.py: Fixed exception
941 * Extensions/ipy_stock_completers.py: Fixed exception
932 on mismatching quotes in %run completer. Patch by
942 on mismatching quotes in %run completer. Patch by
933 Jorgen Stenarson. Closes #127.
943 Jorgen Stenarson. Closes #127.
934
944
935 2007-03-14 Ville Vainio <vivainio@gmail.com>
945 2007-03-14 Ville Vainio <vivainio@gmail.com>
936
946
937 * Extensions/ext_rehashdir.py: Do not do auto_alias
947 * Extensions/ext_rehashdir.py: Do not do auto_alias
938 in %rehashdir, it clobbers %store'd aliases.
948 in %rehashdir, it clobbers %store'd aliases.
939
949
940 * UserConfig/ipy_profile_sh.py: envpersist.py extension
950 * UserConfig/ipy_profile_sh.py: envpersist.py extension
941 (beefed up %env) imported for sh profile.
951 (beefed up %env) imported for sh profile.
942
952
943 2007-03-10 Walter Doerwald <walter@livinglogic.de>
953 2007-03-10 Walter Doerwald <walter@livinglogic.de>
944
954
945 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
955 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
946 as the default browser.
956 as the default browser.
947 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
957 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
948 As igrid displays all attributes it ever encounters, fetch() (which has
958 As igrid displays all attributes it ever encounters, fetch() (which has
949 been renamed to _fetch()) doesn't have to recalculate the display attributes
959 been renamed to _fetch()) doesn't have to recalculate the display attributes
950 every time a new item is fetched. This should speed up scrolling.
960 every time a new item is fetched. This should speed up scrolling.
951
961
952 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
962 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
953
963
954 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
964 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
955 Schmolck's recently reported tab-completion bug (my previous one
965 Schmolck's recently reported tab-completion bug (my previous one
956 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
966 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
957
967
958 2007-03-09 Walter Doerwald <walter@livinglogic.de>
968 2007-03-09 Walter Doerwald <walter@livinglogic.de>
959
969
960 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
970 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
961 Close help window if exiting igrid.
971 Close help window if exiting igrid.
962
972
963 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
973 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
964
974
965 * IPython/Extensions/ipy_defaults.py: Check if readline is available
975 * IPython/Extensions/ipy_defaults.py: Check if readline is available
966 before calling functions from readline.
976 before calling functions from readline.
967
977
968 2007-03-02 Walter Doerwald <walter@livinglogic.de>
978 2007-03-02 Walter Doerwald <walter@livinglogic.de>
969
979
970 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
980 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
971 igrid is a wxPython-based display object for ipipe. If your system has
981 igrid is a wxPython-based display object for ipipe. If your system has
972 wx installed igrid will be the default display. Without wx ipipe falls
982 wx installed igrid will be the default display. Without wx ipipe falls
973 back to ibrowse (which needs curses). If no curses is installed ipipe
983 back to ibrowse (which needs curses). If no curses is installed ipipe
974 falls back to idump.
984 falls back to idump.
975
985
976 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
986 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
977
987
978 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
988 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
979 my changes from yesterday, they introduced bugs. Will reactivate
989 my changes from yesterday, they introduced bugs. Will reactivate
980 once I get a correct solution, which will be much easier thanks to
990 once I get a correct solution, which will be much easier thanks to
981 Dan Milstein's new prefilter test suite.
991 Dan Milstein's new prefilter test suite.
982
992
983 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
993 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
984
994
985 * IPython/iplib.py (split_user_input): fix input splitting so we
995 * IPython/iplib.py (split_user_input): fix input splitting so we
986 don't attempt attribute accesses on things that can't possibly be
996 don't attempt attribute accesses on things that can't possibly be
987 valid Python attributes. After a bug report by Alex Schmolck.
997 valid Python attributes. After a bug report by Alex Schmolck.
988 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
998 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
989 %magic with explicit % prefix.
999 %magic with explicit % prefix.
990
1000
991 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
1001 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
992
1002
993 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
1003 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
994 avoid a DeprecationWarning from GTK.
1004 avoid a DeprecationWarning from GTK.
995
1005
996 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
1006 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
997
1007
998 * IPython/genutils.py (clock): I modified clock() to return total
1008 * IPython/genutils.py (clock): I modified clock() to return total
999 time, user+system. This is a more commonly needed metric. I also
1009 time, user+system. This is a more commonly needed metric. I also
1000 introduced the new clocku/clocks to get only user/system time if
1010 introduced the new clocku/clocks to get only user/system time if
1001 one wants those instead.
1011 one wants those instead.
1002
1012
1003 ***WARNING: API CHANGE*** clock() used to return only user time,
1013 ***WARNING: API CHANGE*** clock() used to return only user time,
1004 so if you want exactly the same results as before, use clocku
1014 so if you want exactly the same results as before, use clocku
1005 instead.
1015 instead.
1006
1016
1007 2007-02-22 Ville Vainio <vivainio@gmail.com>
1017 2007-02-22 Ville Vainio <vivainio@gmail.com>
1008
1018
1009 * IPython/Extensions/ipy_p4.py: Extension for improved
1019 * IPython/Extensions/ipy_p4.py: Extension for improved
1010 p4 (perforce version control system) experience.
1020 p4 (perforce version control system) experience.
1011 Adds %p4 magic with p4 command completion and
1021 Adds %p4 magic with p4 command completion and
1012 automatic -G argument (marshall output as python dict)
1022 automatic -G argument (marshall output as python dict)
1013
1023
1014 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
1024 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
1015
1025
1016 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
1026 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
1017 stop marks.
1027 stop marks.
1018 (ClearingMixin): a simple mixin to easily make a Demo class clear
1028 (ClearingMixin): a simple mixin to easily make a Demo class clear
1019 the screen in between blocks and have empty marquees. The
1029 the screen in between blocks and have empty marquees. The
1020 ClearDemo and ClearIPDemo classes that use it are included.
1030 ClearDemo and ClearIPDemo classes that use it are included.
1021
1031
1022 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
1032 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
1023
1033
1024 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
1034 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
1025 protect against exceptions at Python shutdown time. Patch
1035 protect against exceptions at Python shutdown time. Patch
1026 sumbmitted to upstream.
1036 sumbmitted to upstream.
1027
1037
1028 2007-02-14 Walter Doerwald <walter@livinglogic.de>
1038 2007-02-14 Walter Doerwald <walter@livinglogic.de>
1029
1039
1030 * IPython/Extensions/ibrowse.py: If entering the first object level
1040 * IPython/Extensions/ibrowse.py: If entering the first object level
1031 (i.e. the object for which the browser has been started) fails,
1041 (i.e. the object for which the browser has been started) fails,
1032 now the error is raised directly (aborting the browser) instead of
1042 now the error is raised directly (aborting the browser) instead of
1033 running into an empty levels list later.
1043 running into an empty levels list later.
1034
1044
1035 2007-02-03 Walter Doerwald <walter@livinglogic.de>
1045 2007-02-03 Walter Doerwald <walter@livinglogic.de>
1036
1046
1037 * IPython/Extensions/ipipe.py: Add an xrepr implementation
1047 * IPython/Extensions/ipipe.py: Add an xrepr implementation
1038 for the noitem object.
1048 for the noitem object.
1039
1049
1040 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
1050 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
1041
1051
1042 * IPython/completer.py (Completer.attr_matches): Fix small
1052 * IPython/completer.py (Completer.attr_matches): Fix small
1043 tab-completion bug with Enthought Traits objects with units.
1053 tab-completion bug with Enthought Traits objects with units.
1044 Thanks to a bug report by Tom Denniston
1054 Thanks to a bug report by Tom Denniston
1045 <tom.denniston-AT-alum.dartmouth.org>.
1055 <tom.denniston-AT-alum.dartmouth.org>.
1046
1056
1047 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
1057 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
1048
1058
1049 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
1059 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
1050 bug where only .ipy or .py would be completed. Once the first
1060 bug where only .ipy or .py would be completed. Once the first
1051 argument to %run has been given, all completions are valid because
1061 argument to %run has been given, all completions are valid because
1052 they are the arguments to the script, which may well be non-python
1062 they are the arguments to the script, which may well be non-python
1053 filenames.
1063 filenames.
1054
1064
1055 * IPython/irunner.py (InteractiveRunner.run_source): major updates
1065 * IPython/irunner.py (InteractiveRunner.run_source): major updates
1056 to irunner to allow it to correctly support real doctesting of
1066 to irunner to allow it to correctly support real doctesting of
1057 out-of-process ipython code.
1067 out-of-process ipython code.
1058
1068
1059 * IPython/Magic.py (magic_cd): Make the setting of the terminal
1069 * IPython/Magic.py (magic_cd): Make the setting of the terminal
1060 title an option (-noterm_title) because it completely breaks
1070 title an option (-noterm_title) because it completely breaks
1061 doctesting.
1071 doctesting.
1062
1072
1063 * IPython/demo.py: fix IPythonDemo class that was not actually working.
1073 * IPython/demo.py: fix IPythonDemo class that was not actually working.
1064
1074
1065 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
1075 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
1066
1076
1067 * IPython/irunner.py (main): fix small bug where extensions were
1077 * IPython/irunner.py (main): fix small bug where extensions were
1068 not being correctly recognized.
1078 not being correctly recognized.
1069
1079
1070 2007-01-23 Walter Doerwald <walter@livinglogic.de>
1080 2007-01-23 Walter Doerwald <walter@livinglogic.de>
1071
1081
1072 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
1082 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
1073 a string containing a single line yields the string itself as the
1083 a string containing a single line yields the string itself as the
1074 only item.
1084 only item.
1075
1085
1076 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
1086 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
1077 object if it's the same as the one on the last level (This avoids
1087 object if it's the same as the one on the last level (This avoids
1078 infinite recursion for one line strings).
1088 infinite recursion for one line strings).
1079
1089
1080 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1090 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1081
1091
1082 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
1092 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
1083 all output streams before printing tracebacks. This ensures that
1093 all output streams before printing tracebacks. This ensures that
1084 user output doesn't end up interleaved with traceback output.
1094 user output doesn't end up interleaved with traceback output.
1085
1095
1086 2007-01-10 Ville Vainio <vivainio@gmail.com>
1096 2007-01-10 Ville Vainio <vivainio@gmail.com>
1087
1097
1088 * Extensions/envpersist.py: Turbocharged %env that remembers
1098 * Extensions/envpersist.py: Turbocharged %env that remembers
1089 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1099 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1090 "%env VISUAL=jed".
1100 "%env VISUAL=jed".
1091
1101
1092 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1102 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1093
1103
1094 * IPython/iplib.py (showtraceback): ensure that we correctly call
1104 * IPython/iplib.py (showtraceback): ensure that we correctly call
1095 custom handlers in all cases (some with pdb were slipping through,
1105 custom handlers in all cases (some with pdb were slipping through,
1096 but I'm not exactly sure why).
1106 but I'm not exactly sure why).
1097
1107
1098 * IPython/Debugger.py (Tracer.__init__): added new class to
1108 * IPython/Debugger.py (Tracer.__init__): added new class to
1099 support set_trace-like usage of IPython's enhanced debugger.
1109 support set_trace-like usage of IPython's enhanced debugger.
1100
1110
1101 2006-12-24 Ville Vainio <vivainio@gmail.com>
1111 2006-12-24 Ville Vainio <vivainio@gmail.com>
1102
1112
1103 * ipmaker.py: more informative message when ipy_user_conf
1113 * ipmaker.py: more informative message when ipy_user_conf
1104 import fails (suggest running %upgrade).
1114 import fails (suggest running %upgrade).
1105
1115
1106 * tools/run_ipy_in_profiler.py: Utility to see where
1116 * tools/run_ipy_in_profiler.py: Utility to see where
1107 the time during IPython startup is spent.
1117 the time during IPython startup is spent.
1108
1118
1109 2006-12-20 Ville Vainio <vivainio@gmail.com>
1119 2006-12-20 Ville Vainio <vivainio@gmail.com>
1110
1120
1111 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1121 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1112
1122
1113 * ipapi.py: Add new ipapi method, expand_alias.
1123 * ipapi.py: Add new ipapi method, expand_alias.
1114
1124
1115 * Release.py: Bump up version to 0.7.4.svn
1125 * Release.py: Bump up version to 0.7.4.svn
1116
1126
1117 2006-12-17 Ville Vainio <vivainio@gmail.com>
1127 2006-12-17 Ville Vainio <vivainio@gmail.com>
1118
1128
1119 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1129 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1120 to work properly on posix too
1130 to work properly on posix too
1121
1131
1122 * Release.py: Update revnum (version is still just 0.7.3).
1132 * Release.py: Update revnum (version is still just 0.7.3).
1123
1133
1124 2006-12-15 Ville Vainio <vivainio@gmail.com>
1134 2006-12-15 Ville Vainio <vivainio@gmail.com>
1125
1135
1126 * scripts/ipython_win_post_install: create ipython.py in
1136 * scripts/ipython_win_post_install: create ipython.py in
1127 prefix + "/scripts".
1137 prefix + "/scripts".
1128
1138
1129 * Release.py: Update version to 0.7.3.
1139 * Release.py: Update version to 0.7.3.
1130
1140
1131 2006-12-14 Ville Vainio <vivainio@gmail.com>
1141 2006-12-14 Ville Vainio <vivainio@gmail.com>
1132
1142
1133 * scripts/ipython_win_post_install: Overwrite old shortcuts
1143 * scripts/ipython_win_post_install: Overwrite old shortcuts
1134 if they already exist
1144 if they already exist
1135
1145
1136 * Release.py: release 0.7.3rc2
1146 * Release.py: release 0.7.3rc2
1137
1147
1138 2006-12-13 Ville Vainio <vivainio@gmail.com>
1148 2006-12-13 Ville Vainio <vivainio@gmail.com>
1139
1149
1140 * Branch and update Release.py for 0.7.3rc1
1150 * Branch and update Release.py for 0.7.3rc1
1141
1151
1142 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1152 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1143
1153
1144 * IPython/Shell.py (IPShellWX): update for current WX naming
1154 * IPython/Shell.py (IPShellWX): update for current WX naming
1145 conventions, to avoid a deprecation warning with current WX
1155 conventions, to avoid a deprecation warning with current WX
1146 versions. Thanks to a report by Danny Shevitz.
1156 versions. Thanks to a report by Danny Shevitz.
1147
1157
1148 2006-12-12 Ville Vainio <vivainio@gmail.com>
1158 2006-12-12 Ville Vainio <vivainio@gmail.com>
1149
1159
1150 * ipmaker.py: apply david cournapeau's patch to make
1160 * ipmaker.py: apply david cournapeau's patch to make
1151 import_some work properly even when ipythonrc does
1161 import_some work properly even when ipythonrc does
1152 import_some on empty list (it was an old bug!).
1162 import_some on empty list (it was an old bug!).
1153
1163
1154 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1164 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1155 Add deprecation note to ipythonrc and a url to wiki
1165 Add deprecation note to ipythonrc and a url to wiki
1156 in ipy_user_conf.py
1166 in ipy_user_conf.py
1157
1167
1158
1168
1159 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1169 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1160 as if it was typed on IPython command prompt, i.e.
1170 as if it was typed on IPython command prompt, i.e.
1161 as IPython script.
1171 as IPython script.
1162
1172
1163 * example-magic.py, magic_grepl.py: remove outdated examples
1173 * example-magic.py, magic_grepl.py: remove outdated examples
1164
1174
1165 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1175 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1166
1176
1167 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1177 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1168 is called before any exception has occurred.
1178 is called before any exception has occurred.
1169
1179
1170 2006-12-08 Ville Vainio <vivainio@gmail.com>
1180 2006-12-08 Ville Vainio <vivainio@gmail.com>
1171
1181
1172 * Extensions/ipy_stock_completers.py: fix cd completer
1182 * Extensions/ipy_stock_completers.py: fix cd completer
1173 to translate /'s to \'s again.
1183 to translate /'s to \'s again.
1174
1184
1175 * completer.py: prevent traceback on file completions w/
1185 * completer.py: prevent traceback on file completions w/
1176 backslash.
1186 backslash.
1177
1187
1178 * Release.py: Update release number to 0.7.3b3 for release
1188 * Release.py: Update release number to 0.7.3b3 for release
1179
1189
1180 2006-12-07 Ville Vainio <vivainio@gmail.com>
1190 2006-12-07 Ville Vainio <vivainio@gmail.com>
1181
1191
1182 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1192 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1183 while executing external code. Provides more shell-like behaviour
1193 while executing external code. Provides more shell-like behaviour
1184 and overall better response to ctrl + C / ctrl + break.
1194 and overall better response to ctrl + C / ctrl + break.
1185
1195
1186 * tools/make_tarball.py: new script to create tarball straight from svn
1196 * tools/make_tarball.py: new script to create tarball straight from svn
1187 (setup.py sdist doesn't work on win32).
1197 (setup.py sdist doesn't work on win32).
1188
1198
1189 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1199 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1190 on dirnames with spaces and use the default completer instead.
1200 on dirnames with spaces and use the default completer instead.
1191
1201
1192 * Revision.py: Change version to 0.7.3b2 for release.
1202 * Revision.py: Change version to 0.7.3b2 for release.
1193
1203
1194 2006-12-05 Ville Vainio <vivainio@gmail.com>
1204 2006-12-05 Ville Vainio <vivainio@gmail.com>
1195
1205
1196 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1206 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1197 pydb patch 4 (rm debug printing, py 2.5 checking)
1207 pydb patch 4 (rm debug printing, py 2.5 checking)
1198
1208
1199 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1209 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1200 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1210 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1201 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1211 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1202 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1212 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1203 object the cursor was on before the refresh. The command "markrange" is
1213 object the cursor was on before the refresh. The command "markrange" is
1204 mapped to "%" now.
1214 mapped to "%" now.
1205 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1215 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1206
1216
1207 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1217 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1208
1218
1209 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1219 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1210 interactive debugger on the last traceback, without having to call
1220 interactive debugger on the last traceback, without having to call
1211 %pdb and rerun your code. Made minor changes in various modules,
1221 %pdb and rerun your code. Made minor changes in various modules,
1212 should automatically recognize pydb if available.
1222 should automatically recognize pydb if available.
1213
1223
1214 2006-11-28 Ville Vainio <vivainio@gmail.com>
1224 2006-11-28 Ville Vainio <vivainio@gmail.com>
1215
1225
1216 * completer.py: If the text start with !, show file completions
1226 * completer.py: If the text start with !, show file completions
1217 properly. This helps when trying to complete command name
1227 properly. This helps when trying to complete command name
1218 for shell escapes.
1228 for shell escapes.
1219
1229
1220 2006-11-27 Ville Vainio <vivainio@gmail.com>
1230 2006-11-27 Ville Vainio <vivainio@gmail.com>
1221
1231
1222 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1232 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1223 der Walt. Clean up svn and hg completers by using a common
1233 der Walt. Clean up svn and hg completers by using a common
1224 vcs_completer.
1234 vcs_completer.
1225
1235
1226 2006-11-26 Ville Vainio <vivainio@gmail.com>
1236 2006-11-26 Ville Vainio <vivainio@gmail.com>
1227
1237
1228 * Remove ipconfig and %config; you should use _ip.options structure
1238 * Remove ipconfig and %config; you should use _ip.options structure
1229 directly instead!
1239 directly instead!
1230
1240
1231 * genutils.py: add wrap_deprecated function for deprecating callables
1241 * genutils.py: add wrap_deprecated function for deprecating callables
1232
1242
1233 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1243 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1234 _ip.system instead. ipalias is redundant.
1244 _ip.system instead. ipalias is redundant.
1235
1245
1236 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1246 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1237 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1247 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1238 explicit.
1248 explicit.
1239
1249
1240 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1250 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1241 completer. Try it by entering 'hg ' and pressing tab.
1251 completer. Try it by entering 'hg ' and pressing tab.
1242
1252
1243 * macro.py: Give Macro a useful __repr__ method
1253 * macro.py: Give Macro a useful __repr__ method
1244
1254
1245 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1255 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1246
1256
1247 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1257 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1248 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1258 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1249 we don't get a duplicate ipipe module, where registration of the xrepr
1259 we don't get a duplicate ipipe module, where registration of the xrepr
1250 implementation for Text is useless.
1260 implementation for Text is useless.
1251
1261
1252 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1262 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1253
1263
1254 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1264 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1255
1265
1256 2006-11-24 Ville Vainio <vivainio@gmail.com>
1266 2006-11-24 Ville Vainio <vivainio@gmail.com>
1257
1267
1258 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1268 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1259 try to use "cProfile" instead of the slower pure python
1269 try to use "cProfile" instead of the slower pure python
1260 "profile"
1270 "profile"
1261
1271
1262 2006-11-23 Ville Vainio <vivainio@gmail.com>
1272 2006-11-23 Ville Vainio <vivainio@gmail.com>
1263
1273
1264 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1274 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1265 Qt+IPython+Designer link in documentation.
1275 Qt+IPython+Designer link in documentation.
1266
1276
1267 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1277 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1268 correct Pdb object to %pydb.
1278 correct Pdb object to %pydb.
1269
1279
1270
1280
1271 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1281 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1272 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1282 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1273 generic xrepr(), otherwise the list implementation would kick in.
1283 generic xrepr(), otherwise the list implementation would kick in.
1274
1284
1275 2006-11-21 Ville Vainio <vivainio@gmail.com>
1285 2006-11-21 Ville Vainio <vivainio@gmail.com>
1276
1286
1277 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1287 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1278 with one from UserConfig.
1288 with one from UserConfig.
1279
1289
1280 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1290 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1281 it was missing which broke the sh profile.
1291 it was missing which broke the sh profile.
1282
1292
1283 * completer.py: file completer now uses explicit '/' instead
1293 * completer.py: file completer now uses explicit '/' instead
1284 of os.path.join, expansion of 'foo' was broken on win32
1294 of os.path.join, expansion of 'foo' was broken on win32
1285 if there was one directory with name 'foobar'.
1295 if there was one directory with name 'foobar'.
1286
1296
1287 * A bunch of patches from Kirill Smelkov:
1297 * A bunch of patches from Kirill Smelkov:
1288
1298
1289 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1299 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1290
1300
1291 * [patch 7/9] Implement %page -r (page in raw mode) -
1301 * [patch 7/9] Implement %page -r (page in raw mode) -
1292
1302
1293 * [patch 5/9] ScientificPython webpage has moved
1303 * [patch 5/9] ScientificPython webpage has moved
1294
1304
1295 * [patch 4/9] The manual mentions %ds, should be %dhist
1305 * [patch 4/9] The manual mentions %ds, should be %dhist
1296
1306
1297 * [patch 3/9] Kill old bits from %prun doc.
1307 * [patch 3/9] Kill old bits from %prun doc.
1298
1308
1299 * [patch 1/9] Fix typos here and there.
1309 * [patch 1/9] Fix typos here and there.
1300
1310
1301 2006-11-08 Ville Vainio <vivainio@gmail.com>
1311 2006-11-08 Ville Vainio <vivainio@gmail.com>
1302
1312
1303 * completer.py (attr_matches): catch all exceptions raised
1313 * completer.py (attr_matches): catch all exceptions raised
1304 by eval of expr with dots.
1314 by eval of expr with dots.
1305
1315
1306 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1316 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1307
1317
1308 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1318 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1309 input if it starts with whitespace. This allows you to paste
1319 input if it starts with whitespace. This allows you to paste
1310 indented input from any editor without manually having to type in
1320 indented input from any editor without manually having to type in
1311 the 'if 1:', which is convenient when working interactively.
1321 the 'if 1:', which is convenient when working interactively.
1312 Slightly modifed version of a patch by Bo Peng
1322 Slightly modifed version of a patch by Bo Peng
1313 <bpeng-AT-rice.edu>.
1323 <bpeng-AT-rice.edu>.
1314
1324
1315 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1325 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1316
1326
1317 * IPython/irunner.py (main): modified irunner so it automatically
1327 * IPython/irunner.py (main): modified irunner so it automatically
1318 recognizes the right runner to use based on the extension (.py for
1328 recognizes the right runner to use based on the extension (.py for
1319 python, .ipy for ipython and .sage for sage).
1329 python, .ipy for ipython and .sage for sage).
1320
1330
1321 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1331 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1322 visible in ipapi as ip.config(), to programatically control the
1332 visible in ipapi as ip.config(), to programatically control the
1323 internal rc object. There's an accompanying %config magic for
1333 internal rc object. There's an accompanying %config magic for
1324 interactive use, which has been enhanced to match the
1334 interactive use, which has been enhanced to match the
1325 funtionality in ipconfig.
1335 funtionality in ipconfig.
1326
1336
1327 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1337 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1328 so it's not just a toggle, it now takes an argument. Add support
1338 so it's not just a toggle, it now takes an argument. Add support
1329 for a customizable header when making system calls, as the new
1339 for a customizable header when making system calls, as the new
1330 system_header variable in the ipythonrc file.
1340 system_header variable in the ipythonrc file.
1331
1341
1332 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1342 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1333
1343
1334 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1344 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1335 generic functions (using Philip J. Eby's simplegeneric package).
1345 generic functions (using Philip J. Eby's simplegeneric package).
1336 This makes it possible to customize the display of third-party classes
1346 This makes it possible to customize the display of third-party classes
1337 without having to monkeypatch them. xiter() no longer supports a mode
1347 without having to monkeypatch them. xiter() no longer supports a mode
1338 argument and the XMode class has been removed. The same functionality can
1348 argument and the XMode class has been removed. The same functionality can
1339 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1349 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1340 One consequence of the switch to generic functions is that xrepr() and
1350 One consequence of the switch to generic functions is that xrepr() and
1341 xattrs() implementation must define the default value for the mode
1351 xattrs() implementation must define the default value for the mode
1342 argument themselves and xattrs() implementations must return real
1352 argument themselves and xattrs() implementations must return real
1343 descriptors.
1353 descriptors.
1344
1354
1345 * IPython/external: This new subpackage will contain all third-party
1355 * IPython/external: This new subpackage will contain all third-party
1346 packages that are bundled with IPython. (The first one is simplegeneric).
1356 packages that are bundled with IPython. (The first one is simplegeneric).
1347
1357
1348 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1358 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1349 directory which as been dropped in r1703.
1359 directory which as been dropped in r1703.
1350
1360
1351 * IPython/Extensions/ipipe.py (iless): Fixed.
1361 * IPython/Extensions/ipipe.py (iless): Fixed.
1352
1362
1353 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1363 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1354
1364
1355 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1365 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1356
1366
1357 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1367 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1358 handling in variable expansion so that shells and magics recognize
1368 handling in variable expansion so that shells and magics recognize
1359 function local scopes correctly. Bug reported by Brian.
1369 function local scopes correctly. Bug reported by Brian.
1360
1370
1361 * scripts/ipython: remove the very first entry in sys.path which
1371 * scripts/ipython: remove the very first entry in sys.path which
1362 Python auto-inserts for scripts, so that sys.path under IPython is
1372 Python auto-inserts for scripts, so that sys.path under IPython is
1363 as similar as possible to that under plain Python.
1373 as similar as possible to that under plain Python.
1364
1374
1365 * IPython/completer.py (IPCompleter.file_matches): Fix
1375 * IPython/completer.py (IPCompleter.file_matches): Fix
1366 tab-completion so that quotes are not closed unless the completion
1376 tab-completion so that quotes are not closed unless the completion
1367 is unambiguous. After a request by Stefan. Minor cleanups in
1377 is unambiguous. After a request by Stefan. Minor cleanups in
1368 ipy_stock_completers.
1378 ipy_stock_completers.
1369
1379
1370 2006-11-02 Ville Vainio <vivainio@gmail.com>
1380 2006-11-02 Ville Vainio <vivainio@gmail.com>
1371
1381
1372 * ipy_stock_completers.py: Add %run and %cd completers.
1382 * ipy_stock_completers.py: Add %run and %cd completers.
1373
1383
1374 * completer.py: Try running custom completer for both
1384 * completer.py: Try running custom completer for both
1375 "foo" and "%foo" if the command is just "foo". Ignore case
1385 "foo" and "%foo" if the command is just "foo". Ignore case
1376 when filtering possible completions.
1386 when filtering possible completions.
1377
1387
1378 * UserConfig/ipy_user_conf.py: install stock completers as default
1388 * UserConfig/ipy_user_conf.py: install stock completers as default
1379
1389
1380 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1390 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1381 simplified readline history save / restore through a wrapper
1391 simplified readline history save / restore through a wrapper
1382 function
1392 function
1383
1393
1384
1394
1385 2006-10-31 Ville Vainio <vivainio@gmail.com>
1395 2006-10-31 Ville Vainio <vivainio@gmail.com>
1386
1396
1387 * strdispatch.py, completer.py, ipy_stock_completers.py:
1397 * strdispatch.py, completer.py, ipy_stock_completers.py:
1388 Allow str_key ("command") in completer hooks. Implement
1398 Allow str_key ("command") in completer hooks. Implement
1389 trivial completer for 'import' (stdlib modules only). Rename
1399 trivial completer for 'import' (stdlib modules only). Rename
1390 ipy_linux_package_managers.py to ipy_stock_completers.py.
1400 ipy_linux_package_managers.py to ipy_stock_completers.py.
1391 SVN completer.
1401 SVN completer.
1392
1402
1393 * Extensions/ledit.py: %magic line editor for easily and
1403 * Extensions/ledit.py: %magic line editor for easily and
1394 incrementally manipulating lists of strings. The magic command
1404 incrementally manipulating lists of strings. The magic command
1395 name is %led.
1405 name is %led.
1396
1406
1397 2006-10-30 Ville Vainio <vivainio@gmail.com>
1407 2006-10-30 Ville Vainio <vivainio@gmail.com>
1398
1408
1399 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1409 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1400 Bernsteins's patches for pydb integration.
1410 Bernsteins's patches for pydb integration.
1401 http://bashdb.sourceforge.net/pydb/
1411 http://bashdb.sourceforge.net/pydb/
1402
1412
1403 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1413 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1404 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1414 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1405 custom completer hook to allow the users to implement their own
1415 custom completer hook to allow the users to implement their own
1406 completers. See ipy_linux_package_managers.py for example. The
1416 completers. See ipy_linux_package_managers.py for example. The
1407 hook name is 'complete_command'.
1417 hook name is 'complete_command'.
1408
1418
1409 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1419 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1410
1420
1411 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1421 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1412 Numeric leftovers.
1422 Numeric leftovers.
1413
1423
1414 * ipython.el (py-execute-region): apply Stefan's patch to fix
1424 * ipython.el (py-execute-region): apply Stefan's patch to fix
1415 garbled results if the python shell hasn't been previously started.
1425 garbled results if the python shell hasn't been previously started.
1416
1426
1417 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1427 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1418 pretty generic function and useful for other things.
1428 pretty generic function and useful for other things.
1419
1429
1420 * IPython/OInspect.py (getsource): Add customizable source
1430 * IPython/OInspect.py (getsource): Add customizable source
1421 extractor. After a request/patch form W. Stein (SAGE).
1431 extractor. After a request/patch form W. Stein (SAGE).
1422
1432
1423 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1433 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1424 window size to a more reasonable value from what pexpect does,
1434 window size to a more reasonable value from what pexpect does,
1425 since their choice causes wrapping bugs with long input lines.
1435 since their choice causes wrapping bugs with long input lines.
1426
1436
1427 2006-10-28 Ville Vainio <vivainio@gmail.com>
1437 2006-10-28 Ville Vainio <vivainio@gmail.com>
1428
1438
1429 * Magic.py (%run): Save and restore the readline history from
1439 * Magic.py (%run): Save and restore the readline history from
1430 file around %run commands to prevent side effects from
1440 file around %run commands to prevent side effects from
1431 %runned programs that might use readline (e.g. pydb).
1441 %runned programs that might use readline (e.g. pydb).
1432
1442
1433 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1443 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1434 invoking the pydb enhanced debugger.
1444 invoking the pydb enhanced debugger.
1435
1445
1436 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1446 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1437
1447
1438 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1448 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1439 call the base class method and propagate the return value to
1449 call the base class method and propagate the return value to
1440 ifile. This is now done by path itself.
1450 ifile. This is now done by path itself.
1441
1451
1442 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1452 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1443
1453
1444 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1454 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1445 api: set_crash_handler(), to expose the ability to change the
1455 api: set_crash_handler(), to expose the ability to change the
1446 internal crash handler.
1456 internal crash handler.
1447
1457
1448 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1458 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1449 the various parameters of the crash handler so that apps using
1459 the various parameters of the crash handler so that apps using
1450 IPython as their engine can customize crash handling. Ipmlemented
1460 IPython as their engine can customize crash handling. Ipmlemented
1451 at the request of SAGE.
1461 at the request of SAGE.
1452
1462
1453 2006-10-14 Ville Vainio <vivainio@gmail.com>
1463 2006-10-14 Ville Vainio <vivainio@gmail.com>
1454
1464
1455 * Magic.py, ipython.el: applied first "safe" part of Rocky
1465 * Magic.py, ipython.el: applied first "safe" part of Rocky
1456 Bernstein's patch set for pydb integration.
1466 Bernstein's patch set for pydb integration.
1457
1467
1458 * Magic.py (%unalias, %alias): %store'd aliases can now be
1468 * Magic.py (%unalias, %alias): %store'd aliases can now be
1459 removed with '%unalias'. %alias w/o args now shows most
1469 removed with '%unalias'. %alias w/o args now shows most
1460 interesting (stored / manually defined) aliases last
1470 interesting (stored / manually defined) aliases last
1461 where they catch the eye w/o scrolling.
1471 where they catch the eye w/o scrolling.
1462
1472
1463 * Magic.py (%rehashx), ext_rehashdir.py: files with
1473 * Magic.py (%rehashx), ext_rehashdir.py: files with
1464 'py' extension are always considered executable, even
1474 'py' extension are always considered executable, even
1465 when not in PATHEXT environment variable.
1475 when not in PATHEXT environment variable.
1466
1476
1467 2006-10-12 Ville Vainio <vivainio@gmail.com>
1477 2006-10-12 Ville Vainio <vivainio@gmail.com>
1468
1478
1469 * jobctrl.py: Add new "jobctrl" extension for spawning background
1479 * jobctrl.py: Add new "jobctrl" extension for spawning background
1470 processes with "&find /". 'import jobctrl' to try it out. Requires
1480 processes with "&find /". 'import jobctrl' to try it out. Requires
1471 'subprocess' module, standard in python 2.4+.
1481 'subprocess' module, standard in python 2.4+.
1472
1482
1473 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1483 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1474 so if foo -> bar and bar -> baz, then foo -> baz.
1484 so if foo -> bar and bar -> baz, then foo -> baz.
1475
1485
1476 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1486 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1477
1487
1478 * IPython/Magic.py (Magic.parse_options): add a new posix option
1488 * IPython/Magic.py (Magic.parse_options): add a new posix option
1479 to allow parsing of input args in magics that doesn't strip quotes
1489 to allow parsing of input args in magics that doesn't strip quotes
1480 (if posix=False). This also closes %timeit bug reported by
1490 (if posix=False). This also closes %timeit bug reported by
1481 Stefan.
1491 Stefan.
1482
1492
1483 2006-10-03 Ville Vainio <vivainio@gmail.com>
1493 2006-10-03 Ville Vainio <vivainio@gmail.com>
1484
1494
1485 * iplib.py (raw_input, interact): Return ValueError catching for
1495 * iplib.py (raw_input, interact): Return ValueError catching for
1486 raw_input. Fixes infinite loop for sys.stdin.close() or
1496 raw_input. Fixes infinite loop for sys.stdin.close() or
1487 sys.stdout.close().
1497 sys.stdout.close().
1488
1498
1489 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1499 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1490
1500
1491 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1501 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1492 to help in handling doctests. irunner is now pretty useful for
1502 to help in handling doctests. irunner is now pretty useful for
1493 running standalone scripts and simulate a full interactive session
1503 running standalone scripts and simulate a full interactive session
1494 in a format that can be then pasted as a doctest.
1504 in a format that can be then pasted as a doctest.
1495
1505
1496 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1506 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1497 on top of the default (useless) ones. This also fixes the nasty
1507 on top of the default (useless) ones. This also fixes the nasty
1498 way in which 2.5's Quitter() exits (reverted [1785]).
1508 way in which 2.5's Quitter() exits (reverted [1785]).
1499
1509
1500 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1510 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1501 2.5.
1511 2.5.
1502
1512
1503 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1513 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1504 color scheme is updated as well when color scheme is changed
1514 color scheme is updated as well when color scheme is changed
1505 interactively.
1515 interactively.
1506
1516
1507 2006-09-27 Ville Vainio <vivainio@gmail.com>
1517 2006-09-27 Ville Vainio <vivainio@gmail.com>
1508
1518
1509 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1519 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1510 infinite loop and just exit. It's a hack, but will do for a while.
1520 infinite loop and just exit. It's a hack, but will do for a while.
1511
1521
1512 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1522 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1513
1523
1514 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1524 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1515 the constructor, this makes it possible to get a list of only directories
1525 the constructor, this makes it possible to get a list of only directories
1516 or only files.
1526 or only files.
1517
1527
1518 2006-08-12 Ville Vainio <vivainio@gmail.com>
1528 2006-08-12 Ville Vainio <vivainio@gmail.com>
1519
1529
1520 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1530 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1521 they broke unittest
1531 they broke unittest
1522
1532
1523 2006-08-11 Ville Vainio <vivainio@gmail.com>
1533 2006-08-11 Ville Vainio <vivainio@gmail.com>
1524
1534
1525 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1535 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1526 by resolving issue properly, i.e. by inheriting FakeModule
1536 by resolving issue properly, i.e. by inheriting FakeModule
1527 from types.ModuleType. Pickling ipython interactive data
1537 from types.ModuleType. Pickling ipython interactive data
1528 should still work as usual (testing appreciated).
1538 should still work as usual (testing appreciated).
1529
1539
1530 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1540 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1531
1541
1532 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1542 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1533 running under python 2.3 with code from 2.4 to fix a bug with
1543 running under python 2.3 with code from 2.4 to fix a bug with
1534 help(). Reported by the Debian maintainers, Norbert Tretkowski
1544 help(). Reported by the Debian maintainers, Norbert Tretkowski
1535 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1545 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1536 <afayolle-AT-debian.org>.
1546 <afayolle-AT-debian.org>.
1537
1547
1538 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1548 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1539
1549
1540 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1550 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1541 (which was displaying "quit" twice).
1551 (which was displaying "quit" twice).
1542
1552
1543 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1553 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1544
1554
1545 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1555 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1546 the mode argument).
1556 the mode argument).
1547
1557
1548 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1558 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1549
1559
1550 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1560 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1551 not running under IPython.
1561 not running under IPython.
1552
1562
1553 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1563 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1554 and make it iterable (iterating over the attribute itself). Add two new
1564 and make it iterable (iterating over the attribute itself). Add two new
1555 magic strings for __xattrs__(): If the string starts with "-", the attribute
1565 magic strings for __xattrs__(): If the string starts with "-", the attribute
1556 will not be displayed in ibrowse's detail view (but it can still be
1566 will not be displayed in ibrowse's detail view (but it can still be
1557 iterated over). This makes it possible to add attributes that are large
1567 iterated over). This makes it possible to add attributes that are large
1558 lists or generator methods to the detail view. Replace magic attribute names
1568 lists or generator methods to the detail view. Replace magic attribute names
1559 and _attrname() and _getattr() with "descriptors": For each type of magic
1569 and _attrname() and _getattr() with "descriptors": For each type of magic
1560 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1570 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1561 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1571 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1562 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1572 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1563 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1573 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1564 are still supported.
1574 are still supported.
1565
1575
1566 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1576 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1567 fails in ibrowse.fetch(), the exception object is added as the last item
1577 fails in ibrowse.fetch(), the exception object is added as the last item
1568 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1578 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1569 a generator throws an exception midway through execution.
1579 a generator throws an exception midway through execution.
1570
1580
1571 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1581 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1572 encoding into methods.
1582 encoding into methods.
1573
1583
1574 2006-07-26 Ville Vainio <vivainio@gmail.com>
1584 2006-07-26 Ville Vainio <vivainio@gmail.com>
1575
1585
1576 * iplib.py: history now stores multiline input as single
1586 * iplib.py: history now stores multiline input as single
1577 history entries. Patch by Jorgen Cederlof.
1587 history entries. Patch by Jorgen Cederlof.
1578
1588
1579 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1589 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1580
1590
1581 * IPython/Extensions/ibrowse.py: Make cursor visible over
1591 * IPython/Extensions/ibrowse.py: Make cursor visible over
1582 non existing attributes.
1592 non existing attributes.
1583
1593
1584 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1594 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1585
1595
1586 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1596 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1587 error output of the running command doesn't mess up the screen.
1597 error output of the running command doesn't mess up the screen.
1588
1598
1589 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1599 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1590
1600
1591 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1601 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1592 argument. This sorts the items themselves.
1602 argument. This sorts the items themselves.
1593
1603
1594 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1604 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1595
1605
1596 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1606 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1597 Compile expression strings into code objects. This should speed
1607 Compile expression strings into code objects. This should speed
1598 up ifilter and friends somewhat.
1608 up ifilter and friends somewhat.
1599
1609
1600 2006-07-08 Ville Vainio <vivainio@gmail.com>
1610 2006-07-08 Ville Vainio <vivainio@gmail.com>
1601
1611
1602 * Magic.py: %cpaste now strips > from the beginning of lines
1612 * Magic.py: %cpaste now strips > from the beginning of lines
1603 to ease pasting quoted code from emails. Contributed by
1613 to ease pasting quoted code from emails. Contributed by
1604 Stefan van der Walt.
1614 Stefan van der Walt.
1605
1615
1606 2006-06-29 Ville Vainio <vivainio@gmail.com>
1616 2006-06-29 Ville Vainio <vivainio@gmail.com>
1607
1617
1608 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1618 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1609 mode, patch contributed by Darren Dale. NEEDS TESTING!
1619 mode, patch contributed by Darren Dale. NEEDS TESTING!
1610
1620
1611 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1621 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1612
1622
1613 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1623 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1614 a blue background. Fix fetching new display rows when the browser
1624 a blue background. Fix fetching new display rows when the browser
1615 scrolls more than a screenful (e.g. by using the goto command).
1625 scrolls more than a screenful (e.g. by using the goto command).
1616
1626
1617 2006-06-27 Ville Vainio <vivainio@gmail.com>
1627 2006-06-27 Ville Vainio <vivainio@gmail.com>
1618
1628
1619 * Magic.py (_inspect, _ofind) Apply David Huard's
1629 * Magic.py (_inspect, _ofind) Apply David Huard's
1620 patch for displaying the correct docstring for 'property'
1630 patch for displaying the correct docstring for 'property'
1621 attributes.
1631 attributes.
1622
1632
1623 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1633 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1624
1634
1625 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1635 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1626 commands into the methods implementing them.
1636 commands into the methods implementing them.
1627
1637
1628 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1638 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1629
1639
1630 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1640 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1631 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1641 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1632 autoindent support was authored by Jin Liu.
1642 autoindent support was authored by Jin Liu.
1633
1643
1634 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1644 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1635
1645
1636 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1646 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1637 for keymaps with a custom class that simplifies handling.
1647 for keymaps with a custom class that simplifies handling.
1638
1648
1639 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1649 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1640
1650
1641 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1651 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1642 resizing. This requires Python 2.5 to work.
1652 resizing. This requires Python 2.5 to work.
1643
1653
1644 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1654 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1645
1655
1646 * IPython/Extensions/ibrowse.py: Add two new commands to
1656 * IPython/Extensions/ibrowse.py: Add two new commands to
1647 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1657 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1648 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1658 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1649 attributes again. Remapped the help command to "?". Display
1659 attributes again. Remapped the help command to "?". Display
1650 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1660 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1651 as keys for the "home" and "end" commands. Add three new commands
1661 as keys for the "home" and "end" commands. Add three new commands
1652 to the input mode for "find" and friends: "delend" (CTRL-K)
1662 to the input mode for "find" and friends: "delend" (CTRL-K)
1653 deletes to the end of line. "incsearchup" searches upwards in the
1663 deletes to the end of line. "incsearchup" searches upwards in the
1654 command history for an input that starts with the text before the cursor.
1664 command history for an input that starts with the text before the cursor.
1655 "incsearchdown" does the same downwards. Removed a bogus mapping of
1665 "incsearchdown" does the same downwards. Removed a bogus mapping of
1656 the x key to "delete".
1666 the x key to "delete".
1657
1667
1658 2006-06-15 Ville Vainio <vivainio@gmail.com>
1668 2006-06-15 Ville Vainio <vivainio@gmail.com>
1659
1669
1660 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1670 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1661 used to create prompts dynamically, instead of the "old" way of
1671 used to create prompts dynamically, instead of the "old" way of
1662 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1672 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1663 way still works (it's invoked by the default hook), of course.
1673 way still works (it's invoked by the default hook), of course.
1664
1674
1665 * Prompts.py: added generate_output_prompt hook for altering output
1675 * Prompts.py: added generate_output_prompt hook for altering output
1666 prompt
1676 prompt
1667
1677
1668 * Release.py: Changed version string to 0.7.3.svn.
1678 * Release.py: Changed version string to 0.7.3.svn.
1669
1679
1670 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1680 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1671
1681
1672 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1682 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1673 the call to fetch() always tries to fetch enough data for at least one
1683 the call to fetch() always tries to fetch enough data for at least one
1674 full screen. This makes it possible to simply call moveto(0,0,True) in
1684 full screen. This makes it possible to simply call moveto(0,0,True) in
1675 the constructor. Fix typos and removed the obsolete goto attribute.
1685 the constructor. Fix typos and removed the obsolete goto attribute.
1676
1686
1677 2006-06-12 Ville Vainio <vivainio@gmail.com>
1687 2006-06-12 Ville Vainio <vivainio@gmail.com>
1678
1688
1679 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1689 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1680 allowing $variable interpolation within multiline statements,
1690 allowing $variable interpolation within multiline statements,
1681 though so far only with "sh" profile for a testing period.
1691 though so far only with "sh" profile for a testing period.
1682 The patch also enables splitting long commands with \ but it
1692 The patch also enables splitting long commands with \ but it
1683 doesn't work properly yet.
1693 doesn't work properly yet.
1684
1694
1685 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1695 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1686
1696
1687 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1697 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1688 input history and the position of the cursor in the input history for
1698 input history and the position of the cursor in the input history for
1689 the find, findbackwards and goto command.
1699 the find, findbackwards and goto command.
1690
1700
1691 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1701 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1692
1702
1693 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1703 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1694 implements the basic functionality of browser commands that require
1704 implements the basic functionality of browser commands that require
1695 input. Reimplement the goto, find and findbackwards commands as
1705 input. Reimplement the goto, find and findbackwards commands as
1696 subclasses of _CommandInput. Add an input history and keymaps to those
1706 subclasses of _CommandInput. Add an input history and keymaps to those
1697 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1707 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1698 execute commands.
1708 execute commands.
1699
1709
1700 2006-06-07 Ville Vainio <vivainio@gmail.com>
1710 2006-06-07 Ville Vainio <vivainio@gmail.com>
1701
1711
1702 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1712 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1703 running the batch files instead of leaving the session open.
1713 running the batch files instead of leaving the session open.
1704
1714
1705 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1715 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1706
1716
1707 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1717 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1708 the original fix was incomplete. Patch submitted by W. Maier.
1718 the original fix was incomplete. Patch submitted by W. Maier.
1709
1719
1710 2006-06-07 Ville Vainio <vivainio@gmail.com>
1720 2006-06-07 Ville Vainio <vivainio@gmail.com>
1711
1721
1712 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1722 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1713 Confirmation prompts can be supressed by 'quiet' option.
1723 Confirmation prompts can be supressed by 'quiet' option.
1714 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1724 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1715
1725
1716 2006-06-06 *** Released version 0.7.2
1726 2006-06-06 *** Released version 0.7.2
1717
1727
1718 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1728 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1719
1729
1720 * IPython/Release.py (version): Made 0.7.2 final for release.
1730 * IPython/Release.py (version): Made 0.7.2 final for release.
1721 Repo tagged and release cut.
1731 Repo tagged and release cut.
1722
1732
1723 2006-06-05 Ville Vainio <vivainio@gmail.com>
1733 2006-06-05 Ville Vainio <vivainio@gmail.com>
1724
1734
1725 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1735 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1726 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1736 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1727
1737
1728 * upgrade_dir.py: try import 'path' module a bit harder
1738 * upgrade_dir.py: try import 'path' module a bit harder
1729 (for %upgrade)
1739 (for %upgrade)
1730
1740
1731 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1741 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1732
1742
1733 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1743 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1734 instead of looping 20 times.
1744 instead of looping 20 times.
1735
1745
1736 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1746 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1737 correctly at initialization time. Bug reported by Krishna Mohan
1747 correctly at initialization time. Bug reported by Krishna Mohan
1738 Gundu <gkmohan-AT-gmail.com> on the user list.
1748 Gundu <gkmohan-AT-gmail.com> on the user list.
1739
1749
1740 * IPython/Release.py (version): Mark 0.7.2 version to start
1750 * IPython/Release.py (version): Mark 0.7.2 version to start
1741 testing for release on 06/06.
1751 testing for release on 06/06.
1742
1752
1743 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1753 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1744
1754
1745 * scripts/irunner: thin script interface so users don't have to
1755 * scripts/irunner: thin script interface so users don't have to
1746 find the module and call it as an executable, since modules rarely
1756 find the module and call it as an executable, since modules rarely
1747 live in people's PATH.
1757 live in people's PATH.
1748
1758
1749 * IPython/irunner.py (InteractiveRunner.__init__): added
1759 * IPython/irunner.py (InteractiveRunner.__init__): added
1750 delaybeforesend attribute to control delays with newer versions of
1760 delaybeforesend attribute to control delays with newer versions of
1751 pexpect. Thanks to detailed help from pexpect's author, Noah
1761 pexpect. Thanks to detailed help from pexpect's author, Noah
1752 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1762 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1753 correctly (it works in NoColor mode).
1763 correctly (it works in NoColor mode).
1754
1764
1755 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1765 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1756 SAGE list, from improper log() calls.
1766 SAGE list, from improper log() calls.
1757
1767
1758 2006-05-31 Ville Vainio <vivainio@gmail.com>
1768 2006-05-31 Ville Vainio <vivainio@gmail.com>
1759
1769
1760 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1770 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1761 with args in parens to work correctly with dirs that have spaces.
1771 with args in parens to work correctly with dirs that have spaces.
1762
1772
1763 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1773 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1764
1774
1765 * IPython/Logger.py (Logger.logstart): add option to log raw input
1775 * IPython/Logger.py (Logger.logstart): add option to log raw input
1766 instead of the processed one. A -r flag was added to the
1776 instead of the processed one. A -r flag was added to the
1767 %logstart magic used for controlling logging.
1777 %logstart magic used for controlling logging.
1768
1778
1769 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1779 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1770
1780
1771 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1781 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1772 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1782 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1773 recognize the option. After a bug report by Will Maier. This
1783 recognize the option. After a bug report by Will Maier. This
1774 closes #64 (will do it after confirmation from W. Maier).
1784 closes #64 (will do it after confirmation from W. Maier).
1775
1785
1776 * IPython/irunner.py: New module to run scripts as if manually
1786 * IPython/irunner.py: New module to run scripts as if manually
1777 typed into an interactive environment, based on pexpect. After a
1787 typed into an interactive environment, based on pexpect. After a
1778 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1788 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1779 ipython-user list. Simple unittests in the tests/ directory.
1789 ipython-user list. Simple unittests in the tests/ directory.
1780
1790
1781 * tools/release: add Will Maier, OpenBSD port maintainer, to
1791 * tools/release: add Will Maier, OpenBSD port maintainer, to
1782 recepients list. We are now officially part of the OpenBSD ports:
1792 recepients list. We are now officially part of the OpenBSD ports:
1783 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1793 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1784 work.
1794 work.
1785
1795
1786 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1796 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1787
1797
1788 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1798 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1789 so that it doesn't break tkinter apps.
1799 so that it doesn't break tkinter apps.
1790
1800
1791 * IPython/iplib.py (_prefilter): fix bug where aliases would
1801 * IPython/iplib.py (_prefilter): fix bug where aliases would
1792 shadow variables when autocall was fully off. Reported by SAGE
1802 shadow variables when autocall was fully off. Reported by SAGE
1793 author William Stein.
1803 author William Stein.
1794
1804
1795 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1805 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1796 at what detail level strings are computed when foo? is requested.
1806 at what detail level strings are computed when foo? is requested.
1797 This allows users to ask for example that the string form of an
1807 This allows users to ask for example that the string form of an
1798 object is only computed when foo?? is called, or even never, by
1808 object is only computed when foo?? is called, or even never, by
1799 setting the object_info_string_level >= 2 in the configuration
1809 setting the object_info_string_level >= 2 in the configuration
1800 file. This new option has been added and documented. After a
1810 file. This new option has been added and documented. After a
1801 request by SAGE to be able to control the printing of very large
1811 request by SAGE to be able to control the printing of very large
1802 objects more easily.
1812 objects more easily.
1803
1813
1804 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1814 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1805
1815
1806 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1816 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1807 from sys.argv, to be 100% consistent with how Python itself works
1817 from sys.argv, to be 100% consistent with how Python itself works
1808 (as seen for example with python -i file.py). After a bug report
1818 (as seen for example with python -i file.py). After a bug report
1809 by Jeffrey Collins.
1819 by Jeffrey Collins.
1810
1820
1811 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1821 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1812 nasty bug which was preventing custom namespaces with -pylab,
1822 nasty bug which was preventing custom namespaces with -pylab,
1813 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1823 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1814 compatibility (long gone from mpl).
1824 compatibility (long gone from mpl).
1815
1825
1816 * IPython/ipapi.py (make_session): name change: create->make. We
1826 * IPython/ipapi.py (make_session): name change: create->make. We
1817 use make in other places (ipmaker,...), it's shorter and easier to
1827 use make in other places (ipmaker,...), it's shorter and easier to
1818 type and say, etc. I'm trying to clean things before 0.7.2 so
1828 type and say, etc. I'm trying to clean things before 0.7.2 so
1819 that I can keep things stable wrt to ipapi in the chainsaw branch.
1829 that I can keep things stable wrt to ipapi in the chainsaw branch.
1820
1830
1821 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1831 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1822 python-mode recognizes our debugger mode. Add support for
1832 python-mode recognizes our debugger mode. Add support for
1823 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1833 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1824 <m.liu.jin-AT-gmail.com> originally written by
1834 <m.liu.jin-AT-gmail.com> originally written by
1825 doxgen-AT-newsmth.net (with minor modifications for xemacs
1835 doxgen-AT-newsmth.net (with minor modifications for xemacs
1826 compatibility)
1836 compatibility)
1827
1837
1828 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1838 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1829 tracebacks when walking the stack so that the stack tracking system
1839 tracebacks when walking the stack so that the stack tracking system
1830 in emacs' python-mode can identify the frames correctly.
1840 in emacs' python-mode can identify the frames correctly.
1831
1841
1832 * IPython/ipmaker.py (make_IPython): make the internal (and
1842 * IPython/ipmaker.py (make_IPython): make the internal (and
1833 default config) autoedit_syntax value false by default. Too many
1843 default config) autoedit_syntax value false by default. Too many
1834 users have complained to me (both on and off-list) about problems
1844 users have complained to me (both on and off-list) about problems
1835 with this option being on by default, so I'm making it default to
1845 with this option being on by default, so I'm making it default to
1836 off. It can still be enabled by anyone via the usual mechanisms.
1846 off. It can still be enabled by anyone via the usual mechanisms.
1837
1847
1838 * IPython/completer.py (Completer.attr_matches): add support for
1848 * IPython/completer.py (Completer.attr_matches): add support for
1839 PyCrust-style _getAttributeNames magic method. Patch contributed
1849 PyCrust-style _getAttributeNames magic method. Patch contributed
1840 by <mscott-AT-goldenspud.com>. Closes #50.
1850 by <mscott-AT-goldenspud.com>. Closes #50.
1841
1851
1842 * IPython/iplib.py (InteractiveShell.__init__): remove the
1852 * IPython/iplib.py (InteractiveShell.__init__): remove the
1843 deletion of exit/quit from __builtin__, which can break
1853 deletion of exit/quit from __builtin__, which can break
1844 third-party tools like the Zope debugging console. The
1854 third-party tools like the Zope debugging console. The
1845 %exit/%quit magics remain. In general, it's probably a good idea
1855 %exit/%quit magics remain. In general, it's probably a good idea
1846 not to delete anything from __builtin__, since we never know what
1856 not to delete anything from __builtin__, since we never know what
1847 that will break. In any case, python now (for 2.5) will support
1857 that will break. In any case, python now (for 2.5) will support
1848 'real' exit/quit, so this issue is moot. Closes #55.
1858 'real' exit/quit, so this issue is moot. Closes #55.
1849
1859
1850 * IPython/genutils.py (with_obj): rename the 'with' function to
1860 * IPython/genutils.py (with_obj): rename the 'with' function to
1851 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1861 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1852 becomes a language keyword. Closes #53.
1862 becomes a language keyword. Closes #53.
1853
1863
1854 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1864 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1855 __file__ attribute to this so it fools more things into thinking
1865 __file__ attribute to this so it fools more things into thinking
1856 it is a real module. Closes #59.
1866 it is a real module. Closes #59.
1857
1867
1858 * IPython/Magic.py (magic_edit): add -n option to open the editor
1868 * IPython/Magic.py (magic_edit): add -n option to open the editor
1859 at a specific line number. After a patch by Stefan van der Walt.
1869 at a specific line number. After a patch by Stefan van der Walt.
1860
1870
1861 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1871 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1862
1872
1863 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1873 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1864 reason the file could not be opened. After automatic crash
1874 reason the file could not be opened. After automatic crash
1865 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1875 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1866 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1876 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1867 (_should_recompile): Don't fire editor if using %bg, since there
1877 (_should_recompile): Don't fire editor if using %bg, since there
1868 is no file in the first place. From the same report as above.
1878 is no file in the first place. From the same report as above.
1869 (raw_input): protect against faulty third-party prefilters. After
1879 (raw_input): protect against faulty third-party prefilters. After
1870 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1880 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1871 while running under SAGE.
1881 while running under SAGE.
1872
1882
1873 2006-05-23 Ville Vainio <vivainio@gmail.com>
1883 2006-05-23 Ville Vainio <vivainio@gmail.com>
1874
1884
1875 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1885 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1876 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1886 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1877 now returns None (again), unless dummy is specifically allowed by
1887 now returns None (again), unless dummy is specifically allowed by
1878 ipapi.get(allow_dummy=True).
1888 ipapi.get(allow_dummy=True).
1879
1889
1880 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1890 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1881
1891
1882 * IPython: remove all 2.2-compatibility objects and hacks from
1892 * IPython: remove all 2.2-compatibility objects and hacks from
1883 everywhere, since we only support 2.3 at this point. Docs
1893 everywhere, since we only support 2.3 at this point. Docs
1884 updated.
1894 updated.
1885
1895
1886 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1896 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1887 Anything requiring extra validation can be turned into a Python
1897 Anything requiring extra validation can be turned into a Python
1888 property in the future. I used a property for the db one b/c
1898 property in the future. I used a property for the db one b/c
1889 there was a nasty circularity problem with the initialization
1899 there was a nasty circularity problem with the initialization
1890 order, which right now I don't have time to clean up.
1900 order, which right now I don't have time to clean up.
1891
1901
1892 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1902 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1893 another locking bug reported by Jorgen. I'm not 100% sure though,
1903 another locking bug reported by Jorgen. I'm not 100% sure though,
1894 so more testing is needed...
1904 so more testing is needed...
1895
1905
1896 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1906 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1897
1907
1898 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1908 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1899 local variables from any routine in user code (typically executed
1909 local variables from any routine in user code (typically executed
1900 with %run) directly into the interactive namespace. Very useful
1910 with %run) directly into the interactive namespace. Very useful
1901 when doing complex debugging.
1911 when doing complex debugging.
1902 (IPythonNotRunning): Changed the default None object to a dummy
1912 (IPythonNotRunning): Changed the default None object to a dummy
1903 whose attributes can be queried as well as called without
1913 whose attributes can be queried as well as called without
1904 exploding, to ease writing code which works transparently both in
1914 exploding, to ease writing code which works transparently both in
1905 and out of ipython and uses some of this API.
1915 and out of ipython and uses some of this API.
1906
1916
1907 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1917 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1908
1918
1909 * IPython/hooks.py (result_display): Fix the fact that our display
1919 * IPython/hooks.py (result_display): Fix the fact that our display
1910 hook was using str() instead of repr(), as the default python
1920 hook was using str() instead of repr(), as the default python
1911 console does. This had gone unnoticed b/c it only happened if
1921 console does. This had gone unnoticed b/c it only happened if
1912 %Pprint was off, but the inconsistency was there.
1922 %Pprint was off, but the inconsistency was there.
1913
1923
1914 2006-05-15 Ville Vainio <vivainio@gmail.com>
1924 2006-05-15 Ville Vainio <vivainio@gmail.com>
1915
1925
1916 * Oinspect.py: Only show docstring for nonexisting/binary files
1926 * Oinspect.py: Only show docstring for nonexisting/binary files
1917 when doing object??, closing ticket #62
1927 when doing object??, closing ticket #62
1918
1928
1919 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1929 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1920
1930
1921 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1931 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1922 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1932 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1923 was being released in a routine which hadn't checked if it had
1933 was being released in a routine which hadn't checked if it had
1924 been the one to acquire it.
1934 been the one to acquire it.
1925
1935
1926 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1936 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1927
1937
1928 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1938 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1929
1939
1930 2006-04-11 Ville Vainio <vivainio@gmail.com>
1940 2006-04-11 Ville Vainio <vivainio@gmail.com>
1931
1941
1932 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1942 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1933 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1943 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1934 prefilters, allowing stuff like magics and aliases in the file.
1944 prefilters, allowing stuff like magics and aliases in the file.
1935
1945
1936 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1946 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1937 added. Supported now are "%clear in" and "%clear out" (clear input and
1947 added. Supported now are "%clear in" and "%clear out" (clear input and
1938 output history, respectively). Also fixed CachedOutput.flush to
1948 output history, respectively). Also fixed CachedOutput.flush to
1939 properly flush the output cache.
1949 properly flush the output cache.
1940
1950
1941 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1951 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1942 half-success (and fail explicitly).
1952 half-success (and fail explicitly).
1943
1953
1944 2006-03-28 Ville Vainio <vivainio@gmail.com>
1954 2006-03-28 Ville Vainio <vivainio@gmail.com>
1945
1955
1946 * iplib.py: Fix quoting of aliases so that only argless ones
1956 * iplib.py: Fix quoting of aliases so that only argless ones
1947 are quoted
1957 are quoted
1948
1958
1949 2006-03-28 Ville Vainio <vivainio@gmail.com>
1959 2006-03-28 Ville Vainio <vivainio@gmail.com>
1950
1960
1951 * iplib.py: Quote aliases with spaces in the name.
1961 * iplib.py: Quote aliases with spaces in the name.
1952 "c:\program files\blah\bin" is now legal alias target.
1962 "c:\program files\blah\bin" is now legal alias target.
1953
1963
1954 * ext_rehashdir.py: Space no longer allowed as arg
1964 * ext_rehashdir.py: Space no longer allowed as arg
1955 separator, since space is legal in path names.
1965 separator, since space is legal in path names.
1956
1966
1957 2006-03-16 Ville Vainio <vivainio@gmail.com>
1967 2006-03-16 Ville Vainio <vivainio@gmail.com>
1958
1968
1959 * upgrade_dir.py: Take path.py from Extensions, correcting
1969 * upgrade_dir.py: Take path.py from Extensions, correcting
1960 %upgrade magic
1970 %upgrade magic
1961
1971
1962 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1972 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1963
1973
1964 * hooks.py: Only enclose editor binary in quotes if legal and
1974 * hooks.py: Only enclose editor binary in quotes if legal and
1965 necessary (space in the name, and is an existing file). Fixes a bug
1975 necessary (space in the name, and is an existing file). Fixes a bug
1966 reported by Zachary Pincus.
1976 reported by Zachary Pincus.
1967
1977
1968 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1978 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1969
1979
1970 * Manual: thanks to a tip on proper color handling for Emacs, by
1980 * Manual: thanks to a tip on proper color handling for Emacs, by
1971 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1981 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1972
1982
1973 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1983 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1974 by applying the provided patch. Thanks to Liu Jin
1984 by applying the provided patch. Thanks to Liu Jin
1975 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1985 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1976 XEmacs/Linux, I'm trusting the submitter that it actually helps
1986 XEmacs/Linux, I'm trusting the submitter that it actually helps
1977 under win32/GNU Emacs. Will revisit if any problems are reported.
1987 under win32/GNU Emacs. Will revisit if any problems are reported.
1978
1988
1979 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1989 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1980
1990
1981 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1991 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1982 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1992 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1983
1993
1984 2006-03-12 Ville Vainio <vivainio@gmail.com>
1994 2006-03-12 Ville Vainio <vivainio@gmail.com>
1985
1995
1986 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1996 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1987 Torsten Marek.
1997 Torsten Marek.
1988
1998
1989 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1999 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1990
2000
1991 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
2001 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1992 line ranges works again.
2002 line ranges works again.
1993
2003
1994 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
2004 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1995
2005
1996 * IPython/iplib.py (showtraceback): add back sys.last_traceback
2006 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1997 and friends, after a discussion with Zach Pincus on ipython-user.
2007 and friends, after a discussion with Zach Pincus on ipython-user.
1998 I'm not 100% sure, but after thinking about it quite a bit, it may
2008 I'm not 100% sure, but after thinking about it quite a bit, it may
1999 be OK. Testing with the multithreaded shells didn't reveal any
2009 be OK. Testing with the multithreaded shells didn't reveal any
2000 problems, but let's keep an eye out.
2010 problems, but let's keep an eye out.
2001
2011
2002 In the process, I fixed a few things which were calling
2012 In the process, I fixed a few things which were calling
2003 self.InteractiveTB() directly (like safe_execfile), which is a
2013 self.InteractiveTB() directly (like safe_execfile), which is a
2004 mistake: ALL exception reporting should be done by calling
2014 mistake: ALL exception reporting should be done by calling
2005 self.showtraceback(), which handles state and tab-completion and
2015 self.showtraceback(), which handles state and tab-completion and
2006 more.
2016 more.
2007
2017
2008 2006-03-01 Ville Vainio <vivainio@gmail.com>
2018 2006-03-01 Ville Vainio <vivainio@gmail.com>
2009
2019
2010 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
2020 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
2011 To use, do "from ipipe import *".
2021 To use, do "from ipipe import *".
2012
2022
2013 2006-02-24 Ville Vainio <vivainio@gmail.com>
2023 2006-02-24 Ville Vainio <vivainio@gmail.com>
2014
2024
2015 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
2025 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
2016 "cleanly" and safely than the older upgrade mechanism.
2026 "cleanly" and safely than the older upgrade mechanism.
2017
2027
2018 2006-02-21 Ville Vainio <vivainio@gmail.com>
2028 2006-02-21 Ville Vainio <vivainio@gmail.com>
2019
2029
2020 * Magic.py: %save works again.
2030 * Magic.py: %save works again.
2021
2031
2022 2006-02-15 Ville Vainio <vivainio@gmail.com>
2032 2006-02-15 Ville Vainio <vivainio@gmail.com>
2023
2033
2024 * Magic.py: %Pprint works again
2034 * Magic.py: %Pprint works again
2025
2035
2026 * Extensions/ipy_sane_defaults.py: Provide everything provided
2036 * Extensions/ipy_sane_defaults.py: Provide everything provided
2027 in default ipythonrc, to make it possible to have a completely empty
2037 in default ipythonrc, to make it possible to have a completely empty
2028 ipythonrc (and thus completely rc-file free configuration)
2038 ipythonrc (and thus completely rc-file free configuration)
2029
2039
2030 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
2040 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
2031
2041
2032 * IPython/hooks.py (editor): quote the call to the editor command,
2042 * IPython/hooks.py (editor): quote the call to the editor command,
2033 to allow commands with spaces in them. Problem noted by watching
2043 to allow commands with spaces in them. Problem noted by watching
2034 Ian Oswald's video about textpad under win32 at
2044 Ian Oswald's video about textpad under win32 at
2035 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
2045 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
2036
2046
2037 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
2047 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
2038 describing magics (we haven't used @ for a loong time).
2048 describing magics (we haven't used @ for a loong time).
2039
2049
2040 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
2050 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
2041 contributed by marienz to close
2051 contributed by marienz to close
2042 http://www.scipy.net/roundup/ipython/issue53.
2052 http://www.scipy.net/roundup/ipython/issue53.
2043
2053
2044 2006-02-10 Ville Vainio <vivainio@gmail.com>
2054 2006-02-10 Ville Vainio <vivainio@gmail.com>
2045
2055
2046 * genutils.py: getoutput now works in win32 too
2056 * genutils.py: getoutput now works in win32 too
2047
2057
2048 * completer.py: alias and magic completion only invoked
2058 * completer.py: alias and magic completion only invoked
2049 at the first "item" in the line, to avoid "cd %store"
2059 at the first "item" in the line, to avoid "cd %store"
2050 nonsense.
2060 nonsense.
2051
2061
2052 2006-02-09 Ville Vainio <vivainio@gmail.com>
2062 2006-02-09 Ville Vainio <vivainio@gmail.com>
2053
2063
2054 * test/*: Added a unit testing framework (finally).
2064 * test/*: Added a unit testing framework (finally).
2055 '%run runtests.py' to run test_*.
2065 '%run runtests.py' to run test_*.
2056
2066
2057 * ipapi.py: Exposed runlines and set_custom_exc
2067 * ipapi.py: Exposed runlines and set_custom_exc
2058
2068
2059 2006-02-07 Ville Vainio <vivainio@gmail.com>
2069 2006-02-07 Ville Vainio <vivainio@gmail.com>
2060
2070
2061 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
2071 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
2062 instead use "f(1 2)" as before.
2072 instead use "f(1 2)" as before.
2063
2073
2064 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
2074 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
2065
2075
2066 * IPython/demo.py (IPythonDemo): Add new classes to the demo
2076 * IPython/demo.py (IPythonDemo): Add new classes to the demo
2067 facilities, for demos processed by the IPython input filter
2077 facilities, for demos processed by the IPython input filter
2068 (IPythonDemo), and for running a script one-line-at-a-time as a
2078 (IPythonDemo), and for running a script one-line-at-a-time as a
2069 demo, both for pure Python (LineDemo) and for IPython-processed
2079 demo, both for pure Python (LineDemo) and for IPython-processed
2070 input (IPythonLineDemo). After a request by Dave Kohel, from the
2080 input (IPythonLineDemo). After a request by Dave Kohel, from the
2071 SAGE team.
2081 SAGE team.
2072 (Demo.edit): added an edit() method to the demo objects, to edit
2082 (Demo.edit): added an edit() method to the demo objects, to edit
2073 the in-memory copy of the last executed block.
2083 the in-memory copy of the last executed block.
2074
2084
2075 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
2085 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
2076 processing to %edit, %macro and %save. These commands can now be
2086 processing to %edit, %macro and %save. These commands can now be
2077 invoked on the unprocessed input as it was typed by the user
2087 invoked on the unprocessed input as it was typed by the user
2078 (without any prefilters applied). After requests by the SAGE team
2088 (without any prefilters applied). After requests by the SAGE team
2079 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
2089 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
2080
2090
2081 2006-02-01 Ville Vainio <vivainio@gmail.com>
2091 2006-02-01 Ville Vainio <vivainio@gmail.com>
2082
2092
2083 * setup.py, eggsetup.py: easy_install ipython==dev works
2093 * setup.py, eggsetup.py: easy_install ipython==dev works
2084 correctly now (on Linux)
2094 correctly now (on Linux)
2085
2095
2086 * ipy_user_conf,ipmaker: user config changes, removed spurious
2096 * ipy_user_conf,ipmaker: user config changes, removed spurious
2087 warnings
2097 warnings
2088
2098
2089 * iplib: if rc.banner is string, use it as is.
2099 * iplib: if rc.banner is string, use it as is.
2090
2100
2091 * Magic: %pycat accepts a string argument and pages it's contents.
2101 * Magic: %pycat accepts a string argument and pages it's contents.
2092
2102
2093
2103
2094 2006-01-30 Ville Vainio <vivainio@gmail.com>
2104 2006-01-30 Ville Vainio <vivainio@gmail.com>
2095
2105
2096 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2106 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2097 Now %store and bookmarks work through PickleShare, meaning that
2107 Now %store and bookmarks work through PickleShare, meaning that
2098 concurrent access is possible and all ipython sessions see the
2108 concurrent access is possible and all ipython sessions see the
2099 same database situation all the time, instead of snapshot of
2109 same database situation all the time, instead of snapshot of
2100 the situation when the session was started. Hence, %bookmark
2110 the situation when the session was started. Hence, %bookmark
2101 results are immediately accessible from othes sessions. The database
2111 results are immediately accessible from othes sessions. The database
2102 is also available for use by user extensions. See:
2112 is also available for use by user extensions. See:
2103 http://www.python.org/pypi/pickleshare
2113 http://www.python.org/pypi/pickleshare
2104
2114
2105 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2115 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2106
2116
2107 * aliases can now be %store'd
2117 * aliases can now be %store'd
2108
2118
2109 * path.py moved to Extensions so that pickleshare does not need
2119 * path.py moved to Extensions so that pickleshare does not need
2110 IPython-specific import. Extensions added to pythonpath right
2120 IPython-specific import. Extensions added to pythonpath right
2111 at __init__.
2121 at __init__.
2112
2122
2113 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2123 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2114 called with _ip.system and the pre-transformed command string.
2124 called with _ip.system and the pre-transformed command string.
2115
2125
2116 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2126 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2117
2127
2118 * IPython/iplib.py (interact): Fix that we were not catching
2128 * IPython/iplib.py (interact): Fix that we were not catching
2119 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2129 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2120 logic here had to change, but it's fixed now.
2130 logic here had to change, but it's fixed now.
2121
2131
2122 2006-01-29 Ville Vainio <vivainio@gmail.com>
2132 2006-01-29 Ville Vainio <vivainio@gmail.com>
2123
2133
2124 * iplib.py: Try to import pyreadline on Windows.
2134 * iplib.py: Try to import pyreadline on Windows.
2125
2135
2126 2006-01-27 Ville Vainio <vivainio@gmail.com>
2136 2006-01-27 Ville Vainio <vivainio@gmail.com>
2127
2137
2128 * iplib.py: Expose ipapi as _ip in builtin namespace.
2138 * iplib.py: Expose ipapi as _ip in builtin namespace.
2129 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2139 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2130 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2140 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2131 syntax now produce _ip.* variant of the commands.
2141 syntax now produce _ip.* variant of the commands.
2132
2142
2133 * "_ip.options().autoedit_syntax = 2" automatically throws
2143 * "_ip.options().autoedit_syntax = 2" automatically throws
2134 user to editor for syntax error correction without prompting.
2144 user to editor for syntax error correction without prompting.
2135
2145
2136 2006-01-27 Ville Vainio <vivainio@gmail.com>
2146 2006-01-27 Ville Vainio <vivainio@gmail.com>
2137
2147
2138 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2148 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2139 'ipython' at argv[0]) executed through command line.
2149 'ipython' at argv[0]) executed through command line.
2140 NOTE: this DEPRECATES calling ipython with multiple scripts
2150 NOTE: this DEPRECATES calling ipython with multiple scripts
2141 ("ipython a.py b.py c.py")
2151 ("ipython a.py b.py c.py")
2142
2152
2143 * iplib.py, hooks.py: Added configurable input prefilter,
2153 * iplib.py, hooks.py: Added configurable input prefilter,
2144 named 'input_prefilter'. See ext_rescapture.py for example
2154 named 'input_prefilter'. See ext_rescapture.py for example
2145 usage.
2155 usage.
2146
2156
2147 * ext_rescapture.py, Magic.py: Better system command output capture
2157 * ext_rescapture.py, Magic.py: Better system command output capture
2148 through 'var = !ls' (deprecates user-visible %sc). Same notation
2158 through 'var = !ls' (deprecates user-visible %sc). Same notation
2149 applies for magics, 'var = %alias' assigns alias list to var.
2159 applies for magics, 'var = %alias' assigns alias list to var.
2150
2160
2151 * ipapi.py: added meta() for accessing extension-usable data store.
2161 * ipapi.py: added meta() for accessing extension-usable data store.
2152
2162
2153 * iplib.py: added InteractiveShell.getapi(). New magics should be
2163 * iplib.py: added InteractiveShell.getapi(). New magics should be
2154 written doing self.getapi() instead of using the shell directly.
2164 written doing self.getapi() instead of using the shell directly.
2155
2165
2156 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2166 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2157 %store foo >> ~/myfoo.txt to store variables to files (in clean
2167 %store foo >> ~/myfoo.txt to store variables to files (in clean
2158 textual form, not a restorable pickle).
2168 textual form, not a restorable pickle).
2159
2169
2160 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2170 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2161
2171
2162 * usage.py, Magic.py: added %quickref
2172 * usage.py, Magic.py: added %quickref
2163
2173
2164 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2174 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2165
2175
2166 * GetoptErrors when invoking magics etc. with wrong args
2176 * GetoptErrors when invoking magics etc. with wrong args
2167 are now more helpful:
2177 are now more helpful:
2168 GetoptError: option -l not recognized (allowed: "qb" )
2178 GetoptError: option -l not recognized (allowed: "qb" )
2169
2179
2170 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2180 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2171
2181
2172 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2182 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2173 computationally intensive blocks don't appear to stall the demo.
2183 computationally intensive blocks don't appear to stall the demo.
2174
2184
2175 2006-01-24 Ville Vainio <vivainio@gmail.com>
2185 2006-01-24 Ville Vainio <vivainio@gmail.com>
2176
2186
2177 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2187 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2178 value to manipulate resulting history entry.
2188 value to manipulate resulting history entry.
2179
2189
2180 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2190 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2181 to instance methods of IPApi class, to make extending an embedded
2191 to instance methods of IPApi class, to make extending an embedded
2182 IPython feasible. See ext_rehashdir.py for example usage.
2192 IPython feasible. See ext_rehashdir.py for example usage.
2183
2193
2184 * Merged 1071-1076 from branches/0.7.1
2194 * Merged 1071-1076 from branches/0.7.1
2185
2195
2186
2196
2187 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2197 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2188
2198
2189 * tools/release (daystamp): Fix build tools to use the new
2199 * tools/release (daystamp): Fix build tools to use the new
2190 eggsetup.py script to build lightweight eggs.
2200 eggsetup.py script to build lightweight eggs.
2191
2201
2192 * Applied changesets 1062 and 1064 before 0.7.1 release.
2202 * Applied changesets 1062 and 1064 before 0.7.1 release.
2193
2203
2194 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2204 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2195 see the raw input history (without conversions like %ls ->
2205 see the raw input history (without conversions like %ls ->
2196 ipmagic("ls")). After a request from W. Stein, SAGE
2206 ipmagic("ls")). After a request from W. Stein, SAGE
2197 (http://modular.ucsd.edu/sage) developer. This information is
2207 (http://modular.ucsd.edu/sage) developer. This information is
2198 stored in the input_hist_raw attribute of the IPython instance, so
2208 stored in the input_hist_raw attribute of the IPython instance, so
2199 developers can access it if needed (it's an InputList instance).
2209 developers can access it if needed (it's an InputList instance).
2200
2210
2201 * Versionstring = 0.7.2.svn
2211 * Versionstring = 0.7.2.svn
2202
2212
2203 * eggsetup.py: A separate script for constructing eggs, creates
2213 * eggsetup.py: A separate script for constructing eggs, creates
2204 proper launch scripts even on Windows (an .exe file in
2214 proper launch scripts even on Windows (an .exe file in
2205 \python24\scripts).
2215 \python24\scripts).
2206
2216
2207 * ipapi.py: launch_new_instance, launch entry point needed for the
2217 * ipapi.py: launch_new_instance, launch entry point needed for the
2208 egg.
2218 egg.
2209
2219
2210 2006-01-23 Ville Vainio <vivainio@gmail.com>
2220 2006-01-23 Ville Vainio <vivainio@gmail.com>
2211
2221
2212 * Added %cpaste magic for pasting python code
2222 * Added %cpaste magic for pasting python code
2213
2223
2214 2006-01-22 Ville Vainio <vivainio@gmail.com>
2224 2006-01-22 Ville Vainio <vivainio@gmail.com>
2215
2225
2216 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2226 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2217
2227
2218 * Versionstring = 0.7.2.svn
2228 * Versionstring = 0.7.2.svn
2219
2229
2220 * eggsetup.py: A separate script for constructing eggs, creates
2230 * eggsetup.py: A separate script for constructing eggs, creates
2221 proper launch scripts even on Windows (an .exe file in
2231 proper launch scripts even on Windows (an .exe file in
2222 \python24\scripts).
2232 \python24\scripts).
2223
2233
2224 * ipapi.py: launch_new_instance, launch entry point needed for the
2234 * ipapi.py: launch_new_instance, launch entry point needed for the
2225 egg.
2235 egg.
2226
2236
2227 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2237 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2228
2238
2229 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2239 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2230 %pfile foo would print the file for foo even if it was a binary.
2240 %pfile foo would print the file for foo even if it was a binary.
2231 Now, extensions '.so' and '.dll' are skipped.
2241 Now, extensions '.so' and '.dll' are skipped.
2232
2242
2233 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2243 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2234 bug, where macros would fail in all threaded modes. I'm not 100%
2244 bug, where macros would fail in all threaded modes. I'm not 100%
2235 sure, so I'm going to put out an rc instead of making a release
2245 sure, so I'm going to put out an rc instead of making a release
2236 today, and wait for feedback for at least a few days.
2246 today, and wait for feedback for at least a few days.
2237
2247
2238 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2248 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2239 it...) the handling of pasting external code with autoindent on.
2249 it...) the handling of pasting external code with autoindent on.
2240 To get out of a multiline input, the rule will appear for most
2250 To get out of a multiline input, the rule will appear for most
2241 users unchanged: two blank lines or change the indent level
2251 users unchanged: two blank lines or change the indent level
2242 proposed by IPython. But there is a twist now: you can
2252 proposed by IPython. But there is a twist now: you can
2243 add/subtract only *one or two spaces*. If you add/subtract three
2253 add/subtract only *one or two spaces*. If you add/subtract three
2244 or more (unless you completely delete the line), IPython will
2254 or more (unless you completely delete the line), IPython will
2245 accept that line, and you'll need to enter a second one of pure
2255 accept that line, and you'll need to enter a second one of pure
2246 whitespace. I know it sounds complicated, but I can't find a
2256 whitespace. I know it sounds complicated, but I can't find a
2247 different solution that covers all the cases, with the right
2257 different solution that covers all the cases, with the right
2248 heuristics. Hopefully in actual use, nobody will really notice
2258 heuristics. Hopefully in actual use, nobody will really notice
2249 all these strange rules and things will 'just work'.
2259 all these strange rules and things will 'just work'.
2250
2260
2251 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2261 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2252
2262
2253 * IPython/iplib.py (interact): catch exceptions which can be
2263 * IPython/iplib.py (interact): catch exceptions which can be
2254 triggered asynchronously by signal handlers. Thanks to an
2264 triggered asynchronously by signal handlers. Thanks to an
2255 automatic crash report, submitted by Colin Kingsley
2265 automatic crash report, submitted by Colin Kingsley
2256 <tercel-AT-gentoo.org>.
2266 <tercel-AT-gentoo.org>.
2257
2267
2258 2006-01-20 Ville Vainio <vivainio@gmail.com>
2268 2006-01-20 Ville Vainio <vivainio@gmail.com>
2259
2269
2260 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2270 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2261 (%rehashdir, very useful, try it out) of how to extend ipython
2271 (%rehashdir, very useful, try it out) of how to extend ipython
2262 with new magics. Also added Extensions dir to pythonpath to make
2272 with new magics. Also added Extensions dir to pythonpath to make
2263 importing extensions easy.
2273 importing extensions easy.
2264
2274
2265 * %store now complains when trying to store interactively declared
2275 * %store now complains when trying to store interactively declared
2266 classes / instances of those classes.
2276 classes / instances of those classes.
2267
2277
2268 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2278 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2269 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2279 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2270 if they exist, and ipy_user_conf.py with some defaults is created for
2280 if they exist, and ipy_user_conf.py with some defaults is created for
2271 the user.
2281 the user.
2272
2282
2273 * Startup rehashing done by the config file, not InterpreterExec.
2283 * Startup rehashing done by the config file, not InterpreterExec.
2274 This means system commands are available even without selecting the
2284 This means system commands are available even without selecting the
2275 pysh profile. It's the sensible default after all.
2285 pysh profile. It's the sensible default after all.
2276
2286
2277 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2287 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2278
2288
2279 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2289 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2280 multiline code with autoindent on working. But I am really not
2290 multiline code with autoindent on working. But I am really not
2281 sure, so this needs more testing. Will commit a debug-enabled
2291 sure, so this needs more testing. Will commit a debug-enabled
2282 version for now, while I test it some more, so that Ville and
2292 version for now, while I test it some more, so that Ville and
2283 others may also catch any problems. Also made
2293 others may also catch any problems. Also made
2284 self.indent_current_str() a method, to ensure that there's no
2294 self.indent_current_str() a method, to ensure that there's no
2285 chance of the indent space count and the corresponding string
2295 chance of the indent space count and the corresponding string
2286 falling out of sync. All code needing the string should just call
2296 falling out of sync. All code needing the string should just call
2287 the method.
2297 the method.
2288
2298
2289 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2299 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2290
2300
2291 * IPython/Magic.py (magic_edit): fix check for when users don't
2301 * IPython/Magic.py (magic_edit): fix check for when users don't
2292 save their output files, the try/except was in the wrong section.
2302 save their output files, the try/except was in the wrong section.
2293
2303
2294 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2304 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2295
2305
2296 * IPython/Magic.py (magic_run): fix __file__ global missing from
2306 * IPython/Magic.py (magic_run): fix __file__ global missing from
2297 script's namespace when executed via %run. After a report by
2307 script's namespace when executed via %run. After a report by
2298 Vivian.
2308 Vivian.
2299
2309
2300 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2310 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2301 when using python 2.4. The parent constructor changed in 2.4, and
2311 when using python 2.4. The parent constructor changed in 2.4, and
2302 we need to track it directly (we can't call it, as it messes up
2312 we need to track it directly (we can't call it, as it messes up
2303 readline and tab-completion inside our pdb would stop working).
2313 readline and tab-completion inside our pdb would stop working).
2304 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2314 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2305
2315
2306 2006-01-16 Ville Vainio <vivainio@gmail.com>
2316 2006-01-16 Ville Vainio <vivainio@gmail.com>
2307
2317
2308 * Ipython/magic.py: Reverted back to old %edit functionality
2318 * Ipython/magic.py: Reverted back to old %edit functionality
2309 that returns file contents on exit.
2319 that returns file contents on exit.
2310
2320
2311 * IPython/path.py: Added Jason Orendorff's "path" module to
2321 * IPython/path.py: Added Jason Orendorff's "path" module to
2312 IPython tree, http://www.jorendorff.com/articles/python/path/.
2322 IPython tree, http://www.jorendorff.com/articles/python/path/.
2313 You can get path objects conveniently through %sc, and !!, e.g.:
2323 You can get path objects conveniently through %sc, and !!, e.g.:
2314 sc files=ls
2324 sc files=ls
2315 for p in files.paths: # or files.p
2325 for p in files.paths: # or files.p
2316 print p,p.mtime
2326 print p,p.mtime
2317
2327
2318 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2328 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2319 now work again without considering the exclusion regexp -
2329 now work again without considering the exclusion regexp -
2320 hence, things like ',foo my/path' turn to 'foo("my/path")'
2330 hence, things like ',foo my/path' turn to 'foo("my/path")'
2321 instead of syntax error.
2331 instead of syntax error.
2322
2332
2323
2333
2324 2006-01-14 Ville Vainio <vivainio@gmail.com>
2334 2006-01-14 Ville Vainio <vivainio@gmail.com>
2325
2335
2326 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2336 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2327 ipapi decorators for python 2.4 users, options() provides access to rc
2337 ipapi decorators for python 2.4 users, options() provides access to rc
2328 data.
2338 data.
2329
2339
2330 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2340 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2331 as path separators (even on Linux ;-). Space character after
2341 as path separators (even on Linux ;-). Space character after
2332 backslash (as yielded by tab completer) is still space;
2342 backslash (as yielded by tab completer) is still space;
2333 "%cd long\ name" works as expected.
2343 "%cd long\ name" works as expected.
2334
2344
2335 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2345 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2336 as "chain of command", with priority. API stays the same,
2346 as "chain of command", with priority. API stays the same,
2337 TryNext exception raised by a hook function signals that
2347 TryNext exception raised by a hook function signals that
2338 current hook failed and next hook should try handling it, as
2348 current hook failed and next hook should try handling it, as
2339 suggested by Walter Dörwald <walter@livinglogic.de>. Walter also
2349 suggested by Walter Dörwald <walter@livinglogic.de>. Walter also
2340 requested configurable display hook, which is now implemented.
2350 requested configurable display hook, which is now implemented.
2341
2351
2342 2006-01-13 Ville Vainio <vivainio@gmail.com>
2352 2006-01-13 Ville Vainio <vivainio@gmail.com>
2343
2353
2344 * IPython/platutils*.py: platform specific utility functions,
2354 * IPython/platutils*.py: platform specific utility functions,
2345 so far only set_term_title is implemented (change terminal
2355 so far only set_term_title is implemented (change terminal
2346 label in windowing systems). %cd now changes the title to
2356 label in windowing systems). %cd now changes the title to
2347 current dir.
2357 current dir.
2348
2358
2349 * IPython/Release.py: Added myself to "authors" list,
2359 * IPython/Release.py: Added myself to "authors" list,
2350 had to create new files.
2360 had to create new files.
2351
2361
2352 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2362 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2353 shell escape; not a known bug but had potential to be one in the
2363 shell escape; not a known bug but had potential to be one in the
2354 future.
2364 future.
2355
2365
2356 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2366 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2357 extension API for IPython! See the module for usage example. Fix
2367 extension API for IPython! See the module for usage example. Fix
2358 OInspect for docstring-less magic functions.
2368 OInspect for docstring-less magic functions.
2359
2369
2360
2370
2361 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2371 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2362
2372
2363 * IPython/iplib.py (raw_input): temporarily deactivate all
2373 * IPython/iplib.py (raw_input): temporarily deactivate all
2364 attempts at allowing pasting of code with autoindent on. It
2374 attempts at allowing pasting of code with autoindent on. It
2365 introduced bugs (reported by Prabhu) and I can't seem to find a
2375 introduced bugs (reported by Prabhu) and I can't seem to find a
2366 robust combination which works in all cases. Will have to revisit
2376 robust combination which works in all cases. Will have to revisit
2367 later.
2377 later.
2368
2378
2369 * IPython/genutils.py: remove isspace() function. We've dropped
2379 * IPython/genutils.py: remove isspace() function. We've dropped
2370 2.2 compatibility, so it's OK to use the string method.
2380 2.2 compatibility, so it's OK to use the string method.
2371
2381
2372 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2382 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2373
2383
2374 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2384 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2375 matching what NOT to autocall on, to include all python binary
2385 matching what NOT to autocall on, to include all python binary
2376 operators (including things like 'and', 'or', 'is' and 'in').
2386 operators (including things like 'and', 'or', 'is' and 'in').
2377 Prompted by a bug report on 'foo & bar', but I realized we had
2387 Prompted by a bug report on 'foo & bar', but I realized we had
2378 many more potential bug cases with other operators. The regexp is
2388 many more potential bug cases with other operators. The regexp is
2379 self.re_exclude_auto, it's fairly commented.
2389 self.re_exclude_auto, it's fairly commented.
2380
2390
2381 2006-01-12 Ville Vainio <vivainio@gmail.com>
2391 2006-01-12 Ville Vainio <vivainio@gmail.com>
2382
2392
2383 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2393 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2384 Prettified and hardened string/backslash quoting with ipsystem(),
2394 Prettified and hardened string/backslash quoting with ipsystem(),
2385 ipalias() and ipmagic(). Now even \ characters are passed to
2395 ipalias() and ipmagic(). Now even \ characters are passed to
2386 %magics, !shell escapes and aliases exactly as they are in the
2396 %magics, !shell escapes and aliases exactly as they are in the
2387 ipython command line. Should improve backslash experience,
2397 ipython command line. Should improve backslash experience,
2388 particularly in Windows (path delimiter for some commands that
2398 particularly in Windows (path delimiter for some commands that
2389 won't understand '/'), but Unix benefits as well (regexps). %cd
2399 won't understand '/'), but Unix benefits as well (regexps). %cd
2390 magic still doesn't support backslash path delimiters, though. Also
2400 magic still doesn't support backslash path delimiters, though. Also
2391 deleted all pretense of supporting multiline command strings in
2401 deleted all pretense of supporting multiline command strings in
2392 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2402 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2393
2403
2394 * doc/build_doc_instructions.txt added. Documentation on how to
2404 * doc/build_doc_instructions.txt added. Documentation on how to
2395 use doc/update_manual.py, added yesterday. Both files contributed
2405 use doc/update_manual.py, added yesterday. Both files contributed
2396 by Jörgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2406 by Jörgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2397 doc/*.sh for deprecation at a later date.
2407 doc/*.sh for deprecation at a later date.
2398
2408
2399 * /ipython.py Added ipython.py to root directory for
2409 * /ipython.py Added ipython.py to root directory for
2400 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2410 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2401 ipython.py) and development convenience (no need to keep doing
2411 ipython.py) and development convenience (no need to keep doing
2402 "setup.py install" between changes).
2412 "setup.py install" between changes).
2403
2413
2404 * Made ! and !! shell escapes work (again) in multiline expressions:
2414 * Made ! and !! shell escapes work (again) in multiline expressions:
2405 if 1:
2415 if 1:
2406 !ls
2416 !ls
2407 !!ls
2417 !!ls
2408
2418
2409 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2419 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2410
2420
2411 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2421 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2412 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2422 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2413 module in case-insensitive installation. Was causing crashes
2423 module in case-insensitive installation. Was causing crashes
2414 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2424 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2415
2425
2416 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2426 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2417 <marienz-AT-gentoo.org>, closes
2427 <marienz-AT-gentoo.org>, closes
2418 http://www.scipy.net/roundup/ipython/issue51.
2428 http://www.scipy.net/roundup/ipython/issue51.
2419
2429
2420 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2430 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2421
2431
2422 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2432 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2423 problem of excessive CPU usage under *nix and keyboard lag under
2433 problem of excessive CPU usage under *nix and keyboard lag under
2424 win32.
2434 win32.
2425
2435
2426 2006-01-10 *** Released version 0.7.0
2436 2006-01-10 *** Released version 0.7.0
2427
2437
2428 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2438 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2429
2439
2430 * IPython/Release.py (revision): tag version number to 0.7.0,
2440 * IPython/Release.py (revision): tag version number to 0.7.0,
2431 ready for release.
2441 ready for release.
2432
2442
2433 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2443 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2434 it informs the user of the name of the temp. file used. This can
2444 it informs the user of the name of the temp. file used. This can
2435 help if you decide later to reuse that same file, so you know
2445 help if you decide later to reuse that same file, so you know
2436 where to copy the info from.
2446 where to copy the info from.
2437
2447
2438 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2448 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2439
2449
2440 * setup_bdist_egg.py: little script to build an egg. Added
2450 * setup_bdist_egg.py: little script to build an egg. Added
2441 support in the release tools as well.
2451 support in the release tools as well.
2442
2452
2443 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2453 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2444
2454
2445 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2455 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2446 version selection (new -wxversion command line and ipythonrc
2456 version selection (new -wxversion command line and ipythonrc
2447 parameter). Patch contributed by Arnd Baecker
2457 parameter). Patch contributed by Arnd Baecker
2448 <arnd.baecker-AT-web.de>.
2458 <arnd.baecker-AT-web.de>.
2449
2459
2450 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2460 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2451 embedded instances, for variables defined at the interactive
2461 embedded instances, for variables defined at the interactive
2452 prompt of the embedded ipython. Reported by Arnd.
2462 prompt of the embedded ipython. Reported by Arnd.
2453
2463
2454 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2464 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2455 it can be used as a (stateful) toggle, or with a direct parameter.
2465 it can be used as a (stateful) toggle, or with a direct parameter.
2456
2466
2457 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2467 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2458 could be triggered in certain cases and cause the traceback
2468 could be triggered in certain cases and cause the traceback
2459 printer not to work.
2469 printer not to work.
2460
2470
2461 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2471 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2462
2472
2463 * IPython/iplib.py (_should_recompile): Small fix, closes
2473 * IPython/iplib.py (_should_recompile): Small fix, closes
2464 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2474 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2465
2475
2466 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2476 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2467
2477
2468 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2478 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2469 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2479 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2470 Moad for help with tracking it down.
2480 Moad for help with tracking it down.
2471
2481
2472 * IPython/iplib.py (handle_auto): fix autocall handling for
2482 * IPython/iplib.py (handle_auto): fix autocall handling for
2473 objects which support BOTH __getitem__ and __call__ (so that f [x]
2483 objects which support BOTH __getitem__ and __call__ (so that f [x]
2474 is left alone, instead of becoming f([x]) automatically).
2484 is left alone, instead of becoming f([x]) automatically).
2475
2485
2476 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2486 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2477 Ville's patch.
2487 Ville's patch.
2478
2488
2479 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2489 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2480
2490
2481 * IPython/iplib.py (handle_auto): changed autocall semantics to
2491 * IPython/iplib.py (handle_auto): changed autocall semantics to
2482 include 'smart' mode, where the autocall transformation is NOT
2492 include 'smart' mode, where the autocall transformation is NOT
2483 applied if there are no arguments on the line. This allows you to
2493 applied if there are no arguments on the line. This allows you to
2484 just type 'foo' if foo is a callable to see its internal form,
2494 just type 'foo' if foo is a callable to see its internal form,
2485 instead of having it called with no arguments (typically a
2495 instead of having it called with no arguments (typically a
2486 mistake). The old 'full' autocall still exists: for that, you
2496 mistake). The old 'full' autocall still exists: for that, you
2487 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2497 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2488
2498
2489 * IPython/completer.py (Completer.attr_matches): add
2499 * IPython/completer.py (Completer.attr_matches): add
2490 tab-completion support for Enthoughts' traits. After a report by
2500 tab-completion support for Enthoughts' traits. After a report by
2491 Arnd and a patch by Prabhu.
2501 Arnd and a patch by Prabhu.
2492
2502
2493 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2503 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2494
2504
2495 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2505 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2496 Schmolck's patch to fix inspect.getinnerframes().
2506 Schmolck's patch to fix inspect.getinnerframes().
2497
2507
2498 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2508 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2499 for embedded instances, regarding handling of namespaces and items
2509 for embedded instances, regarding handling of namespaces and items
2500 added to the __builtin__ one. Multiple embedded instances and
2510 added to the __builtin__ one. Multiple embedded instances and
2501 recursive embeddings should work better now (though I'm not sure
2511 recursive embeddings should work better now (though I'm not sure
2502 I've got all the corner cases fixed, that code is a bit of a brain
2512 I've got all the corner cases fixed, that code is a bit of a brain
2503 twister).
2513 twister).
2504
2514
2505 * IPython/Magic.py (magic_edit): added support to edit in-memory
2515 * IPython/Magic.py (magic_edit): added support to edit in-memory
2506 macros (automatically creates the necessary temp files). %edit
2516 macros (automatically creates the necessary temp files). %edit
2507 also doesn't return the file contents anymore, it's just noise.
2517 also doesn't return the file contents anymore, it's just noise.
2508
2518
2509 * IPython/completer.py (Completer.attr_matches): revert change to
2519 * IPython/completer.py (Completer.attr_matches): revert change to
2510 complete only on attributes listed in __all__. I realized it
2520 complete only on attributes listed in __all__. I realized it
2511 cripples the tab-completion system as a tool for exploring the
2521 cripples the tab-completion system as a tool for exploring the
2512 internals of unknown libraries (it renders any non-__all__
2522 internals of unknown libraries (it renders any non-__all__
2513 attribute off-limits). I got bit by this when trying to see
2523 attribute off-limits). I got bit by this when trying to see
2514 something inside the dis module.
2524 something inside the dis module.
2515
2525
2516 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2526 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2517
2527
2518 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2528 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2519 namespace for users and extension writers to hold data in. This
2529 namespace for users and extension writers to hold data in. This
2520 follows the discussion in
2530 follows the discussion in
2521 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2531 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2522
2532
2523 * IPython/completer.py (IPCompleter.complete): small patch to help
2533 * IPython/completer.py (IPCompleter.complete): small patch to help
2524 tab-completion under Emacs, after a suggestion by John Barnard
2534 tab-completion under Emacs, after a suggestion by John Barnard
2525 <barnarj-AT-ccf.org>.
2535 <barnarj-AT-ccf.org>.
2526
2536
2527 * IPython/Magic.py (Magic.extract_input_slices): added support for
2537 * IPython/Magic.py (Magic.extract_input_slices): added support for
2528 the slice notation in magics to use N-M to represent numbers N...M
2538 the slice notation in magics to use N-M to represent numbers N...M
2529 (closed endpoints). This is used by %macro and %save.
2539 (closed endpoints). This is used by %macro and %save.
2530
2540
2531 * IPython/completer.py (Completer.attr_matches): for modules which
2541 * IPython/completer.py (Completer.attr_matches): for modules which
2532 define __all__, complete only on those. After a patch by Jeffrey
2542 define __all__, complete only on those. After a patch by Jeffrey
2533 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2543 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2534 speed up this routine.
2544 speed up this routine.
2535
2545
2536 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2546 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2537 don't know if this is the end of it, but the behavior now is
2547 don't know if this is the end of it, but the behavior now is
2538 certainly much more correct. Note that coupled with macros,
2548 certainly much more correct. Note that coupled with macros,
2539 slightly surprising (at first) behavior may occur: a macro will in
2549 slightly surprising (at first) behavior may occur: a macro will in
2540 general expand to multiple lines of input, so upon exiting, the
2550 general expand to multiple lines of input, so upon exiting, the
2541 in/out counters will both be bumped by the corresponding amount
2551 in/out counters will both be bumped by the corresponding amount
2542 (as if the macro's contents had been typed interactively). Typing
2552 (as if the macro's contents had been typed interactively). Typing
2543 %hist will reveal the intermediate (silently processed) lines.
2553 %hist will reveal the intermediate (silently processed) lines.
2544
2554
2545 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2555 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2546 pickle to fail (%run was overwriting __main__ and not restoring
2556 pickle to fail (%run was overwriting __main__ and not restoring
2547 it, but pickle relies on __main__ to operate).
2557 it, but pickle relies on __main__ to operate).
2548
2558
2549 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2559 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2550 using properties, but forgot to make the main InteractiveShell
2560 using properties, but forgot to make the main InteractiveShell
2551 class a new-style class. Properties fail silently, and
2561 class a new-style class. Properties fail silently, and
2552 mysteriously, with old-style class (getters work, but
2562 mysteriously, with old-style class (getters work, but
2553 setters don't do anything).
2563 setters don't do anything).
2554
2564
2555 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2565 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2556
2566
2557 * IPython/Magic.py (magic_history): fix history reporting bug (I
2567 * IPython/Magic.py (magic_history): fix history reporting bug (I
2558 know some nasties are still there, I just can't seem to find a
2568 know some nasties are still there, I just can't seem to find a
2559 reproducible test case to track them down; the input history is
2569 reproducible test case to track them down; the input history is
2560 falling out of sync...)
2570 falling out of sync...)
2561
2571
2562 * IPython/iplib.py (handle_shell_escape): fix bug where both
2572 * IPython/iplib.py (handle_shell_escape): fix bug where both
2563 aliases and system accesses where broken for indented code (such
2573 aliases and system accesses where broken for indented code (such
2564 as loops).
2574 as loops).
2565
2575
2566 * IPython/genutils.py (shell): fix small but critical bug for
2576 * IPython/genutils.py (shell): fix small but critical bug for
2567 win32 system access.
2577 win32 system access.
2568
2578
2569 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2579 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2570
2580
2571 * IPython/iplib.py (showtraceback): remove use of the
2581 * IPython/iplib.py (showtraceback): remove use of the
2572 sys.last_{type/value/traceback} structures, which are non
2582 sys.last_{type/value/traceback} structures, which are non
2573 thread-safe.
2583 thread-safe.
2574 (_prefilter): change control flow to ensure that we NEVER
2584 (_prefilter): change control flow to ensure that we NEVER
2575 introspect objects when autocall is off. This will guarantee that
2585 introspect objects when autocall is off. This will guarantee that
2576 having an input line of the form 'x.y', where access to attribute
2586 having an input line of the form 'x.y', where access to attribute
2577 'y' has side effects, doesn't trigger the side effect TWICE. It
2587 'y' has side effects, doesn't trigger the side effect TWICE. It
2578 is important to note that, with autocall on, these side effects
2588 is important to note that, with autocall on, these side effects
2579 can still happen.
2589 can still happen.
2580 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2590 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2581 trio. IPython offers these three kinds of special calls which are
2591 trio. IPython offers these three kinds of special calls which are
2582 not python code, and it's a good thing to have their call method
2592 not python code, and it's a good thing to have their call method
2583 be accessible as pure python functions (not just special syntax at
2593 be accessible as pure python functions (not just special syntax at
2584 the command line). It gives us a better internal implementation
2594 the command line). It gives us a better internal implementation
2585 structure, as well as exposing these for user scripting more
2595 structure, as well as exposing these for user scripting more
2586 cleanly.
2596 cleanly.
2587
2597
2588 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2598 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2589 file. Now that they'll be more likely to be used with the
2599 file. Now that they'll be more likely to be used with the
2590 persistance system (%store), I want to make sure their module path
2600 persistance system (%store), I want to make sure their module path
2591 doesn't change in the future, so that we don't break things for
2601 doesn't change in the future, so that we don't break things for
2592 users' persisted data.
2602 users' persisted data.
2593
2603
2594 * IPython/iplib.py (autoindent_update): move indentation
2604 * IPython/iplib.py (autoindent_update): move indentation
2595 management into the _text_ processing loop, not the keyboard
2605 management into the _text_ processing loop, not the keyboard
2596 interactive one. This is necessary to correctly process non-typed
2606 interactive one. This is necessary to correctly process non-typed
2597 multiline input (such as macros).
2607 multiline input (such as macros).
2598
2608
2599 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2609 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2600 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2610 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2601 which was producing problems in the resulting manual.
2611 which was producing problems in the resulting manual.
2602 (magic_whos): improve reporting of instances (show their class,
2612 (magic_whos): improve reporting of instances (show their class,
2603 instead of simply printing 'instance' which isn't terribly
2613 instead of simply printing 'instance' which isn't terribly
2604 informative).
2614 informative).
2605
2615
2606 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2616 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2607 (minor mods) to support network shares under win32.
2617 (minor mods) to support network shares under win32.
2608
2618
2609 * IPython/winconsole.py (get_console_size): add new winconsole
2619 * IPython/winconsole.py (get_console_size): add new winconsole
2610 module and fixes to page_dumb() to improve its behavior under
2620 module and fixes to page_dumb() to improve its behavior under
2611 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2621 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2612
2622
2613 * IPython/Magic.py (Macro): simplified Macro class to just
2623 * IPython/Magic.py (Macro): simplified Macro class to just
2614 subclass list. We've had only 2.2 compatibility for a very long
2624 subclass list. We've had only 2.2 compatibility for a very long
2615 time, yet I was still avoiding subclassing the builtin types. No
2625 time, yet I was still avoiding subclassing the builtin types. No
2616 more (I'm also starting to use properties, though I won't shift to
2626 more (I'm also starting to use properties, though I won't shift to
2617 2.3-specific features quite yet).
2627 2.3-specific features quite yet).
2618 (magic_store): added Ville's patch for lightweight variable
2628 (magic_store): added Ville's patch for lightweight variable
2619 persistence, after a request on the user list by Matt Wilkie
2629 persistence, after a request on the user list by Matt Wilkie
2620 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2630 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2621 details.
2631 details.
2622
2632
2623 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2633 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2624 changed the default logfile name from 'ipython.log' to
2634 changed the default logfile name from 'ipython.log' to
2625 'ipython_log.py'. These logs are real python files, and now that
2635 'ipython_log.py'. These logs are real python files, and now that
2626 we have much better multiline support, people are more likely to
2636 we have much better multiline support, people are more likely to
2627 want to use them as such. Might as well name them correctly.
2637 want to use them as such. Might as well name them correctly.
2628
2638
2629 * IPython/Magic.py: substantial cleanup. While we can't stop
2639 * IPython/Magic.py: substantial cleanup. While we can't stop
2630 using magics as mixins, due to the existing customizations 'out
2640 using magics as mixins, due to the existing customizations 'out
2631 there' which rely on the mixin naming conventions, at least I
2641 there' which rely on the mixin naming conventions, at least I
2632 cleaned out all cross-class name usage. So once we are OK with
2642 cleaned out all cross-class name usage. So once we are OK with
2633 breaking compatibility, the two systems can be separated.
2643 breaking compatibility, the two systems can be separated.
2634
2644
2635 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2645 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2636 anymore, and the class is a fair bit less hideous as well. New
2646 anymore, and the class is a fair bit less hideous as well. New
2637 features were also introduced: timestamping of input, and logging
2647 features were also introduced: timestamping of input, and logging
2638 of output results. These are user-visible with the -t and -o
2648 of output results. These are user-visible with the -t and -o
2639 options to %logstart. Closes
2649 options to %logstart. Closes
2640 http://www.scipy.net/roundup/ipython/issue11 and a request by
2650 http://www.scipy.net/roundup/ipython/issue11 and a request by
2641 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2651 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2642
2652
2643 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2653 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2644
2654
2645 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2655 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2646 better handle backslashes in paths. See the thread 'More Windows
2656 better handle backslashes in paths. See the thread 'More Windows
2647 questions part 2 - \/ characters revisited' on the iypthon user
2657 questions part 2 - \/ characters revisited' on the iypthon user
2648 list:
2658 list:
2649 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2659 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2650
2660
2651 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2661 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2652
2662
2653 (InteractiveShell.__init__): change threaded shells to not use the
2663 (InteractiveShell.__init__): change threaded shells to not use the
2654 ipython crash handler. This was causing more problems than not,
2664 ipython crash handler. This was causing more problems than not,
2655 as exceptions in the main thread (GUI code, typically) would
2665 as exceptions in the main thread (GUI code, typically) would
2656 always show up as a 'crash', when they really weren't.
2666 always show up as a 'crash', when they really weren't.
2657
2667
2658 The colors and exception mode commands (%colors/%xmode) have been
2668 The colors and exception mode commands (%colors/%xmode) have been
2659 synchronized to also take this into account, so users can get
2669 synchronized to also take this into account, so users can get
2660 verbose exceptions for their threaded code as well. I also added
2670 verbose exceptions for their threaded code as well. I also added
2661 support for activating pdb inside this exception handler as well,
2671 support for activating pdb inside this exception handler as well,
2662 so now GUI authors can use IPython's enhanced pdb at runtime.
2672 so now GUI authors can use IPython's enhanced pdb at runtime.
2663
2673
2664 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2674 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2665 true by default, and add it to the shipped ipythonrc file. Since
2675 true by default, and add it to the shipped ipythonrc file. Since
2666 this asks the user before proceeding, I think it's OK to make it
2676 this asks the user before proceeding, I think it's OK to make it
2667 true by default.
2677 true by default.
2668
2678
2669 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2679 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2670 of the previous special-casing of input in the eval loop. I think
2680 of the previous special-casing of input in the eval loop. I think
2671 this is cleaner, as they really are commands and shouldn't have
2681 this is cleaner, as they really are commands and shouldn't have
2672 a special role in the middle of the core code.
2682 a special role in the middle of the core code.
2673
2683
2674 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2684 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2675
2685
2676 * IPython/iplib.py (edit_syntax_error): added support for
2686 * IPython/iplib.py (edit_syntax_error): added support for
2677 automatically reopening the editor if the file had a syntax error
2687 automatically reopening the editor if the file had a syntax error
2678 in it. Thanks to scottt who provided the patch at:
2688 in it. Thanks to scottt who provided the patch at:
2679 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2689 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2680 version committed).
2690 version committed).
2681
2691
2682 * IPython/iplib.py (handle_normal): add suport for multi-line
2692 * IPython/iplib.py (handle_normal): add suport for multi-line
2683 input with emtpy lines. This fixes
2693 input with emtpy lines. This fixes
2684 http://www.scipy.net/roundup/ipython/issue43 and a similar
2694 http://www.scipy.net/roundup/ipython/issue43 and a similar
2685 discussion on the user list.
2695 discussion on the user list.
2686
2696
2687 WARNING: a behavior change is necessarily introduced to support
2697 WARNING: a behavior change is necessarily introduced to support
2688 blank lines: now a single blank line with whitespace does NOT
2698 blank lines: now a single blank line with whitespace does NOT
2689 break the input loop, which means that when autoindent is on, by
2699 break the input loop, which means that when autoindent is on, by
2690 default hitting return on the next (indented) line does NOT exit.
2700 default hitting return on the next (indented) line does NOT exit.
2691
2701
2692 Instead, to exit a multiline input you can either have:
2702 Instead, to exit a multiline input you can either have:
2693
2703
2694 - TWO whitespace lines (just hit return again), or
2704 - TWO whitespace lines (just hit return again), or
2695 - a single whitespace line of a different length than provided
2705 - a single whitespace line of a different length than provided
2696 by the autoindent (add or remove a space).
2706 by the autoindent (add or remove a space).
2697
2707
2698 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2708 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2699 module to better organize all readline-related functionality.
2709 module to better organize all readline-related functionality.
2700 I've deleted FlexCompleter and put all completion clases here.
2710 I've deleted FlexCompleter and put all completion clases here.
2701
2711
2702 * IPython/iplib.py (raw_input): improve indentation management.
2712 * IPython/iplib.py (raw_input): improve indentation management.
2703 It is now possible to paste indented code with autoindent on, and
2713 It is now possible to paste indented code with autoindent on, and
2704 the code is interpreted correctly (though it still looks bad on
2714 the code is interpreted correctly (though it still looks bad on
2705 screen, due to the line-oriented nature of ipython).
2715 screen, due to the line-oriented nature of ipython).
2706 (MagicCompleter.complete): change behavior so that a TAB key on an
2716 (MagicCompleter.complete): change behavior so that a TAB key on an
2707 otherwise empty line actually inserts a tab, instead of completing
2717 otherwise empty line actually inserts a tab, instead of completing
2708 on the entire global namespace. This makes it easier to use the
2718 on the entire global namespace. This makes it easier to use the
2709 TAB key for indentation. After a request by Hans Meine
2719 TAB key for indentation. After a request by Hans Meine
2710 <hans_meine-AT-gmx.net>
2720 <hans_meine-AT-gmx.net>
2711 (_prefilter): add support so that typing plain 'exit' or 'quit'
2721 (_prefilter): add support so that typing plain 'exit' or 'quit'
2712 does a sensible thing. Originally I tried to deviate as little as
2722 does a sensible thing. Originally I tried to deviate as little as
2713 possible from the default python behavior, but even that one may
2723 possible from the default python behavior, but even that one may
2714 change in this direction (thread on python-dev to that effect).
2724 change in this direction (thread on python-dev to that effect).
2715 Regardless, ipython should do the right thing even if CPython's
2725 Regardless, ipython should do the right thing even if CPython's
2716 '>>>' prompt doesn't.
2726 '>>>' prompt doesn't.
2717 (InteractiveShell): removed subclassing code.InteractiveConsole
2727 (InteractiveShell): removed subclassing code.InteractiveConsole
2718 class. By now we'd overridden just about all of its methods: I've
2728 class. By now we'd overridden just about all of its methods: I've
2719 copied the remaining two over, and now ipython is a standalone
2729 copied the remaining two over, and now ipython is a standalone
2720 class. This will provide a clearer picture for the chainsaw
2730 class. This will provide a clearer picture for the chainsaw
2721 branch refactoring.
2731 branch refactoring.
2722
2732
2723 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2733 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2724
2734
2725 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2735 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2726 failures for objects which break when dir() is called on them.
2736 failures for objects which break when dir() is called on them.
2727
2737
2728 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2738 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2729 distinct local and global namespaces in the completer API. This
2739 distinct local and global namespaces in the completer API. This
2730 change allows us to properly handle completion with distinct
2740 change allows us to properly handle completion with distinct
2731 scopes, including in embedded instances (this had never really
2741 scopes, including in embedded instances (this had never really
2732 worked correctly).
2742 worked correctly).
2733
2743
2734 Note: this introduces a change in the constructor for
2744 Note: this introduces a change in the constructor for
2735 MagicCompleter, as a new global_namespace parameter is now the
2745 MagicCompleter, as a new global_namespace parameter is now the
2736 second argument (the others were bumped one position).
2746 second argument (the others were bumped one position).
2737
2747
2738 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2748 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2739
2749
2740 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2750 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2741 embedded instances (which can be done now thanks to Vivian's
2751 embedded instances (which can be done now thanks to Vivian's
2742 frame-handling fixes for pdb).
2752 frame-handling fixes for pdb).
2743 (InteractiveShell.__init__): Fix namespace handling problem in
2753 (InteractiveShell.__init__): Fix namespace handling problem in
2744 embedded instances. We were overwriting __main__ unconditionally,
2754 embedded instances. We were overwriting __main__ unconditionally,
2745 and this should only be done for 'full' (non-embedded) IPython;
2755 and this should only be done for 'full' (non-embedded) IPython;
2746 embedded instances must respect the caller's __main__. Thanks to
2756 embedded instances must respect the caller's __main__. Thanks to
2747 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2757 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2748
2758
2749 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2759 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2750
2760
2751 * setup.py: added download_url to setup(). This registers the
2761 * setup.py: added download_url to setup(). This registers the
2752 download address at PyPI, which is not only useful to humans
2762 download address at PyPI, which is not only useful to humans
2753 browsing the site, but is also picked up by setuptools (the Eggs
2763 browsing the site, but is also picked up by setuptools (the Eggs
2754 machinery). Thanks to Ville and R. Kern for the info/discussion
2764 machinery). Thanks to Ville and R. Kern for the info/discussion
2755 on this.
2765 on this.
2756
2766
2757 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2767 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2758
2768
2759 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2769 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2760 This brings a lot of nice functionality to the pdb mode, which now
2770 This brings a lot of nice functionality to the pdb mode, which now
2761 has tab-completion, syntax highlighting, and better stack handling
2771 has tab-completion, syntax highlighting, and better stack handling
2762 than before. Many thanks to Vivian De Smedt
2772 than before. Many thanks to Vivian De Smedt
2763 <vivian-AT-vdesmedt.com> for the original patches.
2773 <vivian-AT-vdesmedt.com> for the original patches.
2764
2774
2765 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2775 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2766
2776
2767 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2777 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2768 sequence to consistently accept the banner argument. The
2778 sequence to consistently accept the banner argument. The
2769 inconsistency was tripping SAGE, thanks to Gary Zablackis
2779 inconsistency was tripping SAGE, thanks to Gary Zablackis
2770 <gzabl-AT-yahoo.com> for the report.
2780 <gzabl-AT-yahoo.com> for the report.
2771
2781
2772 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2782 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2773
2783
2774 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2784 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2775 Fix bug where a naked 'alias' call in the ipythonrc file would
2785 Fix bug where a naked 'alias' call in the ipythonrc file would
2776 cause a crash. Bug reported by Jorgen Stenarson.
2786 cause a crash. Bug reported by Jorgen Stenarson.
2777
2787
2778 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2788 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2779
2789
2780 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2790 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2781 startup time.
2791 startup time.
2782
2792
2783 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2793 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2784 instances had introduced a bug with globals in normal code. Now
2794 instances had introduced a bug with globals in normal code. Now
2785 it's working in all cases.
2795 it's working in all cases.
2786
2796
2787 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2797 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2788 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2798 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2789 has been introduced to set the default case sensitivity of the
2799 has been introduced to set the default case sensitivity of the
2790 searches. Users can still select either mode at runtime on a
2800 searches. Users can still select either mode at runtime on a
2791 per-search basis.
2801 per-search basis.
2792
2802
2793 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2803 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2794
2804
2795 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2805 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2796 attributes in wildcard searches for subclasses. Modified version
2806 attributes in wildcard searches for subclasses. Modified version
2797 of a patch by Jorgen.
2807 of a patch by Jorgen.
2798
2808
2799 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2809 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2800
2810
2801 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2811 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2802 embedded instances. I added a user_global_ns attribute to the
2812 embedded instances. I added a user_global_ns attribute to the
2803 InteractiveShell class to handle this.
2813 InteractiveShell class to handle this.
2804
2814
2805 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2815 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2806
2816
2807 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2817 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2808 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2818 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2809 (reported under win32, but may happen also in other platforms).
2819 (reported under win32, but may happen also in other platforms).
2810 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2820 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2811
2821
2812 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2822 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2813
2823
2814 * IPython/Magic.py (magic_psearch): new support for wildcard
2824 * IPython/Magic.py (magic_psearch): new support for wildcard
2815 patterns. Now, typing ?a*b will list all names which begin with a
2825 patterns. Now, typing ?a*b will list all names which begin with a
2816 and end in b, for example. The %psearch magic has full
2826 and end in b, for example. The %psearch magic has full
2817 docstrings. Many thanks to Jörgen Stenarson
2827 docstrings. Many thanks to Jörgen Stenarson
2818 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2828 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2819 implementing this functionality.
2829 implementing this functionality.
2820
2830
2821 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2831 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2822
2832
2823 * Manual: fixed long-standing annoyance of double-dashes (as in
2833 * Manual: fixed long-standing annoyance of double-dashes (as in
2824 --prefix=~, for example) being stripped in the HTML version. This
2834 --prefix=~, for example) being stripped in the HTML version. This
2825 is a latex2html bug, but a workaround was provided. Many thanks
2835 is a latex2html bug, but a workaround was provided. Many thanks
2826 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2836 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2827 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2837 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2828 rolling. This seemingly small issue had tripped a number of users
2838 rolling. This seemingly small issue had tripped a number of users
2829 when first installing, so I'm glad to see it gone.
2839 when first installing, so I'm glad to see it gone.
2830
2840
2831 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2841 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2832
2842
2833 * IPython/Extensions/numeric_formats.py: fix missing import,
2843 * IPython/Extensions/numeric_formats.py: fix missing import,
2834 reported by Stephen Walton.
2844 reported by Stephen Walton.
2835
2845
2836 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2846 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2837
2847
2838 * IPython/demo.py: finish demo module, fully documented now.
2848 * IPython/demo.py: finish demo module, fully documented now.
2839
2849
2840 * IPython/genutils.py (file_read): simple little utility to read a
2850 * IPython/genutils.py (file_read): simple little utility to read a
2841 file and ensure it's closed afterwards.
2851 file and ensure it's closed afterwards.
2842
2852
2843 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2853 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2844
2854
2845 * IPython/demo.py (Demo.__init__): added support for individually
2855 * IPython/demo.py (Demo.__init__): added support for individually
2846 tagging blocks for automatic execution.
2856 tagging blocks for automatic execution.
2847
2857
2848 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2858 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2849 syntax-highlighted python sources, requested by John.
2859 syntax-highlighted python sources, requested by John.
2850
2860
2851 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2861 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2852
2862
2853 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2863 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2854 finishing.
2864 finishing.
2855
2865
2856 * IPython/genutils.py (shlex_split): moved from Magic to here,
2866 * IPython/genutils.py (shlex_split): moved from Magic to here,
2857 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2867 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2858
2868
2859 * IPython/demo.py (Demo.__init__): added support for silent
2869 * IPython/demo.py (Demo.__init__): added support for silent
2860 blocks, improved marks as regexps, docstrings written.
2870 blocks, improved marks as regexps, docstrings written.
2861 (Demo.__init__): better docstring, added support for sys.argv.
2871 (Demo.__init__): better docstring, added support for sys.argv.
2862
2872
2863 * IPython/genutils.py (marquee): little utility used by the demo
2873 * IPython/genutils.py (marquee): little utility used by the demo
2864 code, handy in general.
2874 code, handy in general.
2865
2875
2866 * IPython/demo.py (Demo.__init__): new class for interactive
2876 * IPython/demo.py (Demo.__init__): new class for interactive
2867 demos. Not documented yet, I just wrote it in a hurry for
2877 demos. Not documented yet, I just wrote it in a hurry for
2868 scipy'05. Will docstring later.
2878 scipy'05. Will docstring later.
2869
2879
2870 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2880 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2871
2881
2872 * IPython/Shell.py (sigint_handler): Drastic simplification which
2882 * IPython/Shell.py (sigint_handler): Drastic simplification which
2873 also seems to make Ctrl-C work correctly across threads! This is
2883 also seems to make Ctrl-C work correctly across threads! This is
2874 so simple, that I can't beleive I'd missed it before. Needs more
2884 so simple, that I can't beleive I'd missed it before. Needs more
2875 testing, though.
2885 testing, though.
2876 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2886 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2877 like this before...
2887 like this before...
2878
2888
2879 * IPython/genutils.py (get_home_dir): add protection against
2889 * IPython/genutils.py (get_home_dir): add protection against
2880 non-dirs in win32 registry.
2890 non-dirs in win32 registry.
2881
2891
2882 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2892 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2883 bug where dict was mutated while iterating (pysh crash).
2893 bug where dict was mutated while iterating (pysh crash).
2884
2894
2885 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2895 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2886
2896
2887 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2897 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2888 spurious newlines added by this routine. After a report by
2898 spurious newlines added by this routine. After a report by
2889 F. Mantegazza.
2899 F. Mantegazza.
2890
2900
2891 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2901 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2892
2902
2893 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2903 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2894 calls. These were a leftover from the GTK 1.x days, and can cause
2904 calls. These were a leftover from the GTK 1.x days, and can cause
2895 problems in certain cases (after a report by John Hunter).
2905 problems in certain cases (after a report by John Hunter).
2896
2906
2897 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2907 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2898 os.getcwd() fails at init time. Thanks to patch from David Remahl
2908 os.getcwd() fails at init time. Thanks to patch from David Remahl
2899 <chmod007-AT-mac.com>.
2909 <chmod007-AT-mac.com>.
2900 (InteractiveShell.__init__): prevent certain special magics from
2910 (InteractiveShell.__init__): prevent certain special magics from
2901 being shadowed by aliases. Closes
2911 being shadowed by aliases. Closes
2902 http://www.scipy.net/roundup/ipython/issue41.
2912 http://www.scipy.net/roundup/ipython/issue41.
2903
2913
2904 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2914 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2905
2915
2906 * IPython/iplib.py (InteractiveShell.complete): Added new
2916 * IPython/iplib.py (InteractiveShell.complete): Added new
2907 top-level completion method to expose the completion mechanism
2917 top-level completion method to expose the completion mechanism
2908 beyond readline-based environments.
2918 beyond readline-based environments.
2909
2919
2910 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2920 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2911
2921
2912 * tools/ipsvnc (svnversion): fix svnversion capture.
2922 * tools/ipsvnc (svnversion): fix svnversion capture.
2913
2923
2914 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2924 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2915 attribute to self, which was missing. Before, it was set by a
2925 attribute to self, which was missing. Before, it was set by a
2916 routine which in certain cases wasn't being called, so the
2926 routine which in certain cases wasn't being called, so the
2917 instance could end up missing the attribute. This caused a crash.
2927 instance could end up missing the attribute. This caused a crash.
2918 Closes http://www.scipy.net/roundup/ipython/issue40.
2928 Closes http://www.scipy.net/roundup/ipython/issue40.
2919
2929
2920 2005-08-16 Fernando Perez <fperez@colorado.edu>
2930 2005-08-16 Fernando Perez <fperez@colorado.edu>
2921
2931
2922 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2932 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2923 contains non-string attribute. Closes
2933 contains non-string attribute. Closes
2924 http://www.scipy.net/roundup/ipython/issue38.
2934 http://www.scipy.net/roundup/ipython/issue38.
2925
2935
2926 2005-08-14 Fernando Perez <fperez@colorado.edu>
2936 2005-08-14 Fernando Perez <fperez@colorado.edu>
2927
2937
2928 * tools/ipsvnc: Minor improvements, to add changeset info.
2938 * tools/ipsvnc: Minor improvements, to add changeset info.
2929
2939
2930 2005-08-12 Fernando Perez <fperez@colorado.edu>
2940 2005-08-12 Fernando Perez <fperez@colorado.edu>
2931
2941
2932 * IPython/iplib.py (runsource): remove self.code_to_run_src
2942 * IPython/iplib.py (runsource): remove self.code_to_run_src
2933 attribute. I realized this is nothing more than
2943 attribute. I realized this is nothing more than
2934 '\n'.join(self.buffer), and having the same data in two different
2944 '\n'.join(self.buffer), and having the same data in two different
2935 places is just asking for synchronization bugs. This may impact
2945 places is just asking for synchronization bugs. This may impact
2936 people who have custom exception handlers, so I need to warn
2946 people who have custom exception handlers, so I need to warn
2937 ipython-dev about it (F. Mantegazza may use them).
2947 ipython-dev about it (F. Mantegazza may use them).
2938
2948
2939 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2949 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2940
2950
2941 * IPython/genutils.py: fix 2.2 compatibility (generators)
2951 * IPython/genutils.py: fix 2.2 compatibility (generators)
2942
2952
2943 2005-07-18 Fernando Perez <fperez@colorado.edu>
2953 2005-07-18 Fernando Perez <fperez@colorado.edu>
2944
2954
2945 * IPython/genutils.py (get_home_dir): fix to help users with
2955 * IPython/genutils.py (get_home_dir): fix to help users with
2946 invalid $HOME under win32.
2956 invalid $HOME under win32.
2947
2957
2948 2005-07-17 Fernando Perez <fperez@colorado.edu>
2958 2005-07-17 Fernando Perez <fperez@colorado.edu>
2949
2959
2950 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2960 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2951 some old hacks and clean up a bit other routines; code should be
2961 some old hacks and clean up a bit other routines; code should be
2952 simpler and a bit faster.
2962 simpler and a bit faster.
2953
2963
2954 * IPython/iplib.py (interact): removed some last-resort attempts
2964 * IPython/iplib.py (interact): removed some last-resort attempts
2955 to survive broken stdout/stderr. That code was only making it
2965 to survive broken stdout/stderr. That code was only making it
2956 harder to abstract out the i/o (necessary for gui integration),
2966 harder to abstract out the i/o (necessary for gui integration),
2957 and the crashes it could prevent were extremely rare in practice
2967 and the crashes it could prevent were extremely rare in practice
2958 (besides being fully user-induced in a pretty violent manner).
2968 (besides being fully user-induced in a pretty violent manner).
2959
2969
2960 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2970 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2961 Nothing major yet, but the code is simpler to read; this should
2971 Nothing major yet, but the code is simpler to read; this should
2962 make it easier to do more serious modifications in the future.
2972 make it easier to do more serious modifications in the future.
2963
2973
2964 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2974 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2965 which broke in .15 (thanks to a report by Ville).
2975 which broke in .15 (thanks to a report by Ville).
2966
2976
2967 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2977 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2968 be quite correct, I know next to nothing about unicode). This
2978 be quite correct, I know next to nothing about unicode). This
2969 will allow unicode strings to be used in prompts, amongst other
2979 will allow unicode strings to be used in prompts, amongst other
2970 cases. It also will prevent ipython from crashing when unicode
2980 cases. It also will prevent ipython from crashing when unicode
2971 shows up unexpectedly in many places. If ascii encoding fails, we
2981 shows up unexpectedly in many places. If ascii encoding fails, we
2972 assume utf_8. Currently the encoding is not a user-visible
2982 assume utf_8. Currently the encoding is not a user-visible
2973 setting, though it could be made so if there is demand for it.
2983 setting, though it could be made so if there is demand for it.
2974
2984
2975 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2985 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2976
2986
2977 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2987 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2978
2988
2979 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2989 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2980
2990
2981 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2991 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2982 code can work transparently for 2.2/2.3.
2992 code can work transparently for 2.2/2.3.
2983
2993
2984 2005-07-16 Fernando Perez <fperez@colorado.edu>
2994 2005-07-16 Fernando Perez <fperez@colorado.edu>
2985
2995
2986 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2996 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2987 out of the color scheme table used for coloring exception
2997 out of the color scheme table used for coloring exception
2988 tracebacks. This allows user code to add new schemes at runtime.
2998 tracebacks. This allows user code to add new schemes at runtime.
2989 This is a minimally modified version of the patch at
2999 This is a minimally modified version of the patch at
2990 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
3000 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2991 for the contribution.
3001 for the contribution.
2992
3002
2993 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
3003 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2994 slightly modified version of the patch in
3004 slightly modified version of the patch in
2995 http://www.scipy.net/roundup/ipython/issue34, which also allows me
3005 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2996 to remove the previous try/except solution (which was costlier).
3006 to remove the previous try/except solution (which was costlier).
2997 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
3007 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2998
3008
2999 2005-06-08 Fernando Perez <fperez@colorado.edu>
3009 2005-06-08 Fernando Perez <fperez@colorado.edu>
3000
3010
3001 * IPython/iplib.py (write/write_err): Add methods to abstract all
3011 * IPython/iplib.py (write/write_err): Add methods to abstract all
3002 I/O a bit more.
3012 I/O a bit more.
3003
3013
3004 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
3014 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
3005 warning, reported by Aric Hagberg, fix by JD Hunter.
3015 warning, reported by Aric Hagberg, fix by JD Hunter.
3006
3016
3007 2005-06-02 *** Released version 0.6.15
3017 2005-06-02 *** Released version 0.6.15
3008
3018
3009 2005-06-01 Fernando Perez <fperez@colorado.edu>
3019 2005-06-01 Fernando Perez <fperez@colorado.edu>
3010
3020
3011 * IPython/iplib.py (MagicCompleter.file_matches): Fix
3021 * IPython/iplib.py (MagicCompleter.file_matches): Fix
3012 tab-completion of filenames within open-quoted strings. Note that
3022 tab-completion of filenames within open-quoted strings. Note that
3013 this requires that in ~/.ipython/ipythonrc, users change the
3023 this requires that in ~/.ipython/ipythonrc, users change the
3014 readline delimiters configuration to read:
3024 readline delimiters configuration to read:
3015
3025
3016 readline_remove_delims -/~
3026 readline_remove_delims -/~
3017
3027
3018
3028
3019 2005-05-31 *** Released version 0.6.14
3029 2005-05-31 *** Released version 0.6.14
3020
3030
3021 2005-05-29 Fernando Perez <fperez@colorado.edu>
3031 2005-05-29 Fernando Perez <fperez@colorado.edu>
3022
3032
3023 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
3033 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
3024 with files not on the filesystem. Reported by Eliyahu Sandler
3034 with files not on the filesystem. Reported by Eliyahu Sandler
3025 <eli@gondolin.net>
3035 <eli@gondolin.net>
3026
3036
3027 2005-05-22 Fernando Perez <fperez@colorado.edu>
3037 2005-05-22 Fernando Perez <fperez@colorado.edu>
3028
3038
3029 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
3039 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
3030 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
3040 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
3031
3041
3032 2005-05-19 Fernando Perez <fperez@colorado.edu>
3042 2005-05-19 Fernando Perez <fperez@colorado.edu>
3033
3043
3034 * IPython/iplib.py (safe_execfile): close a file which could be
3044 * IPython/iplib.py (safe_execfile): close a file which could be
3035 left open (causing problems in win32, which locks open files).
3045 left open (causing problems in win32, which locks open files).
3036 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
3046 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
3037
3047
3038 2005-05-18 Fernando Perez <fperez@colorado.edu>
3048 2005-05-18 Fernando Perez <fperez@colorado.edu>
3039
3049
3040 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
3050 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
3041 keyword arguments correctly to safe_execfile().
3051 keyword arguments correctly to safe_execfile().
3042
3052
3043 2005-05-13 Fernando Perez <fperez@colorado.edu>
3053 2005-05-13 Fernando Perez <fperez@colorado.edu>
3044
3054
3045 * ipython.1: Added info about Qt to manpage, and threads warning
3055 * ipython.1: Added info about Qt to manpage, and threads warning
3046 to usage page (invoked with --help).
3056 to usage page (invoked with --help).
3047
3057
3048 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
3058 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
3049 new matcher (it goes at the end of the priority list) to do
3059 new matcher (it goes at the end of the priority list) to do
3050 tab-completion on named function arguments. Submitted by George
3060 tab-completion on named function arguments. Submitted by George
3051 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
3061 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
3052 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
3062 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
3053 for more details.
3063 for more details.
3054
3064
3055 * IPython/Magic.py (magic_run): Added new -e flag to ignore
3065 * IPython/Magic.py (magic_run): Added new -e flag to ignore
3056 SystemExit exceptions in the script being run. Thanks to a report
3066 SystemExit exceptions in the script being run. Thanks to a report
3057 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
3067 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
3058 producing very annoying behavior when running unit tests.
3068 producing very annoying behavior when running unit tests.
3059
3069
3060 2005-05-12 Fernando Perez <fperez@colorado.edu>
3070 2005-05-12 Fernando Perez <fperez@colorado.edu>
3061
3071
3062 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
3072 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
3063 which I'd broken (again) due to a changed regexp. In the process,
3073 which I'd broken (again) due to a changed regexp. In the process,
3064 added ';' as an escape to auto-quote the whole line without
3074 added ';' as an escape to auto-quote the whole line without
3065 splitting its arguments. Thanks to a report by Jerry McRae
3075 splitting its arguments. Thanks to a report by Jerry McRae
3066 <qrs0xyc02-AT-sneakemail.com>.
3076 <qrs0xyc02-AT-sneakemail.com>.
3067
3077
3068 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
3078 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
3069 possible crashes caused by a TokenError. Reported by Ed Schofield
3079 possible crashes caused by a TokenError. Reported by Ed Schofield
3070 <schofield-AT-ftw.at>.
3080 <schofield-AT-ftw.at>.
3071
3081
3072 2005-05-06 Fernando Perez <fperez@colorado.edu>
3082 2005-05-06 Fernando Perez <fperez@colorado.edu>
3073
3083
3074 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
3084 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
3075
3085
3076 2005-04-29 Fernando Perez <fperez@colorado.edu>
3086 2005-04-29 Fernando Perez <fperez@colorado.edu>
3077
3087
3078 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
3088 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
3079 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
3089 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
3080 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
3090 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
3081 which provides support for Qt interactive usage (similar to the
3091 which provides support for Qt interactive usage (similar to the
3082 existing one for WX and GTK). This had been often requested.
3092 existing one for WX and GTK). This had been often requested.
3083
3093
3084 2005-04-14 *** Released version 0.6.13
3094 2005-04-14 *** Released version 0.6.13
3085
3095
3086 2005-04-08 Fernando Perez <fperez@colorado.edu>
3096 2005-04-08 Fernando Perez <fperez@colorado.edu>
3087
3097
3088 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3098 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3089 from _ofind, which gets called on almost every input line. Now,
3099 from _ofind, which gets called on almost every input line. Now,
3090 we only try to get docstrings if they are actually going to be
3100 we only try to get docstrings if they are actually going to be
3091 used (the overhead of fetching unnecessary docstrings can be
3101 used (the overhead of fetching unnecessary docstrings can be
3092 noticeable for certain objects, such as Pyro proxies).
3102 noticeable for certain objects, such as Pyro proxies).
3093
3103
3094 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3104 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3095 for completers. For some reason I had been passing them the state
3105 for completers. For some reason I had been passing them the state
3096 variable, which completers never actually need, and was in
3106 variable, which completers never actually need, and was in
3097 conflict with the rlcompleter API. Custom completers ONLY need to
3107 conflict with the rlcompleter API. Custom completers ONLY need to
3098 take the text parameter.
3108 take the text parameter.
3099
3109
3100 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3110 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3101 work correctly in pysh. I've also moved all the logic which used
3111 work correctly in pysh. I've also moved all the logic which used
3102 to be in pysh.py here, which will prevent problems with future
3112 to be in pysh.py here, which will prevent problems with future
3103 upgrades. However, this time I must warn users to update their
3113 upgrades. However, this time I must warn users to update their
3104 pysh profile to include the line
3114 pysh profile to include the line
3105
3115
3106 import_all IPython.Extensions.InterpreterExec
3116 import_all IPython.Extensions.InterpreterExec
3107
3117
3108 because otherwise things won't work for them. They MUST also
3118 because otherwise things won't work for them. They MUST also
3109 delete pysh.py and the line
3119 delete pysh.py and the line
3110
3120
3111 execfile pysh.py
3121 execfile pysh.py
3112
3122
3113 from their ipythonrc-pysh.
3123 from their ipythonrc-pysh.
3114
3124
3115 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3125 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3116 robust in the face of objects whose dir() returns non-strings
3126 robust in the face of objects whose dir() returns non-strings
3117 (which it shouldn't, but some broken libs like ITK do). Thanks to
3127 (which it shouldn't, but some broken libs like ITK do). Thanks to
3118 a patch by John Hunter (implemented differently, though). Also
3128 a patch by John Hunter (implemented differently, though). Also
3119 minor improvements by using .extend instead of + on lists.
3129 minor improvements by using .extend instead of + on lists.
3120
3130
3121 * pysh.py:
3131 * pysh.py:
3122
3132
3123 2005-04-06 Fernando Perez <fperez@colorado.edu>
3133 2005-04-06 Fernando Perez <fperez@colorado.edu>
3124
3134
3125 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3135 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3126 by default, so that all users benefit from it. Those who don't
3136 by default, so that all users benefit from it. Those who don't
3127 want it can still turn it off.
3137 want it can still turn it off.
3128
3138
3129 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3139 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3130 config file, I'd forgotten about this, so users were getting it
3140 config file, I'd forgotten about this, so users were getting it
3131 off by default.
3141 off by default.
3132
3142
3133 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3143 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3134 consistency. Now magics can be called in multiline statements,
3144 consistency. Now magics can be called in multiline statements,
3135 and python variables can be expanded in magic calls via $var.
3145 and python variables can be expanded in magic calls via $var.
3136 This makes the magic system behave just like aliases or !system
3146 This makes the magic system behave just like aliases or !system
3137 calls.
3147 calls.
3138
3148
3139 2005-03-28 Fernando Perez <fperez@colorado.edu>
3149 2005-03-28 Fernando Perez <fperez@colorado.edu>
3140
3150
3141 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3151 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3142 expensive string additions for building command. Add support for
3152 expensive string additions for building command. Add support for
3143 trailing ';' when autocall is used.
3153 trailing ';' when autocall is used.
3144
3154
3145 2005-03-26 Fernando Perez <fperez@colorado.edu>
3155 2005-03-26 Fernando Perez <fperez@colorado.edu>
3146
3156
3147 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3157 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3148 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3158 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3149 ipython.el robust against prompts with any number of spaces
3159 ipython.el robust against prompts with any number of spaces
3150 (including 0) after the ':' character.
3160 (including 0) after the ':' character.
3151
3161
3152 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3162 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3153 continuation prompt, which misled users to think the line was
3163 continuation prompt, which misled users to think the line was
3154 already indented. Closes debian Bug#300847, reported to me by
3164 already indented. Closes debian Bug#300847, reported to me by
3155 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3165 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3156
3166
3157 2005-03-23 Fernando Perez <fperez@colorado.edu>
3167 2005-03-23 Fernando Perez <fperez@colorado.edu>
3158
3168
3159 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3169 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3160 properly aligned if they have embedded newlines.
3170 properly aligned if they have embedded newlines.
3161
3171
3162 * IPython/iplib.py (runlines): Add a public method to expose
3172 * IPython/iplib.py (runlines): Add a public method to expose
3163 IPython's code execution machinery, so that users can run strings
3173 IPython's code execution machinery, so that users can run strings
3164 as if they had been typed at the prompt interactively.
3174 as if they had been typed at the prompt interactively.
3165 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3175 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3166 methods which can call the system shell, but with python variable
3176 methods which can call the system shell, but with python variable
3167 expansion. The three such methods are: __IPYTHON__.system,
3177 expansion. The three such methods are: __IPYTHON__.system,
3168 .getoutput and .getoutputerror. These need to be documented in a
3178 .getoutput and .getoutputerror. These need to be documented in a
3169 'public API' section (to be written) of the manual.
3179 'public API' section (to be written) of the manual.
3170
3180
3171 2005-03-20 Fernando Perez <fperez@colorado.edu>
3181 2005-03-20 Fernando Perez <fperez@colorado.edu>
3172
3182
3173 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3183 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3174 for custom exception handling. This is quite powerful, and it
3184 for custom exception handling. This is quite powerful, and it
3175 allows for user-installable exception handlers which can trap
3185 allows for user-installable exception handlers which can trap
3176 custom exceptions at runtime and treat them separately from
3186 custom exceptions at runtime and treat them separately from
3177 IPython's default mechanisms. At the request of Frédéric
3187 IPython's default mechanisms. At the request of Frédéric
3178 Mantegazza <mantegazza-AT-ill.fr>.
3188 Mantegazza <mantegazza-AT-ill.fr>.
3179 (InteractiveShell.set_custom_completer): public API function to
3189 (InteractiveShell.set_custom_completer): public API function to
3180 add new completers at runtime.
3190 add new completers at runtime.
3181
3191
3182 2005-03-19 Fernando Perez <fperez@colorado.edu>
3192 2005-03-19 Fernando Perez <fperez@colorado.edu>
3183
3193
3184 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3194 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3185 allow objects which provide their docstrings via non-standard
3195 allow objects which provide their docstrings via non-standard
3186 mechanisms (like Pyro proxies) to still be inspected by ipython's
3196 mechanisms (like Pyro proxies) to still be inspected by ipython's
3187 ? system.
3197 ? system.
3188
3198
3189 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3199 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3190 automatic capture system. I tried quite hard to make it work
3200 automatic capture system. I tried quite hard to make it work
3191 reliably, and simply failed. I tried many combinations with the
3201 reliably, and simply failed. I tried many combinations with the
3192 subprocess module, but eventually nothing worked in all needed
3202 subprocess module, but eventually nothing worked in all needed
3193 cases (not blocking stdin for the child, duplicating stdout
3203 cases (not blocking stdin for the child, duplicating stdout
3194 without blocking, etc). The new %sc/%sx still do capture to these
3204 without blocking, etc). The new %sc/%sx still do capture to these
3195 magical list/string objects which make shell use much more
3205 magical list/string objects which make shell use much more
3196 conveninent, so not all is lost.
3206 conveninent, so not all is lost.
3197
3207
3198 XXX - FIX MANUAL for the change above!
3208 XXX - FIX MANUAL for the change above!
3199
3209
3200 (runsource): I copied code.py's runsource() into ipython to modify
3210 (runsource): I copied code.py's runsource() into ipython to modify
3201 it a bit. Now the code object and source to be executed are
3211 it a bit. Now the code object and source to be executed are
3202 stored in ipython. This makes this info accessible to third-party
3212 stored in ipython. This makes this info accessible to third-party
3203 tools, like custom exception handlers. After a request by Frédéric
3213 tools, like custom exception handlers. After a request by Frédéric
3204 Mantegazza <mantegazza-AT-ill.fr>.
3214 Mantegazza <mantegazza-AT-ill.fr>.
3205
3215
3206 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3216 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3207 history-search via readline (like C-p/C-n). I'd wanted this for a
3217 history-search via readline (like C-p/C-n). I'd wanted this for a
3208 long time, but only recently found out how to do it. For users
3218 long time, but only recently found out how to do it. For users
3209 who already have their ipythonrc files made and want this, just
3219 who already have their ipythonrc files made and want this, just
3210 add:
3220 add:
3211
3221
3212 readline_parse_and_bind "\e[A": history-search-backward
3222 readline_parse_and_bind "\e[A": history-search-backward
3213 readline_parse_and_bind "\e[B": history-search-forward
3223 readline_parse_and_bind "\e[B": history-search-forward
3214
3224
3215 2005-03-18 Fernando Perez <fperez@colorado.edu>
3225 2005-03-18 Fernando Perez <fperez@colorado.edu>
3216
3226
3217 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3227 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3218 LSString and SList classes which allow transparent conversions
3228 LSString and SList classes which allow transparent conversions
3219 between list mode and whitespace-separated string.
3229 between list mode and whitespace-separated string.
3220 (magic_r): Fix recursion problem in %r.
3230 (magic_r): Fix recursion problem in %r.
3221
3231
3222 * IPython/genutils.py (LSString): New class to be used for
3232 * IPython/genutils.py (LSString): New class to be used for
3223 automatic storage of the results of all alias/system calls in _o
3233 automatic storage of the results of all alias/system calls in _o
3224 and _e (stdout/err). These provide a .l/.list attribute which
3234 and _e (stdout/err). These provide a .l/.list attribute which
3225 does automatic splitting on newlines. This means that for most
3235 does automatic splitting on newlines. This means that for most
3226 uses, you'll never need to do capturing of output with %sc/%sx
3236 uses, you'll never need to do capturing of output with %sc/%sx
3227 anymore, since ipython keeps this always done for you. Note that
3237 anymore, since ipython keeps this always done for you. Note that
3228 only the LAST results are stored, the _o/e variables are
3238 only the LAST results are stored, the _o/e variables are
3229 overwritten on each call. If you need to save their contents
3239 overwritten on each call. If you need to save their contents
3230 further, simply bind them to any other name.
3240 further, simply bind them to any other name.
3231
3241
3232 2005-03-17 Fernando Perez <fperez@colorado.edu>
3242 2005-03-17 Fernando Perez <fperez@colorado.edu>
3233
3243
3234 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3244 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3235 prompt namespace handling.
3245 prompt namespace handling.
3236
3246
3237 2005-03-16 Fernando Perez <fperez@colorado.edu>
3247 2005-03-16 Fernando Perez <fperez@colorado.edu>
3238
3248
3239 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3249 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3240 classic prompts to be '>>> ' (final space was missing, and it
3250 classic prompts to be '>>> ' (final space was missing, and it
3241 trips the emacs python mode).
3251 trips the emacs python mode).
3242 (BasePrompt.__str__): Added safe support for dynamic prompt
3252 (BasePrompt.__str__): Added safe support for dynamic prompt
3243 strings. Now you can set your prompt string to be '$x', and the
3253 strings. Now you can set your prompt string to be '$x', and the
3244 value of x will be printed from your interactive namespace. The
3254 value of x will be printed from your interactive namespace. The
3245 interpolation syntax includes the full Itpl support, so
3255 interpolation syntax includes the full Itpl support, so
3246 ${foo()+x+bar()} is a valid prompt string now, and the function
3256 ${foo()+x+bar()} is a valid prompt string now, and the function
3247 calls will be made at runtime.
3257 calls will be made at runtime.
3248
3258
3249 2005-03-15 Fernando Perez <fperez@colorado.edu>
3259 2005-03-15 Fernando Perez <fperez@colorado.edu>
3250
3260
3251 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3261 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3252 avoid name clashes in pylab. %hist still works, it just forwards
3262 avoid name clashes in pylab. %hist still works, it just forwards
3253 the call to %history.
3263 the call to %history.
3254
3264
3255 2005-03-02 *** Released version 0.6.12
3265 2005-03-02 *** Released version 0.6.12
3256
3266
3257 2005-03-02 Fernando Perez <fperez@colorado.edu>
3267 2005-03-02 Fernando Perez <fperez@colorado.edu>
3258
3268
3259 * IPython/iplib.py (handle_magic): log magic calls properly as
3269 * IPython/iplib.py (handle_magic): log magic calls properly as
3260 ipmagic() function calls.
3270 ipmagic() function calls.
3261
3271
3262 * IPython/Magic.py (magic_time): Improved %time to support
3272 * IPython/Magic.py (magic_time): Improved %time to support
3263 statements and provide wall-clock as well as CPU time.
3273 statements and provide wall-clock as well as CPU time.
3264
3274
3265 2005-02-27 Fernando Perez <fperez@colorado.edu>
3275 2005-02-27 Fernando Perez <fperez@colorado.edu>
3266
3276
3267 * IPython/hooks.py: New hooks module, to expose user-modifiable
3277 * IPython/hooks.py: New hooks module, to expose user-modifiable
3268 IPython functionality in a clean manner. For now only the editor
3278 IPython functionality in a clean manner. For now only the editor
3269 hook is actually written, and other thigns which I intend to turn
3279 hook is actually written, and other thigns which I intend to turn
3270 into proper hooks aren't yet there. The display and prefilter
3280 into proper hooks aren't yet there. The display and prefilter
3271 stuff, for example, should be hooks. But at least now the
3281 stuff, for example, should be hooks. But at least now the
3272 framework is in place, and the rest can be moved here with more
3282 framework is in place, and the rest can be moved here with more
3273 time later. IPython had had a .hooks variable for a long time for
3283 time later. IPython had had a .hooks variable for a long time for
3274 this purpose, but I'd never actually used it for anything.
3284 this purpose, but I'd never actually used it for anything.
3275
3285
3276 2005-02-26 Fernando Perez <fperez@colorado.edu>
3286 2005-02-26 Fernando Perez <fperez@colorado.edu>
3277
3287
3278 * IPython/ipmaker.py (make_IPython): make the default ipython
3288 * IPython/ipmaker.py (make_IPython): make the default ipython
3279 directory be called _ipython under win32, to follow more the
3289 directory be called _ipython under win32, to follow more the
3280 naming peculiarities of that platform (where buggy software like
3290 naming peculiarities of that platform (where buggy software like
3281 Visual Sourcesafe breaks with .named directories). Reported by
3291 Visual Sourcesafe breaks with .named directories). Reported by
3282 Ville Vainio.
3292 Ville Vainio.
3283
3293
3284 2005-02-23 Fernando Perez <fperez@colorado.edu>
3294 2005-02-23 Fernando Perez <fperez@colorado.edu>
3285
3295
3286 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3296 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3287 auto_aliases for win32 which were causing problems. Users can
3297 auto_aliases for win32 which were causing problems. Users can
3288 define the ones they personally like.
3298 define the ones they personally like.
3289
3299
3290 2005-02-21 Fernando Perez <fperez@colorado.edu>
3300 2005-02-21 Fernando Perez <fperez@colorado.edu>
3291
3301
3292 * IPython/Magic.py (magic_time): new magic to time execution of
3302 * IPython/Magic.py (magic_time): new magic to time execution of
3293 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3303 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3294
3304
3295 2005-02-19 Fernando Perez <fperez@colorado.edu>
3305 2005-02-19 Fernando Perez <fperez@colorado.edu>
3296
3306
3297 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3307 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3298 into keys (for prompts, for example).
3308 into keys (for prompts, for example).
3299
3309
3300 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3310 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3301 prompts in case users want them. This introduces a small behavior
3311 prompts in case users want them. This introduces a small behavior
3302 change: ipython does not automatically add a space to all prompts
3312 change: ipython does not automatically add a space to all prompts
3303 anymore. To get the old prompts with a space, users should add it
3313 anymore. To get the old prompts with a space, users should add it
3304 manually to their ipythonrc file, so for example prompt_in1 should
3314 manually to their ipythonrc file, so for example prompt_in1 should
3305 now read 'In [\#]: ' instead of 'In [\#]:'.
3315 now read 'In [\#]: ' instead of 'In [\#]:'.
3306 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3316 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3307 file) to control left-padding of secondary prompts.
3317 file) to control left-padding of secondary prompts.
3308
3318
3309 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3319 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3310 the profiler can't be imported. Fix for Debian, which removed
3320 the profiler can't be imported. Fix for Debian, which removed
3311 profile.py because of License issues. I applied a slightly
3321 profile.py because of License issues. I applied a slightly
3312 modified version of the original Debian patch at
3322 modified version of the original Debian patch at
3313 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3323 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3314
3324
3315 2005-02-17 Fernando Perez <fperez@colorado.edu>
3325 2005-02-17 Fernando Perez <fperez@colorado.edu>
3316
3326
3317 * IPython/genutils.py (native_line_ends): Fix bug which would
3327 * IPython/genutils.py (native_line_ends): Fix bug which would
3318 cause improper line-ends under win32 b/c I was not opening files
3328 cause improper line-ends under win32 b/c I was not opening files
3319 in binary mode. Bug report and fix thanks to Ville.
3329 in binary mode. Bug report and fix thanks to Ville.
3320
3330
3321 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3331 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3322 trying to catch spurious foo[1] autocalls. My fix actually broke
3332 trying to catch spurious foo[1] autocalls. My fix actually broke
3323 ',/' autoquote/call with explicit escape (bad regexp).
3333 ',/' autoquote/call with explicit escape (bad regexp).
3324
3334
3325 2005-02-15 *** Released version 0.6.11
3335 2005-02-15 *** Released version 0.6.11
3326
3336
3327 2005-02-14 Fernando Perez <fperez@colorado.edu>
3337 2005-02-14 Fernando Perez <fperez@colorado.edu>
3328
3338
3329 * IPython/background_jobs.py: New background job management
3339 * IPython/background_jobs.py: New background job management
3330 subsystem. This is implemented via a new set of classes, and
3340 subsystem. This is implemented via a new set of classes, and
3331 IPython now provides a builtin 'jobs' object for background job
3341 IPython now provides a builtin 'jobs' object for background job
3332 execution. A convenience %bg magic serves as a lightweight
3342 execution. A convenience %bg magic serves as a lightweight
3333 frontend for starting the more common type of calls. This was
3343 frontend for starting the more common type of calls. This was
3334 inspired by discussions with B. Granger and the BackgroundCommand
3344 inspired by discussions with B. Granger and the BackgroundCommand
3335 class described in the book Python Scripting for Computational
3345 class described in the book Python Scripting for Computational
3336 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3346 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3337 (although ultimately no code from this text was used, as IPython's
3347 (although ultimately no code from this text was used, as IPython's
3338 system is a separate implementation).
3348 system is a separate implementation).
3339
3349
3340 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3350 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3341 to control the completion of single/double underscore names
3351 to control the completion of single/double underscore names
3342 separately. As documented in the example ipytonrc file, the
3352 separately. As documented in the example ipytonrc file, the
3343 readline_omit__names variable can now be set to 2, to omit even
3353 readline_omit__names variable can now be set to 2, to omit even
3344 single underscore names. Thanks to a patch by Brian Wong
3354 single underscore names. Thanks to a patch by Brian Wong
3345 <BrianWong-AT-AirgoNetworks.Com>.
3355 <BrianWong-AT-AirgoNetworks.Com>.
3346 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3356 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3347 be autocalled as foo([1]) if foo were callable. A problem for
3357 be autocalled as foo([1]) if foo were callable. A problem for
3348 things which are both callable and implement __getitem__.
3358 things which are both callable and implement __getitem__.
3349 (init_readline): Fix autoindentation for win32. Thanks to a patch
3359 (init_readline): Fix autoindentation for win32. Thanks to a patch
3350 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3360 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3351
3361
3352 2005-02-12 Fernando Perez <fperez@colorado.edu>
3362 2005-02-12 Fernando Perez <fperez@colorado.edu>
3353
3363
3354 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3364 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3355 which I had written long ago to sort out user error messages which
3365 which I had written long ago to sort out user error messages which
3356 may occur during startup. This seemed like a good idea initially,
3366 may occur during startup. This seemed like a good idea initially,
3357 but it has proven a disaster in retrospect. I don't want to
3367 but it has proven a disaster in retrospect. I don't want to
3358 change much code for now, so my fix is to set the internal 'debug'
3368 change much code for now, so my fix is to set the internal 'debug'
3359 flag to true everywhere, whose only job was precisely to control
3369 flag to true everywhere, whose only job was precisely to control
3360 this subsystem. This closes issue 28 (as well as avoiding all
3370 this subsystem. This closes issue 28 (as well as avoiding all
3361 sorts of strange hangups which occur from time to time).
3371 sorts of strange hangups which occur from time to time).
3362
3372
3363 2005-02-07 Fernando Perez <fperez@colorado.edu>
3373 2005-02-07 Fernando Perez <fperez@colorado.edu>
3364
3374
3365 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3375 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3366 previous call produced a syntax error.
3376 previous call produced a syntax error.
3367
3377
3368 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3378 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3369 classes without constructor.
3379 classes without constructor.
3370
3380
3371 2005-02-06 Fernando Perez <fperez@colorado.edu>
3381 2005-02-06 Fernando Perez <fperez@colorado.edu>
3372
3382
3373 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3383 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3374 completions with the results of each matcher, so we return results
3384 completions with the results of each matcher, so we return results
3375 to the user from all namespaces. This breaks with ipython
3385 to the user from all namespaces. This breaks with ipython
3376 tradition, but I think it's a nicer behavior. Now you get all
3386 tradition, but I think it's a nicer behavior. Now you get all
3377 possible completions listed, from all possible namespaces (python,
3387 possible completions listed, from all possible namespaces (python,
3378 filesystem, magics...) After a request by John Hunter
3388 filesystem, magics...) After a request by John Hunter
3379 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3389 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3380
3390
3381 2005-02-05 Fernando Perez <fperez@colorado.edu>
3391 2005-02-05 Fernando Perez <fperez@colorado.edu>
3382
3392
3383 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3393 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3384 the call had quote characters in it (the quotes were stripped).
3394 the call had quote characters in it (the quotes were stripped).
3385
3395
3386 2005-01-31 Fernando Perez <fperez@colorado.edu>
3396 2005-01-31 Fernando Perez <fperez@colorado.edu>
3387
3397
3388 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3398 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3389 Itpl.itpl() to make the code more robust against psyco
3399 Itpl.itpl() to make the code more robust against psyco
3390 optimizations.
3400 optimizations.
3391
3401
3392 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3402 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3393 of causing an exception. Quicker, cleaner.
3403 of causing an exception. Quicker, cleaner.
3394
3404
3395 2005-01-28 Fernando Perez <fperez@colorado.edu>
3405 2005-01-28 Fernando Perez <fperez@colorado.edu>
3396
3406
3397 * scripts/ipython_win_post_install.py (install): hardcode
3407 * scripts/ipython_win_post_install.py (install): hardcode
3398 sys.prefix+'python.exe' as the executable path. It turns out that
3408 sys.prefix+'python.exe' as the executable path. It turns out that
3399 during the post-installation run, sys.executable resolves to the
3409 during the post-installation run, sys.executable resolves to the
3400 name of the binary installer! I should report this as a distutils
3410 name of the binary installer! I should report this as a distutils
3401 bug, I think. I updated the .10 release with this tiny fix, to
3411 bug, I think. I updated the .10 release with this tiny fix, to
3402 avoid annoying the lists further.
3412 avoid annoying the lists further.
3403
3413
3404 2005-01-27 *** Released version 0.6.10
3414 2005-01-27 *** Released version 0.6.10
3405
3415
3406 2005-01-27 Fernando Perez <fperez@colorado.edu>
3416 2005-01-27 Fernando Perez <fperez@colorado.edu>
3407
3417
3408 * IPython/numutils.py (norm): Added 'inf' as optional name for
3418 * IPython/numutils.py (norm): Added 'inf' as optional name for
3409 L-infinity norm, included references to mathworld.com for vector
3419 L-infinity norm, included references to mathworld.com for vector
3410 norm definitions.
3420 norm definitions.
3411 (amin/amax): added amin/amax for array min/max. Similar to what
3421 (amin/amax): added amin/amax for array min/max. Similar to what
3412 pylab ships with after the recent reorganization of names.
3422 pylab ships with after the recent reorganization of names.
3413 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3423 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3414
3424
3415 * ipython.el: committed Alex's recent fixes and improvements.
3425 * ipython.el: committed Alex's recent fixes and improvements.
3416 Tested with python-mode from CVS, and it looks excellent. Since
3426 Tested with python-mode from CVS, and it looks excellent. Since
3417 python-mode hasn't released anything in a while, I'm temporarily
3427 python-mode hasn't released anything in a while, I'm temporarily
3418 putting a copy of today's CVS (v 4.70) of python-mode in:
3428 putting a copy of today's CVS (v 4.70) of python-mode in:
3419 http://ipython.scipy.org/tmp/python-mode.el
3429 http://ipython.scipy.org/tmp/python-mode.el
3420
3430
3421 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3431 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3422 sys.executable for the executable name, instead of assuming it's
3432 sys.executable for the executable name, instead of assuming it's
3423 called 'python.exe' (the post-installer would have produced broken
3433 called 'python.exe' (the post-installer would have produced broken
3424 setups on systems with a differently named python binary).
3434 setups on systems with a differently named python binary).
3425
3435
3426 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3436 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3427 references to os.linesep, to make the code more
3437 references to os.linesep, to make the code more
3428 platform-independent. This is also part of the win32 coloring
3438 platform-independent. This is also part of the win32 coloring
3429 fixes.
3439 fixes.
3430
3440
3431 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3441 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3432 lines, which actually cause coloring bugs because the length of
3442 lines, which actually cause coloring bugs because the length of
3433 the line is very difficult to correctly compute with embedded
3443 the line is very difficult to correctly compute with embedded
3434 escapes. This was the source of all the coloring problems under
3444 escapes. This was the source of all the coloring problems under
3435 Win32. I think that _finally_, Win32 users have a properly
3445 Win32. I think that _finally_, Win32 users have a properly
3436 working ipython in all respects. This would never have happened
3446 working ipython in all respects. This would never have happened
3437 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3447 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3438
3448
3439 2005-01-26 *** Released version 0.6.9
3449 2005-01-26 *** Released version 0.6.9
3440
3450
3441 2005-01-25 Fernando Perez <fperez@colorado.edu>
3451 2005-01-25 Fernando Perez <fperez@colorado.edu>
3442
3452
3443 * setup.py: finally, we have a true Windows installer, thanks to
3453 * setup.py: finally, we have a true Windows installer, thanks to
3444 the excellent work of Viktor Ransmayr
3454 the excellent work of Viktor Ransmayr
3445 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3455 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3446 Windows users. The setup routine is quite a bit cleaner thanks to
3456 Windows users. The setup routine is quite a bit cleaner thanks to
3447 this, and the post-install script uses the proper functions to
3457 this, and the post-install script uses the proper functions to
3448 allow a clean de-installation using the standard Windows Control
3458 allow a clean de-installation using the standard Windows Control
3449 Panel.
3459 Panel.
3450
3460
3451 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3461 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3452 environment variable under all OSes (including win32) if
3462 environment variable under all OSes (including win32) if
3453 available. This will give consistency to win32 users who have set
3463 available. This will give consistency to win32 users who have set
3454 this variable for any reason. If os.environ['HOME'] fails, the
3464 this variable for any reason. If os.environ['HOME'] fails, the
3455 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3465 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3456
3466
3457 2005-01-24 Fernando Perez <fperez@colorado.edu>
3467 2005-01-24 Fernando Perez <fperez@colorado.edu>
3458
3468
3459 * IPython/numutils.py (empty_like): add empty_like(), similar to
3469 * IPython/numutils.py (empty_like): add empty_like(), similar to
3460 zeros_like() but taking advantage of the new empty() Numeric routine.
3470 zeros_like() but taking advantage of the new empty() Numeric routine.
3461
3471
3462 2005-01-23 *** Released version 0.6.8
3472 2005-01-23 *** Released version 0.6.8
3463
3473
3464 2005-01-22 Fernando Perez <fperez@colorado.edu>
3474 2005-01-22 Fernando Perez <fperez@colorado.edu>
3465
3475
3466 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3476 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3467 automatic show() calls. After discussing things with JDH, it
3477 automatic show() calls. After discussing things with JDH, it
3468 turns out there are too many corner cases where this can go wrong.
3478 turns out there are too many corner cases where this can go wrong.
3469 It's best not to try to be 'too smart', and simply have ipython
3479 It's best not to try to be 'too smart', and simply have ipython
3470 reproduce as much as possible the default behavior of a normal
3480 reproduce as much as possible the default behavior of a normal
3471 python shell.
3481 python shell.
3472
3482
3473 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3483 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3474 line-splitting regexp and _prefilter() to avoid calling getattr()
3484 line-splitting regexp and _prefilter() to avoid calling getattr()
3475 on assignments. This closes
3485 on assignments. This closes
3476 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3486 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3477 readline uses getattr(), so a simple <TAB> keypress is still
3487 readline uses getattr(), so a simple <TAB> keypress is still
3478 enough to trigger getattr() calls on an object.
3488 enough to trigger getattr() calls on an object.
3479
3489
3480 2005-01-21 Fernando Perez <fperez@colorado.edu>
3490 2005-01-21 Fernando Perez <fperez@colorado.edu>
3481
3491
3482 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3492 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3483 docstring under pylab so it doesn't mask the original.
3493 docstring under pylab so it doesn't mask the original.
3484
3494
3485 2005-01-21 *** Released version 0.6.7
3495 2005-01-21 *** Released version 0.6.7
3486
3496
3487 2005-01-21 Fernando Perez <fperez@colorado.edu>
3497 2005-01-21 Fernando Perez <fperez@colorado.edu>
3488
3498
3489 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3499 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3490 signal handling for win32 users in multithreaded mode.
3500 signal handling for win32 users in multithreaded mode.
3491
3501
3492 2005-01-17 Fernando Perez <fperez@colorado.edu>
3502 2005-01-17 Fernando Perez <fperez@colorado.edu>
3493
3503
3494 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3504 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3495 instances with no __init__. After a crash report by Norbert Nemec
3505 instances with no __init__. After a crash report by Norbert Nemec
3496 <Norbert-AT-nemec-online.de>.
3506 <Norbert-AT-nemec-online.de>.
3497
3507
3498 2005-01-14 Fernando Perez <fperez@colorado.edu>
3508 2005-01-14 Fernando Perez <fperez@colorado.edu>
3499
3509
3500 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3510 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3501 names for verbose exceptions, when multiple dotted names and the
3511 names for verbose exceptions, when multiple dotted names and the
3502 'parent' object were present on the same line.
3512 'parent' object were present on the same line.
3503
3513
3504 2005-01-11 Fernando Perez <fperez@colorado.edu>
3514 2005-01-11 Fernando Perez <fperez@colorado.edu>
3505
3515
3506 * IPython/genutils.py (flag_calls): new utility to trap and flag
3516 * IPython/genutils.py (flag_calls): new utility to trap and flag
3507 calls in functions. I need it to clean up matplotlib support.
3517 calls in functions. I need it to clean up matplotlib support.
3508 Also removed some deprecated code in genutils.
3518 Also removed some deprecated code in genutils.
3509
3519
3510 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3520 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3511 that matplotlib scripts called with %run, which don't call show()
3521 that matplotlib scripts called with %run, which don't call show()
3512 themselves, still have their plotting windows open.
3522 themselves, still have their plotting windows open.
3513
3523
3514 2005-01-05 Fernando Perez <fperez@colorado.edu>
3524 2005-01-05 Fernando Perez <fperez@colorado.edu>
3515
3525
3516 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3526 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3517 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3527 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3518
3528
3519 2004-12-19 Fernando Perez <fperez@colorado.edu>
3529 2004-12-19 Fernando Perez <fperez@colorado.edu>
3520
3530
3521 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3531 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3522 parent_runcode, which was an eyesore. The same result can be
3532 parent_runcode, which was an eyesore. The same result can be
3523 obtained with Python's regular superclass mechanisms.
3533 obtained with Python's regular superclass mechanisms.
3524
3534
3525 2004-12-17 Fernando Perez <fperez@colorado.edu>
3535 2004-12-17 Fernando Perez <fperez@colorado.edu>
3526
3536
3527 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3537 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3528 reported by Prabhu.
3538 reported by Prabhu.
3529 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3539 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3530 sys.stderr) instead of explicitly calling sys.stderr. This helps
3540 sys.stderr) instead of explicitly calling sys.stderr. This helps
3531 maintain our I/O abstractions clean, for future GUI embeddings.
3541 maintain our I/O abstractions clean, for future GUI embeddings.
3532
3542
3533 * IPython/genutils.py (info): added new utility for sys.stderr
3543 * IPython/genutils.py (info): added new utility for sys.stderr
3534 unified info message handling (thin wrapper around warn()).
3544 unified info message handling (thin wrapper around warn()).
3535
3545
3536 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3546 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3537 composite (dotted) names on verbose exceptions.
3547 composite (dotted) names on verbose exceptions.
3538 (VerboseTB.nullrepr): harden against another kind of errors which
3548 (VerboseTB.nullrepr): harden against another kind of errors which
3539 Python's inspect module can trigger, and which were crashing
3549 Python's inspect module can trigger, and which were crashing
3540 IPython. Thanks to a report by Marco Lombardi
3550 IPython. Thanks to a report by Marco Lombardi
3541 <mlombard-AT-ma010192.hq.eso.org>.
3551 <mlombard-AT-ma010192.hq.eso.org>.
3542
3552
3543 2004-12-13 *** Released version 0.6.6
3553 2004-12-13 *** Released version 0.6.6
3544
3554
3545 2004-12-12 Fernando Perez <fperez@colorado.edu>
3555 2004-12-12 Fernando Perez <fperez@colorado.edu>
3546
3556
3547 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3557 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3548 generated by pygtk upon initialization if it was built without
3558 generated by pygtk upon initialization if it was built without
3549 threads (for matplotlib users). After a crash reported by
3559 threads (for matplotlib users). After a crash reported by
3550 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3560 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3551
3561
3552 * IPython/ipmaker.py (make_IPython): fix small bug in the
3562 * IPython/ipmaker.py (make_IPython): fix small bug in the
3553 import_some parameter for multiple imports.
3563 import_some parameter for multiple imports.
3554
3564
3555 * IPython/iplib.py (ipmagic): simplified the interface of
3565 * IPython/iplib.py (ipmagic): simplified the interface of
3556 ipmagic() to take a single string argument, just as it would be
3566 ipmagic() to take a single string argument, just as it would be
3557 typed at the IPython cmd line.
3567 typed at the IPython cmd line.
3558 (ipalias): Added new ipalias() with an interface identical to
3568 (ipalias): Added new ipalias() with an interface identical to
3559 ipmagic(). This completes exposing a pure python interface to the
3569 ipmagic(). This completes exposing a pure python interface to the
3560 alias and magic system, which can be used in loops or more complex
3570 alias and magic system, which can be used in loops or more complex
3561 code where IPython's automatic line mangling is not active.
3571 code where IPython's automatic line mangling is not active.
3562
3572
3563 * IPython/genutils.py (timing): changed interface of timing to
3573 * IPython/genutils.py (timing): changed interface of timing to
3564 simply run code once, which is the most common case. timings()
3574 simply run code once, which is the most common case. timings()
3565 remains unchanged, for the cases where you want multiple runs.
3575 remains unchanged, for the cases where you want multiple runs.
3566
3576
3567 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3577 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3568 bug where Python2.2 crashes with exec'ing code which does not end
3578 bug where Python2.2 crashes with exec'ing code which does not end
3569 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3579 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3570 before.
3580 before.
3571
3581
3572 2004-12-10 Fernando Perez <fperez@colorado.edu>
3582 2004-12-10 Fernando Perez <fperez@colorado.edu>
3573
3583
3574 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3584 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3575 -t to -T, to accomodate the new -t flag in %run (the %run and
3585 -t to -T, to accomodate the new -t flag in %run (the %run and
3576 %prun options are kind of intermixed, and it's not easy to change
3586 %prun options are kind of intermixed, and it's not easy to change
3577 this with the limitations of python's getopt).
3587 this with the limitations of python's getopt).
3578
3588
3579 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3589 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3580 the execution of scripts. It's not as fine-tuned as timeit.py,
3590 the execution of scripts. It's not as fine-tuned as timeit.py,
3581 but it works from inside ipython (and under 2.2, which lacks
3591 but it works from inside ipython (and under 2.2, which lacks
3582 timeit.py). Optionally a number of runs > 1 can be given for
3592 timeit.py). Optionally a number of runs > 1 can be given for
3583 timing very short-running code.
3593 timing very short-running code.
3584
3594
3585 * IPython/genutils.py (uniq_stable): new routine which returns a
3595 * IPython/genutils.py (uniq_stable): new routine which returns a
3586 list of unique elements in any iterable, but in stable order of
3596 list of unique elements in any iterable, but in stable order of
3587 appearance. I needed this for the ultraTB fixes, and it's a handy
3597 appearance. I needed this for the ultraTB fixes, and it's a handy
3588 utility.
3598 utility.
3589
3599
3590 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3600 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3591 dotted names in Verbose exceptions. This had been broken since
3601 dotted names in Verbose exceptions. This had been broken since
3592 the very start, now x.y will properly be printed in a Verbose
3602 the very start, now x.y will properly be printed in a Verbose
3593 traceback, instead of x being shown and y appearing always as an
3603 traceback, instead of x being shown and y appearing always as an
3594 'undefined global'. Getting this to work was a bit tricky,
3604 'undefined global'. Getting this to work was a bit tricky,
3595 because by default python tokenizers are stateless. Saved by
3605 because by default python tokenizers are stateless. Saved by
3596 python's ability to easily add a bit of state to an arbitrary
3606 python's ability to easily add a bit of state to an arbitrary
3597 function (without needing to build a full-blown callable object).
3607 function (without needing to build a full-blown callable object).
3598
3608
3599 Also big cleanup of this code, which had horrendous runtime
3609 Also big cleanup of this code, which had horrendous runtime
3600 lookups of zillions of attributes for colorization. Moved all
3610 lookups of zillions of attributes for colorization. Moved all
3601 this code into a few templates, which make it cleaner and quicker.
3611 this code into a few templates, which make it cleaner and quicker.
3602
3612
3603 Printout quality was also improved for Verbose exceptions: one
3613 Printout quality was also improved for Verbose exceptions: one
3604 variable per line, and memory addresses are printed (this can be
3614 variable per line, and memory addresses are printed (this can be
3605 quite handy in nasty debugging situations, which is what Verbose
3615 quite handy in nasty debugging situations, which is what Verbose
3606 is for).
3616 is for).
3607
3617
3608 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3618 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3609 the command line as scripts to be loaded by embedded instances.
3619 the command line as scripts to be loaded by embedded instances.
3610 Doing so has the potential for an infinite recursion if there are
3620 Doing so has the potential for an infinite recursion if there are
3611 exceptions thrown in the process. This fixes a strange crash
3621 exceptions thrown in the process. This fixes a strange crash
3612 reported by Philippe MULLER <muller-AT-irit.fr>.
3622 reported by Philippe MULLER <muller-AT-irit.fr>.
3613
3623
3614 2004-12-09 Fernando Perez <fperez@colorado.edu>
3624 2004-12-09 Fernando Perez <fperez@colorado.edu>
3615
3625
3616 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3626 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3617 to reflect new names in matplotlib, which now expose the
3627 to reflect new names in matplotlib, which now expose the
3618 matlab-compatible interface via a pylab module instead of the
3628 matlab-compatible interface via a pylab module instead of the
3619 'matlab' name. The new code is backwards compatible, so users of
3629 'matlab' name. The new code is backwards compatible, so users of
3620 all matplotlib versions are OK. Patch by J. Hunter.
3630 all matplotlib versions are OK. Patch by J. Hunter.
3621
3631
3622 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3632 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3623 of __init__ docstrings for instances (class docstrings are already
3633 of __init__ docstrings for instances (class docstrings are already
3624 automatically printed). Instances with customized docstrings
3634 automatically printed). Instances with customized docstrings
3625 (indep. of the class) are also recognized and all 3 separate
3635 (indep. of the class) are also recognized and all 3 separate
3626 docstrings are printed (instance, class, constructor). After some
3636 docstrings are printed (instance, class, constructor). After some
3627 comments/suggestions by J. Hunter.
3637 comments/suggestions by J. Hunter.
3628
3638
3629 2004-12-05 Fernando Perez <fperez@colorado.edu>
3639 2004-12-05 Fernando Perez <fperez@colorado.edu>
3630
3640
3631 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3641 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3632 warnings when tab-completion fails and triggers an exception.
3642 warnings when tab-completion fails and triggers an exception.
3633
3643
3634 2004-12-03 Fernando Perez <fperez@colorado.edu>
3644 2004-12-03 Fernando Perez <fperez@colorado.edu>
3635
3645
3636 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3646 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3637 be triggered when using 'run -p'. An incorrect option flag was
3647 be triggered when using 'run -p'. An incorrect option flag was
3638 being set ('d' instead of 'D').
3648 being set ('d' instead of 'D').
3639 (manpage): fix missing escaped \- sign.
3649 (manpage): fix missing escaped \- sign.
3640
3650
3641 2004-11-30 *** Released version 0.6.5
3651 2004-11-30 *** Released version 0.6.5
3642
3652
3643 2004-11-30 Fernando Perez <fperez@colorado.edu>
3653 2004-11-30 Fernando Perez <fperez@colorado.edu>
3644
3654
3645 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3655 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3646 setting with -d option.
3656 setting with -d option.
3647
3657
3648 * setup.py (docfiles): Fix problem where the doc glob I was using
3658 * setup.py (docfiles): Fix problem where the doc glob I was using
3649 was COMPLETELY BROKEN. It was giving the right files by pure
3659 was COMPLETELY BROKEN. It was giving the right files by pure
3650 accident, but failed once I tried to include ipython.el. Note:
3660 accident, but failed once I tried to include ipython.el. Note:
3651 glob() does NOT allow you to do exclusion on multiple endings!
3661 glob() does NOT allow you to do exclusion on multiple endings!
3652
3662
3653 2004-11-29 Fernando Perez <fperez@colorado.edu>
3663 2004-11-29 Fernando Perez <fperez@colorado.edu>
3654
3664
3655 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3665 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3656 the manpage as the source. Better formatting & consistency.
3666 the manpage as the source. Better formatting & consistency.
3657
3667
3658 * IPython/Magic.py (magic_run): Added new -d option, to run
3668 * IPython/Magic.py (magic_run): Added new -d option, to run
3659 scripts under the control of the python pdb debugger. Note that
3669 scripts under the control of the python pdb debugger. Note that
3660 this required changing the %prun option -d to -D, to avoid a clash
3670 this required changing the %prun option -d to -D, to avoid a clash
3661 (since %run must pass options to %prun, and getopt is too dumb to
3671 (since %run must pass options to %prun, and getopt is too dumb to
3662 handle options with string values with embedded spaces). Thanks
3672 handle options with string values with embedded spaces). Thanks
3663 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3673 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3664 (magic_who_ls): added type matching to %who and %whos, so that one
3674 (magic_who_ls): added type matching to %who and %whos, so that one
3665 can filter their output to only include variables of certain
3675 can filter their output to only include variables of certain
3666 types. Another suggestion by Matthew.
3676 types. Another suggestion by Matthew.
3667 (magic_whos): Added memory summaries in kb and Mb for arrays.
3677 (magic_whos): Added memory summaries in kb and Mb for arrays.
3668 (magic_who): Improve formatting (break lines every 9 vars).
3678 (magic_who): Improve formatting (break lines every 9 vars).
3669
3679
3670 2004-11-28 Fernando Perez <fperez@colorado.edu>
3680 2004-11-28 Fernando Perez <fperez@colorado.edu>
3671
3681
3672 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3682 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3673 cache when empty lines were present.
3683 cache when empty lines were present.
3674
3684
3675 2004-11-24 Fernando Perez <fperez@colorado.edu>
3685 2004-11-24 Fernando Perez <fperez@colorado.edu>
3676
3686
3677 * IPython/usage.py (__doc__): document the re-activated threading
3687 * IPython/usage.py (__doc__): document the re-activated threading
3678 options for WX and GTK.
3688 options for WX and GTK.
3679
3689
3680 2004-11-23 Fernando Perez <fperez@colorado.edu>
3690 2004-11-23 Fernando Perez <fperez@colorado.edu>
3681
3691
3682 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3692 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3683 the -wthread and -gthread options, along with a new -tk one to try
3693 the -wthread and -gthread options, along with a new -tk one to try
3684 and coordinate Tk threading with wx/gtk. The tk support is very
3694 and coordinate Tk threading with wx/gtk. The tk support is very
3685 platform dependent, since it seems to require Tcl and Tk to be
3695 platform dependent, since it seems to require Tcl and Tk to be
3686 built with threads (Fedora1/2 appears NOT to have it, but in
3696 built with threads (Fedora1/2 appears NOT to have it, but in
3687 Prabhu's Debian boxes it works OK). But even with some Tk
3697 Prabhu's Debian boxes it works OK). But even with some Tk
3688 limitations, this is a great improvement.
3698 limitations, this is a great improvement.
3689
3699
3690 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3700 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3691 info in user prompts. Patch by Prabhu.
3701 info in user prompts. Patch by Prabhu.
3692
3702
3693 2004-11-18 Fernando Perez <fperez@colorado.edu>
3703 2004-11-18 Fernando Perez <fperez@colorado.edu>
3694
3704
3695 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3705 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3696 EOFErrors and bail, to avoid infinite loops if a non-terminating
3706 EOFErrors and bail, to avoid infinite loops if a non-terminating
3697 file is fed into ipython. Patch submitted in issue 19 by user,
3707 file is fed into ipython. Patch submitted in issue 19 by user,
3698 many thanks.
3708 many thanks.
3699
3709
3700 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3710 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3701 autoquote/parens in continuation prompts, which can cause lots of
3711 autoquote/parens in continuation prompts, which can cause lots of
3702 problems. Closes roundup issue 20.
3712 problems. Closes roundup issue 20.
3703
3713
3704 2004-11-17 Fernando Perez <fperez@colorado.edu>
3714 2004-11-17 Fernando Perez <fperez@colorado.edu>
3705
3715
3706 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3716 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3707 reported as debian bug #280505. I'm not sure my local changelog
3717 reported as debian bug #280505. I'm not sure my local changelog
3708 entry has the proper debian format (Jack?).
3718 entry has the proper debian format (Jack?).
3709
3719
3710 2004-11-08 *** Released version 0.6.4
3720 2004-11-08 *** Released version 0.6.4
3711
3721
3712 2004-11-08 Fernando Perez <fperez@colorado.edu>
3722 2004-11-08 Fernando Perez <fperez@colorado.edu>
3713
3723
3714 * IPython/iplib.py (init_readline): Fix exit message for Windows
3724 * IPython/iplib.py (init_readline): Fix exit message for Windows
3715 when readline is active. Thanks to a report by Eric Jones
3725 when readline is active. Thanks to a report by Eric Jones
3716 <eric-AT-enthought.com>.
3726 <eric-AT-enthought.com>.
3717
3727
3718 2004-11-07 Fernando Perez <fperez@colorado.edu>
3728 2004-11-07 Fernando Perez <fperez@colorado.edu>
3719
3729
3720 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3730 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3721 sometimes seen by win2k/cygwin users.
3731 sometimes seen by win2k/cygwin users.
3722
3732
3723 2004-11-06 Fernando Perez <fperez@colorado.edu>
3733 2004-11-06 Fernando Perez <fperez@colorado.edu>
3724
3734
3725 * IPython/iplib.py (interact): Change the handling of %Exit from
3735 * IPython/iplib.py (interact): Change the handling of %Exit from
3726 trying to propagate a SystemExit to an internal ipython flag.
3736 trying to propagate a SystemExit to an internal ipython flag.
3727 This is less elegant than using Python's exception mechanism, but
3737 This is less elegant than using Python's exception mechanism, but
3728 I can't get that to work reliably with threads, so under -pylab
3738 I can't get that to work reliably with threads, so under -pylab
3729 %Exit was hanging IPython. Cross-thread exception handling is
3739 %Exit was hanging IPython. Cross-thread exception handling is
3730 really a bitch. Thaks to a bug report by Stephen Walton
3740 really a bitch. Thaks to a bug report by Stephen Walton
3731 <stephen.walton-AT-csun.edu>.
3741 <stephen.walton-AT-csun.edu>.
3732
3742
3733 2004-11-04 Fernando Perez <fperez@colorado.edu>
3743 2004-11-04 Fernando Perez <fperez@colorado.edu>
3734
3744
3735 * IPython/iplib.py (raw_input_original): store a pointer to the
3745 * IPython/iplib.py (raw_input_original): store a pointer to the
3736 true raw_input to harden against code which can modify it
3746 true raw_input to harden against code which can modify it
3737 (wx.py.PyShell does this and would otherwise crash ipython).
3747 (wx.py.PyShell does this and would otherwise crash ipython).
3738 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3748 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3739
3749
3740 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3750 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3741 Ctrl-C problem, which does not mess up the input line.
3751 Ctrl-C problem, which does not mess up the input line.
3742
3752
3743 2004-11-03 Fernando Perez <fperez@colorado.edu>
3753 2004-11-03 Fernando Perez <fperez@colorado.edu>
3744
3754
3745 * IPython/Release.py: Changed licensing to BSD, in all files.
3755 * IPython/Release.py: Changed licensing to BSD, in all files.
3746 (name): lowercase name for tarball/RPM release.
3756 (name): lowercase name for tarball/RPM release.
3747
3757
3748 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3758 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3749 use throughout ipython.
3759 use throughout ipython.
3750
3760
3751 * IPython/Magic.py (Magic._ofind): Switch to using the new
3761 * IPython/Magic.py (Magic._ofind): Switch to using the new
3752 OInspect.getdoc() function.
3762 OInspect.getdoc() function.
3753
3763
3754 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3764 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3755 of the line currently being canceled via Ctrl-C. It's extremely
3765 of the line currently being canceled via Ctrl-C. It's extremely
3756 ugly, but I don't know how to do it better (the problem is one of
3766 ugly, but I don't know how to do it better (the problem is one of
3757 handling cross-thread exceptions).
3767 handling cross-thread exceptions).
3758
3768
3759 2004-10-28 Fernando Perez <fperez@colorado.edu>
3769 2004-10-28 Fernando Perez <fperez@colorado.edu>
3760
3770
3761 * IPython/Shell.py (signal_handler): add signal handlers to trap
3771 * IPython/Shell.py (signal_handler): add signal handlers to trap
3762 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3772 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3763 report by Francesc Alted.
3773 report by Francesc Alted.
3764
3774
3765 2004-10-21 Fernando Perez <fperez@colorado.edu>
3775 2004-10-21 Fernando Perez <fperez@colorado.edu>
3766
3776
3767 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3777 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3768 to % for pysh syntax extensions.
3778 to % for pysh syntax extensions.
3769
3779
3770 2004-10-09 Fernando Perez <fperez@colorado.edu>
3780 2004-10-09 Fernando Perez <fperez@colorado.edu>
3771
3781
3772 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3782 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3773 arrays to print a more useful summary, without calling str(arr).
3783 arrays to print a more useful summary, without calling str(arr).
3774 This avoids the problem of extremely lengthy computations which
3784 This avoids the problem of extremely lengthy computations which
3775 occur if arr is large, and appear to the user as a system lockup
3785 occur if arr is large, and appear to the user as a system lockup
3776 with 100% cpu activity. After a suggestion by Kristian Sandberg
3786 with 100% cpu activity. After a suggestion by Kristian Sandberg
3777 <Kristian.Sandberg@colorado.edu>.
3787 <Kristian.Sandberg@colorado.edu>.
3778 (Magic.__init__): fix bug in global magic escapes not being
3788 (Magic.__init__): fix bug in global magic escapes not being
3779 correctly set.
3789 correctly set.
3780
3790
3781 2004-10-08 Fernando Perez <fperez@colorado.edu>
3791 2004-10-08 Fernando Perez <fperez@colorado.edu>
3782
3792
3783 * IPython/Magic.py (__license__): change to absolute imports of
3793 * IPython/Magic.py (__license__): change to absolute imports of
3784 ipython's own internal packages, to start adapting to the absolute
3794 ipython's own internal packages, to start adapting to the absolute
3785 import requirement of PEP-328.
3795 import requirement of PEP-328.
3786
3796
3787 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3797 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3788 files, and standardize author/license marks through the Release
3798 files, and standardize author/license marks through the Release
3789 module instead of having per/file stuff (except for files with
3799 module instead of having per/file stuff (except for files with
3790 particular licenses, like the MIT/PSF-licensed codes).
3800 particular licenses, like the MIT/PSF-licensed codes).
3791
3801
3792 * IPython/Debugger.py: remove dead code for python 2.1
3802 * IPython/Debugger.py: remove dead code for python 2.1
3793
3803
3794 2004-10-04 Fernando Perez <fperez@colorado.edu>
3804 2004-10-04 Fernando Perez <fperez@colorado.edu>
3795
3805
3796 * IPython/iplib.py (ipmagic): New function for accessing magics
3806 * IPython/iplib.py (ipmagic): New function for accessing magics
3797 via a normal python function call.
3807 via a normal python function call.
3798
3808
3799 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3809 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3800 from '@' to '%', to accomodate the new @decorator syntax of python
3810 from '@' to '%', to accomodate the new @decorator syntax of python
3801 2.4.
3811 2.4.
3802
3812
3803 2004-09-29 Fernando Perez <fperez@colorado.edu>
3813 2004-09-29 Fernando Perez <fperez@colorado.edu>
3804
3814
3805 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3815 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3806 matplotlib.use to prevent running scripts which try to switch
3816 matplotlib.use to prevent running scripts which try to switch
3807 interactive backends from within ipython. This will just crash
3817 interactive backends from within ipython. This will just crash
3808 the python interpreter, so we can't allow it (but a detailed error
3818 the python interpreter, so we can't allow it (but a detailed error
3809 is given to the user).
3819 is given to the user).
3810
3820
3811 2004-09-28 Fernando Perez <fperez@colorado.edu>
3821 2004-09-28 Fernando Perez <fperez@colorado.edu>
3812
3822
3813 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3823 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3814 matplotlib-related fixes so that using @run with non-matplotlib
3824 matplotlib-related fixes so that using @run with non-matplotlib
3815 scripts doesn't pop up spurious plot windows. This requires
3825 scripts doesn't pop up spurious plot windows. This requires
3816 matplotlib >= 0.63, where I had to make some changes as well.
3826 matplotlib >= 0.63, where I had to make some changes as well.
3817
3827
3818 * IPython/ipmaker.py (make_IPython): update version requirement to
3828 * IPython/ipmaker.py (make_IPython): update version requirement to
3819 python 2.2.
3829 python 2.2.
3820
3830
3821 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3831 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3822 banner arg for embedded customization.
3832 banner arg for embedded customization.
3823
3833
3824 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3834 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3825 explicit uses of __IP as the IPython's instance name. Now things
3835 explicit uses of __IP as the IPython's instance name. Now things
3826 are properly handled via the shell.name value. The actual code
3836 are properly handled via the shell.name value. The actual code
3827 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3837 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3828 is much better than before. I'll clean things completely when the
3838 is much better than before. I'll clean things completely when the
3829 magic stuff gets a real overhaul.
3839 magic stuff gets a real overhaul.
3830
3840
3831 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3841 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3832 minor changes to debian dir.
3842 minor changes to debian dir.
3833
3843
3834 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3844 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3835 pointer to the shell itself in the interactive namespace even when
3845 pointer to the shell itself in the interactive namespace even when
3836 a user-supplied dict is provided. This is needed for embedding
3846 a user-supplied dict is provided. This is needed for embedding
3837 purposes (found by tests with Michel Sanner).
3847 purposes (found by tests with Michel Sanner).
3838
3848
3839 2004-09-27 Fernando Perez <fperez@colorado.edu>
3849 2004-09-27 Fernando Perez <fperez@colorado.edu>
3840
3850
3841 * IPython/UserConfig/ipythonrc: remove []{} from
3851 * IPython/UserConfig/ipythonrc: remove []{} from
3842 readline_remove_delims, so that things like [modname.<TAB> do
3852 readline_remove_delims, so that things like [modname.<TAB> do
3843 proper completion. This disables [].TAB, but that's a less common
3853 proper completion. This disables [].TAB, but that's a less common
3844 case than module names in list comprehensions, for example.
3854 case than module names in list comprehensions, for example.
3845 Thanks to a report by Andrea Riciputi.
3855 Thanks to a report by Andrea Riciputi.
3846
3856
3847 2004-09-09 Fernando Perez <fperez@colorado.edu>
3857 2004-09-09 Fernando Perez <fperez@colorado.edu>
3848
3858
3849 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3859 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3850 blocking problems in win32 and osx. Fix by John.
3860 blocking problems in win32 and osx. Fix by John.
3851
3861
3852 2004-09-08 Fernando Perez <fperez@colorado.edu>
3862 2004-09-08 Fernando Perez <fperez@colorado.edu>
3853
3863
3854 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3864 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3855 for Win32 and OSX. Fix by John Hunter.
3865 for Win32 and OSX. Fix by John Hunter.
3856
3866
3857 2004-08-30 *** Released version 0.6.3
3867 2004-08-30 *** Released version 0.6.3
3858
3868
3859 2004-08-30 Fernando Perez <fperez@colorado.edu>
3869 2004-08-30 Fernando Perez <fperez@colorado.edu>
3860
3870
3861 * setup.py (isfile): Add manpages to list of dependent files to be
3871 * setup.py (isfile): Add manpages to list of dependent files to be
3862 updated.
3872 updated.
3863
3873
3864 2004-08-27 Fernando Perez <fperez@colorado.edu>
3874 2004-08-27 Fernando Perez <fperez@colorado.edu>
3865
3875
3866 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3876 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3867 for now. They don't really work with standalone WX/GTK code
3877 for now. They don't really work with standalone WX/GTK code
3868 (though matplotlib IS working fine with both of those backends).
3878 (though matplotlib IS working fine with both of those backends).
3869 This will neeed much more testing. I disabled most things with
3879 This will neeed much more testing. I disabled most things with
3870 comments, so turning it back on later should be pretty easy.
3880 comments, so turning it back on later should be pretty easy.
3871
3881
3872 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3882 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3873 autocalling of expressions like r'foo', by modifying the line
3883 autocalling of expressions like r'foo', by modifying the line
3874 split regexp. Closes
3884 split regexp. Closes
3875 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3885 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3876 Riley <ipythonbugs-AT-sabi.net>.
3886 Riley <ipythonbugs-AT-sabi.net>.
3877 (InteractiveShell.mainloop): honor --nobanner with banner
3887 (InteractiveShell.mainloop): honor --nobanner with banner
3878 extensions.
3888 extensions.
3879
3889
3880 * IPython/Shell.py: Significant refactoring of all classes, so
3890 * IPython/Shell.py: Significant refactoring of all classes, so
3881 that we can really support ALL matplotlib backends and threading
3891 that we can really support ALL matplotlib backends and threading
3882 models (John spotted a bug with Tk which required this). Now we
3892 models (John spotted a bug with Tk which required this). Now we
3883 should support single-threaded, WX-threads and GTK-threads, both
3893 should support single-threaded, WX-threads and GTK-threads, both
3884 for generic code and for matplotlib.
3894 for generic code and for matplotlib.
3885
3895
3886 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3896 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3887 -pylab, to simplify things for users. Will also remove the pylab
3897 -pylab, to simplify things for users. Will also remove the pylab
3888 profile, since now all of matplotlib configuration is directly
3898 profile, since now all of matplotlib configuration is directly
3889 handled here. This also reduces startup time.
3899 handled here. This also reduces startup time.
3890
3900
3891 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3901 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3892 shell wasn't being correctly called. Also in IPShellWX.
3902 shell wasn't being correctly called. Also in IPShellWX.
3893
3903
3894 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3904 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3895 fine-tune banner.
3905 fine-tune banner.
3896
3906
3897 * IPython/numutils.py (spike): Deprecate these spike functions,
3907 * IPython/numutils.py (spike): Deprecate these spike functions,
3898 delete (long deprecated) gnuplot_exec handler.
3908 delete (long deprecated) gnuplot_exec handler.
3899
3909
3900 2004-08-26 Fernando Perez <fperez@colorado.edu>
3910 2004-08-26 Fernando Perez <fperez@colorado.edu>
3901
3911
3902 * ipython.1: Update for threading options, plus some others which
3912 * ipython.1: Update for threading options, plus some others which
3903 were missing.
3913 were missing.
3904
3914
3905 * IPython/ipmaker.py (__call__): Added -wthread option for
3915 * IPython/ipmaker.py (__call__): Added -wthread option for
3906 wxpython thread handling. Make sure threading options are only
3916 wxpython thread handling. Make sure threading options are only
3907 valid at the command line.
3917 valid at the command line.
3908
3918
3909 * scripts/ipython: moved shell selection into a factory function
3919 * scripts/ipython: moved shell selection into a factory function
3910 in Shell.py, to keep the starter script to a minimum.
3920 in Shell.py, to keep the starter script to a minimum.
3911
3921
3912 2004-08-25 Fernando Perez <fperez@colorado.edu>
3922 2004-08-25 Fernando Perez <fperez@colorado.edu>
3913
3923
3914 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3924 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3915 John. Along with some recent changes he made to matplotlib, the
3925 John. Along with some recent changes he made to matplotlib, the
3916 next versions of both systems should work very well together.
3926 next versions of both systems should work very well together.
3917
3927
3918 2004-08-24 Fernando Perez <fperez@colorado.edu>
3928 2004-08-24 Fernando Perez <fperez@colorado.edu>
3919
3929
3920 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3930 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3921 tried to switch the profiling to using hotshot, but I'm getting
3931 tried to switch the profiling to using hotshot, but I'm getting
3922 strange errors from prof.runctx() there. I may be misreading the
3932 strange errors from prof.runctx() there. I may be misreading the
3923 docs, but it looks weird. For now the profiling code will
3933 docs, but it looks weird. For now the profiling code will
3924 continue to use the standard profiler.
3934 continue to use the standard profiler.
3925
3935
3926 2004-08-23 Fernando Perez <fperez@colorado.edu>
3936 2004-08-23 Fernando Perez <fperez@colorado.edu>
3927
3937
3928 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3938 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3929 threaded shell, by John Hunter. It's not quite ready yet, but
3939 threaded shell, by John Hunter. It's not quite ready yet, but
3930 close.
3940 close.
3931
3941
3932 2004-08-22 Fernando Perez <fperez@colorado.edu>
3942 2004-08-22 Fernando Perez <fperez@colorado.edu>
3933
3943
3934 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3944 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3935 in Magic and ultraTB.
3945 in Magic and ultraTB.
3936
3946
3937 * ipython.1: document threading options in manpage.
3947 * ipython.1: document threading options in manpage.
3938
3948
3939 * scripts/ipython: Changed name of -thread option to -gthread,
3949 * scripts/ipython: Changed name of -thread option to -gthread,
3940 since this is GTK specific. I want to leave the door open for a
3950 since this is GTK specific. I want to leave the door open for a
3941 -wthread option for WX, which will most likely be necessary. This
3951 -wthread option for WX, which will most likely be necessary. This
3942 change affects usage and ipmaker as well.
3952 change affects usage and ipmaker as well.
3943
3953
3944 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3954 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3945 handle the matplotlib shell issues. Code by John Hunter
3955 handle the matplotlib shell issues. Code by John Hunter
3946 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3956 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3947 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3957 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3948 broken (and disabled for end users) for now, but it puts the
3958 broken (and disabled for end users) for now, but it puts the
3949 infrastructure in place.
3959 infrastructure in place.
3950
3960
3951 2004-08-21 Fernando Perez <fperez@colorado.edu>
3961 2004-08-21 Fernando Perez <fperez@colorado.edu>
3952
3962
3953 * ipythonrc-pylab: Add matplotlib support.
3963 * ipythonrc-pylab: Add matplotlib support.
3954
3964
3955 * matplotlib_config.py: new files for matplotlib support, part of
3965 * matplotlib_config.py: new files for matplotlib support, part of
3956 the pylab profile.
3966 the pylab profile.
3957
3967
3958 * IPython/usage.py (__doc__): documented the threading options.
3968 * IPython/usage.py (__doc__): documented the threading options.
3959
3969
3960 2004-08-20 Fernando Perez <fperez@colorado.edu>
3970 2004-08-20 Fernando Perez <fperez@colorado.edu>
3961
3971
3962 * ipython: Modified the main calling routine to handle the -thread
3972 * ipython: Modified the main calling routine to handle the -thread
3963 and -mpthread options. This needs to be done as a top-level hack,
3973 and -mpthread options. This needs to be done as a top-level hack,
3964 because it determines which class to instantiate for IPython
3974 because it determines which class to instantiate for IPython
3965 itself.
3975 itself.
3966
3976
3967 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3977 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3968 classes to support multithreaded GTK operation without blocking,
3978 classes to support multithreaded GTK operation without blocking,
3969 and matplotlib with all backends. This is a lot of still very
3979 and matplotlib with all backends. This is a lot of still very
3970 experimental code, and threads are tricky. So it may still have a
3980 experimental code, and threads are tricky. So it may still have a
3971 few rough edges... This code owes a lot to
3981 few rough edges... This code owes a lot to
3972 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3982 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3973 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3983 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3974 to John Hunter for all the matplotlib work.
3984 to John Hunter for all the matplotlib work.
3975
3985
3976 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3986 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3977 options for gtk thread and matplotlib support.
3987 options for gtk thread and matplotlib support.
3978
3988
3979 2004-08-16 Fernando Perez <fperez@colorado.edu>
3989 2004-08-16 Fernando Perez <fperez@colorado.edu>
3980
3990
3981 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3991 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3982 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3992 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3983 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3993 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3984
3994
3985 2004-08-11 Fernando Perez <fperez@colorado.edu>
3995 2004-08-11 Fernando Perez <fperez@colorado.edu>
3986
3996
3987 * setup.py (isfile): Fix build so documentation gets updated for
3997 * setup.py (isfile): Fix build so documentation gets updated for
3988 rpms (it was only done for .tgz builds).
3998 rpms (it was only done for .tgz builds).
3989
3999
3990 2004-08-10 Fernando Perez <fperez@colorado.edu>
4000 2004-08-10 Fernando Perez <fperez@colorado.edu>
3991
4001
3992 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
4002 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3993
4003
3994 * iplib.py : Silence syntax error exceptions in tab-completion.
4004 * iplib.py : Silence syntax error exceptions in tab-completion.
3995
4005
3996 2004-08-05 Fernando Perez <fperez@colorado.edu>
4006 2004-08-05 Fernando Perez <fperez@colorado.edu>
3997
4007
3998 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
4008 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3999 'color off' mark for continuation prompts. This was causing long
4009 'color off' mark for continuation prompts. This was causing long
4000 continuation lines to mis-wrap.
4010 continuation lines to mis-wrap.
4001
4011
4002 2004-08-01 Fernando Perez <fperez@colorado.edu>
4012 2004-08-01 Fernando Perez <fperez@colorado.edu>
4003
4013
4004 * IPython/ipmaker.py (make_IPython): Allow the shell class used
4014 * IPython/ipmaker.py (make_IPython): Allow the shell class used
4005 for building ipython to be a parameter. All this is necessary
4015 for building ipython to be a parameter. All this is necessary
4006 right now to have a multithreaded version, but this insane
4016 right now to have a multithreaded version, but this insane
4007 non-design will be cleaned up soon. For now, it's a hack that
4017 non-design will be cleaned up soon. For now, it's a hack that
4008 works.
4018 works.
4009
4019
4010 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
4020 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
4011 args in various places. No bugs so far, but it's a dangerous
4021 args in various places. No bugs so far, but it's a dangerous
4012 practice.
4022 practice.
4013
4023
4014 2004-07-31 Fernando Perez <fperez@colorado.edu>
4024 2004-07-31 Fernando Perez <fperez@colorado.edu>
4015
4025
4016 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
4026 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
4017 fix completion of files with dots in their names under most
4027 fix completion of files with dots in their names under most
4018 profiles (pysh was OK because the completion order is different).
4028 profiles (pysh was OK because the completion order is different).
4019
4029
4020 2004-07-27 Fernando Perez <fperez@colorado.edu>
4030 2004-07-27 Fernando Perez <fperez@colorado.edu>
4021
4031
4022 * IPython/iplib.py (InteractiveShell.__init__): build dict of
4032 * IPython/iplib.py (InteractiveShell.__init__): build dict of
4023 keywords manually, b/c the one in keyword.py was removed in python
4033 keywords manually, b/c the one in keyword.py was removed in python
4024 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
4034 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
4025 This is NOT a bug under python 2.3 and earlier.
4035 This is NOT a bug under python 2.3 and earlier.
4026
4036
4027 2004-07-26 Fernando Perez <fperez@colorado.edu>
4037 2004-07-26 Fernando Perez <fperez@colorado.edu>
4028
4038
4029 * IPython/ultraTB.py (VerboseTB.text): Add another
4039 * IPython/ultraTB.py (VerboseTB.text): Add another
4030 linecache.checkcache() call to try to prevent inspect.py from
4040 linecache.checkcache() call to try to prevent inspect.py from
4031 crashing under python 2.3. I think this fixes
4041 crashing under python 2.3. I think this fixes
4032 http://www.scipy.net/roundup/ipython/issue17.
4042 http://www.scipy.net/roundup/ipython/issue17.
4033
4043
4034 2004-07-26 *** Released version 0.6.2
4044 2004-07-26 *** Released version 0.6.2
4035
4045
4036 2004-07-26 Fernando Perez <fperez@colorado.edu>
4046 2004-07-26 Fernando Perez <fperez@colorado.edu>
4037
4047
4038 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
4048 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
4039 fail for any number.
4049 fail for any number.
4040 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
4050 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
4041 empty bookmarks.
4051 empty bookmarks.
4042
4052
4043 2004-07-26 *** Released version 0.6.1
4053 2004-07-26 *** Released version 0.6.1
4044
4054
4045 2004-07-26 Fernando Perez <fperez@colorado.edu>
4055 2004-07-26 Fernando Perez <fperez@colorado.edu>
4046
4056
4047 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
4057 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
4048
4058
4049 * IPython/iplib.py (protect_filename): Applied Ville's patch for
4059 * IPython/iplib.py (protect_filename): Applied Ville's patch for
4050 escaping '()[]{}' in filenames.
4060 escaping '()[]{}' in filenames.
4051
4061
4052 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
4062 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
4053 Python 2.2 users who lack a proper shlex.split.
4063 Python 2.2 users who lack a proper shlex.split.
4054
4064
4055 2004-07-19 Fernando Perez <fperez@colorado.edu>
4065 2004-07-19 Fernando Perez <fperez@colorado.edu>
4056
4066
4057 * IPython/iplib.py (InteractiveShell.init_readline): Add support
4067 * IPython/iplib.py (InteractiveShell.init_readline): Add support
4058 for reading readline's init file. I follow the normal chain:
4068 for reading readline's init file. I follow the normal chain:
4059 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
4069 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
4060 report by Mike Heeter. This closes
4070 report by Mike Heeter. This closes
4061 http://www.scipy.net/roundup/ipython/issue16.
4071 http://www.scipy.net/roundup/ipython/issue16.
4062
4072
4063 2004-07-18 Fernando Perez <fperez@colorado.edu>
4073 2004-07-18 Fernando Perez <fperez@colorado.edu>
4064
4074
4065 * IPython/iplib.py (__init__): Add better handling of '\' under
4075 * IPython/iplib.py (__init__): Add better handling of '\' under
4066 Win32 for filenames. After a patch by Ville.
4076 Win32 for filenames. After a patch by Ville.
4067
4077
4068 2004-07-17 Fernando Perez <fperez@colorado.edu>
4078 2004-07-17 Fernando Perez <fperez@colorado.edu>
4069
4079
4070 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4080 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4071 autocalling would be triggered for 'foo is bar' if foo is
4081 autocalling would be triggered for 'foo is bar' if foo is
4072 callable. I also cleaned up the autocall detection code to use a
4082 callable. I also cleaned up the autocall detection code to use a
4073 regexp, which is faster. Bug reported by Alexander Schmolck.
4083 regexp, which is faster. Bug reported by Alexander Schmolck.
4074
4084
4075 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
4085 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
4076 '?' in them would confuse the help system. Reported by Alex
4086 '?' in them would confuse the help system. Reported by Alex
4077 Schmolck.
4087 Schmolck.
4078
4088
4079 2004-07-16 Fernando Perez <fperez@colorado.edu>
4089 2004-07-16 Fernando Perez <fperez@colorado.edu>
4080
4090
4081 * IPython/GnuplotInteractive.py (__all__): added plot2.
4091 * IPython/GnuplotInteractive.py (__all__): added plot2.
4082
4092
4083 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
4093 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
4084 plotting dictionaries, lists or tuples of 1d arrays.
4094 plotting dictionaries, lists or tuples of 1d arrays.
4085
4095
4086 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4096 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4087 optimizations.
4097 optimizations.
4088
4098
4089 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4099 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4090 the information which was there from Janko's original IPP code:
4100 the information which was there from Janko's original IPP code:
4091
4101
4092 03.05.99 20:53 porto.ifm.uni-kiel.de
4102 03.05.99 20:53 porto.ifm.uni-kiel.de
4093 --Started changelog.
4103 --Started changelog.
4094 --make clear do what it say it does
4104 --make clear do what it say it does
4095 --added pretty output of lines from inputcache
4105 --added pretty output of lines from inputcache
4096 --Made Logger a mixin class, simplifies handling of switches
4106 --Made Logger a mixin class, simplifies handling of switches
4097 --Added own completer class. .string<TAB> expands to last history
4107 --Added own completer class. .string<TAB> expands to last history
4098 line which starts with string. The new expansion is also present
4108 line which starts with string. The new expansion is also present
4099 with Ctrl-r from the readline library. But this shows, who this
4109 with Ctrl-r from the readline library. But this shows, who this
4100 can be done for other cases.
4110 can be done for other cases.
4101 --Added convention that all shell functions should accept a
4111 --Added convention that all shell functions should accept a
4102 parameter_string This opens the door for different behaviour for
4112 parameter_string This opens the door for different behaviour for
4103 each function. @cd is a good example of this.
4113 each function. @cd is a good example of this.
4104
4114
4105 04.05.99 12:12 porto.ifm.uni-kiel.de
4115 04.05.99 12:12 porto.ifm.uni-kiel.de
4106 --added logfile rotation
4116 --added logfile rotation
4107 --added new mainloop method which freezes first the namespace
4117 --added new mainloop method which freezes first the namespace
4108
4118
4109 07.05.99 21:24 porto.ifm.uni-kiel.de
4119 07.05.99 21:24 porto.ifm.uni-kiel.de
4110 --added the docreader classes. Now there is a help system.
4120 --added the docreader classes. Now there is a help system.
4111 -This is only a first try. Currently it's not easy to put new
4121 -This is only a first try. Currently it's not easy to put new
4112 stuff in the indices. But this is the way to go. Info would be
4122 stuff in the indices. But this is the way to go. Info would be
4113 better, but HTML is every where and not everybody has an info
4123 better, but HTML is every where and not everybody has an info
4114 system installed and it's not so easy to change html-docs to info.
4124 system installed and it's not so easy to change html-docs to info.
4115 --added global logfile option
4125 --added global logfile option
4116 --there is now a hook for object inspection method pinfo needs to
4126 --there is now a hook for object inspection method pinfo needs to
4117 be provided for this. Can be reached by two '??'.
4127 be provided for this. Can be reached by two '??'.
4118
4128
4119 08.05.99 20:51 porto.ifm.uni-kiel.de
4129 08.05.99 20:51 porto.ifm.uni-kiel.de
4120 --added a README
4130 --added a README
4121 --bug in rc file. Something has changed so functions in the rc
4131 --bug in rc file. Something has changed so functions in the rc
4122 file need to reference the shell and not self. Not clear if it's a
4132 file need to reference the shell and not self. Not clear if it's a
4123 bug or feature.
4133 bug or feature.
4124 --changed rc file for new behavior
4134 --changed rc file for new behavior
4125
4135
4126 2004-07-15 Fernando Perez <fperez@colorado.edu>
4136 2004-07-15 Fernando Perez <fperez@colorado.edu>
4127
4137
4128 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4138 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4129 cache was falling out of sync in bizarre manners when multi-line
4139 cache was falling out of sync in bizarre manners when multi-line
4130 input was present. Minor optimizations and cleanup.
4140 input was present. Minor optimizations and cleanup.
4131
4141
4132 (Logger): Remove old Changelog info for cleanup. This is the
4142 (Logger): Remove old Changelog info for cleanup. This is the
4133 information which was there from Janko's original code:
4143 information which was there from Janko's original code:
4134
4144
4135 Changes to Logger: - made the default log filename a parameter
4145 Changes to Logger: - made the default log filename a parameter
4136
4146
4137 - put a check for lines beginning with !@? in log(). Needed
4147 - put a check for lines beginning with !@? in log(). Needed
4138 (even if the handlers properly log their lines) for mid-session
4148 (even if the handlers properly log their lines) for mid-session
4139 logging activation to work properly. Without this, lines logged
4149 logging activation to work properly. Without this, lines logged
4140 in mid session, which get read from the cache, would end up
4150 in mid session, which get read from the cache, would end up
4141 'bare' (with !@? in the open) in the log. Now they are caught
4151 'bare' (with !@? in the open) in the log. Now they are caught
4142 and prepended with a #.
4152 and prepended with a #.
4143
4153
4144 * IPython/iplib.py (InteractiveShell.init_readline): added check
4154 * IPython/iplib.py (InteractiveShell.init_readline): added check
4145 in case MagicCompleter fails to be defined, so we don't crash.
4155 in case MagicCompleter fails to be defined, so we don't crash.
4146
4156
4147 2004-07-13 Fernando Perez <fperez@colorado.edu>
4157 2004-07-13 Fernando Perez <fperez@colorado.edu>
4148
4158
4149 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4159 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4150 of EPS if the requested filename ends in '.eps'.
4160 of EPS if the requested filename ends in '.eps'.
4151
4161
4152 2004-07-04 Fernando Perez <fperez@colorado.edu>
4162 2004-07-04 Fernando Perez <fperez@colorado.edu>
4153
4163
4154 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4164 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4155 escaping of quotes when calling the shell.
4165 escaping of quotes when calling the shell.
4156
4166
4157 2004-07-02 Fernando Perez <fperez@colorado.edu>
4167 2004-07-02 Fernando Perez <fperez@colorado.edu>
4158
4168
4159 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4169 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4160 gettext not working because we were clobbering '_'. Fixes
4170 gettext not working because we were clobbering '_'. Fixes
4161 http://www.scipy.net/roundup/ipython/issue6.
4171 http://www.scipy.net/roundup/ipython/issue6.
4162
4172
4163 2004-07-01 Fernando Perez <fperez@colorado.edu>
4173 2004-07-01 Fernando Perez <fperez@colorado.edu>
4164
4174
4165 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4175 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4166 into @cd. Patch by Ville.
4176 into @cd. Patch by Ville.
4167
4177
4168 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4178 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4169 new function to store things after ipmaker runs. Patch by Ville.
4179 new function to store things after ipmaker runs. Patch by Ville.
4170 Eventually this will go away once ipmaker is removed and the class
4180 Eventually this will go away once ipmaker is removed and the class
4171 gets cleaned up, but for now it's ok. Key functionality here is
4181 gets cleaned up, but for now it's ok. Key functionality here is
4172 the addition of the persistent storage mechanism, a dict for
4182 the addition of the persistent storage mechanism, a dict for
4173 keeping data across sessions (for now just bookmarks, but more can
4183 keeping data across sessions (for now just bookmarks, but more can
4174 be implemented later).
4184 be implemented later).
4175
4185
4176 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4186 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4177 persistent across sections. Patch by Ville, I modified it
4187 persistent across sections. Patch by Ville, I modified it
4178 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4188 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4179 added a '-l' option to list all bookmarks.
4189 added a '-l' option to list all bookmarks.
4180
4190
4181 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4191 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4182 center for cleanup. Registered with atexit.register(). I moved
4192 center for cleanup. Registered with atexit.register(). I moved
4183 here the old exit_cleanup(). After a patch by Ville.
4193 here the old exit_cleanup(). After a patch by Ville.
4184
4194
4185 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4195 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4186 characters in the hacked shlex_split for python 2.2.
4196 characters in the hacked shlex_split for python 2.2.
4187
4197
4188 * IPython/iplib.py (file_matches): more fixes to filenames with
4198 * IPython/iplib.py (file_matches): more fixes to filenames with
4189 whitespace in them. It's not perfect, but limitations in python's
4199 whitespace in them. It's not perfect, but limitations in python's
4190 readline make it impossible to go further.
4200 readline make it impossible to go further.
4191
4201
4192 2004-06-29 Fernando Perez <fperez@colorado.edu>
4202 2004-06-29 Fernando Perez <fperez@colorado.edu>
4193
4203
4194 * IPython/iplib.py (file_matches): escape whitespace correctly in
4204 * IPython/iplib.py (file_matches): escape whitespace correctly in
4195 filename completions. Bug reported by Ville.
4205 filename completions. Bug reported by Ville.
4196
4206
4197 2004-06-28 Fernando Perez <fperez@colorado.edu>
4207 2004-06-28 Fernando Perez <fperez@colorado.edu>
4198
4208
4199 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4209 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4200 the history file will be called 'history-PROFNAME' (or just
4210 the history file will be called 'history-PROFNAME' (or just
4201 'history' if no profile is loaded). I was getting annoyed at
4211 'history' if no profile is loaded). I was getting annoyed at
4202 getting my Numerical work history clobbered by pysh sessions.
4212 getting my Numerical work history clobbered by pysh sessions.
4203
4213
4204 * IPython/iplib.py (InteractiveShell.__init__): Internal
4214 * IPython/iplib.py (InteractiveShell.__init__): Internal
4205 getoutputerror() function so that we can honor the system_verbose
4215 getoutputerror() function so that we can honor the system_verbose
4206 flag for _all_ system calls. I also added escaping of #
4216 flag for _all_ system calls. I also added escaping of #
4207 characters here to avoid confusing Itpl.
4217 characters here to avoid confusing Itpl.
4208
4218
4209 * IPython/Magic.py (shlex_split): removed call to shell in
4219 * IPython/Magic.py (shlex_split): removed call to shell in
4210 parse_options and replaced it with shlex.split(). The annoying
4220 parse_options and replaced it with shlex.split(). The annoying
4211 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4221 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4212 to backport it from 2.3, with several frail hacks (the shlex
4222 to backport it from 2.3, with several frail hacks (the shlex
4213 module is rather limited in 2.2). Thanks to a suggestion by Ville
4223 module is rather limited in 2.2). Thanks to a suggestion by Ville
4214 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4224 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4215 problem.
4225 problem.
4216
4226
4217 (Magic.magic_system_verbose): new toggle to print the actual
4227 (Magic.magic_system_verbose): new toggle to print the actual
4218 system calls made by ipython. Mainly for debugging purposes.
4228 system calls made by ipython. Mainly for debugging purposes.
4219
4229
4220 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4230 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4221 doesn't support persistence. Reported (and fix suggested) by
4231 doesn't support persistence. Reported (and fix suggested) by
4222 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4232 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4223
4233
4224 2004-06-26 Fernando Perez <fperez@colorado.edu>
4234 2004-06-26 Fernando Perez <fperez@colorado.edu>
4225
4235
4226 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4236 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4227 continue prompts.
4237 continue prompts.
4228
4238
4229 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4239 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4230 function (basically a big docstring) and a few more things here to
4240 function (basically a big docstring) and a few more things here to
4231 speedup startup. pysh.py is now very lightweight. We want because
4241 speedup startup. pysh.py is now very lightweight. We want because
4232 it gets execfile'd, while InterpreterExec gets imported, so
4242 it gets execfile'd, while InterpreterExec gets imported, so
4233 byte-compilation saves time.
4243 byte-compilation saves time.
4234
4244
4235 2004-06-25 Fernando Perez <fperez@colorado.edu>
4245 2004-06-25 Fernando Perez <fperez@colorado.edu>
4236
4246
4237 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4247 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4238 -NUM', which was recently broken.
4248 -NUM', which was recently broken.
4239
4249
4240 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4250 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4241 in multi-line input (but not !!, which doesn't make sense there).
4251 in multi-line input (but not !!, which doesn't make sense there).
4242
4252
4243 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4253 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4244 It's just too useful, and people can turn it off in the less
4254 It's just too useful, and people can turn it off in the less
4245 common cases where it's a problem.
4255 common cases where it's a problem.
4246
4256
4247 2004-06-24 Fernando Perez <fperez@colorado.edu>
4257 2004-06-24 Fernando Perez <fperez@colorado.edu>
4248
4258
4249 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4259 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4250 special syntaxes (like alias calling) is now allied in multi-line
4260 special syntaxes (like alias calling) is now allied in multi-line
4251 input. This is still _very_ experimental, but it's necessary for
4261 input. This is still _very_ experimental, but it's necessary for
4252 efficient shell usage combining python looping syntax with system
4262 efficient shell usage combining python looping syntax with system
4253 calls. For now it's restricted to aliases, I don't think it
4263 calls. For now it's restricted to aliases, I don't think it
4254 really even makes sense to have this for magics.
4264 really even makes sense to have this for magics.
4255
4265
4256 2004-06-23 Fernando Perez <fperez@colorado.edu>
4266 2004-06-23 Fernando Perez <fperez@colorado.edu>
4257
4267
4258 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4268 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4259 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4269 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4260
4270
4261 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4271 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4262 extensions under Windows (after code sent by Gary Bishop). The
4272 extensions under Windows (after code sent by Gary Bishop). The
4263 extensions considered 'executable' are stored in IPython's rc
4273 extensions considered 'executable' are stored in IPython's rc
4264 structure as win_exec_ext.
4274 structure as win_exec_ext.
4265
4275
4266 * IPython/genutils.py (shell): new function, like system() but
4276 * IPython/genutils.py (shell): new function, like system() but
4267 without return value. Very useful for interactive shell work.
4277 without return value. Very useful for interactive shell work.
4268
4278
4269 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4279 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4270 delete aliases.
4280 delete aliases.
4271
4281
4272 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4282 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4273 sure that the alias table doesn't contain python keywords.
4283 sure that the alias table doesn't contain python keywords.
4274
4284
4275 2004-06-21 Fernando Perez <fperez@colorado.edu>
4285 2004-06-21 Fernando Perez <fperez@colorado.edu>
4276
4286
4277 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4287 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4278 non-existent items are found in $PATH. Reported by Thorsten.
4288 non-existent items are found in $PATH. Reported by Thorsten.
4279
4289
4280 2004-06-20 Fernando Perez <fperez@colorado.edu>
4290 2004-06-20 Fernando Perez <fperez@colorado.edu>
4281
4291
4282 * IPython/iplib.py (complete): modified the completer so that the
4292 * IPython/iplib.py (complete): modified the completer so that the
4283 order of priorities can be easily changed at runtime.
4293 order of priorities can be easily changed at runtime.
4284
4294
4285 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4295 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4286 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4296 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4287
4297
4288 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4298 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4289 expand Python variables prepended with $ in all system calls. The
4299 expand Python variables prepended with $ in all system calls. The
4290 same was done to InteractiveShell.handle_shell_escape. Now all
4300 same was done to InteractiveShell.handle_shell_escape. Now all
4291 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4301 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4292 expansion of python variables and expressions according to the
4302 expansion of python variables and expressions according to the
4293 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4303 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4294
4304
4295 Though PEP-215 has been rejected, a similar (but simpler) one
4305 Though PEP-215 has been rejected, a similar (but simpler) one
4296 seems like it will go into Python 2.4, PEP-292 -
4306 seems like it will go into Python 2.4, PEP-292 -
4297 http://www.python.org/peps/pep-0292.html.
4307 http://www.python.org/peps/pep-0292.html.
4298
4308
4299 I'll keep the full syntax of PEP-215, since IPython has since the
4309 I'll keep the full syntax of PEP-215, since IPython has since the
4300 start used Ka-Ping Yee's reference implementation discussed there
4310 start used Ka-Ping Yee's reference implementation discussed there
4301 (Itpl), and I actually like the powerful semantics it offers.
4311 (Itpl), and I actually like the powerful semantics it offers.
4302
4312
4303 In order to access normal shell variables, the $ has to be escaped
4313 In order to access normal shell variables, the $ has to be escaped
4304 via an extra $. For example:
4314 via an extra $. For example:
4305
4315
4306 In [7]: PATH='a python variable'
4316 In [7]: PATH='a python variable'
4307
4317
4308 In [8]: !echo $PATH
4318 In [8]: !echo $PATH
4309 a python variable
4319 a python variable
4310
4320
4311 In [9]: !echo $$PATH
4321 In [9]: !echo $$PATH
4312 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4322 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4313
4323
4314 (Magic.parse_options): escape $ so the shell doesn't evaluate
4324 (Magic.parse_options): escape $ so the shell doesn't evaluate
4315 things prematurely.
4325 things prematurely.
4316
4326
4317 * IPython/iplib.py (InteractiveShell.call_alias): added the
4327 * IPython/iplib.py (InteractiveShell.call_alias): added the
4318 ability for aliases to expand python variables via $.
4328 ability for aliases to expand python variables via $.
4319
4329
4320 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4330 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4321 system, now there's a @rehash/@rehashx pair of magics. These work
4331 system, now there's a @rehash/@rehashx pair of magics. These work
4322 like the csh rehash command, and can be invoked at any time. They
4332 like the csh rehash command, and can be invoked at any time. They
4323 build a table of aliases to everything in the user's $PATH
4333 build a table of aliases to everything in the user's $PATH
4324 (@rehash uses everything, @rehashx is slower but only adds
4334 (@rehash uses everything, @rehashx is slower but only adds
4325 executable files). With this, the pysh.py-based shell profile can
4335 executable files). With this, the pysh.py-based shell profile can
4326 now simply call rehash upon startup, and full access to all
4336 now simply call rehash upon startup, and full access to all
4327 programs in the user's path is obtained.
4337 programs in the user's path is obtained.
4328
4338
4329 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4339 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4330 functionality is now fully in place. I removed the old dynamic
4340 functionality is now fully in place. I removed the old dynamic
4331 code generation based approach, in favor of a much lighter one
4341 code generation based approach, in favor of a much lighter one
4332 based on a simple dict. The advantage is that this allows me to
4342 based on a simple dict. The advantage is that this allows me to
4333 now have thousands of aliases with negligible cost (unthinkable
4343 now have thousands of aliases with negligible cost (unthinkable
4334 with the old system).
4344 with the old system).
4335
4345
4336 2004-06-19 Fernando Perez <fperez@colorado.edu>
4346 2004-06-19 Fernando Perez <fperez@colorado.edu>
4337
4347
4338 * IPython/iplib.py (__init__): extended MagicCompleter class to
4348 * IPython/iplib.py (__init__): extended MagicCompleter class to
4339 also complete (last in priority) on user aliases.
4349 also complete (last in priority) on user aliases.
4340
4350
4341 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4351 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4342 call to eval.
4352 call to eval.
4343 (ItplNS.__init__): Added a new class which functions like Itpl,
4353 (ItplNS.__init__): Added a new class which functions like Itpl,
4344 but allows configuring the namespace for the evaluation to occur
4354 but allows configuring the namespace for the evaluation to occur
4345 in.
4355 in.
4346
4356
4347 2004-06-18 Fernando Perez <fperez@colorado.edu>
4357 2004-06-18 Fernando Perez <fperez@colorado.edu>
4348
4358
4349 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4359 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4350 better message when 'exit' or 'quit' are typed (a common newbie
4360 better message when 'exit' or 'quit' are typed (a common newbie
4351 confusion).
4361 confusion).
4352
4362
4353 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4363 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4354 check for Windows users.
4364 check for Windows users.
4355
4365
4356 * IPython/iplib.py (InteractiveShell.user_setup): removed
4366 * IPython/iplib.py (InteractiveShell.user_setup): removed
4357 disabling of colors for Windows. I'll test at runtime and issue a
4367 disabling of colors for Windows. I'll test at runtime and issue a
4358 warning if Gary's readline isn't found, as to nudge users to
4368 warning if Gary's readline isn't found, as to nudge users to
4359 download it.
4369 download it.
4360
4370
4361 2004-06-16 Fernando Perez <fperez@colorado.edu>
4371 2004-06-16 Fernando Perez <fperez@colorado.edu>
4362
4372
4363 * IPython/genutils.py (Stream.__init__): changed to print errors
4373 * IPython/genutils.py (Stream.__init__): changed to print errors
4364 to sys.stderr. I had a circular dependency here. Now it's
4374 to sys.stderr. I had a circular dependency here. Now it's
4365 possible to run ipython as IDLE's shell (consider this pre-alpha,
4375 possible to run ipython as IDLE's shell (consider this pre-alpha,
4366 since true stdout things end up in the starting terminal instead
4376 since true stdout things end up in the starting terminal instead
4367 of IDLE's out).
4377 of IDLE's out).
4368
4378
4369 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4379 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4370 users who haven't # updated their prompt_in2 definitions. Remove
4380 users who haven't # updated their prompt_in2 definitions. Remove
4371 eventually.
4381 eventually.
4372 (multiple_replace): added credit to original ASPN recipe.
4382 (multiple_replace): added credit to original ASPN recipe.
4373
4383
4374 2004-06-15 Fernando Perez <fperez@colorado.edu>
4384 2004-06-15 Fernando Perez <fperez@colorado.edu>
4375
4385
4376 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4386 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4377 list of auto-defined aliases.
4387 list of auto-defined aliases.
4378
4388
4379 2004-06-13 Fernando Perez <fperez@colorado.edu>
4389 2004-06-13 Fernando Perez <fperez@colorado.edu>
4380
4390
4381 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4391 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4382 install was really requested (so setup.py can be used for other
4392 install was really requested (so setup.py can be used for other
4383 things under Windows).
4393 things under Windows).
4384
4394
4385 2004-06-10 Fernando Perez <fperez@colorado.edu>
4395 2004-06-10 Fernando Perez <fperez@colorado.edu>
4386
4396
4387 * IPython/Logger.py (Logger.create_log): Manually remove any old
4397 * IPython/Logger.py (Logger.create_log): Manually remove any old
4388 backup, since os.remove may fail under Windows. Fixes bug
4398 backup, since os.remove may fail under Windows. Fixes bug
4389 reported by Thorsten.
4399 reported by Thorsten.
4390
4400
4391 2004-06-09 Fernando Perez <fperez@colorado.edu>
4401 2004-06-09 Fernando Perez <fperez@colorado.edu>
4392
4402
4393 * examples/example-embed.py: fixed all references to %n (replaced
4403 * examples/example-embed.py: fixed all references to %n (replaced
4394 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4404 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4395 for all examples and the manual as well.
4405 for all examples and the manual as well.
4396
4406
4397 2004-06-08 Fernando Perez <fperez@colorado.edu>
4407 2004-06-08 Fernando Perez <fperez@colorado.edu>
4398
4408
4399 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4409 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4400 alignment and color management. All 3 prompt subsystems now
4410 alignment and color management. All 3 prompt subsystems now
4401 inherit from BasePrompt.
4411 inherit from BasePrompt.
4402
4412
4403 * tools/release: updates for windows installer build and tag rpms
4413 * tools/release: updates for windows installer build and tag rpms
4404 with python version (since paths are fixed).
4414 with python version (since paths are fixed).
4405
4415
4406 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4416 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4407 which will become eventually obsolete. Also fixed the default
4417 which will become eventually obsolete. Also fixed the default
4408 prompt_in2 to use \D, so at least new users start with the correct
4418 prompt_in2 to use \D, so at least new users start with the correct
4409 defaults.
4419 defaults.
4410 WARNING: Users with existing ipythonrc files will need to apply
4420 WARNING: Users with existing ipythonrc files will need to apply
4411 this fix manually!
4421 this fix manually!
4412
4422
4413 * setup.py: make windows installer (.exe). This is finally the
4423 * setup.py: make windows installer (.exe). This is finally the
4414 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4424 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4415 which I hadn't included because it required Python 2.3 (or recent
4425 which I hadn't included because it required Python 2.3 (or recent
4416 distutils).
4426 distutils).
4417
4427
4418 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4428 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4419 usage of new '\D' escape.
4429 usage of new '\D' escape.
4420
4430
4421 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4431 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4422 lacks os.getuid())
4432 lacks os.getuid())
4423 (CachedOutput.set_colors): Added the ability to turn coloring
4433 (CachedOutput.set_colors): Added the ability to turn coloring
4424 on/off with @colors even for manually defined prompt colors. It
4434 on/off with @colors even for manually defined prompt colors. It
4425 uses a nasty global, but it works safely and via the generic color
4435 uses a nasty global, but it works safely and via the generic color
4426 handling mechanism.
4436 handling mechanism.
4427 (Prompt2.__init__): Introduced new escape '\D' for continuation
4437 (Prompt2.__init__): Introduced new escape '\D' for continuation
4428 prompts. It represents the counter ('\#') as dots.
4438 prompts. It represents the counter ('\#') as dots.
4429 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4439 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4430 need to update their ipythonrc files and replace '%n' with '\D' in
4440 need to update their ipythonrc files and replace '%n' with '\D' in
4431 their prompt_in2 settings everywhere. Sorry, but there's
4441 their prompt_in2 settings everywhere. Sorry, but there's
4432 otherwise no clean way to get all prompts to properly align. The
4442 otherwise no clean way to get all prompts to properly align. The
4433 ipythonrc shipped with IPython has been updated.
4443 ipythonrc shipped with IPython has been updated.
4434
4444
4435 2004-06-07 Fernando Perez <fperez@colorado.edu>
4445 2004-06-07 Fernando Perez <fperez@colorado.edu>
4436
4446
4437 * setup.py (isfile): Pass local_icons option to latex2html, so the
4447 * setup.py (isfile): Pass local_icons option to latex2html, so the
4438 resulting HTML file is self-contained. Thanks to
4448 resulting HTML file is self-contained. Thanks to
4439 dryice-AT-liu.com.cn for the tip.
4449 dryice-AT-liu.com.cn for the tip.
4440
4450
4441 * pysh.py: I created a new profile 'shell', which implements a
4451 * pysh.py: I created a new profile 'shell', which implements a
4442 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4452 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4443 system shell, nor will it become one anytime soon. It's mainly
4453 system shell, nor will it become one anytime soon. It's mainly
4444 meant to illustrate the use of the new flexible bash-like prompts.
4454 meant to illustrate the use of the new flexible bash-like prompts.
4445 I guess it could be used by hardy souls for true shell management,
4455 I guess it could be used by hardy souls for true shell management,
4446 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4456 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4447 profile. This uses the InterpreterExec extension provided by
4457 profile. This uses the InterpreterExec extension provided by
4448 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4458 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4449
4459
4450 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4460 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4451 auto-align itself with the length of the previous input prompt
4461 auto-align itself with the length of the previous input prompt
4452 (taking into account the invisible color escapes).
4462 (taking into account the invisible color escapes).
4453 (CachedOutput.__init__): Large restructuring of this class. Now
4463 (CachedOutput.__init__): Large restructuring of this class. Now
4454 all three prompts (primary1, primary2, output) are proper objects,
4464 all three prompts (primary1, primary2, output) are proper objects,
4455 managed by the 'parent' CachedOutput class. The code is still a
4465 managed by the 'parent' CachedOutput class. The code is still a
4456 bit hackish (all prompts share state via a pointer to the cache),
4466 bit hackish (all prompts share state via a pointer to the cache),
4457 but it's overall far cleaner than before.
4467 but it's overall far cleaner than before.
4458
4468
4459 * IPython/genutils.py (getoutputerror): modified to add verbose,
4469 * IPython/genutils.py (getoutputerror): modified to add verbose,
4460 debug and header options. This makes the interface of all getout*
4470 debug and header options. This makes the interface of all getout*
4461 functions uniform.
4471 functions uniform.
4462 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4472 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4463
4473
4464 * IPython/Magic.py (Magic.default_option): added a function to
4474 * IPython/Magic.py (Magic.default_option): added a function to
4465 allow registering default options for any magic command. This
4475 allow registering default options for any magic command. This
4466 makes it easy to have profiles which customize the magics globally
4476 makes it easy to have profiles which customize the magics globally
4467 for a certain use. The values set through this function are
4477 for a certain use. The values set through this function are
4468 picked up by the parse_options() method, which all magics should
4478 picked up by the parse_options() method, which all magics should
4469 use to parse their options.
4479 use to parse their options.
4470
4480
4471 * IPython/genutils.py (warn): modified the warnings framework to
4481 * IPython/genutils.py (warn): modified the warnings framework to
4472 use the Term I/O class. I'm trying to slowly unify all of
4482 use the Term I/O class. I'm trying to slowly unify all of
4473 IPython's I/O operations to pass through Term.
4483 IPython's I/O operations to pass through Term.
4474
4484
4475 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4485 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4476 the secondary prompt to correctly match the length of the primary
4486 the secondary prompt to correctly match the length of the primary
4477 one for any prompt. Now multi-line code will properly line up
4487 one for any prompt. Now multi-line code will properly line up
4478 even for path dependent prompts, such as the new ones available
4488 even for path dependent prompts, such as the new ones available
4479 via the prompt_specials.
4489 via the prompt_specials.
4480
4490
4481 2004-06-06 Fernando Perez <fperez@colorado.edu>
4491 2004-06-06 Fernando Perez <fperez@colorado.edu>
4482
4492
4483 * IPython/Prompts.py (prompt_specials): Added the ability to have
4493 * IPython/Prompts.py (prompt_specials): Added the ability to have
4484 bash-like special sequences in the prompts, which get
4494 bash-like special sequences in the prompts, which get
4485 automatically expanded. Things like hostname, current working
4495 automatically expanded. Things like hostname, current working
4486 directory and username are implemented already, but it's easy to
4496 directory and username are implemented already, but it's easy to
4487 add more in the future. Thanks to a patch by W.J. van der Laan
4497 add more in the future. Thanks to a patch by W.J. van der Laan
4488 <gnufnork-AT-hetdigitalegat.nl>
4498 <gnufnork-AT-hetdigitalegat.nl>
4489 (prompt_specials): Added color support for prompt strings, so
4499 (prompt_specials): Added color support for prompt strings, so
4490 users can define arbitrary color setups for their prompts.
4500 users can define arbitrary color setups for their prompts.
4491
4501
4492 2004-06-05 Fernando Perez <fperez@colorado.edu>
4502 2004-06-05 Fernando Perez <fperez@colorado.edu>
4493
4503
4494 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4504 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4495 code to load Gary Bishop's readline and configure it
4505 code to load Gary Bishop's readline and configure it
4496 automatically. Thanks to Gary for help on this.
4506 automatically. Thanks to Gary for help on this.
4497
4507
4498 2004-06-01 Fernando Perez <fperez@colorado.edu>
4508 2004-06-01 Fernando Perez <fperez@colorado.edu>
4499
4509
4500 * IPython/Logger.py (Logger.create_log): fix bug for logging
4510 * IPython/Logger.py (Logger.create_log): fix bug for logging
4501 with no filename (previous fix was incomplete).
4511 with no filename (previous fix was incomplete).
4502
4512
4503 2004-05-25 Fernando Perez <fperez@colorado.edu>
4513 2004-05-25 Fernando Perez <fperez@colorado.edu>
4504
4514
4505 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4515 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4506 parens would get passed to the shell.
4516 parens would get passed to the shell.
4507
4517
4508 2004-05-20 Fernando Perez <fperez@colorado.edu>
4518 2004-05-20 Fernando Perez <fperez@colorado.edu>
4509
4519
4510 * IPython/Magic.py (Magic.magic_prun): changed default profile
4520 * IPython/Magic.py (Magic.magic_prun): changed default profile
4511 sort order to 'time' (the more common profiling need).
4521 sort order to 'time' (the more common profiling need).
4512
4522
4513 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4523 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4514 so that source code shown is guaranteed in sync with the file on
4524 so that source code shown is guaranteed in sync with the file on
4515 disk (also changed in psource). Similar fix to the one for
4525 disk (also changed in psource). Similar fix to the one for
4516 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4526 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4517 <yann.ledu-AT-noos.fr>.
4527 <yann.ledu-AT-noos.fr>.
4518
4528
4519 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4529 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4520 with a single option would not be correctly parsed. Closes
4530 with a single option would not be correctly parsed. Closes
4521 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4531 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4522 introduced in 0.6.0 (on 2004-05-06).
4532 introduced in 0.6.0 (on 2004-05-06).
4523
4533
4524 2004-05-13 *** Released version 0.6.0
4534 2004-05-13 *** Released version 0.6.0
4525
4535
4526 2004-05-13 Fernando Perez <fperez@colorado.edu>
4536 2004-05-13 Fernando Perez <fperez@colorado.edu>
4527
4537
4528 * debian/: Added debian/ directory to CVS, so that debian support
4538 * debian/: Added debian/ directory to CVS, so that debian support
4529 is publicly accessible. The debian package is maintained by Jack
4539 is publicly accessible. The debian package is maintained by Jack
4530 Moffit <jack-AT-xiph.org>.
4540 Moffit <jack-AT-xiph.org>.
4531
4541
4532 * Documentation: included the notes about an ipython-based system
4542 * Documentation: included the notes about an ipython-based system
4533 shell (the hypothetical 'pysh') into the new_design.pdf document,
4543 shell (the hypothetical 'pysh') into the new_design.pdf document,
4534 so that these ideas get distributed to users along with the
4544 so that these ideas get distributed to users along with the
4535 official documentation.
4545 official documentation.
4536
4546
4537 2004-05-10 Fernando Perez <fperez@colorado.edu>
4547 2004-05-10 Fernando Perez <fperez@colorado.edu>
4538
4548
4539 * IPython/Logger.py (Logger.create_log): fix recently introduced
4549 * IPython/Logger.py (Logger.create_log): fix recently introduced
4540 bug (misindented line) where logstart would fail when not given an
4550 bug (misindented line) where logstart would fail when not given an
4541 explicit filename.
4551 explicit filename.
4542
4552
4543 2004-05-09 Fernando Perez <fperez@colorado.edu>
4553 2004-05-09 Fernando Perez <fperez@colorado.edu>
4544
4554
4545 * IPython/Magic.py (Magic.parse_options): skip system call when
4555 * IPython/Magic.py (Magic.parse_options): skip system call when
4546 there are no options to look for. Faster, cleaner for the common
4556 there are no options to look for. Faster, cleaner for the common
4547 case.
4557 case.
4548
4558
4549 * Documentation: many updates to the manual: describing Windows
4559 * Documentation: many updates to the manual: describing Windows
4550 support better, Gnuplot updates, credits, misc small stuff. Also
4560 support better, Gnuplot updates, credits, misc small stuff. Also
4551 updated the new_design doc a bit.
4561 updated the new_design doc a bit.
4552
4562
4553 2004-05-06 *** Released version 0.6.0.rc1
4563 2004-05-06 *** Released version 0.6.0.rc1
4554
4564
4555 2004-05-06 Fernando Perez <fperez@colorado.edu>
4565 2004-05-06 Fernando Perez <fperez@colorado.edu>
4556
4566
4557 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4567 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4558 operations to use the vastly more efficient list/''.join() method.
4568 operations to use the vastly more efficient list/''.join() method.
4559 (FormattedTB.text): Fix
4569 (FormattedTB.text): Fix
4560 http://www.scipy.net/roundup/ipython/issue12 - exception source
4570 http://www.scipy.net/roundup/ipython/issue12 - exception source
4561 extract not updated after reload. Thanks to Mike Salib
4571 extract not updated after reload. Thanks to Mike Salib
4562 <msalib-AT-mit.edu> for pinning the source of the problem.
4572 <msalib-AT-mit.edu> for pinning the source of the problem.
4563 Fortunately, the solution works inside ipython and doesn't require
4573 Fortunately, the solution works inside ipython and doesn't require
4564 any changes to python proper.
4574 any changes to python proper.
4565
4575
4566 * IPython/Magic.py (Magic.parse_options): Improved to process the
4576 * IPython/Magic.py (Magic.parse_options): Improved to process the
4567 argument list as a true shell would (by actually using the
4577 argument list as a true shell would (by actually using the
4568 underlying system shell). This way, all @magics automatically get
4578 underlying system shell). This way, all @magics automatically get
4569 shell expansion for variables. Thanks to a comment by Alex
4579 shell expansion for variables. Thanks to a comment by Alex
4570 Schmolck.
4580 Schmolck.
4571
4581
4572 2004-04-04 Fernando Perez <fperez@colorado.edu>
4582 2004-04-04 Fernando Perez <fperez@colorado.edu>
4573
4583
4574 * IPython/iplib.py (InteractiveShell.interact): Added a special
4584 * IPython/iplib.py (InteractiveShell.interact): Added a special
4575 trap for a debugger quit exception, which is basically impossible
4585 trap for a debugger quit exception, which is basically impossible
4576 to handle by normal mechanisms, given what pdb does to the stack.
4586 to handle by normal mechanisms, given what pdb does to the stack.
4577 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4587 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4578
4588
4579 2004-04-03 Fernando Perez <fperez@colorado.edu>
4589 2004-04-03 Fernando Perez <fperez@colorado.edu>
4580
4590
4581 * IPython/genutils.py (Term): Standardized the names of the Term
4591 * IPython/genutils.py (Term): Standardized the names of the Term
4582 class streams to cin/cout/cerr, following C++ naming conventions
4592 class streams to cin/cout/cerr, following C++ naming conventions
4583 (I can't use in/out/err because 'in' is not a valid attribute
4593 (I can't use in/out/err because 'in' is not a valid attribute
4584 name).
4594 name).
4585
4595
4586 * IPython/iplib.py (InteractiveShell.interact): don't increment
4596 * IPython/iplib.py (InteractiveShell.interact): don't increment
4587 the prompt if there's no user input. By Daniel 'Dang' Griffith
4597 the prompt if there's no user input. By Daniel 'Dang' Griffith
4588 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4598 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4589 Francois Pinard.
4599 Francois Pinard.
4590
4600
4591 2004-04-02 Fernando Perez <fperez@colorado.edu>
4601 2004-04-02 Fernando Perez <fperez@colorado.edu>
4592
4602
4593 * IPython/genutils.py (Stream.__init__): Modified to survive at
4603 * IPython/genutils.py (Stream.__init__): Modified to survive at
4594 least importing in contexts where stdin/out/err aren't true file
4604 least importing in contexts where stdin/out/err aren't true file
4595 objects, such as PyCrust (they lack fileno() and mode). However,
4605 objects, such as PyCrust (they lack fileno() and mode). However,
4596 the recovery facilities which rely on these things existing will
4606 the recovery facilities which rely on these things existing will
4597 not work.
4607 not work.
4598
4608
4599 2004-04-01 Fernando Perez <fperez@colorado.edu>
4609 2004-04-01 Fernando Perez <fperez@colorado.edu>
4600
4610
4601 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4611 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4602 use the new getoutputerror() function, so it properly
4612 use the new getoutputerror() function, so it properly
4603 distinguishes stdout/err.
4613 distinguishes stdout/err.
4604
4614
4605 * IPython/genutils.py (getoutputerror): added a function to
4615 * IPython/genutils.py (getoutputerror): added a function to
4606 capture separately the standard output and error of a command.
4616 capture separately the standard output and error of a command.
4607 After a comment from dang on the mailing lists. This code is
4617 After a comment from dang on the mailing lists. This code is
4608 basically a modified version of commands.getstatusoutput(), from
4618 basically a modified version of commands.getstatusoutput(), from
4609 the standard library.
4619 the standard library.
4610
4620
4611 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4621 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4612 '!!' as a special syntax (shorthand) to access @sx.
4622 '!!' as a special syntax (shorthand) to access @sx.
4613
4623
4614 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4624 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4615 command and return its output as a list split on '\n'.
4625 command and return its output as a list split on '\n'.
4616
4626
4617 2004-03-31 Fernando Perez <fperez@colorado.edu>
4627 2004-03-31 Fernando Perez <fperez@colorado.edu>
4618
4628
4619 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4629 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4620 method to dictionaries used as FakeModule instances if they lack
4630 method to dictionaries used as FakeModule instances if they lack
4621 it. At least pydoc in python2.3 breaks for runtime-defined
4631 it. At least pydoc in python2.3 breaks for runtime-defined
4622 functions without this hack. At some point I need to _really_
4632 functions without this hack. At some point I need to _really_
4623 understand what FakeModule is doing, because it's a gross hack.
4633 understand what FakeModule is doing, because it's a gross hack.
4624 But it solves Arnd's problem for now...
4634 But it solves Arnd's problem for now...
4625
4635
4626 2004-02-27 Fernando Perez <fperez@colorado.edu>
4636 2004-02-27 Fernando Perez <fperez@colorado.edu>
4627
4637
4628 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4638 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4629 mode would behave erratically. Also increased the number of
4639 mode would behave erratically. Also increased the number of
4630 possible logs in rotate mod to 999. Thanks to Rod Holland
4640 possible logs in rotate mod to 999. Thanks to Rod Holland
4631 <rhh@StructureLABS.com> for the report and fixes.
4641 <rhh@StructureLABS.com> for the report and fixes.
4632
4642
4633 2004-02-26 Fernando Perez <fperez@colorado.edu>
4643 2004-02-26 Fernando Perez <fperez@colorado.edu>
4634
4644
4635 * IPython/genutils.py (page): Check that the curses module really
4645 * IPython/genutils.py (page): Check that the curses module really
4636 has the initscr attribute before trying to use it. For some
4646 has the initscr attribute before trying to use it. For some
4637 reason, the Solaris curses module is missing this. I think this
4647 reason, the Solaris curses module is missing this. I think this
4638 should be considered a Solaris python bug, but I'm not sure.
4648 should be considered a Solaris python bug, but I'm not sure.
4639
4649
4640 2004-01-17 Fernando Perez <fperez@colorado.edu>
4650 2004-01-17 Fernando Perez <fperez@colorado.edu>
4641
4651
4642 * IPython/genutils.py (Stream.__init__): Changes to try to make
4652 * IPython/genutils.py (Stream.__init__): Changes to try to make
4643 ipython robust against stdin/out/err being closed by the user.
4653 ipython robust against stdin/out/err being closed by the user.
4644 This is 'user error' (and blocks a normal python session, at least
4654 This is 'user error' (and blocks a normal python session, at least
4645 the stdout case). However, Ipython should be able to survive such
4655 the stdout case). However, Ipython should be able to survive such
4646 instances of abuse as gracefully as possible. To simplify the
4656 instances of abuse as gracefully as possible. To simplify the
4647 coding and maintain compatibility with Gary Bishop's Term
4657 coding and maintain compatibility with Gary Bishop's Term
4648 contributions, I've made use of classmethods for this. I think
4658 contributions, I've made use of classmethods for this. I think
4649 this introduces a dependency on python 2.2.
4659 this introduces a dependency on python 2.2.
4650
4660
4651 2004-01-13 Fernando Perez <fperez@colorado.edu>
4661 2004-01-13 Fernando Perez <fperez@colorado.edu>
4652
4662
4653 * IPython/numutils.py (exp_safe): simplified the code a bit and
4663 * IPython/numutils.py (exp_safe): simplified the code a bit and
4654 removed the need for importing the kinds module altogether.
4664 removed the need for importing the kinds module altogether.
4655
4665
4656 2004-01-06 Fernando Perez <fperez@colorado.edu>
4666 2004-01-06 Fernando Perez <fperez@colorado.edu>
4657
4667
4658 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4668 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4659 a magic function instead, after some community feedback. No
4669 a magic function instead, after some community feedback. No
4660 special syntax will exist for it, but its name is deliberately
4670 special syntax will exist for it, but its name is deliberately
4661 very short.
4671 very short.
4662
4672
4663 2003-12-20 Fernando Perez <fperez@colorado.edu>
4673 2003-12-20 Fernando Perez <fperez@colorado.edu>
4664
4674
4665 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4675 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4666 new functionality, to automagically assign the result of a shell
4676 new functionality, to automagically assign the result of a shell
4667 command to a variable. I'll solicit some community feedback on
4677 command to a variable. I'll solicit some community feedback on
4668 this before making it permanent.
4678 this before making it permanent.
4669
4679
4670 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4680 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4671 requested about callables for which inspect couldn't obtain a
4681 requested about callables for which inspect couldn't obtain a
4672 proper argspec. Thanks to a crash report sent by Etienne
4682 proper argspec. Thanks to a crash report sent by Etienne
4673 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4683 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4674
4684
4675 2003-12-09 Fernando Perez <fperez@colorado.edu>
4685 2003-12-09 Fernando Perez <fperez@colorado.edu>
4676
4686
4677 * IPython/genutils.py (page): patch for the pager to work across
4687 * IPython/genutils.py (page): patch for the pager to work across
4678 various versions of Windows. By Gary Bishop.
4688 various versions of Windows. By Gary Bishop.
4679
4689
4680 2003-12-04 Fernando Perez <fperez@colorado.edu>
4690 2003-12-04 Fernando Perez <fperez@colorado.edu>
4681
4691
4682 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4692 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4683 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4693 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4684 While I tested this and it looks ok, there may still be corner
4694 While I tested this and it looks ok, there may still be corner
4685 cases I've missed.
4695 cases I've missed.
4686
4696
4687 2003-12-01 Fernando Perez <fperez@colorado.edu>
4697 2003-12-01 Fernando Perez <fperez@colorado.edu>
4688
4698
4689 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4699 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4690 where a line like 'p,q=1,2' would fail because the automagic
4700 where a line like 'p,q=1,2' would fail because the automagic
4691 system would be triggered for @p.
4701 system would be triggered for @p.
4692
4702
4693 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4703 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4694 cleanups, code unmodified.
4704 cleanups, code unmodified.
4695
4705
4696 * IPython/genutils.py (Term): added a class for IPython to handle
4706 * IPython/genutils.py (Term): added a class for IPython to handle
4697 output. In most cases it will just be a proxy for stdout/err, but
4707 output. In most cases it will just be a proxy for stdout/err, but
4698 having this allows modifications to be made for some platforms,
4708 having this allows modifications to be made for some platforms,
4699 such as handling color escapes under Windows. All of this code
4709 such as handling color escapes under Windows. All of this code
4700 was contributed by Gary Bishop, with minor modifications by me.
4710 was contributed by Gary Bishop, with minor modifications by me.
4701 The actual changes affect many files.
4711 The actual changes affect many files.
4702
4712
4703 2003-11-30 Fernando Perez <fperez@colorado.edu>
4713 2003-11-30 Fernando Perez <fperez@colorado.edu>
4704
4714
4705 * IPython/iplib.py (file_matches): new completion code, courtesy
4715 * IPython/iplib.py (file_matches): new completion code, courtesy
4706 of Jeff Collins. This enables filename completion again under
4716 of Jeff Collins. This enables filename completion again under
4707 python 2.3, which disabled it at the C level.
4717 python 2.3, which disabled it at the C level.
4708
4718
4709 2003-11-11 Fernando Perez <fperez@colorado.edu>
4719 2003-11-11 Fernando Perez <fperez@colorado.edu>
4710
4720
4711 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4721 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4712 for Numeric.array(map(...)), but often convenient.
4722 for Numeric.array(map(...)), but often convenient.
4713
4723
4714 2003-11-05 Fernando Perez <fperez@colorado.edu>
4724 2003-11-05 Fernando Perez <fperez@colorado.edu>
4715
4725
4716 * IPython/numutils.py (frange): Changed a call from int() to
4726 * IPython/numutils.py (frange): Changed a call from int() to
4717 int(round()) to prevent a problem reported with arange() in the
4727 int(round()) to prevent a problem reported with arange() in the
4718 numpy list.
4728 numpy list.
4719
4729
4720 2003-10-06 Fernando Perez <fperez@colorado.edu>
4730 2003-10-06 Fernando Perez <fperez@colorado.edu>
4721
4731
4722 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4732 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4723 prevent crashes if sys lacks an argv attribute (it happens with
4733 prevent crashes if sys lacks an argv attribute (it happens with
4724 embedded interpreters which build a bare-bones sys module).
4734 embedded interpreters which build a bare-bones sys module).
4725 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4735 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4726
4736
4727 2003-09-24 Fernando Perez <fperez@colorado.edu>
4737 2003-09-24 Fernando Perez <fperez@colorado.edu>
4728
4738
4729 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4739 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4730 to protect against poorly written user objects where __getattr__
4740 to protect against poorly written user objects where __getattr__
4731 raises exceptions other than AttributeError. Thanks to a bug
4741 raises exceptions other than AttributeError. Thanks to a bug
4732 report by Oliver Sander <osander-AT-gmx.de>.
4742 report by Oliver Sander <osander-AT-gmx.de>.
4733
4743
4734 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4744 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4735 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4745 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4736
4746
4737 2003-09-09 Fernando Perez <fperez@colorado.edu>
4747 2003-09-09 Fernando Perez <fperez@colorado.edu>
4738
4748
4739 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4749 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4740 unpacking a list whith a callable as first element would
4750 unpacking a list whith a callable as first element would
4741 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4751 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4742 Collins.
4752 Collins.
4743
4753
4744 2003-08-25 *** Released version 0.5.0
4754 2003-08-25 *** Released version 0.5.0
4745
4755
4746 2003-08-22 Fernando Perez <fperez@colorado.edu>
4756 2003-08-22 Fernando Perez <fperez@colorado.edu>
4747
4757
4748 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4758 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4749 improperly defined user exceptions. Thanks to feedback from Mark
4759 improperly defined user exceptions. Thanks to feedback from Mark
4750 Russell <mrussell-AT-verio.net>.
4760 Russell <mrussell-AT-verio.net>.
4751
4761
4752 2003-08-20 Fernando Perez <fperez@colorado.edu>
4762 2003-08-20 Fernando Perez <fperez@colorado.edu>
4753
4763
4754 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4764 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4755 printing so that it would print multi-line string forms starting
4765 printing so that it would print multi-line string forms starting
4756 with a new line. This way the formatting is better respected for
4766 with a new line. This way the formatting is better respected for
4757 objects which work hard to make nice string forms.
4767 objects which work hard to make nice string forms.
4758
4768
4759 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4769 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4760 autocall would overtake data access for objects with both
4770 autocall would overtake data access for objects with both
4761 __getitem__ and __call__.
4771 __getitem__ and __call__.
4762
4772
4763 2003-08-19 *** Released version 0.5.0-rc1
4773 2003-08-19 *** Released version 0.5.0-rc1
4764
4774
4765 2003-08-19 Fernando Perez <fperez@colorado.edu>
4775 2003-08-19 Fernando Perez <fperez@colorado.edu>
4766
4776
4767 * IPython/deep_reload.py (load_tail): single tiny change here
4777 * IPython/deep_reload.py (load_tail): single tiny change here
4768 seems to fix the long-standing bug of dreload() failing to work
4778 seems to fix the long-standing bug of dreload() failing to work
4769 for dotted names. But this module is pretty tricky, so I may have
4779 for dotted names. But this module is pretty tricky, so I may have
4770 missed some subtlety. Needs more testing!.
4780 missed some subtlety. Needs more testing!.
4771
4781
4772 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4782 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4773 exceptions which have badly implemented __str__ methods.
4783 exceptions which have badly implemented __str__ methods.
4774 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4784 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4775 which I've been getting reports about from Python 2.3 users. I
4785 which I've been getting reports about from Python 2.3 users. I
4776 wish I had a simple test case to reproduce the problem, so I could
4786 wish I had a simple test case to reproduce the problem, so I could
4777 either write a cleaner workaround or file a bug report if
4787 either write a cleaner workaround or file a bug report if
4778 necessary.
4788 necessary.
4779
4789
4780 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4790 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4781 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4791 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4782 a bug report by Tjabo Kloppenburg.
4792 a bug report by Tjabo Kloppenburg.
4783
4793
4784 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4794 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4785 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4795 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4786 seems rather unstable. Thanks to a bug report by Tjabo
4796 seems rather unstable. Thanks to a bug report by Tjabo
4787 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4797 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4788
4798
4789 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4799 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4790 this out soon because of the critical fixes in the inner loop for
4800 this out soon because of the critical fixes in the inner loop for
4791 generators.
4801 generators.
4792
4802
4793 * IPython/Magic.py (Magic.getargspec): removed. This (and
4803 * IPython/Magic.py (Magic.getargspec): removed. This (and
4794 _get_def) have been obsoleted by OInspect for a long time, I
4804 _get_def) have been obsoleted by OInspect for a long time, I
4795 hadn't noticed that they were dead code.
4805 hadn't noticed that they were dead code.
4796 (Magic._ofind): restored _ofind functionality for a few literals
4806 (Magic._ofind): restored _ofind functionality for a few literals
4797 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4807 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4798 for things like "hello".capitalize?, since that would require a
4808 for things like "hello".capitalize?, since that would require a
4799 potentially dangerous eval() again.
4809 potentially dangerous eval() again.
4800
4810
4801 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4811 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4802 logic a bit more to clean up the escapes handling and minimize the
4812 logic a bit more to clean up the escapes handling and minimize the
4803 use of _ofind to only necessary cases. The interactive 'feel' of
4813 use of _ofind to only necessary cases. The interactive 'feel' of
4804 IPython should have improved quite a bit with the changes in
4814 IPython should have improved quite a bit with the changes in
4805 _prefilter and _ofind (besides being far safer than before).
4815 _prefilter and _ofind (besides being far safer than before).
4806
4816
4807 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4817 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4808 obscure, never reported). Edit would fail to find the object to
4818 obscure, never reported). Edit would fail to find the object to
4809 edit under some circumstances.
4819 edit under some circumstances.
4810 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4820 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4811 which were causing double-calling of generators. Those eval calls
4821 which were causing double-calling of generators. Those eval calls
4812 were _very_ dangerous, since code with side effects could be
4822 were _very_ dangerous, since code with side effects could be
4813 triggered. As they say, 'eval is evil'... These were the
4823 triggered. As they say, 'eval is evil'... These were the
4814 nastiest evals in IPython. Besides, _ofind is now far simpler,
4824 nastiest evals in IPython. Besides, _ofind is now far simpler,
4815 and it should also be quite a bit faster. Its use of inspect is
4825 and it should also be quite a bit faster. Its use of inspect is
4816 also safer, so perhaps some of the inspect-related crashes I've
4826 also safer, so perhaps some of the inspect-related crashes I've
4817 seen lately with Python 2.3 might be taken care of. That will
4827 seen lately with Python 2.3 might be taken care of. That will
4818 need more testing.
4828 need more testing.
4819
4829
4820 2003-08-17 Fernando Perez <fperez@colorado.edu>
4830 2003-08-17 Fernando Perez <fperez@colorado.edu>
4821
4831
4822 * IPython/iplib.py (InteractiveShell._prefilter): significant
4832 * IPython/iplib.py (InteractiveShell._prefilter): significant
4823 simplifications to the logic for handling user escapes. Faster
4833 simplifications to the logic for handling user escapes. Faster
4824 and simpler code.
4834 and simpler code.
4825
4835
4826 2003-08-14 Fernando Perez <fperez@colorado.edu>
4836 2003-08-14 Fernando Perez <fperez@colorado.edu>
4827
4837
4828 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4838 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4829 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4839 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4830 but it should be quite a bit faster. And the recursive version
4840 but it should be quite a bit faster. And the recursive version
4831 generated O(log N) intermediate storage for all rank>1 arrays,
4841 generated O(log N) intermediate storage for all rank>1 arrays,
4832 even if they were contiguous.
4842 even if they were contiguous.
4833 (l1norm): Added this function.
4843 (l1norm): Added this function.
4834 (norm): Added this function for arbitrary norms (including
4844 (norm): Added this function for arbitrary norms (including
4835 l-infinity). l1 and l2 are still special cases for convenience
4845 l-infinity). l1 and l2 are still special cases for convenience
4836 and speed.
4846 and speed.
4837
4847
4838 2003-08-03 Fernando Perez <fperez@colorado.edu>
4848 2003-08-03 Fernando Perez <fperez@colorado.edu>
4839
4849
4840 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4850 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4841 exceptions, which now raise PendingDeprecationWarnings in Python
4851 exceptions, which now raise PendingDeprecationWarnings in Python
4842 2.3. There were some in Magic and some in Gnuplot2.
4852 2.3. There were some in Magic and some in Gnuplot2.
4843
4853
4844 2003-06-30 Fernando Perez <fperez@colorado.edu>
4854 2003-06-30 Fernando Perez <fperez@colorado.edu>
4845
4855
4846 * IPython/genutils.py (page): modified to call curses only for
4856 * IPython/genutils.py (page): modified to call curses only for
4847 terminals where TERM=='xterm'. After problems under many other
4857 terminals where TERM=='xterm'. After problems under many other
4848 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4858 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4849
4859
4850 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4860 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4851 would be triggered when readline was absent. This was just an old
4861 would be triggered when readline was absent. This was just an old
4852 debugging statement I'd forgotten to take out.
4862 debugging statement I'd forgotten to take out.
4853
4863
4854 2003-06-20 Fernando Perez <fperez@colorado.edu>
4864 2003-06-20 Fernando Perez <fperez@colorado.edu>
4855
4865
4856 * IPython/genutils.py (clock): modified to return only user time
4866 * IPython/genutils.py (clock): modified to return only user time
4857 (not counting system time), after a discussion on scipy. While
4867 (not counting system time), after a discussion on scipy. While
4858 system time may be a useful quantity occasionally, it may much
4868 system time may be a useful quantity occasionally, it may much
4859 more easily be skewed by occasional swapping or other similar
4869 more easily be skewed by occasional swapping or other similar
4860 activity.
4870 activity.
4861
4871
4862 2003-06-05 Fernando Perez <fperez@colorado.edu>
4872 2003-06-05 Fernando Perez <fperez@colorado.edu>
4863
4873
4864 * IPython/numutils.py (identity): new function, for building
4874 * IPython/numutils.py (identity): new function, for building
4865 arbitrary rank Kronecker deltas (mostly backwards compatible with
4875 arbitrary rank Kronecker deltas (mostly backwards compatible with
4866 Numeric.identity)
4876 Numeric.identity)
4867
4877
4868 2003-06-03 Fernando Perez <fperez@colorado.edu>
4878 2003-06-03 Fernando Perez <fperez@colorado.edu>
4869
4879
4870 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4880 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4871 arguments passed to magics with spaces, to allow trailing '\' to
4881 arguments passed to magics with spaces, to allow trailing '\' to
4872 work normally (mainly for Windows users).
4882 work normally (mainly for Windows users).
4873
4883
4874 2003-05-29 Fernando Perez <fperez@colorado.edu>
4884 2003-05-29 Fernando Perez <fperez@colorado.edu>
4875
4885
4876 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4886 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4877 instead of pydoc.help. This fixes a bizarre behavior where
4887 instead of pydoc.help. This fixes a bizarre behavior where
4878 printing '%s' % locals() would trigger the help system. Now
4888 printing '%s' % locals() would trigger the help system. Now
4879 ipython behaves like normal python does.
4889 ipython behaves like normal python does.
4880
4890
4881 Note that if one does 'from pydoc import help', the bizarre
4891 Note that if one does 'from pydoc import help', the bizarre
4882 behavior returns, but this will also happen in normal python, so
4892 behavior returns, but this will also happen in normal python, so
4883 it's not an ipython bug anymore (it has to do with how pydoc.help
4893 it's not an ipython bug anymore (it has to do with how pydoc.help
4884 is implemented).
4894 is implemented).
4885
4895
4886 2003-05-22 Fernando Perez <fperez@colorado.edu>
4896 2003-05-22 Fernando Perez <fperez@colorado.edu>
4887
4897
4888 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4898 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4889 return [] instead of None when nothing matches, also match to end
4899 return [] instead of None when nothing matches, also match to end
4890 of line. Patch by Gary Bishop.
4900 of line. Patch by Gary Bishop.
4891
4901
4892 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4902 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4893 protection as before, for files passed on the command line. This
4903 protection as before, for files passed on the command line. This
4894 prevents the CrashHandler from kicking in if user files call into
4904 prevents the CrashHandler from kicking in if user files call into
4895 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4905 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4896 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4906 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4897
4907
4898 2003-05-20 *** Released version 0.4.0
4908 2003-05-20 *** Released version 0.4.0
4899
4909
4900 2003-05-20 Fernando Perez <fperez@colorado.edu>
4910 2003-05-20 Fernando Perez <fperez@colorado.edu>
4901
4911
4902 * setup.py: added support for manpages. It's a bit hackish b/c of
4912 * setup.py: added support for manpages. It's a bit hackish b/c of
4903 a bug in the way the bdist_rpm distutils target handles gzipped
4913 a bug in the way the bdist_rpm distutils target handles gzipped
4904 manpages, but it works. After a patch by Jack.
4914 manpages, but it works. After a patch by Jack.
4905
4915
4906 2003-05-19 Fernando Perez <fperez@colorado.edu>
4916 2003-05-19 Fernando Perez <fperez@colorado.edu>
4907
4917
4908 * IPython/numutils.py: added a mockup of the kinds module, since
4918 * IPython/numutils.py: added a mockup of the kinds module, since
4909 it was recently removed from Numeric. This way, numutils will
4919 it was recently removed from Numeric. This way, numutils will
4910 work for all users even if they are missing kinds.
4920 work for all users even if they are missing kinds.
4911
4921
4912 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4922 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4913 failure, which can occur with SWIG-wrapped extensions. After a
4923 failure, which can occur with SWIG-wrapped extensions. After a
4914 crash report from Prabhu.
4924 crash report from Prabhu.
4915
4925
4916 2003-05-16 Fernando Perez <fperez@colorado.edu>
4926 2003-05-16 Fernando Perez <fperez@colorado.edu>
4917
4927
4918 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4928 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4919 protect ipython from user code which may call directly
4929 protect ipython from user code which may call directly
4920 sys.excepthook (this looks like an ipython crash to the user, even
4930 sys.excepthook (this looks like an ipython crash to the user, even
4921 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4931 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4922 This is especially important to help users of WxWindows, but may
4932 This is especially important to help users of WxWindows, but may
4923 also be useful in other cases.
4933 also be useful in other cases.
4924
4934
4925 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4935 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4926 an optional tb_offset to be specified, and to preserve exception
4936 an optional tb_offset to be specified, and to preserve exception
4927 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4937 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4928
4938
4929 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4939 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4930
4940
4931 2003-05-15 Fernando Perez <fperez@colorado.edu>
4941 2003-05-15 Fernando Perez <fperez@colorado.edu>
4932
4942
4933 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4943 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4934 installing for a new user under Windows.
4944 installing for a new user under Windows.
4935
4945
4936 2003-05-12 Fernando Perez <fperez@colorado.edu>
4946 2003-05-12 Fernando Perez <fperez@colorado.edu>
4937
4947
4938 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4948 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4939 handler for Emacs comint-based lines. Currently it doesn't do
4949 handler for Emacs comint-based lines. Currently it doesn't do
4940 much (but importantly, it doesn't update the history cache). In
4950 much (but importantly, it doesn't update the history cache). In
4941 the future it may be expanded if Alex needs more functionality
4951 the future it may be expanded if Alex needs more functionality
4942 there.
4952 there.
4943
4953
4944 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4954 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4945 info to crash reports.
4955 info to crash reports.
4946
4956
4947 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4957 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4948 just like Python's -c. Also fixed crash with invalid -color
4958 just like Python's -c. Also fixed crash with invalid -color
4949 option value at startup. Thanks to Will French
4959 option value at startup. Thanks to Will French
4950 <wfrench-AT-bestweb.net> for the bug report.
4960 <wfrench-AT-bestweb.net> for the bug report.
4951
4961
4952 2003-05-09 Fernando Perez <fperez@colorado.edu>
4962 2003-05-09 Fernando Perez <fperez@colorado.edu>
4953
4963
4954 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4964 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4955 to EvalDict (it's a mapping, after all) and simplified its code
4965 to EvalDict (it's a mapping, after all) and simplified its code
4956 quite a bit, after a nice discussion on c.l.py where Gustavo
4966 quite a bit, after a nice discussion on c.l.py where Gustavo
4957 Córdova <gcordova-AT-sismex.com> suggested the new version.
4967 Córdova <gcordova-AT-sismex.com> suggested the new version.
4958
4968
4959 2003-04-30 Fernando Perez <fperez@colorado.edu>
4969 2003-04-30 Fernando Perez <fperez@colorado.edu>
4960
4970
4961 * IPython/genutils.py (timings_out): modified it to reduce its
4971 * IPython/genutils.py (timings_out): modified it to reduce its
4962 overhead in the common reps==1 case.
4972 overhead in the common reps==1 case.
4963
4973
4964 2003-04-29 Fernando Perez <fperez@colorado.edu>
4974 2003-04-29 Fernando Perez <fperez@colorado.edu>
4965
4975
4966 * IPython/genutils.py (timings_out): Modified to use the resource
4976 * IPython/genutils.py (timings_out): Modified to use the resource
4967 module, which avoids the wraparound problems of time.clock().
4977 module, which avoids the wraparound problems of time.clock().
4968
4978
4969 2003-04-17 *** Released version 0.2.15pre4
4979 2003-04-17 *** Released version 0.2.15pre4
4970
4980
4971 2003-04-17 Fernando Perez <fperez@colorado.edu>
4981 2003-04-17 Fernando Perez <fperez@colorado.edu>
4972
4982
4973 * setup.py (scriptfiles): Split windows-specific stuff over to a
4983 * setup.py (scriptfiles): Split windows-specific stuff over to a
4974 separate file, in an attempt to have a Windows GUI installer.
4984 separate file, in an attempt to have a Windows GUI installer.
4975 That didn't work, but part of the groundwork is done.
4985 That didn't work, but part of the groundwork is done.
4976
4986
4977 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4987 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4978 indent/unindent with 4 spaces. Particularly useful in combination
4988 indent/unindent with 4 spaces. Particularly useful in combination
4979 with the new auto-indent option.
4989 with the new auto-indent option.
4980
4990
4981 2003-04-16 Fernando Perez <fperez@colorado.edu>
4991 2003-04-16 Fernando Perez <fperez@colorado.edu>
4982
4992
4983 * IPython/Magic.py: various replacements of self.rc for
4993 * IPython/Magic.py: various replacements of self.rc for
4984 self.shell.rc. A lot more remains to be done to fully disentangle
4994 self.shell.rc. A lot more remains to be done to fully disentangle
4985 this class from the main Shell class.
4995 this class from the main Shell class.
4986
4996
4987 * IPython/GnuplotRuntime.py: added checks for mouse support so
4997 * IPython/GnuplotRuntime.py: added checks for mouse support so
4988 that we don't try to enable it if the current gnuplot doesn't
4998 that we don't try to enable it if the current gnuplot doesn't
4989 really support it. Also added checks so that we don't try to
4999 really support it. Also added checks so that we don't try to
4990 enable persist under Windows (where Gnuplot doesn't recognize the
5000 enable persist under Windows (where Gnuplot doesn't recognize the
4991 option).
5001 option).
4992
5002
4993 * IPython/iplib.py (InteractiveShell.interact): Added optional
5003 * IPython/iplib.py (InteractiveShell.interact): Added optional
4994 auto-indenting code, after a patch by King C. Shu
5004 auto-indenting code, after a patch by King C. Shu
4995 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
5005 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4996 get along well with pasting indented code. If I ever figure out
5006 get along well with pasting indented code. If I ever figure out
4997 how to make that part go well, it will become on by default.
5007 how to make that part go well, it will become on by default.
4998
5008
4999 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
5009 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
5000 crash ipython if there was an unmatched '%' in the user's prompt
5010 crash ipython if there was an unmatched '%' in the user's prompt
5001 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5011 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5002
5012
5003 * IPython/iplib.py (InteractiveShell.interact): removed the
5013 * IPython/iplib.py (InteractiveShell.interact): removed the
5004 ability to ask the user whether he wants to crash or not at the
5014 ability to ask the user whether he wants to crash or not at the
5005 'last line' exception handler. Calling functions at that point
5015 'last line' exception handler. Calling functions at that point
5006 changes the stack, and the error reports would have incorrect
5016 changes the stack, and the error reports would have incorrect
5007 tracebacks.
5017 tracebacks.
5008
5018
5009 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
5019 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
5010 pass through a peger a pretty-printed form of any object. After a
5020 pass through a peger a pretty-printed form of any object. After a
5011 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
5021 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
5012
5022
5013 2003-04-14 Fernando Perez <fperez@colorado.edu>
5023 2003-04-14 Fernando Perez <fperez@colorado.edu>
5014
5024
5015 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
5025 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
5016 all files in ~ would be modified at first install (instead of
5026 all files in ~ would be modified at first install (instead of
5017 ~/.ipython). This could be potentially disastrous, as the
5027 ~/.ipython). This could be potentially disastrous, as the
5018 modification (make line-endings native) could damage binary files.
5028 modification (make line-endings native) could damage binary files.
5019
5029
5020 2003-04-10 Fernando Perez <fperez@colorado.edu>
5030 2003-04-10 Fernando Perez <fperez@colorado.edu>
5021
5031
5022 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
5032 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
5023 handle only lines which are invalid python. This now means that
5033 handle only lines which are invalid python. This now means that
5024 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
5034 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
5025 for the bug report.
5035 for the bug report.
5026
5036
5027 2003-04-01 Fernando Perez <fperez@colorado.edu>
5037 2003-04-01 Fernando Perez <fperez@colorado.edu>
5028
5038
5029 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
5039 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
5030 where failing to set sys.last_traceback would crash pdb.pm().
5040 where failing to set sys.last_traceback would crash pdb.pm().
5031 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
5041 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
5032 report.
5042 report.
5033
5043
5034 2003-03-25 Fernando Perez <fperez@colorado.edu>
5044 2003-03-25 Fernando Perez <fperez@colorado.edu>
5035
5045
5036 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
5046 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
5037 before printing it (it had a lot of spurious blank lines at the
5047 before printing it (it had a lot of spurious blank lines at the
5038 end).
5048 end).
5039
5049
5040 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
5050 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
5041 output would be sent 21 times! Obviously people don't use this
5051 output would be sent 21 times! Obviously people don't use this
5042 too often, or I would have heard about it.
5052 too often, or I would have heard about it.
5043
5053
5044 2003-03-24 Fernando Perez <fperez@colorado.edu>
5054 2003-03-24 Fernando Perez <fperez@colorado.edu>
5045
5055
5046 * setup.py (scriptfiles): renamed the data_files parameter from
5056 * setup.py (scriptfiles): renamed the data_files parameter from
5047 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
5057 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
5048 for the patch.
5058 for the patch.
5049
5059
5050 2003-03-20 Fernando Perez <fperez@colorado.edu>
5060 2003-03-20 Fernando Perez <fperez@colorado.edu>
5051
5061
5052 * IPython/genutils.py (error): added error() and fatal()
5062 * IPython/genutils.py (error): added error() and fatal()
5053 functions.
5063 functions.
5054
5064
5055 2003-03-18 *** Released version 0.2.15pre3
5065 2003-03-18 *** Released version 0.2.15pre3
5056
5066
5057 2003-03-18 Fernando Perez <fperez@colorado.edu>
5067 2003-03-18 Fernando Perez <fperez@colorado.edu>
5058
5068
5059 * setupext/install_data_ext.py
5069 * setupext/install_data_ext.py
5060 (install_data_ext.initialize_options): Class contributed by Jack
5070 (install_data_ext.initialize_options): Class contributed by Jack
5061 Moffit for fixing the old distutils hack. He is sending this to
5071 Moffit for fixing the old distutils hack. He is sending this to
5062 the distutils folks so in the future we may not need it as a
5072 the distutils folks so in the future we may not need it as a
5063 private fix.
5073 private fix.
5064
5074
5065 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
5075 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
5066 changes for Debian packaging. See his patch for full details.
5076 changes for Debian packaging. See his patch for full details.
5067 The old distutils hack of making the ipythonrc* files carry a
5077 The old distutils hack of making the ipythonrc* files carry a
5068 bogus .py extension is gone, at last. Examples were moved to a
5078 bogus .py extension is gone, at last. Examples were moved to a
5069 separate subdir under doc/, and the separate executable scripts
5079 separate subdir under doc/, and the separate executable scripts
5070 now live in their own directory. Overall a great cleanup. The
5080 now live in their own directory. Overall a great cleanup. The
5071 manual was updated to use the new files, and setup.py has been
5081 manual was updated to use the new files, and setup.py has been
5072 fixed for this setup.
5082 fixed for this setup.
5073
5083
5074 * IPython/PyColorize.py (Parser.usage): made non-executable and
5084 * IPython/PyColorize.py (Parser.usage): made non-executable and
5075 created a pycolor wrapper around it to be included as a script.
5085 created a pycolor wrapper around it to be included as a script.
5076
5086
5077 2003-03-12 *** Released version 0.2.15pre2
5087 2003-03-12 *** Released version 0.2.15pre2
5078
5088
5079 2003-03-12 Fernando Perez <fperez@colorado.edu>
5089 2003-03-12 Fernando Perez <fperez@colorado.edu>
5080
5090
5081 * IPython/ColorANSI.py (make_color_table): Finally fixed the
5091 * IPython/ColorANSI.py (make_color_table): Finally fixed the
5082 long-standing problem with garbage characters in some terminals.
5092 long-standing problem with garbage characters in some terminals.
5083 The issue was really that the \001 and \002 escapes must _only_ be
5093 The issue was really that the \001 and \002 escapes must _only_ be
5084 passed to input prompts (which call readline), but _never_ to
5094 passed to input prompts (which call readline), but _never_ to
5085 normal text to be printed on screen. I changed ColorANSI to have
5095 normal text to be printed on screen. I changed ColorANSI to have
5086 two classes: TermColors and InputTermColors, each with the
5096 two classes: TermColors and InputTermColors, each with the
5087 appropriate escapes for input prompts or normal text. The code in
5097 appropriate escapes for input prompts or normal text. The code in
5088 Prompts.py got slightly more complicated, but this very old and
5098 Prompts.py got slightly more complicated, but this very old and
5089 annoying bug is finally fixed.
5099 annoying bug is finally fixed.
5090
5100
5091 All the credit for nailing down the real origin of this problem
5101 All the credit for nailing down the real origin of this problem
5092 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5102 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5093 *Many* thanks to him for spending quite a bit of effort on this.
5103 *Many* thanks to him for spending quite a bit of effort on this.
5094
5104
5095 2003-03-05 *** Released version 0.2.15pre1
5105 2003-03-05 *** Released version 0.2.15pre1
5096
5106
5097 2003-03-03 Fernando Perez <fperez@colorado.edu>
5107 2003-03-03 Fernando Perez <fperez@colorado.edu>
5098
5108
5099 * IPython/FakeModule.py: Moved the former _FakeModule to a
5109 * IPython/FakeModule.py: Moved the former _FakeModule to a
5100 separate file, because it's also needed by Magic (to fix a similar
5110 separate file, because it's also needed by Magic (to fix a similar
5101 pickle-related issue in @run).
5111 pickle-related issue in @run).
5102
5112
5103 2003-03-02 Fernando Perez <fperez@colorado.edu>
5113 2003-03-02 Fernando Perez <fperez@colorado.edu>
5104
5114
5105 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5115 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5106 the autocall option at runtime.
5116 the autocall option at runtime.
5107 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5117 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5108 across Magic.py to start separating Magic from InteractiveShell.
5118 across Magic.py to start separating Magic from InteractiveShell.
5109 (Magic._ofind): Fixed to return proper namespace for dotted
5119 (Magic._ofind): Fixed to return proper namespace for dotted
5110 names. Before, a dotted name would always return 'not currently
5120 names. Before, a dotted name would always return 'not currently
5111 defined', because it would find the 'parent'. s.x would be found,
5121 defined', because it would find the 'parent'. s.x would be found,
5112 but since 'x' isn't defined by itself, it would get confused.
5122 but since 'x' isn't defined by itself, it would get confused.
5113 (Magic.magic_run): Fixed pickling problems reported by Ralf
5123 (Magic.magic_run): Fixed pickling problems reported by Ralf
5114 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5124 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5115 that I'd used when Mike Heeter reported similar issues at the
5125 that I'd used when Mike Heeter reported similar issues at the
5116 top-level, but now for @run. It boils down to injecting the
5126 top-level, but now for @run. It boils down to injecting the
5117 namespace where code is being executed with something that looks
5127 namespace where code is being executed with something that looks
5118 enough like a module to fool pickle.dump(). Since a pickle stores
5128 enough like a module to fool pickle.dump(). Since a pickle stores
5119 a named reference to the importing module, we need this for
5129 a named reference to the importing module, we need this for
5120 pickles to save something sensible.
5130 pickles to save something sensible.
5121
5131
5122 * IPython/ipmaker.py (make_IPython): added an autocall option.
5132 * IPython/ipmaker.py (make_IPython): added an autocall option.
5123
5133
5124 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5134 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5125 the auto-eval code. Now autocalling is an option, and the code is
5135 the auto-eval code. Now autocalling is an option, and the code is
5126 also vastly safer. There is no more eval() involved at all.
5136 also vastly safer. There is no more eval() involved at all.
5127
5137
5128 2003-03-01 Fernando Perez <fperez@colorado.edu>
5138 2003-03-01 Fernando Perez <fperez@colorado.edu>
5129
5139
5130 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5140 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5131 dict with named keys instead of a tuple.
5141 dict with named keys instead of a tuple.
5132
5142
5133 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5143 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5134
5144
5135 * setup.py (make_shortcut): Fixed message about directories
5145 * setup.py (make_shortcut): Fixed message about directories
5136 created during Windows installation (the directories were ok, just
5146 created during Windows installation (the directories were ok, just
5137 the printed message was misleading). Thanks to Chris Liechti
5147 the printed message was misleading). Thanks to Chris Liechti
5138 <cliechti-AT-gmx.net> for the heads up.
5148 <cliechti-AT-gmx.net> for the heads up.
5139
5149
5140 2003-02-21 Fernando Perez <fperez@colorado.edu>
5150 2003-02-21 Fernando Perez <fperez@colorado.edu>
5141
5151
5142 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5152 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5143 of ValueError exception when checking for auto-execution. This
5153 of ValueError exception when checking for auto-execution. This
5144 one is raised by things like Numeric arrays arr.flat when the
5154 one is raised by things like Numeric arrays arr.flat when the
5145 array is non-contiguous.
5155 array is non-contiguous.
5146
5156
5147 2003-01-31 Fernando Perez <fperez@colorado.edu>
5157 2003-01-31 Fernando Perez <fperez@colorado.edu>
5148
5158
5149 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5159 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5150 not return any value at all (even though the command would get
5160 not return any value at all (even though the command would get
5151 executed).
5161 executed).
5152 (xsys): Flush stdout right after printing the command to ensure
5162 (xsys): Flush stdout right after printing the command to ensure
5153 proper ordering of commands and command output in the total
5163 proper ordering of commands and command output in the total
5154 output.
5164 output.
5155 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5165 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5156 system/getoutput as defaults. The old ones are kept for
5166 system/getoutput as defaults. The old ones are kept for
5157 compatibility reasons, so no code which uses this library needs
5167 compatibility reasons, so no code which uses this library needs
5158 changing.
5168 changing.
5159
5169
5160 2003-01-27 *** Released version 0.2.14
5170 2003-01-27 *** Released version 0.2.14
5161
5171
5162 2003-01-25 Fernando Perez <fperez@colorado.edu>
5172 2003-01-25 Fernando Perez <fperez@colorado.edu>
5163
5173
5164 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5174 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5165 functions defined in previous edit sessions could not be re-edited
5175 functions defined in previous edit sessions could not be re-edited
5166 (because the temp files were immediately removed). Now temp files
5176 (because the temp files were immediately removed). Now temp files
5167 are removed only at IPython's exit.
5177 are removed only at IPython's exit.
5168 (Magic.magic_run): Improved @run to perform shell-like expansions
5178 (Magic.magic_run): Improved @run to perform shell-like expansions
5169 on its arguments (~users and $VARS). With this, @run becomes more
5179 on its arguments (~users and $VARS). With this, @run becomes more
5170 like a normal command-line.
5180 like a normal command-line.
5171
5181
5172 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5182 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5173 bugs related to embedding and cleaned up that code. A fairly
5183 bugs related to embedding and cleaned up that code. A fairly
5174 important one was the impossibility to access the global namespace
5184 important one was the impossibility to access the global namespace
5175 through the embedded IPython (only local variables were visible).
5185 through the embedded IPython (only local variables were visible).
5176
5186
5177 2003-01-14 Fernando Perez <fperez@colorado.edu>
5187 2003-01-14 Fernando Perez <fperez@colorado.edu>
5178
5188
5179 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5189 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5180 auto-calling to be a bit more conservative. Now it doesn't get
5190 auto-calling to be a bit more conservative. Now it doesn't get
5181 triggered if any of '!=()<>' are in the rest of the input line, to
5191 triggered if any of '!=()<>' are in the rest of the input line, to
5182 allow comparing callables. Thanks to Alex for the heads up.
5192 allow comparing callables. Thanks to Alex for the heads up.
5183
5193
5184 2003-01-07 Fernando Perez <fperez@colorado.edu>
5194 2003-01-07 Fernando Perez <fperez@colorado.edu>
5185
5195
5186 * IPython/genutils.py (page): fixed estimation of the number of
5196 * IPython/genutils.py (page): fixed estimation of the number of
5187 lines in a string to be paged to simply count newlines. This
5197 lines in a string to be paged to simply count newlines. This
5188 prevents over-guessing due to embedded escape sequences. A better
5198 prevents over-guessing due to embedded escape sequences. A better
5189 long-term solution would involve stripping out the control chars
5199 long-term solution would involve stripping out the control chars
5190 for the count, but it's potentially so expensive I just don't
5200 for the count, but it's potentially so expensive I just don't
5191 think it's worth doing.
5201 think it's worth doing.
5192
5202
5193 2002-12-19 *** Released version 0.2.14pre50
5203 2002-12-19 *** Released version 0.2.14pre50
5194
5204
5195 2002-12-19 Fernando Perez <fperez@colorado.edu>
5205 2002-12-19 Fernando Perez <fperez@colorado.edu>
5196
5206
5197 * tools/release (version): Changed release scripts to inform
5207 * tools/release (version): Changed release scripts to inform
5198 Andrea and build a NEWS file with a list of recent changes.
5208 Andrea and build a NEWS file with a list of recent changes.
5199
5209
5200 * IPython/ColorANSI.py (__all__): changed terminal detection
5210 * IPython/ColorANSI.py (__all__): changed terminal detection
5201 code. Seems to work better for xterms without breaking
5211 code. Seems to work better for xterms without breaking
5202 konsole. Will need more testing to determine if WinXP and Mac OSX
5212 konsole. Will need more testing to determine if WinXP and Mac OSX
5203 also work ok.
5213 also work ok.
5204
5214
5205 2002-12-18 *** Released version 0.2.14pre49
5215 2002-12-18 *** Released version 0.2.14pre49
5206
5216
5207 2002-12-18 Fernando Perez <fperez@colorado.edu>
5217 2002-12-18 Fernando Perez <fperez@colorado.edu>
5208
5218
5209 * Docs: added new info about Mac OSX, from Andrea.
5219 * Docs: added new info about Mac OSX, from Andrea.
5210
5220
5211 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5221 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5212 allow direct plotting of python strings whose format is the same
5222 allow direct plotting of python strings whose format is the same
5213 of gnuplot data files.
5223 of gnuplot data files.
5214
5224
5215 2002-12-16 Fernando Perez <fperez@colorado.edu>
5225 2002-12-16 Fernando Perez <fperez@colorado.edu>
5216
5226
5217 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5227 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5218 value of exit question to be acknowledged.
5228 value of exit question to be acknowledged.
5219
5229
5220 2002-12-03 Fernando Perez <fperez@colorado.edu>
5230 2002-12-03 Fernando Perez <fperez@colorado.edu>
5221
5231
5222 * IPython/ipmaker.py: removed generators, which had been added
5232 * IPython/ipmaker.py: removed generators, which had been added
5223 by mistake in an earlier debugging run. This was causing trouble
5233 by mistake in an earlier debugging run. This was causing trouble
5224 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5234 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5225 for pointing this out.
5235 for pointing this out.
5226
5236
5227 2002-11-17 Fernando Perez <fperez@colorado.edu>
5237 2002-11-17 Fernando Perez <fperez@colorado.edu>
5228
5238
5229 * Manual: updated the Gnuplot section.
5239 * Manual: updated the Gnuplot section.
5230
5240
5231 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5241 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5232 a much better split of what goes in Runtime and what goes in
5242 a much better split of what goes in Runtime and what goes in
5233 Interactive.
5243 Interactive.
5234
5244
5235 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5245 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5236 being imported from iplib.
5246 being imported from iplib.
5237
5247
5238 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5248 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5239 for command-passing. Now the global Gnuplot instance is called
5249 for command-passing. Now the global Gnuplot instance is called
5240 'gp' instead of 'g', which was really a far too fragile and
5250 'gp' instead of 'g', which was really a far too fragile and
5241 common name.
5251 common name.
5242
5252
5243 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5253 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5244 bounding boxes generated by Gnuplot for square plots.
5254 bounding boxes generated by Gnuplot for square plots.
5245
5255
5246 * IPython/genutils.py (popkey): new function added. I should
5256 * IPython/genutils.py (popkey): new function added. I should
5247 suggest this on c.l.py as a dict method, it seems useful.
5257 suggest this on c.l.py as a dict method, it seems useful.
5248
5258
5249 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5259 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5250 to transparently handle PostScript generation. MUCH better than
5260 to transparently handle PostScript generation. MUCH better than
5251 the previous plot_eps/replot_eps (which I removed now). The code
5261 the previous plot_eps/replot_eps (which I removed now). The code
5252 is also fairly clean and well documented now (including
5262 is also fairly clean and well documented now (including
5253 docstrings).
5263 docstrings).
5254
5264
5255 2002-11-13 Fernando Perez <fperez@colorado.edu>
5265 2002-11-13 Fernando Perez <fperez@colorado.edu>
5256
5266
5257 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5267 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5258 (inconsistent with options).
5268 (inconsistent with options).
5259
5269
5260 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5270 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5261 manually disabled, I don't know why. Fixed it.
5271 manually disabled, I don't know why. Fixed it.
5262 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5272 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5263 eps output.
5273 eps output.
5264
5274
5265 2002-11-12 Fernando Perez <fperez@colorado.edu>
5275 2002-11-12 Fernando Perez <fperez@colorado.edu>
5266
5276
5267 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5277 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5268 don't propagate up to caller. Fixes crash reported by François
5278 don't propagate up to caller. Fixes crash reported by François
5269 Pinard.
5279 Pinard.
5270
5280
5271 2002-11-09 Fernando Perez <fperez@colorado.edu>
5281 2002-11-09 Fernando Perez <fperez@colorado.edu>
5272
5282
5273 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5283 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5274 history file for new users.
5284 history file for new users.
5275 (make_IPython): fixed bug where initial install would leave the
5285 (make_IPython): fixed bug where initial install would leave the
5276 user running in the .ipython dir.
5286 user running in the .ipython dir.
5277 (make_IPython): fixed bug where config dir .ipython would be
5287 (make_IPython): fixed bug where config dir .ipython would be
5278 created regardless of the given -ipythondir option. Thanks to Cory
5288 created regardless of the given -ipythondir option. Thanks to Cory
5279 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5289 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5280
5290
5281 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5291 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5282 type confirmations. Will need to use it in all of IPython's code
5292 type confirmations. Will need to use it in all of IPython's code
5283 consistently.
5293 consistently.
5284
5294
5285 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5295 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5286 context to print 31 lines instead of the default 5. This will make
5296 context to print 31 lines instead of the default 5. This will make
5287 the crash reports extremely detailed in case the problem is in
5297 the crash reports extremely detailed in case the problem is in
5288 libraries I don't have access to.
5298 libraries I don't have access to.
5289
5299
5290 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5300 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5291 line of defense' code to still crash, but giving users fair
5301 line of defense' code to still crash, but giving users fair
5292 warning. I don't want internal errors to go unreported: if there's
5302 warning. I don't want internal errors to go unreported: if there's
5293 an internal problem, IPython should crash and generate a full
5303 an internal problem, IPython should crash and generate a full
5294 report.
5304 report.
5295
5305
5296 2002-11-08 Fernando Perez <fperez@colorado.edu>
5306 2002-11-08 Fernando Perez <fperez@colorado.edu>
5297
5307
5298 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5308 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5299 otherwise uncaught exceptions which can appear if people set
5309 otherwise uncaught exceptions which can appear if people set
5300 sys.stdout to something badly broken. Thanks to a crash report
5310 sys.stdout to something badly broken. Thanks to a crash report
5301 from henni-AT-mail.brainbot.com.
5311 from henni-AT-mail.brainbot.com.
5302
5312
5303 2002-11-04 Fernando Perez <fperez@colorado.edu>
5313 2002-11-04 Fernando Perez <fperez@colorado.edu>
5304
5314
5305 * IPython/iplib.py (InteractiveShell.interact): added
5315 * IPython/iplib.py (InteractiveShell.interact): added
5306 __IPYTHON__active to the builtins. It's a flag which goes on when
5316 __IPYTHON__active to the builtins. It's a flag which goes on when
5307 the interaction starts and goes off again when it stops. This
5317 the interaction starts and goes off again when it stops. This
5308 allows embedding code to detect being inside IPython. Before this
5318 allows embedding code to detect being inside IPython. Before this
5309 was done via __IPYTHON__, but that only shows that an IPython
5319 was done via __IPYTHON__, but that only shows that an IPython
5310 instance has been created.
5320 instance has been created.
5311
5321
5312 * IPython/Magic.py (Magic.magic_env): I realized that in a
5322 * IPython/Magic.py (Magic.magic_env): I realized that in a
5313 UserDict, instance.data holds the data as a normal dict. So I
5323 UserDict, instance.data holds the data as a normal dict. So I
5314 modified @env to return os.environ.data instead of rebuilding a
5324 modified @env to return os.environ.data instead of rebuilding a
5315 dict by hand.
5325 dict by hand.
5316
5326
5317 2002-11-02 Fernando Perez <fperez@colorado.edu>
5327 2002-11-02 Fernando Perez <fperez@colorado.edu>
5318
5328
5319 * IPython/genutils.py (warn): changed so that level 1 prints no
5329 * IPython/genutils.py (warn): changed so that level 1 prints no
5320 header. Level 2 is now the default (with 'WARNING' header, as
5330 header. Level 2 is now the default (with 'WARNING' header, as
5321 before). I think I tracked all places where changes were needed in
5331 before). I think I tracked all places where changes were needed in
5322 IPython, but outside code using the old level numbering may have
5332 IPython, but outside code using the old level numbering may have
5323 broken.
5333 broken.
5324
5334
5325 * IPython/iplib.py (InteractiveShell.runcode): added this to
5335 * IPython/iplib.py (InteractiveShell.runcode): added this to
5326 handle the tracebacks in SystemExit traps correctly. The previous
5336 handle the tracebacks in SystemExit traps correctly. The previous
5327 code (through interact) was printing more of the stack than
5337 code (through interact) was printing more of the stack than
5328 necessary, showing IPython internal code to the user.
5338 necessary, showing IPython internal code to the user.
5329
5339
5330 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5340 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5331 default. Now that the default at the confirmation prompt is yes,
5341 default. Now that the default at the confirmation prompt is yes,
5332 it's not so intrusive. François' argument that ipython sessions
5342 it's not so intrusive. François' argument that ipython sessions
5333 tend to be complex enough not to lose them from an accidental C-d,
5343 tend to be complex enough not to lose them from an accidental C-d,
5334 is a valid one.
5344 is a valid one.
5335
5345
5336 * IPython/iplib.py (InteractiveShell.interact): added a
5346 * IPython/iplib.py (InteractiveShell.interact): added a
5337 showtraceback() call to the SystemExit trap, and modified the exit
5347 showtraceback() call to the SystemExit trap, and modified the exit
5338 confirmation to have yes as the default.
5348 confirmation to have yes as the default.
5339
5349
5340 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5350 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5341 this file. It's been gone from the code for a long time, this was
5351 this file. It's been gone from the code for a long time, this was
5342 simply leftover junk.
5352 simply leftover junk.
5343
5353
5344 2002-11-01 Fernando Perez <fperez@colorado.edu>
5354 2002-11-01 Fernando Perez <fperez@colorado.edu>
5345
5355
5346 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5356 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5347 added. If set, IPython now traps EOF and asks for
5357 added. If set, IPython now traps EOF and asks for
5348 confirmation. After a request by François Pinard.
5358 confirmation. After a request by François Pinard.
5349
5359
5350 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5360 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5351 of @abort, and with a new (better) mechanism for handling the
5361 of @abort, and with a new (better) mechanism for handling the
5352 exceptions.
5362 exceptions.
5353
5363
5354 2002-10-27 Fernando Perez <fperez@colorado.edu>
5364 2002-10-27 Fernando Perez <fperez@colorado.edu>
5355
5365
5356 * IPython/usage.py (__doc__): updated the --help information and
5366 * IPython/usage.py (__doc__): updated the --help information and
5357 the ipythonrc file to indicate that -log generates
5367 the ipythonrc file to indicate that -log generates
5358 ./ipython.log. Also fixed the corresponding info in @logstart.
5368 ./ipython.log. Also fixed the corresponding info in @logstart.
5359 This and several other fixes in the manuals thanks to reports by
5369 This and several other fixes in the manuals thanks to reports by
5360 François Pinard <pinard-AT-iro.umontreal.ca>.
5370 François Pinard <pinard-AT-iro.umontreal.ca>.
5361
5371
5362 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5372 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5363 refer to @logstart (instead of @log, which doesn't exist).
5373 refer to @logstart (instead of @log, which doesn't exist).
5364
5374
5365 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5375 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5366 AttributeError crash. Thanks to Christopher Armstrong
5376 AttributeError crash. Thanks to Christopher Armstrong
5367 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5377 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5368 introduced recently (in 0.2.14pre37) with the fix to the eval
5378 introduced recently (in 0.2.14pre37) with the fix to the eval
5369 problem mentioned below.
5379 problem mentioned below.
5370
5380
5371 2002-10-17 Fernando Perez <fperez@colorado.edu>
5381 2002-10-17 Fernando Perez <fperez@colorado.edu>
5372
5382
5373 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5383 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5374 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5384 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5375
5385
5376 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5386 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5377 this function to fix a problem reported by Alex Schmolck. He saw
5387 this function to fix a problem reported by Alex Schmolck. He saw
5378 it with list comprehensions and generators, which were getting
5388 it with list comprehensions and generators, which were getting
5379 called twice. The real problem was an 'eval' call in testing for
5389 called twice. The real problem was an 'eval' call in testing for
5380 automagic which was evaluating the input line silently.
5390 automagic which was evaluating the input line silently.
5381
5391
5382 This is a potentially very nasty bug, if the input has side
5392 This is a potentially very nasty bug, if the input has side
5383 effects which must not be repeated. The code is much cleaner now,
5393 effects which must not be repeated. The code is much cleaner now,
5384 without any blanket 'except' left and with a regexp test for
5394 without any blanket 'except' left and with a regexp test for
5385 actual function names.
5395 actual function names.
5386
5396
5387 But an eval remains, which I'm not fully comfortable with. I just
5397 But an eval remains, which I'm not fully comfortable with. I just
5388 don't know how to find out if an expression could be a callable in
5398 don't know how to find out if an expression could be a callable in
5389 the user's namespace without doing an eval on the string. However
5399 the user's namespace without doing an eval on the string. However
5390 that string is now much more strictly checked so that no code
5400 that string is now much more strictly checked so that no code
5391 slips by, so the eval should only happen for things that can
5401 slips by, so the eval should only happen for things that can
5392 really be only function/method names.
5402 really be only function/method names.
5393
5403
5394 2002-10-15 Fernando Perez <fperez@colorado.edu>
5404 2002-10-15 Fernando Perez <fperez@colorado.edu>
5395
5405
5396 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5406 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5397 OSX information to main manual, removed README_Mac_OSX file from
5407 OSX information to main manual, removed README_Mac_OSX file from
5398 distribution. Also updated credits for recent additions.
5408 distribution. Also updated credits for recent additions.
5399
5409
5400 2002-10-10 Fernando Perez <fperez@colorado.edu>
5410 2002-10-10 Fernando Perez <fperez@colorado.edu>
5401
5411
5402 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5412 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5403 terminal-related issues. Many thanks to Andrea Riciputi
5413 terminal-related issues. Many thanks to Andrea Riciputi
5404 <andrea.riciputi-AT-libero.it> for writing it.
5414 <andrea.riciputi-AT-libero.it> for writing it.
5405
5415
5406 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5416 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5407 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5417 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5408
5418
5409 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5419 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5410 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5420 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5411 <syver-en-AT-online.no> who both submitted patches for this problem.
5421 <syver-en-AT-online.no> who both submitted patches for this problem.
5412
5422
5413 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5423 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5414 global embedding to make sure that things don't overwrite user
5424 global embedding to make sure that things don't overwrite user
5415 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5425 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5416
5426
5417 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5427 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5418 compatibility. Thanks to Hayden Callow
5428 compatibility. Thanks to Hayden Callow
5419 <h.callow-AT-elec.canterbury.ac.nz>
5429 <h.callow-AT-elec.canterbury.ac.nz>
5420
5430
5421 2002-10-04 Fernando Perez <fperez@colorado.edu>
5431 2002-10-04 Fernando Perez <fperez@colorado.edu>
5422
5432
5423 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5433 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5424 Gnuplot.File objects.
5434 Gnuplot.File objects.
5425
5435
5426 2002-07-23 Fernando Perez <fperez@colorado.edu>
5436 2002-07-23 Fernando Perez <fperez@colorado.edu>
5427
5437
5428 * IPython/genutils.py (timing): Added timings() and timing() for
5438 * IPython/genutils.py (timing): Added timings() and timing() for
5429 quick access to the most commonly needed data, the execution
5439 quick access to the most commonly needed data, the execution
5430 times. Old timing() renamed to timings_out().
5440 times. Old timing() renamed to timings_out().
5431
5441
5432 2002-07-18 Fernando Perez <fperez@colorado.edu>
5442 2002-07-18 Fernando Perez <fperez@colorado.edu>
5433
5443
5434 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5444 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5435 bug with nested instances disrupting the parent's tab completion.
5445 bug with nested instances disrupting the parent's tab completion.
5436
5446
5437 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5447 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5438 all_completions code to begin the emacs integration.
5448 all_completions code to begin the emacs integration.
5439
5449
5440 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5450 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5441 argument to allow titling individual arrays when plotting.
5451 argument to allow titling individual arrays when plotting.
5442
5452
5443 2002-07-15 Fernando Perez <fperez@colorado.edu>
5453 2002-07-15 Fernando Perez <fperez@colorado.edu>
5444
5454
5445 * setup.py (make_shortcut): changed to retrieve the value of
5455 * setup.py (make_shortcut): changed to retrieve the value of
5446 'Program Files' directory from the registry (this value changes in
5456 'Program Files' directory from the registry (this value changes in
5447 non-english versions of Windows). Thanks to Thomas Fanslau
5457 non-english versions of Windows). Thanks to Thomas Fanslau
5448 <tfanslau-AT-gmx.de> for the report.
5458 <tfanslau-AT-gmx.de> for the report.
5449
5459
5450 2002-07-10 Fernando Perez <fperez@colorado.edu>
5460 2002-07-10 Fernando Perez <fperez@colorado.edu>
5451
5461
5452 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5462 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5453 a bug in pdb, which crashes if a line with only whitespace is
5463 a bug in pdb, which crashes if a line with only whitespace is
5454 entered. Bug report submitted to sourceforge.
5464 entered. Bug report submitted to sourceforge.
5455
5465
5456 2002-07-09 Fernando Perez <fperez@colorado.edu>
5466 2002-07-09 Fernando Perez <fperez@colorado.edu>
5457
5467
5458 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5468 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5459 reporting exceptions (it's a bug in inspect.py, I just set a
5469 reporting exceptions (it's a bug in inspect.py, I just set a
5460 workaround).
5470 workaround).
5461
5471
5462 2002-07-08 Fernando Perez <fperez@colorado.edu>
5472 2002-07-08 Fernando Perez <fperez@colorado.edu>
5463
5473
5464 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5474 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5465 __IPYTHON__ in __builtins__ to show up in user_ns.
5475 __IPYTHON__ in __builtins__ to show up in user_ns.
5466
5476
5467 2002-07-03 Fernando Perez <fperez@colorado.edu>
5477 2002-07-03 Fernando Perez <fperez@colorado.edu>
5468
5478
5469 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5479 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5470 name from @gp_set_instance to @gp_set_default.
5480 name from @gp_set_instance to @gp_set_default.
5471
5481
5472 * IPython/ipmaker.py (make_IPython): default editor value set to
5482 * IPython/ipmaker.py (make_IPython): default editor value set to
5473 '0' (a string), to match the rc file. Otherwise will crash when
5483 '0' (a string), to match the rc file. Otherwise will crash when
5474 .strip() is called on it.
5484 .strip() is called on it.
5475
5485
5476
5486
5477 2002-06-28 Fernando Perez <fperez@colorado.edu>
5487 2002-06-28 Fernando Perez <fperez@colorado.edu>
5478
5488
5479 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5489 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5480 of files in current directory when a file is executed via
5490 of files in current directory when a file is executed via
5481 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5491 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5482
5492
5483 * setup.py (manfiles): fix for rpm builds, submitted by RA
5493 * setup.py (manfiles): fix for rpm builds, submitted by RA
5484 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5494 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5485
5495
5486 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5496 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5487 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5497 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5488 string!). A. Schmolck caught this one.
5498 string!). A. Schmolck caught this one.
5489
5499
5490 2002-06-27 Fernando Perez <fperez@colorado.edu>
5500 2002-06-27 Fernando Perez <fperez@colorado.edu>
5491
5501
5492 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5502 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5493 defined files at the cmd line. __name__ wasn't being set to
5503 defined files at the cmd line. __name__ wasn't being set to
5494 __main__.
5504 __main__.
5495
5505
5496 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5506 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5497 regular lists and tuples besides Numeric arrays.
5507 regular lists and tuples besides Numeric arrays.
5498
5508
5499 * IPython/Prompts.py (CachedOutput.__call__): Added output
5509 * IPython/Prompts.py (CachedOutput.__call__): Added output
5500 supression for input ending with ';'. Similar to Mathematica and
5510 supression for input ending with ';'. Similar to Mathematica and
5501 Matlab. The _* vars and Out[] list are still updated, just like
5511 Matlab. The _* vars and Out[] list are still updated, just like
5502 Mathematica behaves.
5512 Mathematica behaves.
5503
5513
5504 2002-06-25 Fernando Perez <fperez@colorado.edu>
5514 2002-06-25 Fernando Perez <fperez@colorado.edu>
5505
5515
5506 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5516 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5507 .ini extensions for profiels under Windows.
5517 .ini extensions for profiels under Windows.
5508
5518
5509 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5519 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5510 string form. Fix contributed by Alexander Schmolck
5520 string form. Fix contributed by Alexander Schmolck
5511 <a.schmolck-AT-gmx.net>
5521 <a.schmolck-AT-gmx.net>
5512
5522
5513 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5523 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5514 pre-configured Gnuplot instance.
5524 pre-configured Gnuplot instance.
5515
5525
5516 2002-06-21 Fernando Perez <fperez@colorado.edu>
5526 2002-06-21 Fernando Perez <fperez@colorado.edu>
5517
5527
5518 * IPython/numutils.py (exp_safe): new function, works around the
5528 * IPython/numutils.py (exp_safe): new function, works around the
5519 underflow problems in Numeric.
5529 underflow problems in Numeric.
5520 (log2): New fn. Safe log in base 2: returns exact integer answer
5530 (log2): New fn. Safe log in base 2: returns exact integer answer
5521 for exact integer powers of 2.
5531 for exact integer powers of 2.
5522
5532
5523 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5533 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5524 properly.
5534 properly.
5525
5535
5526 2002-06-20 Fernando Perez <fperez@colorado.edu>
5536 2002-06-20 Fernando Perez <fperez@colorado.edu>
5527
5537
5528 * IPython/genutils.py (timing): new function like
5538 * IPython/genutils.py (timing): new function like
5529 Mathematica's. Similar to time_test, but returns more info.
5539 Mathematica's. Similar to time_test, but returns more info.
5530
5540
5531 2002-06-18 Fernando Perez <fperez@colorado.edu>
5541 2002-06-18 Fernando Perez <fperez@colorado.edu>
5532
5542
5533 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5543 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5534 according to Mike Heeter's suggestions.
5544 according to Mike Heeter's suggestions.
5535
5545
5536 2002-06-16 Fernando Perez <fperez@colorado.edu>
5546 2002-06-16 Fernando Perez <fperez@colorado.edu>
5537
5547
5538 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5548 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5539 system. GnuplotMagic is gone as a user-directory option. New files
5549 system. GnuplotMagic is gone as a user-directory option. New files
5540 make it easier to use all the gnuplot stuff both from external
5550 make it easier to use all the gnuplot stuff both from external
5541 programs as well as from IPython. Had to rewrite part of
5551 programs as well as from IPython. Had to rewrite part of
5542 hardcopy() b/c of a strange bug: often the ps files simply don't
5552 hardcopy() b/c of a strange bug: often the ps files simply don't
5543 get created, and require a repeat of the command (often several
5553 get created, and require a repeat of the command (often several
5544 times).
5554 times).
5545
5555
5546 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5556 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5547 resolve output channel at call time, so that if sys.stderr has
5557 resolve output channel at call time, so that if sys.stderr has
5548 been redirected by user this gets honored.
5558 been redirected by user this gets honored.
5549
5559
5550 2002-06-13 Fernando Perez <fperez@colorado.edu>
5560 2002-06-13 Fernando Perez <fperez@colorado.edu>
5551
5561
5552 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5562 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5553 IPShell. Kept a copy with the old names to avoid breaking people's
5563 IPShell. Kept a copy with the old names to avoid breaking people's
5554 embedded code.
5564 embedded code.
5555
5565
5556 * IPython/ipython: simplified it to the bare minimum after
5566 * IPython/ipython: simplified it to the bare minimum after
5557 Holger's suggestions. Added info about how to use it in
5567 Holger's suggestions. Added info about how to use it in
5558 PYTHONSTARTUP.
5568 PYTHONSTARTUP.
5559
5569
5560 * IPython/Shell.py (IPythonShell): changed the options passing
5570 * IPython/Shell.py (IPythonShell): changed the options passing
5561 from a string with funky %s replacements to a straight list. Maybe
5571 from a string with funky %s replacements to a straight list. Maybe
5562 a bit more typing, but it follows sys.argv conventions, so there's
5572 a bit more typing, but it follows sys.argv conventions, so there's
5563 less special-casing to remember.
5573 less special-casing to remember.
5564
5574
5565 2002-06-12 Fernando Perez <fperez@colorado.edu>
5575 2002-06-12 Fernando Perez <fperez@colorado.edu>
5566
5576
5567 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5577 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5568 command. Thanks to a suggestion by Mike Heeter.
5578 command. Thanks to a suggestion by Mike Heeter.
5569 (Magic.magic_pfile): added behavior to look at filenames if given
5579 (Magic.magic_pfile): added behavior to look at filenames if given
5570 arg is not a defined object.
5580 arg is not a defined object.
5571 (Magic.magic_save): New @save function to save code snippets. Also
5581 (Magic.magic_save): New @save function to save code snippets. Also
5572 a Mike Heeter idea.
5582 a Mike Heeter idea.
5573
5583
5574 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5584 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5575 plot() and replot(). Much more convenient now, especially for
5585 plot() and replot(). Much more convenient now, especially for
5576 interactive use.
5586 interactive use.
5577
5587
5578 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5588 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5579 filenames.
5589 filenames.
5580
5590
5581 2002-06-02 Fernando Perez <fperez@colorado.edu>
5591 2002-06-02 Fernando Perez <fperez@colorado.edu>
5582
5592
5583 * IPython/Struct.py (Struct.__init__): modified to admit
5593 * IPython/Struct.py (Struct.__init__): modified to admit
5584 initialization via another struct.
5594 initialization via another struct.
5585
5595
5586 * IPython/genutils.py (SystemExec.__init__): New stateful
5596 * IPython/genutils.py (SystemExec.__init__): New stateful
5587 interface to xsys and bq. Useful for writing system scripts.
5597 interface to xsys and bq. Useful for writing system scripts.
5588
5598
5589 2002-05-30 Fernando Perez <fperez@colorado.edu>
5599 2002-05-30 Fernando Perez <fperez@colorado.edu>
5590
5600
5591 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5601 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5592 documents. This will make the user download smaller (it's getting
5602 documents. This will make the user download smaller (it's getting
5593 too big).
5603 too big).
5594
5604
5595 2002-05-29 Fernando Perez <fperez@colorado.edu>
5605 2002-05-29 Fernando Perez <fperez@colorado.edu>
5596
5606
5597 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5607 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5598 fix problems with shelve and pickle. Seems to work, but I don't
5608 fix problems with shelve and pickle. Seems to work, but I don't
5599 know if corner cases break it. Thanks to Mike Heeter
5609 know if corner cases break it. Thanks to Mike Heeter
5600 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5610 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5601
5611
5602 2002-05-24 Fernando Perez <fperez@colorado.edu>
5612 2002-05-24 Fernando Perez <fperez@colorado.edu>
5603
5613
5604 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5614 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5605 macros having broken.
5615 macros having broken.
5606
5616
5607 2002-05-21 Fernando Perez <fperez@colorado.edu>
5617 2002-05-21 Fernando Perez <fperez@colorado.edu>
5608
5618
5609 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5619 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5610 introduced logging bug: all history before logging started was
5620 introduced logging bug: all history before logging started was
5611 being written one character per line! This came from the redesign
5621 being written one character per line! This came from the redesign
5612 of the input history as a special list which slices to strings,
5622 of the input history as a special list which slices to strings,
5613 not to lists.
5623 not to lists.
5614
5624
5615 2002-05-20 Fernando Perez <fperez@colorado.edu>
5625 2002-05-20 Fernando Perez <fperez@colorado.edu>
5616
5626
5617 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5627 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5618 be an attribute of all classes in this module. The design of these
5628 be an attribute of all classes in this module. The design of these
5619 classes needs some serious overhauling.
5629 classes needs some serious overhauling.
5620
5630
5621 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5631 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5622 which was ignoring '_' in option names.
5632 which was ignoring '_' in option names.
5623
5633
5624 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5634 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5625 'Verbose_novars' to 'Context' and made it the new default. It's a
5635 'Verbose_novars' to 'Context' and made it the new default. It's a
5626 bit more readable and also safer than verbose.
5636 bit more readable and also safer than verbose.
5627
5637
5628 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5638 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5629 triple-quoted strings.
5639 triple-quoted strings.
5630
5640
5631 * IPython/OInspect.py (__all__): new module exposing the object
5641 * IPython/OInspect.py (__all__): new module exposing the object
5632 introspection facilities. Now the corresponding magics are dummy
5642 introspection facilities. Now the corresponding magics are dummy
5633 wrappers around this. Having this module will make it much easier
5643 wrappers around this. Having this module will make it much easier
5634 to put these functions into our modified pdb.
5644 to put these functions into our modified pdb.
5635 This new object inspector system uses the new colorizing module,
5645 This new object inspector system uses the new colorizing module,
5636 so source code and other things are nicely syntax highlighted.
5646 so source code and other things are nicely syntax highlighted.
5637
5647
5638 2002-05-18 Fernando Perez <fperez@colorado.edu>
5648 2002-05-18 Fernando Perez <fperez@colorado.edu>
5639
5649
5640 * IPython/ColorANSI.py: Split the coloring tools into a separate
5650 * IPython/ColorANSI.py: Split the coloring tools into a separate
5641 module so I can use them in other code easier (they were part of
5651 module so I can use them in other code easier (they were part of
5642 ultraTB).
5652 ultraTB).
5643
5653
5644 2002-05-17 Fernando Perez <fperez@colorado.edu>
5654 2002-05-17 Fernando Perez <fperez@colorado.edu>
5645
5655
5646 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5656 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5647 fixed it to set the global 'g' also to the called instance, as
5657 fixed it to set the global 'g' also to the called instance, as
5648 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5658 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5649 user's 'g' variables).
5659 user's 'g' variables).
5650
5660
5651 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5661 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5652 global variables (aliases to _ih,_oh) so that users which expect
5662 global variables (aliases to _ih,_oh) so that users which expect
5653 In[5] or Out[7] to work aren't unpleasantly surprised.
5663 In[5] or Out[7] to work aren't unpleasantly surprised.
5654 (InputList.__getslice__): new class to allow executing slices of
5664 (InputList.__getslice__): new class to allow executing slices of
5655 input history directly. Very simple class, complements the use of
5665 input history directly. Very simple class, complements the use of
5656 macros.
5666 macros.
5657
5667
5658 2002-05-16 Fernando Perez <fperez@colorado.edu>
5668 2002-05-16 Fernando Perez <fperez@colorado.edu>
5659
5669
5660 * setup.py (docdirbase): make doc directory be just doc/IPython
5670 * setup.py (docdirbase): make doc directory be just doc/IPython
5661 without version numbers, it will reduce clutter for users.
5671 without version numbers, it will reduce clutter for users.
5662
5672
5663 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5673 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5664 execfile call to prevent possible memory leak. See for details:
5674 execfile call to prevent possible memory leak. See for details:
5665 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5675 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5666
5676
5667 2002-05-15 Fernando Perez <fperez@colorado.edu>
5677 2002-05-15 Fernando Perez <fperez@colorado.edu>
5668
5678
5669 * IPython/Magic.py (Magic.magic_psource): made the object
5679 * IPython/Magic.py (Magic.magic_psource): made the object
5670 introspection names be more standard: pdoc, pdef, pfile and
5680 introspection names be more standard: pdoc, pdef, pfile and
5671 psource. They all print/page their output, and it makes
5681 psource. They all print/page their output, and it makes
5672 remembering them easier. Kept old names for compatibility as
5682 remembering them easier. Kept old names for compatibility as
5673 aliases.
5683 aliases.
5674
5684
5675 2002-05-14 Fernando Perez <fperez@colorado.edu>
5685 2002-05-14 Fernando Perez <fperez@colorado.edu>
5676
5686
5677 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5687 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5678 what the mouse problem was. The trick is to use gnuplot with temp
5688 what the mouse problem was. The trick is to use gnuplot with temp
5679 files and NOT with pipes (for data communication), because having
5689 files and NOT with pipes (for data communication), because having
5680 both pipes and the mouse on is bad news.
5690 both pipes and the mouse on is bad news.
5681
5691
5682 2002-05-13 Fernando Perez <fperez@colorado.edu>
5692 2002-05-13 Fernando Perez <fperez@colorado.edu>
5683
5693
5684 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5694 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5685 bug. Information would be reported about builtins even when
5695 bug. Information would be reported about builtins even when
5686 user-defined functions overrode them.
5696 user-defined functions overrode them.
5687
5697
5688 2002-05-11 Fernando Perez <fperez@colorado.edu>
5698 2002-05-11 Fernando Perez <fperez@colorado.edu>
5689
5699
5690 * IPython/__init__.py (__all__): removed FlexCompleter from
5700 * IPython/__init__.py (__all__): removed FlexCompleter from
5691 __all__ so that things don't fail in platforms without readline.
5701 __all__ so that things don't fail in platforms without readline.
5692
5702
5693 2002-05-10 Fernando Perez <fperez@colorado.edu>
5703 2002-05-10 Fernando Perez <fperez@colorado.edu>
5694
5704
5695 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5705 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5696 it requires Numeric, effectively making Numeric a dependency for
5706 it requires Numeric, effectively making Numeric a dependency for
5697 IPython.
5707 IPython.
5698
5708
5699 * Released 0.2.13
5709 * Released 0.2.13
5700
5710
5701 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5711 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5702 profiler interface. Now all the major options from the profiler
5712 profiler interface. Now all the major options from the profiler
5703 module are directly supported in IPython, both for single
5713 module are directly supported in IPython, both for single
5704 expressions (@prun) and for full programs (@run -p).
5714 expressions (@prun) and for full programs (@run -p).
5705
5715
5706 2002-05-09 Fernando Perez <fperez@colorado.edu>
5716 2002-05-09 Fernando Perez <fperez@colorado.edu>
5707
5717
5708 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5718 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5709 magic properly formatted for screen.
5719 magic properly formatted for screen.
5710
5720
5711 * setup.py (make_shortcut): Changed things to put pdf version in
5721 * setup.py (make_shortcut): Changed things to put pdf version in
5712 doc/ instead of doc/manual (had to change lyxport a bit).
5722 doc/ instead of doc/manual (had to change lyxport a bit).
5713
5723
5714 * IPython/Magic.py (Profile.string_stats): made profile runs go
5724 * IPython/Magic.py (Profile.string_stats): made profile runs go
5715 through pager (they are long and a pager allows searching, saving,
5725 through pager (they are long and a pager allows searching, saving,
5716 etc.)
5726 etc.)
5717
5727
5718 2002-05-08 Fernando Perez <fperez@colorado.edu>
5728 2002-05-08 Fernando Perez <fperez@colorado.edu>
5719
5729
5720 * Released 0.2.12
5730 * Released 0.2.12
5721
5731
5722 2002-05-06 Fernando Perez <fperez@colorado.edu>
5732 2002-05-06 Fernando Perez <fperez@colorado.edu>
5723
5733
5724 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5734 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5725 introduced); 'hist n1 n2' was broken.
5735 introduced); 'hist n1 n2' was broken.
5726 (Magic.magic_pdb): added optional on/off arguments to @pdb
5736 (Magic.magic_pdb): added optional on/off arguments to @pdb
5727 (Magic.magic_run): added option -i to @run, which executes code in
5737 (Magic.magic_run): added option -i to @run, which executes code in
5728 the IPython namespace instead of a clean one. Also added @irun as
5738 the IPython namespace instead of a clean one. Also added @irun as
5729 an alias to @run -i.
5739 an alias to @run -i.
5730
5740
5731 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5741 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5732 fixed (it didn't really do anything, the namespaces were wrong).
5742 fixed (it didn't really do anything, the namespaces were wrong).
5733
5743
5734 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5744 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5735
5745
5736 * IPython/__init__.py (__all__): Fixed package namespace, now
5746 * IPython/__init__.py (__all__): Fixed package namespace, now
5737 'import IPython' does give access to IPython.<all> as
5747 'import IPython' does give access to IPython.<all> as
5738 expected. Also renamed __release__ to Release.
5748 expected. Also renamed __release__ to Release.
5739
5749
5740 * IPython/Debugger.py (__license__): created new Pdb class which
5750 * IPython/Debugger.py (__license__): created new Pdb class which
5741 functions like a drop-in for the normal pdb.Pdb but does NOT
5751 functions like a drop-in for the normal pdb.Pdb but does NOT
5742 import readline by default. This way it doesn't muck up IPython's
5752 import readline by default. This way it doesn't muck up IPython's
5743 readline handling, and now tab-completion finally works in the
5753 readline handling, and now tab-completion finally works in the
5744 debugger -- sort of. It completes things globally visible, but the
5754 debugger -- sort of. It completes things globally visible, but the
5745 completer doesn't track the stack as pdb walks it. That's a bit
5755 completer doesn't track the stack as pdb walks it. That's a bit
5746 tricky, and I'll have to implement it later.
5756 tricky, and I'll have to implement it later.
5747
5757
5748 2002-05-05 Fernando Perez <fperez@colorado.edu>
5758 2002-05-05 Fernando Perez <fperez@colorado.edu>
5749
5759
5750 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5760 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5751 magic docstrings when printed via ? (explicit \'s were being
5761 magic docstrings when printed via ? (explicit \'s were being
5752 printed).
5762 printed).
5753
5763
5754 * IPython/ipmaker.py (make_IPython): fixed namespace
5764 * IPython/ipmaker.py (make_IPython): fixed namespace
5755 identification bug. Now variables loaded via logs or command-line
5765 identification bug. Now variables loaded via logs or command-line
5756 files are recognized in the interactive namespace by @who.
5766 files are recognized in the interactive namespace by @who.
5757
5767
5758 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5768 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5759 log replay system stemming from the string form of Structs.
5769 log replay system stemming from the string form of Structs.
5760
5770
5761 * IPython/Magic.py (Macro.__init__): improved macros to properly
5771 * IPython/Magic.py (Macro.__init__): improved macros to properly
5762 handle magic commands in them.
5772 handle magic commands in them.
5763 (Magic.magic_logstart): usernames are now expanded so 'logstart
5773 (Magic.magic_logstart): usernames are now expanded so 'logstart
5764 ~/mylog' now works.
5774 ~/mylog' now works.
5765
5775
5766 * IPython/iplib.py (complete): fixed bug where paths starting with
5776 * IPython/iplib.py (complete): fixed bug where paths starting with
5767 '/' would be completed as magic names.
5777 '/' would be completed as magic names.
5768
5778
5769 2002-05-04 Fernando Perez <fperez@colorado.edu>
5779 2002-05-04 Fernando Perez <fperez@colorado.edu>
5770
5780
5771 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5781 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5772 allow running full programs under the profiler's control.
5782 allow running full programs under the profiler's control.
5773
5783
5774 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5784 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5775 mode to report exceptions verbosely but without formatting
5785 mode to report exceptions verbosely but without formatting
5776 variables. This addresses the issue of ipython 'freezing' (it's
5786 variables. This addresses the issue of ipython 'freezing' (it's
5777 not frozen, but caught in an expensive formatting loop) when huge
5787 not frozen, but caught in an expensive formatting loop) when huge
5778 variables are in the context of an exception.
5788 variables are in the context of an exception.
5779 (VerboseTB.text): Added '--->' markers at line where exception was
5789 (VerboseTB.text): Added '--->' markers at line where exception was
5780 triggered. Much clearer to read, especially in NoColor modes.
5790 triggered. Much clearer to read, especially in NoColor modes.
5781
5791
5782 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5792 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5783 implemented in reverse when changing to the new parse_options().
5793 implemented in reverse when changing to the new parse_options().
5784
5794
5785 2002-05-03 Fernando Perez <fperez@colorado.edu>
5795 2002-05-03 Fernando Perez <fperez@colorado.edu>
5786
5796
5787 * IPython/Magic.py (Magic.parse_options): new function so that
5797 * IPython/Magic.py (Magic.parse_options): new function so that
5788 magics can parse options easier.
5798 magics can parse options easier.
5789 (Magic.magic_prun): new function similar to profile.run(),
5799 (Magic.magic_prun): new function similar to profile.run(),
5790 suggested by Chris Hart.
5800 suggested by Chris Hart.
5791 (Magic.magic_cd): fixed behavior so that it only changes if
5801 (Magic.magic_cd): fixed behavior so that it only changes if
5792 directory actually is in history.
5802 directory actually is in history.
5793
5803
5794 * IPython/usage.py (__doc__): added information about potential
5804 * IPython/usage.py (__doc__): added information about potential
5795 slowness of Verbose exception mode when there are huge data
5805 slowness of Verbose exception mode when there are huge data
5796 structures to be formatted (thanks to Archie Paulson).
5806 structures to be formatted (thanks to Archie Paulson).
5797
5807
5798 * IPython/ipmaker.py (make_IPython): Changed default logging
5808 * IPython/ipmaker.py (make_IPython): Changed default logging
5799 (when simply called with -log) to use curr_dir/ipython.log in
5809 (when simply called with -log) to use curr_dir/ipython.log in
5800 rotate mode. Fixed crash which was occuring with -log before
5810 rotate mode. Fixed crash which was occuring with -log before
5801 (thanks to Jim Boyle).
5811 (thanks to Jim Boyle).
5802
5812
5803 2002-05-01 Fernando Perez <fperez@colorado.edu>
5813 2002-05-01 Fernando Perez <fperez@colorado.edu>
5804
5814
5805 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5815 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5806 was nasty -- though somewhat of a corner case).
5816 was nasty -- though somewhat of a corner case).
5807
5817
5808 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5818 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5809 text (was a bug).
5819 text (was a bug).
5810
5820
5811 2002-04-30 Fernando Perez <fperez@colorado.edu>
5821 2002-04-30 Fernando Perez <fperez@colorado.edu>
5812
5822
5813 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5823 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5814 a print after ^D or ^C from the user so that the In[] prompt
5824 a print after ^D or ^C from the user so that the In[] prompt
5815 doesn't over-run the gnuplot one.
5825 doesn't over-run the gnuplot one.
5816
5826
5817 2002-04-29 Fernando Perez <fperez@colorado.edu>
5827 2002-04-29 Fernando Perez <fperez@colorado.edu>
5818
5828
5819 * Released 0.2.10
5829 * Released 0.2.10
5820
5830
5821 * IPython/__release__.py (version): get date dynamically.
5831 * IPython/__release__.py (version): get date dynamically.
5822
5832
5823 * Misc. documentation updates thanks to Arnd's comments. Also ran
5833 * Misc. documentation updates thanks to Arnd's comments. Also ran
5824 a full spellcheck on the manual (hadn't been done in a while).
5834 a full spellcheck on the manual (hadn't been done in a while).
5825
5835
5826 2002-04-27 Fernando Perez <fperez@colorado.edu>
5836 2002-04-27 Fernando Perez <fperez@colorado.edu>
5827
5837
5828 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5838 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5829 starting a log in mid-session would reset the input history list.
5839 starting a log in mid-session would reset the input history list.
5830
5840
5831 2002-04-26 Fernando Perez <fperez@colorado.edu>
5841 2002-04-26 Fernando Perez <fperez@colorado.edu>
5832
5842
5833 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5843 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5834 all files were being included in an update. Now anything in
5844 all files were being included in an update. Now anything in
5835 UserConfig that matches [A-Za-z]*.py will go (this excludes
5845 UserConfig that matches [A-Za-z]*.py will go (this excludes
5836 __init__.py)
5846 __init__.py)
5837
5847
5838 2002-04-25 Fernando Perez <fperez@colorado.edu>
5848 2002-04-25 Fernando Perez <fperez@colorado.edu>
5839
5849
5840 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5850 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5841 to __builtins__ so that any form of embedded or imported code can
5851 to __builtins__ so that any form of embedded or imported code can
5842 test for being inside IPython.
5852 test for being inside IPython.
5843
5853
5844 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5854 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5845 changed to GnuplotMagic because it's now an importable module,
5855 changed to GnuplotMagic because it's now an importable module,
5846 this makes the name follow that of the standard Gnuplot module.
5856 this makes the name follow that of the standard Gnuplot module.
5847 GnuplotMagic can now be loaded at any time in mid-session.
5857 GnuplotMagic can now be loaded at any time in mid-session.
5848
5858
5849 2002-04-24 Fernando Perez <fperez@colorado.edu>
5859 2002-04-24 Fernando Perez <fperez@colorado.edu>
5850
5860
5851 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5861 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5852 the globals (IPython has its own namespace) and the
5862 the globals (IPython has its own namespace) and the
5853 PhysicalQuantity stuff is much better anyway.
5863 PhysicalQuantity stuff is much better anyway.
5854
5864
5855 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5865 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5856 embedding example to standard user directory for
5866 embedding example to standard user directory for
5857 distribution. Also put it in the manual.
5867 distribution. Also put it in the manual.
5858
5868
5859 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5869 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5860 instance as first argument (so it doesn't rely on some obscure
5870 instance as first argument (so it doesn't rely on some obscure
5861 hidden global).
5871 hidden global).
5862
5872
5863 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5873 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5864 delimiters. While it prevents ().TAB from working, it allows
5874 delimiters. While it prevents ().TAB from working, it allows
5865 completions in open (... expressions. This is by far a more common
5875 completions in open (... expressions. This is by far a more common
5866 case.
5876 case.
5867
5877
5868 2002-04-23 Fernando Perez <fperez@colorado.edu>
5878 2002-04-23 Fernando Perez <fperez@colorado.edu>
5869
5879
5870 * IPython/Extensions/InterpreterPasteInput.py: new
5880 * IPython/Extensions/InterpreterPasteInput.py: new
5871 syntax-processing module for pasting lines with >>> or ... at the
5881 syntax-processing module for pasting lines with >>> or ... at the
5872 start.
5882 start.
5873
5883
5874 * IPython/Extensions/PhysicalQ_Interactive.py
5884 * IPython/Extensions/PhysicalQ_Interactive.py
5875 (PhysicalQuantityInteractive.__int__): fixed to work with either
5885 (PhysicalQuantityInteractive.__int__): fixed to work with either
5876 Numeric or math.
5886 Numeric or math.
5877
5887
5878 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5888 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5879 provided profiles. Now we have:
5889 provided profiles. Now we have:
5880 -math -> math module as * and cmath with its own namespace.
5890 -math -> math module as * and cmath with its own namespace.
5881 -numeric -> Numeric as *, plus gnuplot & grace
5891 -numeric -> Numeric as *, plus gnuplot & grace
5882 -physics -> same as before
5892 -physics -> same as before
5883
5893
5884 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5894 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5885 user-defined magics wouldn't be found by @magic if they were
5895 user-defined magics wouldn't be found by @magic if they were
5886 defined as class methods. Also cleaned up the namespace search
5896 defined as class methods. Also cleaned up the namespace search
5887 logic and the string building (to use %s instead of many repeated
5897 logic and the string building (to use %s instead of many repeated
5888 string adds).
5898 string adds).
5889
5899
5890 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5900 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5891 of user-defined magics to operate with class methods (cleaner, in
5901 of user-defined magics to operate with class methods (cleaner, in
5892 line with the gnuplot code).
5902 line with the gnuplot code).
5893
5903
5894 2002-04-22 Fernando Perez <fperez@colorado.edu>
5904 2002-04-22 Fernando Perez <fperez@colorado.edu>
5895
5905
5896 * setup.py: updated dependency list so that manual is updated when
5906 * setup.py: updated dependency list so that manual is updated when
5897 all included files change.
5907 all included files change.
5898
5908
5899 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5909 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5900 the delimiter removal option (the fix is ugly right now).
5910 the delimiter removal option (the fix is ugly right now).
5901
5911
5902 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5912 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5903 all of the math profile (quicker loading, no conflict between
5913 all of the math profile (quicker loading, no conflict between
5904 g-9.8 and g-gnuplot).
5914 g-9.8 and g-gnuplot).
5905
5915
5906 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5916 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5907 name of post-mortem files to IPython_crash_report.txt.
5917 name of post-mortem files to IPython_crash_report.txt.
5908
5918
5909 * Cleanup/update of the docs. Added all the new readline info and
5919 * Cleanup/update of the docs. Added all the new readline info and
5910 formatted all lists as 'real lists'.
5920 formatted all lists as 'real lists'.
5911
5921
5912 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5922 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5913 tab-completion options, since the full readline parse_and_bind is
5923 tab-completion options, since the full readline parse_and_bind is
5914 now accessible.
5924 now accessible.
5915
5925
5916 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5926 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5917 handling of readline options. Now users can specify any string to
5927 handling of readline options. Now users can specify any string to
5918 be passed to parse_and_bind(), as well as the delimiters to be
5928 be passed to parse_and_bind(), as well as the delimiters to be
5919 removed.
5929 removed.
5920 (InteractiveShell.__init__): Added __name__ to the global
5930 (InteractiveShell.__init__): Added __name__ to the global
5921 namespace so that things like Itpl which rely on its existence
5931 namespace so that things like Itpl which rely on its existence
5922 don't crash.
5932 don't crash.
5923 (InteractiveShell._prefilter): Defined the default with a _ so
5933 (InteractiveShell._prefilter): Defined the default with a _ so
5924 that prefilter() is easier to override, while the default one
5934 that prefilter() is easier to override, while the default one
5925 remains available.
5935 remains available.
5926
5936
5927 2002-04-18 Fernando Perez <fperez@colorado.edu>
5937 2002-04-18 Fernando Perez <fperez@colorado.edu>
5928
5938
5929 * Added information about pdb in the docs.
5939 * Added information about pdb in the docs.
5930
5940
5931 2002-04-17 Fernando Perez <fperez@colorado.edu>
5941 2002-04-17 Fernando Perez <fperez@colorado.edu>
5932
5942
5933 * IPython/ipmaker.py (make_IPython): added rc_override option to
5943 * IPython/ipmaker.py (make_IPython): added rc_override option to
5934 allow passing config options at creation time which may override
5944 allow passing config options at creation time which may override
5935 anything set in the config files or command line. This is
5945 anything set in the config files or command line. This is
5936 particularly useful for configuring embedded instances.
5946 particularly useful for configuring embedded instances.
5937
5947
5938 2002-04-15 Fernando Perez <fperez@colorado.edu>
5948 2002-04-15 Fernando Perez <fperez@colorado.edu>
5939
5949
5940 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5950 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5941 crash embedded instances because of the input cache falling out of
5951 crash embedded instances because of the input cache falling out of
5942 sync with the output counter.
5952 sync with the output counter.
5943
5953
5944 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5954 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5945 mode which calls pdb after an uncaught exception in IPython itself.
5955 mode which calls pdb after an uncaught exception in IPython itself.
5946
5956
5947 2002-04-14 Fernando Perez <fperez@colorado.edu>
5957 2002-04-14 Fernando Perez <fperez@colorado.edu>
5948
5958
5949 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5959 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5950 readline, fix it back after each call.
5960 readline, fix it back after each call.
5951
5961
5952 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5962 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5953 method to force all access via __call__(), which guarantees that
5963 method to force all access via __call__(), which guarantees that
5954 traceback references are properly deleted.
5964 traceback references are properly deleted.
5955
5965
5956 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5966 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5957 improve printing when pprint is in use.
5967 improve printing when pprint is in use.
5958
5968
5959 2002-04-13 Fernando Perez <fperez@colorado.edu>
5969 2002-04-13 Fernando Perez <fperez@colorado.edu>
5960
5970
5961 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5971 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5962 exceptions aren't caught anymore. If the user triggers one, he
5972 exceptions aren't caught anymore. If the user triggers one, he
5963 should know why he's doing it and it should go all the way up,
5973 should know why he's doing it and it should go all the way up,
5964 just like any other exception. So now @abort will fully kill the
5974 just like any other exception. So now @abort will fully kill the
5965 embedded interpreter and the embedding code (unless that happens
5975 embedded interpreter and the embedding code (unless that happens
5966 to catch SystemExit).
5976 to catch SystemExit).
5967
5977
5968 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5978 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5969 and a debugger() method to invoke the interactive pdb debugger
5979 and a debugger() method to invoke the interactive pdb debugger
5970 after printing exception information. Also added the corresponding
5980 after printing exception information. Also added the corresponding
5971 -pdb option and @pdb magic to control this feature, and updated
5981 -pdb option and @pdb magic to control this feature, and updated
5972 the docs. After a suggestion from Christopher Hart
5982 the docs. After a suggestion from Christopher Hart
5973 (hart-AT-caltech.edu).
5983 (hart-AT-caltech.edu).
5974
5984
5975 2002-04-12 Fernando Perez <fperez@colorado.edu>
5985 2002-04-12 Fernando Perez <fperez@colorado.edu>
5976
5986
5977 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5987 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5978 the exception handlers defined by the user (not the CrashHandler)
5988 the exception handlers defined by the user (not the CrashHandler)
5979 so that user exceptions don't trigger an ipython bug report.
5989 so that user exceptions don't trigger an ipython bug report.
5980
5990
5981 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5991 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5982 configurable (it should have always been so).
5992 configurable (it should have always been so).
5983
5993
5984 2002-03-26 Fernando Perez <fperez@colorado.edu>
5994 2002-03-26 Fernando Perez <fperez@colorado.edu>
5985
5995
5986 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5996 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5987 and there to fix embedding namespace issues. This should all be
5997 and there to fix embedding namespace issues. This should all be
5988 done in a more elegant way.
5998 done in a more elegant way.
5989
5999
5990 2002-03-25 Fernando Perez <fperez@colorado.edu>
6000 2002-03-25 Fernando Perez <fperez@colorado.edu>
5991
6001
5992 * IPython/genutils.py (get_home_dir): Try to make it work under
6002 * IPython/genutils.py (get_home_dir): Try to make it work under
5993 win9x also.
6003 win9x also.
5994
6004
5995 2002-03-20 Fernando Perez <fperez@colorado.edu>
6005 2002-03-20 Fernando Perez <fperez@colorado.edu>
5996
6006
5997 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
6007 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5998 sys.displayhook untouched upon __init__.
6008 sys.displayhook untouched upon __init__.
5999
6009
6000 2002-03-19 Fernando Perez <fperez@colorado.edu>
6010 2002-03-19 Fernando Perez <fperez@colorado.edu>
6001
6011
6002 * Released 0.2.9 (for embedding bug, basically).
6012 * Released 0.2.9 (for embedding bug, basically).
6003
6013
6004 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
6014 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
6005 exceptions so that enclosing shell's state can be restored.
6015 exceptions so that enclosing shell's state can be restored.
6006
6016
6007 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
6017 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
6008 naming conventions in the .ipython/ dir.
6018 naming conventions in the .ipython/ dir.
6009
6019
6010 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
6020 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
6011 from delimiters list so filenames with - in them get expanded.
6021 from delimiters list so filenames with - in them get expanded.
6012
6022
6013 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
6023 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
6014 sys.displayhook not being properly restored after an embedded call.
6024 sys.displayhook not being properly restored after an embedded call.
6015
6025
6016 2002-03-18 Fernando Perez <fperez@colorado.edu>
6026 2002-03-18 Fernando Perez <fperez@colorado.edu>
6017
6027
6018 * Released 0.2.8
6028 * Released 0.2.8
6019
6029
6020 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
6030 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
6021 some files weren't being included in a -upgrade.
6031 some files weren't being included in a -upgrade.
6022 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
6032 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
6023 on' so that the first tab completes.
6033 on' so that the first tab completes.
6024 (InteractiveShell.handle_magic): fixed bug with spaces around
6034 (InteractiveShell.handle_magic): fixed bug with spaces around
6025 quotes breaking many magic commands.
6035 quotes breaking many magic commands.
6026
6036
6027 * setup.py: added note about ignoring the syntax error messages at
6037 * setup.py: added note about ignoring the syntax error messages at
6028 installation.
6038 installation.
6029
6039
6030 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
6040 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
6031 streamlining the gnuplot interface, now there's only one magic @gp.
6041 streamlining the gnuplot interface, now there's only one magic @gp.
6032
6042
6033 2002-03-17 Fernando Perez <fperez@colorado.edu>
6043 2002-03-17 Fernando Perez <fperez@colorado.edu>
6034
6044
6035 * IPython/UserConfig/magic_gnuplot.py: new name for the
6045 * IPython/UserConfig/magic_gnuplot.py: new name for the
6036 example-magic_pm.py file. Much enhanced system, now with a shell
6046 example-magic_pm.py file. Much enhanced system, now with a shell
6037 for communicating directly with gnuplot, one command at a time.
6047 for communicating directly with gnuplot, one command at a time.
6038
6048
6039 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
6049 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
6040 setting __name__=='__main__'.
6050 setting __name__=='__main__'.
6041
6051
6042 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
6052 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
6043 mini-shell for accessing gnuplot from inside ipython. Should
6053 mini-shell for accessing gnuplot from inside ipython. Should
6044 extend it later for grace access too. Inspired by Arnd's
6054 extend it later for grace access too. Inspired by Arnd's
6045 suggestion.
6055 suggestion.
6046
6056
6047 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
6057 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
6048 calling magic functions with () in their arguments. Thanks to Arnd
6058 calling magic functions with () in their arguments. Thanks to Arnd
6049 Baecker for pointing this to me.
6059 Baecker for pointing this to me.
6050
6060
6051 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
6061 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
6052 infinitely for integer or complex arrays (only worked with floats).
6062 infinitely for integer or complex arrays (only worked with floats).
6053
6063
6054 2002-03-16 Fernando Perez <fperez@colorado.edu>
6064 2002-03-16 Fernando Perez <fperez@colorado.edu>
6055
6065
6056 * setup.py: Merged setup and setup_windows into a single script
6066 * setup.py: Merged setup and setup_windows into a single script
6057 which properly handles things for windows users.
6067 which properly handles things for windows users.
6058
6068
6059 2002-03-15 Fernando Perez <fperez@colorado.edu>
6069 2002-03-15 Fernando Perez <fperez@colorado.edu>
6060
6070
6061 * Big change to the manual: now the magics are all automatically
6071 * Big change to the manual: now the magics are all automatically
6062 documented. This information is generated from their docstrings
6072 documented. This information is generated from their docstrings
6063 and put in a latex file included by the manual lyx file. This way
6073 and put in a latex file included by the manual lyx file. This way
6064 we get always up to date information for the magics. The manual
6074 we get always up to date information for the magics. The manual
6065 now also has proper version information, also auto-synced.
6075 now also has proper version information, also auto-synced.
6066
6076
6067 For this to work, an undocumented --magic_docstrings option was added.
6077 For this to work, an undocumented --magic_docstrings option was added.
6068
6078
6069 2002-03-13 Fernando Perez <fperez@colorado.edu>
6079 2002-03-13 Fernando Perez <fperez@colorado.edu>
6070
6080
6071 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
6081 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
6072 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
6082 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
6073
6083
6074 2002-03-12 Fernando Perez <fperez@colorado.edu>
6084 2002-03-12 Fernando Perez <fperez@colorado.edu>
6075
6085
6076 * IPython/ultraTB.py (TermColors): changed color escapes again to
6086 * IPython/ultraTB.py (TermColors): changed color escapes again to
6077 fix the (old, reintroduced) line-wrapping bug. Basically, if
6087 fix the (old, reintroduced) line-wrapping bug. Basically, if
6078 \001..\002 aren't given in the color escapes, lines get wrapped
6088 \001..\002 aren't given in the color escapes, lines get wrapped
6079 weirdly. But giving those screws up old xterms and emacs terms. So
6089 weirdly. But giving those screws up old xterms and emacs terms. So
6080 I added some logic for emacs terms to be ok, but I can't identify old
6090 I added some logic for emacs terms to be ok, but I can't identify old
6081 xterms separately ($TERM=='xterm' for many terminals, like konsole).
6091 xterms separately ($TERM=='xterm' for many terminals, like konsole).
6082
6092
6083 2002-03-10 Fernando Perez <fperez@colorado.edu>
6093 2002-03-10 Fernando Perez <fperez@colorado.edu>
6084
6094
6085 * IPython/usage.py (__doc__): Various documentation cleanups and
6095 * IPython/usage.py (__doc__): Various documentation cleanups and
6086 updates, both in usage docstrings and in the manual.
6096 updates, both in usage docstrings and in the manual.
6087
6097
6088 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6098 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6089 handling of caching. Set minimum acceptabe value for having a
6099 handling of caching. Set minimum acceptabe value for having a
6090 cache at 20 values.
6100 cache at 20 values.
6091
6101
6092 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6102 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6093 install_first_time function to a method, renamed it and added an
6103 install_first_time function to a method, renamed it and added an
6094 'upgrade' mode. Now people can update their config directory with
6104 'upgrade' mode. Now people can update their config directory with
6095 a simple command line switch (-upgrade, also new).
6105 a simple command line switch (-upgrade, also new).
6096
6106
6097 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6107 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6098 @file (convenient for automagic users under Python >= 2.2).
6108 @file (convenient for automagic users under Python >= 2.2).
6099 Removed @files (it seemed more like a plural than an abbrev. of
6109 Removed @files (it seemed more like a plural than an abbrev. of
6100 'file show').
6110 'file show').
6101
6111
6102 * IPython/iplib.py (install_first_time): Fixed crash if there were
6112 * IPython/iplib.py (install_first_time): Fixed crash if there were
6103 backup files ('~') in .ipython/ install directory.
6113 backup files ('~') in .ipython/ install directory.
6104
6114
6105 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6115 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6106 system. Things look fine, but these changes are fairly
6116 system. Things look fine, but these changes are fairly
6107 intrusive. Test them for a few days.
6117 intrusive. Test them for a few days.
6108
6118
6109 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6119 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6110 the prompts system. Now all in/out prompt strings are user
6120 the prompts system. Now all in/out prompt strings are user
6111 controllable. This is particularly useful for embedding, as one
6121 controllable. This is particularly useful for embedding, as one
6112 can tag embedded instances with particular prompts.
6122 can tag embedded instances with particular prompts.
6113
6123
6114 Also removed global use of sys.ps1/2, which now allows nested
6124 Also removed global use of sys.ps1/2, which now allows nested
6115 embeddings without any problems. Added command-line options for
6125 embeddings without any problems. Added command-line options for
6116 the prompt strings.
6126 the prompt strings.
6117
6127
6118 2002-03-08 Fernando Perez <fperez@colorado.edu>
6128 2002-03-08 Fernando Perez <fperez@colorado.edu>
6119
6129
6120 * IPython/UserConfig/example-embed-short.py (ipshell): added
6130 * IPython/UserConfig/example-embed-short.py (ipshell): added
6121 example file with the bare minimum code for embedding.
6131 example file with the bare minimum code for embedding.
6122
6132
6123 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6133 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6124 functionality for the embeddable shell to be activated/deactivated
6134 functionality for the embeddable shell to be activated/deactivated
6125 either globally or at each call.
6135 either globally or at each call.
6126
6136
6127 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6137 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6128 rewriting the prompt with '--->' for auto-inputs with proper
6138 rewriting the prompt with '--->' for auto-inputs with proper
6129 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6139 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6130 this is handled by the prompts class itself, as it should.
6140 this is handled by the prompts class itself, as it should.
6131
6141
6132 2002-03-05 Fernando Perez <fperez@colorado.edu>
6142 2002-03-05 Fernando Perez <fperez@colorado.edu>
6133
6143
6134 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6144 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6135 @logstart to avoid name clashes with the math log function.
6145 @logstart to avoid name clashes with the math log function.
6136
6146
6137 * Big updates to X/Emacs section of the manual.
6147 * Big updates to X/Emacs section of the manual.
6138
6148
6139 * Removed ipython_emacs. Milan explained to me how to pass
6149 * Removed ipython_emacs. Milan explained to me how to pass
6140 arguments to ipython through Emacs. Some day I'm going to end up
6150 arguments to ipython through Emacs. Some day I'm going to end up
6141 learning some lisp...
6151 learning some lisp...
6142
6152
6143 2002-03-04 Fernando Perez <fperez@colorado.edu>
6153 2002-03-04 Fernando Perez <fperez@colorado.edu>
6144
6154
6145 * IPython/ipython_emacs: Created script to be used as the
6155 * IPython/ipython_emacs: Created script to be used as the
6146 py-python-command Emacs variable so we can pass IPython
6156 py-python-command Emacs variable so we can pass IPython
6147 parameters. I can't figure out how to tell Emacs directly to pass
6157 parameters. I can't figure out how to tell Emacs directly to pass
6148 parameters to IPython, so a dummy shell script will do it.
6158 parameters to IPython, so a dummy shell script will do it.
6149
6159
6150 Other enhancements made for things to work better under Emacs'
6160 Other enhancements made for things to work better under Emacs'
6151 various types of terminals. Many thanks to Milan Zamazal
6161 various types of terminals. Many thanks to Milan Zamazal
6152 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6162 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6153
6163
6154 2002-03-01 Fernando Perez <fperez@colorado.edu>
6164 2002-03-01 Fernando Perez <fperez@colorado.edu>
6155
6165
6156 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6166 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6157 that loading of readline is now optional. This gives better
6167 that loading of readline is now optional. This gives better
6158 control to emacs users.
6168 control to emacs users.
6159
6169
6160 * IPython/ultraTB.py (__date__): Modified color escape sequences
6170 * IPython/ultraTB.py (__date__): Modified color escape sequences
6161 and now things work fine under xterm and in Emacs' term buffers
6171 and now things work fine under xterm and in Emacs' term buffers
6162 (though not shell ones). Well, in emacs you get colors, but all
6172 (though not shell ones). Well, in emacs you get colors, but all
6163 seem to be 'light' colors (no difference between dark and light
6173 seem to be 'light' colors (no difference between dark and light
6164 ones). But the garbage chars are gone, and also in xterms. It
6174 ones). But the garbage chars are gone, and also in xterms. It
6165 seems that now I'm using 'cleaner' ansi sequences.
6175 seems that now I'm using 'cleaner' ansi sequences.
6166
6176
6167 2002-02-21 Fernando Perez <fperez@colorado.edu>
6177 2002-02-21 Fernando Perez <fperez@colorado.edu>
6168
6178
6169 * Released 0.2.7 (mainly to publish the scoping fix).
6179 * Released 0.2.7 (mainly to publish the scoping fix).
6170
6180
6171 * IPython/Logger.py (Logger.logstate): added. A corresponding
6181 * IPython/Logger.py (Logger.logstate): added. A corresponding
6172 @logstate magic was created.
6182 @logstate magic was created.
6173
6183
6174 * IPython/Magic.py: fixed nested scoping problem under Python
6184 * IPython/Magic.py: fixed nested scoping problem under Python
6175 2.1.x (automagic wasn't working).
6185 2.1.x (automagic wasn't working).
6176
6186
6177 2002-02-20 Fernando Perez <fperez@colorado.edu>
6187 2002-02-20 Fernando Perez <fperez@colorado.edu>
6178
6188
6179 * Released 0.2.6.
6189 * Released 0.2.6.
6180
6190
6181 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6191 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6182 option so that logs can come out without any headers at all.
6192 option so that logs can come out without any headers at all.
6183
6193
6184 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6194 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6185 SciPy.
6195 SciPy.
6186
6196
6187 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6197 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6188 that embedded IPython calls don't require vars() to be explicitly
6198 that embedded IPython calls don't require vars() to be explicitly
6189 passed. Now they are extracted from the caller's frame (code
6199 passed. Now they are extracted from the caller's frame (code
6190 snatched from Eric Jones' weave). Added better documentation to
6200 snatched from Eric Jones' weave). Added better documentation to
6191 the section on embedding and the example file.
6201 the section on embedding and the example file.
6192
6202
6193 * IPython/genutils.py (page): Changed so that under emacs, it just
6203 * IPython/genutils.py (page): Changed so that under emacs, it just
6194 prints the string. You can then page up and down in the emacs
6204 prints the string. You can then page up and down in the emacs
6195 buffer itself. This is how the builtin help() works.
6205 buffer itself. This is how the builtin help() works.
6196
6206
6197 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6207 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6198 macro scoping: macros need to be executed in the user's namespace
6208 macro scoping: macros need to be executed in the user's namespace
6199 to work as if they had been typed by the user.
6209 to work as if they had been typed by the user.
6200
6210
6201 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6211 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6202 execute automatically (no need to type 'exec...'). They then
6212 execute automatically (no need to type 'exec...'). They then
6203 behave like 'true macros'. The printing system was also modified
6213 behave like 'true macros'. The printing system was also modified
6204 for this to work.
6214 for this to work.
6205
6215
6206 2002-02-19 Fernando Perez <fperez@colorado.edu>
6216 2002-02-19 Fernando Perez <fperez@colorado.edu>
6207
6217
6208 * IPython/genutils.py (page_file): new function for paging files
6218 * IPython/genutils.py (page_file): new function for paging files
6209 in an OS-independent way. Also necessary for file viewing to work
6219 in an OS-independent way. Also necessary for file viewing to work
6210 well inside Emacs buffers.
6220 well inside Emacs buffers.
6211 (page): Added checks for being in an emacs buffer.
6221 (page): Added checks for being in an emacs buffer.
6212 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6222 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6213 same bug in iplib.
6223 same bug in iplib.
6214
6224
6215 2002-02-18 Fernando Perez <fperez@colorado.edu>
6225 2002-02-18 Fernando Perez <fperez@colorado.edu>
6216
6226
6217 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6227 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6218 of readline so that IPython can work inside an Emacs buffer.
6228 of readline so that IPython can work inside an Emacs buffer.
6219
6229
6220 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6230 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6221 method signatures (they weren't really bugs, but it looks cleaner
6231 method signatures (they weren't really bugs, but it looks cleaner
6222 and keeps PyChecker happy).
6232 and keeps PyChecker happy).
6223
6233
6224 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6234 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6225 for implementing various user-defined hooks. Currently only
6235 for implementing various user-defined hooks. Currently only
6226 display is done.
6236 display is done.
6227
6237
6228 * IPython/Prompts.py (CachedOutput._display): changed display
6238 * IPython/Prompts.py (CachedOutput._display): changed display
6229 functions so that they can be dynamically changed by users easily.
6239 functions so that they can be dynamically changed by users easily.
6230
6240
6231 * IPython/Extensions/numeric_formats.py (num_display): added an
6241 * IPython/Extensions/numeric_formats.py (num_display): added an
6232 extension for printing NumPy arrays in flexible manners. It
6242 extension for printing NumPy arrays in flexible manners. It
6233 doesn't do anything yet, but all the structure is in
6243 doesn't do anything yet, but all the structure is in
6234 place. Ultimately the plan is to implement output format control
6244 place. Ultimately the plan is to implement output format control
6235 like in Octave.
6245 like in Octave.
6236
6246
6237 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6247 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6238 methods are found at run-time by all the automatic machinery.
6248 methods are found at run-time by all the automatic machinery.
6239
6249
6240 2002-02-17 Fernando Perez <fperez@colorado.edu>
6250 2002-02-17 Fernando Perez <fperez@colorado.edu>
6241
6251
6242 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6252 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6243 whole file a little.
6253 whole file a little.
6244
6254
6245 * ToDo: closed this document. Now there's a new_design.lyx
6255 * ToDo: closed this document. Now there's a new_design.lyx
6246 document for all new ideas. Added making a pdf of it for the
6256 document for all new ideas. Added making a pdf of it for the
6247 end-user distro.
6257 end-user distro.
6248
6258
6249 * IPython/Logger.py (Logger.switch_log): Created this to replace
6259 * IPython/Logger.py (Logger.switch_log): Created this to replace
6250 logon() and logoff(). It also fixes a nasty crash reported by
6260 logon() and logoff(). It also fixes a nasty crash reported by
6251 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6261 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6252
6262
6253 * IPython/iplib.py (complete): got auto-completion to work with
6263 * IPython/iplib.py (complete): got auto-completion to work with
6254 automagic (I had wanted this for a long time).
6264 automagic (I had wanted this for a long time).
6255
6265
6256 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6266 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6257 to @file, since file() is now a builtin and clashes with automagic
6267 to @file, since file() is now a builtin and clashes with automagic
6258 for @file.
6268 for @file.
6259
6269
6260 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6270 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6261 of this was previously in iplib, which had grown to more than 2000
6271 of this was previously in iplib, which had grown to more than 2000
6262 lines, way too long. No new functionality, but it makes managing
6272 lines, way too long. No new functionality, but it makes managing
6263 the code a bit easier.
6273 the code a bit easier.
6264
6274
6265 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6275 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6266 information to crash reports.
6276 information to crash reports.
6267
6277
6268 2002-02-12 Fernando Perez <fperez@colorado.edu>
6278 2002-02-12 Fernando Perez <fperez@colorado.edu>
6269
6279
6270 * Released 0.2.5.
6280 * Released 0.2.5.
6271
6281
6272 2002-02-11 Fernando Perez <fperez@colorado.edu>
6282 2002-02-11 Fernando Perez <fperez@colorado.edu>
6273
6283
6274 * Wrote a relatively complete Windows installer. It puts
6284 * Wrote a relatively complete Windows installer. It puts
6275 everything in place, creates Start Menu entries and fixes the
6285 everything in place, creates Start Menu entries and fixes the
6276 color issues. Nothing fancy, but it works.
6286 color issues. Nothing fancy, but it works.
6277
6287
6278 2002-02-10 Fernando Perez <fperez@colorado.edu>
6288 2002-02-10 Fernando Perez <fperez@colorado.edu>
6279
6289
6280 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6290 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6281 os.path.expanduser() call so that we can type @run ~/myfile.py and
6291 os.path.expanduser() call so that we can type @run ~/myfile.py and
6282 have thigs work as expected.
6292 have thigs work as expected.
6283
6293
6284 * IPython/genutils.py (page): fixed exception handling so things
6294 * IPython/genutils.py (page): fixed exception handling so things
6285 work both in Unix and Windows correctly. Quitting a pager triggers
6295 work both in Unix and Windows correctly. Quitting a pager triggers
6286 an IOError/broken pipe in Unix, and in windows not finding a pager
6296 an IOError/broken pipe in Unix, and in windows not finding a pager
6287 is also an IOError, so I had to actually look at the return value
6297 is also an IOError, so I had to actually look at the return value
6288 of the exception, not just the exception itself. Should be ok now.
6298 of the exception, not just the exception itself. Should be ok now.
6289
6299
6290 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6300 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6291 modified to allow case-insensitive color scheme changes.
6301 modified to allow case-insensitive color scheme changes.
6292
6302
6293 2002-02-09 Fernando Perez <fperez@colorado.edu>
6303 2002-02-09 Fernando Perez <fperez@colorado.edu>
6294
6304
6295 * IPython/genutils.py (native_line_ends): new function to leave
6305 * IPython/genutils.py (native_line_ends): new function to leave
6296 user config files with os-native line-endings.
6306 user config files with os-native line-endings.
6297
6307
6298 * README and manual updates.
6308 * README and manual updates.
6299
6309
6300 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6310 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6301 instead of StringType to catch Unicode strings.
6311 instead of StringType to catch Unicode strings.
6302
6312
6303 * IPython/genutils.py (filefind): fixed bug for paths with
6313 * IPython/genutils.py (filefind): fixed bug for paths with
6304 embedded spaces (very common in Windows).
6314 embedded spaces (very common in Windows).
6305
6315
6306 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6316 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6307 files under Windows, so that they get automatically associated
6317 files under Windows, so that they get automatically associated
6308 with a text editor. Windows makes it a pain to handle
6318 with a text editor. Windows makes it a pain to handle
6309 extension-less files.
6319 extension-less files.
6310
6320
6311 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6321 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6312 warning about readline only occur for Posix. In Windows there's no
6322 warning about readline only occur for Posix. In Windows there's no
6313 way to get readline, so why bother with the warning.
6323 way to get readline, so why bother with the warning.
6314
6324
6315 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6325 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6316 for __str__ instead of dir(self), since dir() changed in 2.2.
6326 for __str__ instead of dir(self), since dir() changed in 2.2.
6317
6327
6318 * Ported to Windows! Tested on XP, I suspect it should work fine
6328 * Ported to Windows! Tested on XP, I suspect it should work fine
6319 on NT/2000, but I don't think it will work on 98 et al. That
6329 on NT/2000, but I don't think it will work on 98 et al. That
6320 series of Windows is such a piece of junk anyway that I won't try
6330 series of Windows is such a piece of junk anyway that I won't try
6321 porting it there. The XP port was straightforward, showed a few
6331 porting it there. The XP port was straightforward, showed a few
6322 bugs here and there (fixed all), in particular some string
6332 bugs here and there (fixed all), in particular some string
6323 handling stuff which required considering Unicode strings (which
6333 handling stuff which required considering Unicode strings (which
6324 Windows uses). This is good, but hasn't been too tested :) No
6334 Windows uses). This is good, but hasn't been too tested :) No
6325 fancy installer yet, I'll put a note in the manual so people at
6335 fancy installer yet, I'll put a note in the manual so people at
6326 least make manually a shortcut.
6336 least make manually a shortcut.
6327
6337
6328 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6338 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6329 into a single one, "colors". This now controls both prompt and
6339 into a single one, "colors". This now controls both prompt and
6330 exception color schemes, and can be changed both at startup
6340 exception color schemes, and can be changed both at startup
6331 (either via command-line switches or via ipythonrc files) and at
6341 (either via command-line switches or via ipythonrc files) and at
6332 runtime, with @colors.
6342 runtime, with @colors.
6333 (Magic.magic_run): renamed @prun to @run and removed the old
6343 (Magic.magic_run): renamed @prun to @run and removed the old
6334 @run. The two were too similar to warrant keeping both.
6344 @run. The two were too similar to warrant keeping both.
6335
6345
6336 2002-02-03 Fernando Perez <fperez@colorado.edu>
6346 2002-02-03 Fernando Perez <fperez@colorado.edu>
6337
6347
6338 * IPython/iplib.py (install_first_time): Added comment on how to
6348 * IPython/iplib.py (install_first_time): Added comment on how to
6339 configure the color options for first-time users. Put a <return>
6349 configure the color options for first-time users. Put a <return>
6340 request at the end so that small-terminal users get a chance to
6350 request at the end so that small-terminal users get a chance to
6341 read the startup info.
6351 read the startup info.
6342
6352
6343 2002-01-23 Fernando Perez <fperez@colorado.edu>
6353 2002-01-23 Fernando Perez <fperez@colorado.edu>
6344
6354
6345 * IPython/iplib.py (CachedOutput.update): Changed output memory
6355 * IPython/iplib.py (CachedOutput.update): Changed output memory
6346 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6356 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6347 input history we still use _i. Did this b/c these variable are
6357 input history we still use _i. Did this b/c these variable are
6348 very commonly used in interactive work, so the less we need to
6358 very commonly used in interactive work, so the less we need to
6349 type the better off we are.
6359 type the better off we are.
6350 (Magic.magic_prun): updated @prun to better handle the namespaces
6360 (Magic.magic_prun): updated @prun to better handle the namespaces
6351 the file will run in, including a fix for __name__ not being set
6361 the file will run in, including a fix for __name__ not being set
6352 before.
6362 before.
6353
6363
6354 2002-01-20 Fernando Perez <fperez@colorado.edu>
6364 2002-01-20 Fernando Perez <fperez@colorado.edu>
6355
6365
6356 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6366 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6357 extra garbage for Python 2.2. Need to look more carefully into
6367 extra garbage for Python 2.2. Need to look more carefully into
6358 this later.
6368 this later.
6359
6369
6360 2002-01-19 Fernando Perez <fperez@colorado.edu>
6370 2002-01-19 Fernando Perez <fperez@colorado.edu>
6361
6371
6362 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6372 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6363 display SyntaxError exceptions properly formatted when they occur
6373 display SyntaxError exceptions properly formatted when they occur
6364 (they can be triggered by imported code).
6374 (they can be triggered by imported code).
6365
6375
6366 2002-01-18 Fernando Perez <fperez@colorado.edu>
6376 2002-01-18 Fernando Perez <fperez@colorado.edu>
6367
6377
6368 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6378 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6369 SyntaxError exceptions are reported nicely formatted, instead of
6379 SyntaxError exceptions are reported nicely formatted, instead of
6370 spitting out only offset information as before.
6380 spitting out only offset information as before.
6371 (Magic.magic_prun): Added the @prun function for executing
6381 (Magic.magic_prun): Added the @prun function for executing
6372 programs with command line args inside IPython.
6382 programs with command line args inside IPython.
6373
6383
6374 2002-01-16 Fernando Perez <fperez@colorado.edu>
6384 2002-01-16 Fernando Perez <fperez@colorado.edu>
6375
6385
6376 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6386 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6377 to *not* include the last item given in a range. This brings their
6387 to *not* include the last item given in a range. This brings their
6378 behavior in line with Python's slicing:
6388 behavior in line with Python's slicing:
6379 a[n1:n2] -> a[n1]...a[n2-1]
6389 a[n1:n2] -> a[n1]...a[n2-1]
6380 It may be a bit less convenient, but I prefer to stick to Python's
6390 It may be a bit less convenient, but I prefer to stick to Python's
6381 conventions *everywhere*, so users never have to wonder.
6391 conventions *everywhere*, so users never have to wonder.
6382 (Magic.magic_macro): Added @macro function to ease the creation of
6392 (Magic.magic_macro): Added @macro function to ease the creation of
6383 macros.
6393 macros.
6384
6394
6385 2002-01-05 Fernando Perez <fperez@colorado.edu>
6395 2002-01-05 Fernando Perez <fperez@colorado.edu>
6386
6396
6387 * Released 0.2.4.
6397 * Released 0.2.4.
6388
6398
6389 * IPython/iplib.py (Magic.magic_pdef):
6399 * IPython/iplib.py (Magic.magic_pdef):
6390 (InteractiveShell.safe_execfile): report magic lines and error
6400 (InteractiveShell.safe_execfile): report magic lines and error
6391 lines without line numbers so one can easily copy/paste them for
6401 lines without line numbers so one can easily copy/paste them for
6392 re-execution.
6402 re-execution.
6393
6403
6394 * Updated manual with recent changes.
6404 * Updated manual with recent changes.
6395
6405
6396 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6406 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6397 docstring printing when class? is called. Very handy for knowing
6407 docstring printing when class? is called. Very handy for knowing
6398 how to create class instances (as long as __init__ is well
6408 how to create class instances (as long as __init__ is well
6399 documented, of course :)
6409 documented, of course :)
6400 (Magic.magic_doc): print both class and constructor docstrings.
6410 (Magic.magic_doc): print both class and constructor docstrings.
6401 (Magic.magic_pdef): give constructor info if passed a class and
6411 (Magic.magic_pdef): give constructor info if passed a class and
6402 __call__ info for callable object instances.
6412 __call__ info for callable object instances.
6403
6413
6404 2002-01-04 Fernando Perez <fperez@colorado.edu>
6414 2002-01-04 Fernando Perez <fperez@colorado.edu>
6405
6415
6406 * Made deep_reload() off by default. It doesn't always work
6416 * Made deep_reload() off by default. It doesn't always work
6407 exactly as intended, so it's probably safer to have it off. It's
6417 exactly as intended, so it's probably safer to have it off. It's
6408 still available as dreload() anyway, so nothing is lost.
6418 still available as dreload() anyway, so nothing is lost.
6409
6419
6410 2002-01-02 Fernando Perez <fperez@colorado.edu>
6420 2002-01-02 Fernando Perez <fperez@colorado.edu>
6411
6421
6412 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6422 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6413 so I wanted an updated release).
6423 so I wanted an updated release).
6414
6424
6415 2001-12-27 Fernando Perez <fperez@colorado.edu>
6425 2001-12-27 Fernando Perez <fperez@colorado.edu>
6416
6426
6417 * IPython/iplib.py (InteractiveShell.interact): Added the original
6427 * IPython/iplib.py (InteractiveShell.interact): Added the original
6418 code from 'code.py' for this module in order to change the
6428 code from 'code.py' for this module in order to change the
6419 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6429 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6420 the history cache would break when the user hit Ctrl-C, and
6430 the history cache would break when the user hit Ctrl-C, and
6421 interact() offers no way to add any hooks to it.
6431 interact() offers no way to add any hooks to it.
6422
6432
6423 2001-12-23 Fernando Perez <fperez@colorado.edu>
6433 2001-12-23 Fernando Perez <fperez@colorado.edu>
6424
6434
6425 * setup.py: added check for 'MANIFEST' before trying to remove
6435 * setup.py: added check for 'MANIFEST' before trying to remove
6426 it. Thanks to Sean Reifschneider.
6436 it. Thanks to Sean Reifschneider.
6427
6437
6428 2001-12-22 Fernando Perez <fperez@colorado.edu>
6438 2001-12-22 Fernando Perez <fperez@colorado.edu>
6429
6439
6430 * Released 0.2.2.
6440 * Released 0.2.2.
6431
6441
6432 * Finished (reasonably) writing the manual. Later will add the
6442 * Finished (reasonably) writing the manual. Later will add the
6433 python-standard navigation stylesheets, but for the time being
6443 python-standard navigation stylesheets, but for the time being
6434 it's fairly complete. Distribution will include html and pdf
6444 it's fairly complete. Distribution will include html and pdf
6435 versions.
6445 versions.
6436
6446
6437 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6447 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6438 (MayaVi author).
6448 (MayaVi author).
6439
6449
6440 2001-12-21 Fernando Perez <fperez@colorado.edu>
6450 2001-12-21 Fernando Perez <fperez@colorado.edu>
6441
6451
6442 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6452 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6443 good public release, I think (with the manual and the distutils
6453 good public release, I think (with the manual and the distutils
6444 installer). The manual can use some work, but that can go
6454 installer). The manual can use some work, but that can go
6445 slowly. Otherwise I think it's quite nice for end users. Next
6455 slowly. Otherwise I think it's quite nice for end users. Next
6446 summer, rewrite the guts of it...
6456 summer, rewrite the guts of it...
6447
6457
6448 * Changed format of ipythonrc files to use whitespace as the
6458 * Changed format of ipythonrc files to use whitespace as the
6449 separator instead of an explicit '='. Cleaner.
6459 separator instead of an explicit '='. Cleaner.
6450
6460
6451 2001-12-20 Fernando Perez <fperez@colorado.edu>
6461 2001-12-20 Fernando Perez <fperez@colorado.edu>
6452
6462
6453 * Started a manual in LyX. For now it's just a quick merge of the
6463 * Started a manual in LyX. For now it's just a quick merge of the
6454 various internal docstrings and READMEs. Later it may grow into a
6464 various internal docstrings and READMEs. Later it may grow into a
6455 nice, full-blown manual.
6465 nice, full-blown manual.
6456
6466
6457 * Set up a distutils based installer. Installation should now be
6467 * Set up a distutils based installer. Installation should now be
6458 trivially simple for end-users.
6468 trivially simple for end-users.
6459
6469
6460 2001-12-11 Fernando Perez <fperez@colorado.edu>
6470 2001-12-11 Fernando Perez <fperez@colorado.edu>
6461
6471
6462 * Released 0.2.0. First public release, announced it at
6472 * Released 0.2.0. First public release, announced it at
6463 comp.lang.python. From now on, just bugfixes...
6473 comp.lang.python. From now on, just bugfixes...
6464
6474
6465 * Went through all the files, set copyright/license notices and
6475 * Went through all the files, set copyright/license notices and
6466 cleaned up things. Ready for release.
6476 cleaned up things. Ready for release.
6467
6477
6468 2001-12-10 Fernando Perez <fperez@colorado.edu>
6478 2001-12-10 Fernando Perez <fperez@colorado.edu>
6469
6479
6470 * Changed the first-time installer not to use tarfiles. It's more
6480 * Changed the first-time installer not to use tarfiles. It's more
6471 robust now and less unix-dependent. Also makes it easier for
6481 robust now and less unix-dependent. Also makes it easier for
6472 people to later upgrade versions.
6482 people to later upgrade versions.
6473
6483
6474 * Changed @exit to @abort to reflect the fact that it's pretty
6484 * Changed @exit to @abort to reflect the fact that it's pretty
6475 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6485 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6476 becomes significant only when IPyhton is embedded: in that case,
6486 becomes significant only when IPyhton is embedded: in that case,
6477 C-D closes IPython only, but @abort kills the enclosing program
6487 C-D closes IPython only, but @abort kills the enclosing program
6478 too (unless it had called IPython inside a try catching
6488 too (unless it had called IPython inside a try catching
6479 SystemExit).
6489 SystemExit).
6480
6490
6481 * Created Shell module which exposes the actuall IPython Shell
6491 * Created Shell module which exposes the actuall IPython Shell
6482 classes, currently the normal and the embeddable one. This at
6492 classes, currently the normal and the embeddable one. This at
6483 least offers a stable interface we won't need to change when
6493 least offers a stable interface we won't need to change when
6484 (later) the internals are rewritten. That rewrite will be confined
6494 (later) the internals are rewritten. That rewrite will be confined
6485 to iplib and ipmaker, but the Shell interface should remain as is.
6495 to iplib and ipmaker, but the Shell interface should remain as is.
6486
6496
6487 * Added embed module which offers an embeddable IPShell object,
6497 * Added embed module which offers an embeddable IPShell object,
6488 useful to fire up IPython *inside* a running program. Great for
6498 useful to fire up IPython *inside* a running program. Great for
6489 debugging or dynamical data analysis.
6499 debugging or dynamical data analysis.
6490
6500
6491 2001-12-08 Fernando Perez <fperez@colorado.edu>
6501 2001-12-08 Fernando Perez <fperez@colorado.edu>
6492
6502
6493 * Fixed small bug preventing seeing info from methods of defined
6503 * Fixed small bug preventing seeing info from methods of defined
6494 objects (incorrect namespace in _ofind()).
6504 objects (incorrect namespace in _ofind()).
6495
6505
6496 * Documentation cleanup. Moved the main usage docstrings to a
6506 * Documentation cleanup. Moved the main usage docstrings to a
6497 separate file, usage.py (cleaner to maintain, and hopefully in the
6507 separate file, usage.py (cleaner to maintain, and hopefully in the
6498 future some perlpod-like way of producing interactive, man and
6508 future some perlpod-like way of producing interactive, man and
6499 html docs out of it will be found).
6509 html docs out of it will be found).
6500
6510
6501 * Added @profile to see your profile at any time.
6511 * Added @profile to see your profile at any time.
6502
6512
6503 * Added @p as an alias for 'print'. It's especially convenient if
6513 * Added @p as an alias for 'print'. It's especially convenient if
6504 using automagic ('p x' prints x).
6514 using automagic ('p x' prints x).
6505
6515
6506 * Small cleanups and fixes after a pychecker run.
6516 * Small cleanups and fixes after a pychecker run.
6507
6517
6508 * Changed the @cd command to handle @cd - and @cd -<n> for
6518 * Changed the @cd command to handle @cd - and @cd -<n> for
6509 visiting any directory in _dh.
6519 visiting any directory in _dh.
6510
6520
6511 * Introduced _dh, a history of visited directories. @dhist prints
6521 * Introduced _dh, a history of visited directories. @dhist prints
6512 it out with numbers.
6522 it out with numbers.
6513
6523
6514 2001-12-07 Fernando Perez <fperez@colorado.edu>
6524 2001-12-07 Fernando Perez <fperez@colorado.edu>
6515
6525
6516 * Released 0.1.22
6526 * Released 0.1.22
6517
6527
6518 * Made initialization a bit more robust against invalid color
6528 * Made initialization a bit more robust against invalid color
6519 options in user input (exit, not traceback-crash).
6529 options in user input (exit, not traceback-crash).
6520
6530
6521 * Changed the bug crash reporter to write the report only in the
6531 * Changed the bug crash reporter to write the report only in the
6522 user's .ipython directory. That way IPython won't litter people's
6532 user's .ipython directory. That way IPython won't litter people's
6523 hard disks with crash files all over the place. Also print on
6533 hard disks with crash files all over the place. Also print on
6524 screen the necessary mail command.
6534 screen the necessary mail command.
6525
6535
6526 * With the new ultraTB, implemented LightBG color scheme for light
6536 * With the new ultraTB, implemented LightBG color scheme for light
6527 background terminals. A lot of people like white backgrounds, so I
6537 background terminals. A lot of people like white backgrounds, so I
6528 guess we should at least give them something readable.
6538 guess we should at least give them something readable.
6529
6539
6530 2001-12-06 Fernando Perez <fperez@colorado.edu>
6540 2001-12-06 Fernando Perez <fperez@colorado.edu>
6531
6541
6532 * Modified the structure of ultraTB. Now there's a proper class
6542 * Modified the structure of ultraTB. Now there's a proper class
6533 for tables of color schemes which allow adding schemes easily and
6543 for tables of color schemes which allow adding schemes easily and
6534 switching the active scheme without creating a new instance every
6544 switching the active scheme without creating a new instance every
6535 time (which was ridiculous). The syntax for creating new schemes
6545 time (which was ridiculous). The syntax for creating new schemes
6536 is also cleaner. I think ultraTB is finally done, with a clean
6546 is also cleaner. I think ultraTB is finally done, with a clean
6537 class structure. Names are also much cleaner (now there's proper
6547 class structure. Names are also much cleaner (now there's proper
6538 color tables, no need for every variable to also have 'color' in
6548 color tables, no need for every variable to also have 'color' in
6539 its name).
6549 its name).
6540
6550
6541 * Broke down genutils into separate files. Now genutils only
6551 * Broke down genutils into separate files. Now genutils only
6542 contains utility functions, and classes have been moved to their
6552 contains utility functions, and classes have been moved to their
6543 own files (they had enough independent functionality to warrant
6553 own files (they had enough independent functionality to warrant
6544 it): ConfigLoader, OutputTrap, Struct.
6554 it): ConfigLoader, OutputTrap, Struct.
6545
6555
6546 2001-12-05 Fernando Perez <fperez@colorado.edu>
6556 2001-12-05 Fernando Perez <fperez@colorado.edu>
6547
6557
6548 * IPython turns 21! Released version 0.1.21, as a candidate for
6558 * IPython turns 21! Released version 0.1.21, as a candidate for
6549 public consumption. If all goes well, release in a few days.
6559 public consumption. If all goes well, release in a few days.
6550
6560
6551 * Fixed path bug (files in Extensions/ directory wouldn't be found
6561 * Fixed path bug (files in Extensions/ directory wouldn't be found
6552 unless IPython/ was explicitly in sys.path).
6562 unless IPython/ was explicitly in sys.path).
6553
6563
6554 * Extended the FlexCompleter class as MagicCompleter to allow
6564 * Extended the FlexCompleter class as MagicCompleter to allow
6555 completion of @-starting lines.
6565 completion of @-starting lines.
6556
6566
6557 * Created __release__.py file as a central repository for release
6567 * Created __release__.py file as a central repository for release
6558 info that other files can read from.
6568 info that other files can read from.
6559
6569
6560 * Fixed small bug in logging: when logging was turned on in
6570 * Fixed small bug in logging: when logging was turned on in
6561 mid-session, old lines with special meanings (!@?) were being
6571 mid-session, old lines with special meanings (!@?) were being
6562 logged without the prepended comment, which is necessary since
6572 logged without the prepended comment, which is necessary since
6563 they are not truly valid python syntax. This should make session
6573 they are not truly valid python syntax. This should make session
6564 restores produce less errors.
6574 restores produce less errors.
6565
6575
6566 * The namespace cleanup forced me to make a FlexCompleter class
6576 * The namespace cleanup forced me to make a FlexCompleter class
6567 which is nothing but a ripoff of rlcompleter, but with selectable
6577 which is nothing but a ripoff of rlcompleter, but with selectable
6568 namespace (rlcompleter only works in __main__.__dict__). I'll try
6578 namespace (rlcompleter only works in __main__.__dict__). I'll try
6569 to submit a note to the authors to see if this change can be
6579 to submit a note to the authors to see if this change can be
6570 incorporated in future rlcompleter releases (Dec.6: done)
6580 incorporated in future rlcompleter releases (Dec.6: done)
6571
6581
6572 * More fixes to namespace handling. It was a mess! Now all
6582 * More fixes to namespace handling. It was a mess! Now all
6573 explicit references to __main__.__dict__ are gone (except when
6583 explicit references to __main__.__dict__ are gone (except when
6574 really needed) and everything is handled through the namespace
6584 really needed) and everything is handled through the namespace
6575 dicts in the IPython instance. We seem to be getting somewhere
6585 dicts in the IPython instance. We seem to be getting somewhere
6576 with this, finally...
6586 with this, finally...
6577
6587
6578 * Small documentation updates.
6588 * Small documentation updates.
6579
6589
6580 * Created the Extensions directory under IPython (with an
6590 * Created the Extensions directory under IPython (with an
6581 __init__.py). Put the PhysicalQ stuff there. This directory should
6591 __init__.py). Put the PhysicalQ stuff there. This directory should
6582 be used for all special-purpose extensions.
6592 be used for all special-purpose extensions.
6583
6593
6584 * File renaming:
6594 * File renaming:
6585 ipythonlib --> ipmaker
6595 ipythonlib --> ipmaker
6586 ipplib --> iplib
6596 ipplib --> iplib
6587 This makes a bit more sense in terms of what these files actually do.
6597 This makes a bit more sense in terms of what these files actually do.
6588
6598
6589 * Moved all the classes and functions in ipythonlib to ipplib, so
6599 * Moved all the classes and functions in ipythonlib to ipplib, so
6590 now ipythonlib only has make_IPython(). This will ease up its
6600 now ipythonlib only has make_IPython(). This will ease up its
6591 splitting in smaller functional chunks later.
6601 splitting in smaller functional chunks later.
6592
6602
6593 * Cleaned up (done, I think) output of @whos. Better column
6603 * Cleaned up (done, I think) output of @whos. Better column
6594 formatting, and now shows str(var) for as much as it can, which is
6604 formatting, and now shows str(var) for as much as it can, which is
6595 typically what one gets with a 'print var'.
6605 typically what one gets with a 'print var'.
6596
6606
6597 2001-12-04 Fernando Perez <fperez@colorado.edu>
6607 2001-12-04 Fernando Perez <fperez@colorado.edu>
6598
6608
6599 * Fixed namespace problems. Now builtin/IPyhton/user names get
6609 * Fixed namespace problems. Now builtin/IPyhton/user names get
6600 properly reported in their namespace. Internal namespace handling
6610 properly reported in their namespace. Internal namespace handling
6601 is finally getting decent (not perfect yet, but much better than
6611 is finally getting decent (not perfect yet, but much better than
6602 the ad-hoc mess we had).
6612 the ad-hoc mess we had).
6603
6613
6604 * Removed -exit option. If people just want to run a python
6614 * Removed -exit option. If people just want to run a python
6605 script, that's what the normal interpreter is for. Less
6615 script, that's what the normal interpreter is for. Less
6606 unnecessary options, less chances for bugs.
6616 unnecessary options, less chances for bugs.
6607
6617
6608 * Added a crash handler which generates a complete post-mortem if
6618 * Added a crash handler which generates a complete post-mortem if
6609 IPython crashes. This will help a lot in tracking bugs down the
6619 IPython crashes. This will help a lot in tracking bugs down the
6610 road.
6620 road.
6611
6621
6612 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6622 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6613 which were boud to functions being reassigned would bypass the
6623 which were boud to functions being reassigned would bypass the
6614 logger, breaking the sync of _il with the prompt counter. This
6624 logger, breaking the sync of _il with the prompt counter. This
6615 would then crash IPython later when a new line was logged.
6625 would then crash IPython later when a new line was logged.
6616
6626
6617 2001-12-02 Fernando Perez <fperez@colorado.edu>
6627 2001-12-02 Fernando Perez <fperez@colorado.edu>
6618
6628
6619 * Made IPython a package. This means people don't have to clutter
6629 * Made IPython a package. This means people don't have to clutter
6620 their sys.path with yet another directory. Changed the INSTALL
6630 their sys.path with yet another directory. Changed the INSTALL
6621 file accordingly.
6631 file accordingly.
6622
6632
6623 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6633 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6624 sorts its output (so @who shows it sorted) and @whos formats the
6634 sorts its output (so @who shows it sorted) and @whos formats the
6625 table according to the width of the first column. Nicer, easier to
6635 table according to the width of the first column. Nicer, easier to
6626 read. Todo: write a generic table_format() which takes a list of
6636 read. Todo: write a generic table_format() which takes a list of
6627 lists and prints it nicely formatted, with optional row/column
6637 lists and prints it nicely formatted, with optional row/column
6628 separators and proper padding and justification.
6638 separators and proper padding and justification.
6629
6639
6630 * Released 0.1.20
6640 * Released 0.1.20
6631
6641
6632 * Fixed bug in @log which would reverse the inputcache list (a
6642 * Fixed bug in @log which would reverse the inputcache list (a
6633 copy operation was missing).
6643 copy operation was missing).
6634
6644
6635 * Code cleanup. @config was changed to use page(). Better, since
6645 * Code cleanup. @config was changed to use page(). Better, since
6636 its output is always quite long.
6646 its output is always quite long.
6637
6647
6638 * Itpl is back as a dependency. I was having too many problems
6648 * Itpl is back as a dependency. I was having too many problems
6639 getting the parametric aliases to work reliably, and it's just
6649 getting the parametric aliases to work reliably, and it's just
6640 easier to code weird string operations with it than playing %()s
6650 easier to code weird string operations with it than playing %()s
6641 games. It's only ~6k, so I don't think it's too big a deal.
6651 games. It's only ~6k, so I don't think it's too big a deal.
6642
6652
6643 * Found (and fixed) a very nasty bug with history. !lines weren't
6653 * Found (and fixed) a very nasty bug with history. !lines weren't
6644 getting cached, and the out of sync caches would crash
6654 getting cached, and the out of sync caches would crash
6645 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6655 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6646 division of labor a bit better. Bug fixed, cleaner structure.
6656 division of labor a bit better. Bug fixed, cleaner structure.
6647
6657
6648 2001-12-01 Fernando Perez <fperez@colorado.edu>
6658 2001-12-01 Fernando Perez <fperez@colorado.edu>
6649
6659
6650 * Released 0.1.19
6660 * Released 0.1.19
6651
6661
6652 * Added option -n to @hist to prevent line number printing. Much
6662 * Added option -n to @hist to prevent line number printing. Much
6653 easier to copy/paste code this way.
6663 easier to copy/paste code this way.
6654
6664
6655 * Created global _il to hold the input list. Allows easy
6665 * Created global _il to hold the input list. Allows easy
6656 re-execution of blocks of code by slicing it (inspired by Janko's
6666 re-execution of blocks of code by slicing it (inspired by Janko's
6657 comment on 'macros').
6667 comment on 'macros').
6658
6668
6659 * Small fixes and doc updates.
6669 * Small fixes and doc updates.
6660
6670
6661 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6671 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6662 much too fragile with automagic. Handles properly multi-line
6672 much too fragile with automagic. Handles properly multi-line
6663 statements and takes parameters.
6673 statements and takes parameters.
6664
6674
6665 2001-11-30 Fernando Perez <fperez@colorado.edu>
6675 2001-11-30 Fernando Perez <fperez@colorado.edu>
6666
6676
6667 * Version 0.1.18 released.
6677 * Version 0.1.18 released.
6668
6678
6669 * Fixed nasty namespace bug in initial module imports.
6679 * Fixed nasty namespace bug in initial module imports.
6670
6680
6671 * Added copyright/license notes to all code files (except
6681 * Added copyright/license notes to all code files (except
6672 DPyGetOpt). For the time being, LGPL. That could change.
6682 DPyGetOpt). For the time being, LGPL. That could change.
6673
6683
6674 * Rewrote a much nicer README, updated INSTALL, cleaned up
6684 * Rewrote a much nicer README, updated INSTALL, cleaned up
6675 ipythonrc-* samples.
6685 ipythonrc-* samples.
6676
6686
6677 * Overall code/documentation cleanup. Basically ready for
6687 * Overall code/documentation cleanup. Basically ready for
6678 release. Only remaining thing: licence decision (LGPL?).
6688 release. Only remaining thing: licence decision (LGPL?).
6679
6689
6680 * Converted load_config to a class, ConfigLoader. Now recursion
6690 * Converted load_config to a class, ConfigLoader. Now recursion
6681 control is better organized. Doesn't include the same file twice.
6691 control is better organized. Doesn't include the same file twice.
6682
6692
6683 2001-11-29 Fernando Perez <fperez@colorado.edu>
6693 2001-11-29 Fernando Perez <fperez@colorado.edu>
6684
6694
6685 * Got input history working. Changed output history variables from
6695 * Got input history working. Changed output history variables from
6686 _p to _o so that _i is for input and _o for output. Just cleaner
6696 _p to _o so that _i is for input and _o for output. Just cleaner
6687 convention.
6697 convention.
6688
6698
6689 * Implemented parametric aliases. This pretty much allows the
6699 * Implemented parametric aliases. This pretty much allows the
6690 alias system to offer full-blown shell convenience, I think.
6700 alias system to offer full-blown shell convenience, I think.
6691
6701
6692 * Version 0.1.17 released, 0.1.18 opened.
6702 * Version 0.1.17 released, 0.1.18 opened.
6693
6703
6694 * dot_ipython/ipythonrc (alias): added documentation.
6704 * dot_ipython/ipythonrc (alias): added documentation.
6695 (xcolor): Fixed small bug (xcolors -> xcolor)
6705 (xcolor): Fixed small bug (xcolors -> xcolor)
6696
6706
6697 * Changed the alias system. Now alias is a magic command to define
6707 * Changed the alias system. Now alias is a magic command to define
6698 aliases just like the shell. Rationale: the builtin magics should
6708 aliases just like the shell. Rationale: the builtin magics should
6699 be there for things deeply connected to IPython's
6709 be there for things deeply connected to IPython's
6700 architecture. And this is a much lighter system for what I think
6710 architecture. And this is a much lighter system for what I think
6701 is the really important feature: allowing users to define quickly
6711 is the really important feature: allowing users to define quickly
6702 magics that will do shell things for them, so they can customize
6712 magics that will do shell things for them, so they can customize
6703 IPython easily to match their work habits. If someone is really
6713 IPython easily to match their work habits. If someone is really
6704 desperate to have another name for a builtin alias, they can
6714 desperate to have another name for a builtin alias, they can
6705 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6715 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6706 works.
6716 works.
6707
6717
6708 2001-11-28 Fernando Perez <fperez@colorado.edu>
6718 2001-11-28 Fernando Perez <fperez@colorado.edu>
6709
6719
6710 * Changed @file so that it opens the source file at the proper
6720 * Changed @file so that it opens the source file at the proper
6711 line. Since it uses less, if your EDITOR environment is
6721 line. Since it uses less, if your EDITOR environment is
6712 configured, typing v will immediately open your editor of choice
6722 configured, typing v will immediately open your editor of choice
6713 right at the line where the object is defined. Not as quick as
6723 right at the line where the object is defined. Not as quick as
6714 having a direct @edit command, but for all intents and purposes it
6724 having a direct @edit command, but for all intents and purposes it
6715 works. And I don't have to worry about writing @edit to deal with
6725 works. And I don't have to worry about writing @edit to deal with
6716 all the editors, less does that.
6726 all the editors, less does that.
6717
6727
6718 * Version 0.1.16 released, 0.1.17 opened.
6728 * Version 0.1.16 released, 0.1.17 opened.
6719
6729
6720 * Fixed some nasty bugs in the page/page_dumb combo that could
6730 * Fixed some nasty bugs in the page/page_dumb combo that could
6721 crash IPython.
6731 crash IPython.
6722
6732
6723 2001-11-27 Fernando Perez <fperez@colorado.edu>
6733 2001-11-27 Fernando Perez <fperez@colorado.edu>
6724
6734
6725 * Version 0.1.15 released, 0.1.16 opened.
6735 * Version 0.1.15 released, 0.1.16 opened.
6726
6736
6727 * Finally got ? and ?? to work for undefined things: now it's
6737 * Finally got ? and ?? to work for undefined things: now it's
6728 possible to type {}.get? and get information about the get method
6738 possible to type {}.get? and get information about the get method
6729 of dicts, or os.path? even if only os is defined (so technically
6739 of dicts, or os.path? even if only os is defined (so technically
6730 os.path isn't). Works at any level. For example, after import os,
6740 os.path isn't). Works at any level. For example, after import os,
6731 os?, os.path?, os.path.abspath? all work. This is great, took some
6741 os?, os.path?, os.path.abspath? all work. This is great, took some
6732 work in _ofind.
6742 work in _ofind.
6733
6743
6734 * Fixed more bugs with logging. The sanest way to do it was to add
6744 * Fixed more bugs with logging. The sanest way to do it was to add
6735 to @log a 'mode' parameter. Killed two in one shot (this mode
6745 to @log a 'mode' parameter. Killed two in one shot (this mode
6736 option was a request of Janko's). I think it's finally clean
6746 option was a request of Janko's). I think it's finally clean
6737 (famous last words).
6747 (famous last words).
6738
6748
6739 * Added a page_dumb() pager which does a decent job of paging on
6749 * Added a page_dumb() pager which does a decent job of paging on
6740 screen, if better things (like less) aren't available. One less
6750 screen, if better things (like less) aren't available. One less
6741 unix dependency (someday maybe somebody will port this to
6751 unix dependency (someday maybe somebody will port this to
6742 windows).
6752 windows).
6743
6753
6744 * Fixed problem in magic_log: would lock of logging out if log
6754 * Fixed problem in magic_log: would lock of logging out if log
6745 creation failed (because it would still think it had succeeded).
6755 creation failed (because it would still think it had succeeded).
6746
6756
6747 * Improved the page() function using curses to auto-detect screen
6757 * Improved the page() function using curses to auto-detect screen
6748 size. Now it can make a much better decision on whether to print
6758 size. Now it can make a much better decision on whether to print
6749 or page a string. Option screen_length was modified: a value 0
6759 or page a string. Option screen_length was modified: a value 0
6750 means auto-detect, and that's the default now.
6760 means auto-detect, and that's the default now.
6751
6761
6752 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6762 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6753 go out. I'll test it for a few days, then talk to Janko about
6763 go out. I'll test it for a few days, then talk to Janko about
6754 licences and announce it.
6764 licences and announce it.
6755
6765
6756 * Fixed the length of the auto-generated ---> prompt which appears
6766 * Fixed the length of the auto-generated ---> prompt which appears
6757 for auto-parens and auto-quotes. Getting this right isn't trivial,
6767 for auto-parens and auto-quotes. Getting this right isn't trivial,
6758 with all the color escapes, different prompt types and optional
6768 with all the color escapes, different prompt types and optional
6759 separators. But it seems to be working in all the combinations.
6769 separators. But it seems to be working in all the combinations.
6760
6770
6761 2001-11-26 Fernando Perez <fperez@colorado.edu>
6771 2001-11-26 Fernando Perez <fperez@colorado.edu>
6762
6772
6763 * Wrote a regexp filter to get option types from the option names
6773 * Wrote a regexp filter to get option types from the option names
6764 string. This eliminates the need to manually keep two duplicate
6774 string. This eliminates the need to manually keep two duplicate
6765 lists.
6775 lists.
6766
6776
6767 * Removed the unneeded check_option_names. Now options are handled
6777 * Removed the unneeded check_option_names. Now options are handled
6768 in a much saner manner and it's easy to visually check that things
6778 in a much saner manner and it's easy to visually check that things
6769 are ok.
6779 are ok.
6770
6780
6771 * Updated version numbers on all files I modified to carry a
6781 * Updated version numbers on all files I modified to carry a
6772 notice so Janko and Nathan have clear version markers.
6782 notice so Janko and Nathan have clear version markers.
6773
6783
6774 * Updated docstring for ultraTB with my changes. I should send
6784 * Updated docstring for ultraTB with my changes. I should send
6775 this to Nathan.
6785 this to Nathan.
6776
6786
6777 * Lots of small fixes. Ran everything through pychecker again.
6787 * Lots of small fixes. Ran everything through pychecker again.
6778
6788
6779 * Made loading of deep_reload an cmd line option. If it's not too
6789 * Made loading of deep_reload an cmd line option. If it's not too
6780 kosher, now people can just disable it. With -nodeep_reload it's
6790 kosher, now people can just disable it. With -nodeep_reload it's
6781 still available as dreload(), it just won't overwrite reload().
6791 still available as dreload(), it just won't overwrite reload().
6782
6792
6783 * Moved many options to the no| form (-opt and -noopt
6793 * Moved many options to the no| form (-opt and -noopt
6784 accepted). Cleaner.
6794 accepted). Cleaner.
6785
6795
6786 * Changed magic_log so that if called with no parameters, it uses
6796 * Changed magic_log so that if called with no parameters, it uses
6787 'rotate' mode. That way auto-generated logs aren't automatically
6797 'rotate' mode. That way auto-generated logs aren't automatically
6788 over-written. For normal logs, now a backup is made if it exists
6798 over-written. For normal logs, now a backup is made if it exists
6789 (only 1 level of backups). A new 'backup' mode was added to the
6799 (only 1 level of backups). A new 'backup' mode was added to the
6790 Logger class to support this. This was a request by Janko.
6800 Logger class to support this. This was a request by Janko.
6791
6801
6792 * Added @logoff/@logon to stop/restart an active log.
6802 * Added @logoff/@logon to stop/restart an active log.
6793
6803
6794 * Fixed a lot of bugs in log saving/replay. It was pretty
6804 * Fixed a lot of bugs in log saving/replay. It was pretty
6795 broken. Now special lines (!@,/) appear properly in the command
6805 broken. Now special lines (!@,/) appear properly in the command
6796 history after a log replay.
6806 history after a log replay.
6797
6807
6798 * Tried and failed to implement full session saving via pickle. My
6808 * Tried and failed to implement full session saving via pickle. My
6799 idea was to pickle __main__.__dict__, but modules can't be
6809 idea was to pickle __main__.__dict__, but modules can't be
6800 pickled. This would be a better alternative to replaying logs, but
6810 pickled. This would be a better alternative to replaying logs, but
6801 seems quite tricky to get to work. Changed -session to be called
6811 seems quite tricky to get to work. Changed -session to be called
6802 -logplay, which more accurately reflects what it does. And if we
6812 -logplay, which more accurately reflects what it does. And if we
6803 ever get real session saving working, -session is now available.
6813 ever get real session saving working, -session is now available.
6804
6814
6805 * Implemented color schemes for prompts also. As for tracebacks,
6815 * Implemented color schemes for prompts also. As for tracebacks,
6806 currently only NoColor and Linux are supported. But now the
6816 currently only NoColor and Linux are supported. But now the
6807 infrastructure is in place, based on a generic ColorScheme
6817 infrastructure is in place, based on a generic ColorScheme
6808 class. So writing and activating new schemes both for the prompts
6818 class. So writing and activating new schemes both for the prompts
6809 and the tracebacks should be straightforward.
6819 and the tracebacks should be straightforward.
6810
6820
6811 * Version 0.1.13 released, 0.1.14 opened.
6821 * Version 0.1.13 released, 0.1.14 opened.
6812
6822
6813 * Changed handling of options for output cache. Now counter is
6823 * Changed handling of options for output cache. Now counter is
6814 hardwired starting at 1 and one specifies the maximum number of
6824 hardwired starting at 1 and one specifies the maximum number of
6815 entries *in the outcache* (not the max prompt counter). This is
6825 entries *in the outcache* (not the max prompt counter). This is
6816 much better, since many statements won't increase the cache
6826 much better, since many statements won't increase the cache
6817 count. It also eliminated some confusing options, now there's only
6827 count. It also eliminated some confusing options, now there's only
6818 one: cache_size.
6828 one: cache_size.
6819
6829
6820 * Added 'alias' magic function and magic_alias option in the
6830 * Added 'alias' magic function and magic_alias option in the
6821 ipythonrc file. Now the user can easily define whatever names he
6831 ipythonrc file. Now the user can easily define whatever names he
6822 wants for the magic functions without having to play weird
6832 wants for the magic functions without having to play weird
6823 namespace games. This gives IPython a real shell-like feel.
6833 namespace games. This gives IPython a real shell-like feel.
6824
6834
6825 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6835 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6826 @ or not).
6836 @ or not).
6827
6837
6828 This was one of the last remaining 'visible' bugs (that I know
6838 This was one of the last remaining 'visible' bugs (that I know
6829 of). I think if I can clean up the session loading so it works
6839 of). I think if I can clean up the session loading so it works
6830 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6840 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6831 about licensing).
6841 about licensing).
6832
6842
6833 2001-11-25 Fernando Perez <fperez@colorado.edu>
6843 2001-11-25 Fernando Perez <fperez@colorado.edu>
6834
6844
6835 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6845 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6836 there's a cleaner distinction between what ? and ?? show.
6846 there's a cleaner distinction between what ? and ?? show.
6837
6847
6838 * Added screen_length option. Now the user can define his own
6848 * Added screen_length option. Now the user can define his own
6839 screen size for page() operations.
6849 screen size for page() operations.
6840
6850
6841 * Implemented magic shell-like functions with automatic code
6851 * Implemented magic shell-like functions with automatic code
6842 generation. Now adding another function is just a matter of adding
6852 generation. Now adding another function is just a matter of adding
6843 an entry to a dict, and the function is dynamically generated at
6853 an entry to a dict, and the function is dynamically generated at
6844 run-time. Python has some really cool features!
6854 run-time. Python has some really cool features!
6845
6855
6846 * Renamed many options to cleanup conventions a little. Now all
6856 * Renamed many options to cleanup conventions a little. Now all
6847 are lowercase, and only underscores where needed. Also in the code
6857 are lowercase, and only underscores where needed. Also in the code
6848 option name tables are clearer.
6858 option name tables are clearer.
6849
6859
6850 * Changed prompts a little. Now input is 'In [n]:' instead of
6860 * Changed prompts a little. Now input is 'In [n]:' instead of
6851 'In[n]:='. This allows it the numbers to be aligned with the
6861 'In[n]:='. This allows it the numbers to be aligned with the
6852 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6862 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6853 Python (it was a Mathematica thing). The '...' continuation prompt
6863 Python (it was a Mathematica thing). The '...' continuation prompt
6854 was also changed a little to align better.
6864 was also changed a little to align better.
6855
6865
6856 * Fixed bug when flushing output cache. Not all _p<n> variables
6866 * Fixed bug when flushing output cache. Not all _p<n> variables
6857 exist, so their deletion needs to be wrapped in a try:
6867 exist, so their deletion needs to be wrapped in a try:
6858
6868
6859 * Figured out how to properly use inspect.formatargspec() (it
6869 * Figured out how to properly use inspect.formatargspec() (it
6860 requires the args preceded by *). So I removed all the code from
6870 requires the args preceded by *). So I removed all the code from
6861 _get_pdef in Magic, which was just replicating that.
6871 _get_pdef in Magic, which was just replicating that.
6862
6872
6863 * Added test to prefilter to allow redefining magic function names
6873 * Added test to prefilter to allow redefining magic function names
6864 as variables. This is ok, since the @ form is always available,
6874 as variables. This is ok, since the @ form is always available,
6865 but whe should allow the user to define a variable called 'ls' if
6875 but whe should allow the user to define a variable called 'ls' if
6866 he needs it.
6876 he needs it.
6867
6877
6868 * Moved the ToDo information from README into a separate ToDo.
6878 * Moved the ToDo information from README into a separate ToDo.
6869
6879
6870 * General code cleanup and small bugfixes. I think it's close to a
6880 * General code cleanup and small bugfixes. I think it's close to a
6871 state where it can be released, obviously with a big 'beta'
6881 state where it can be released, obviously with a big 'beta'
6872 warning on it.
6882 warning on it.
6873
6883
6874 * Got the magic function split to work. Now all magics are defined
6884 * Got the magic function split to work. Now all magics are defined
6875 in a separate class. It just organizes things a bit, and now
6885 in a separate class. It just organizes things a bit, and now
6876 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6886 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6877 was too long).
6887 was too long).
6878
6888
6879 * Changed @clear to @reset to avoid potential confusions with
6889 * Changed @clear to @reset to avoid potential confusions with
6880 the shell command clear. Also renamed @cl to @clear, which does
6890 the shell command clear. Also renamed @cl to @clear, which does
6881 exactly what people expect it to from their shell experience.
6891 exactly what people expect it to from their shell experience.
6882
6892
6883 Added a check to the @reset command (since it's so
6893 Added a check to the @reset command (since it's so
6884 destructive, it's probably a good idea to ask for confirmation).
6894 destructive, it's probably a good idea to ask for confirmation).
6885 But now reset only works for full namespace resetting. Since the
6895 But now reset only works for full namespace resetting. Since the
6886 del keyword is already there for deleting a few specific
6896 del keyword is already there for deleting a few specific
6887 variables, I don't see the point of having a redundant magic
6897 variables, I don't see the point of having a redundant magic
6888 function for the same task.
6898 function for the same task.
6889
6899
6890 2001-11-24 Fernando Perez <fperez@colorado.edu>
6900 2001-11-24 Fernando Perez <fperez@colorado.edu>
6891
6901
6892 * Updated the builtin docs (esp. the ? ones).
6902 * Updated the builtin docs (esp. the ? ones).
6893
6903
6894 * Ran all the code through pychecker. Not terribly impressed with
6904 * Ran all the code through pychecker. Not terribly impressed with
6895 it: lots of spurious warnings and didn't really find anything of
6905 it: lots of spurious warnings and didn't really find anything of
6896 substance (just a few modules being imported and not used).
6906 substance (just a few modules being imported and not used).
6897
6907
6898 * Implemented the new ultraTB functionality into IPython. New
6908 * Implemented the new ultraTB functionality into IPython. New
6899 option: xcolors. This chooses color scheme. xmode now only selects
6909 option: xcolors. This chooses color scheme. xmode now only selects
6900 between Plain and Verbose. Better orthogonality.
6910 between Plain and Verbose. Better orthogonality.
6901
6911
6902 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6912 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6903 mode and color scheme for the exception handlers. Now it's
6913 mode and color scheme for the exception handlers. Now it's
6904 possible to have the verbose traceback with no coloring.
6914 possible to have the verbose traceback with no coloring.
6905
6915
6906 2001-11-23 Fernando Perez <fperez@colorado.edu>
6916 2001-11-23 Fernando Perez <fperez@colorado.edu>
6907
6917
6908 * Version 0.1.12 released, 0.1.13 opened.
6918 * Version 0.1.12 released, 0.1.13 opened.
6909
6919
6910 * Removed option to set auto-quote and auto-paren escapes by
6920 * Removed option to set auto-quote and auto-paren escapes by
6911 user. The chances of breaking valid syntax are just too high. If
6921 user. The chances of breaking valid syntax are just too high. If
6912 someone *really* wants, they can always dig into the code.
6922 someone *really* wants, they can always dig into the code.
6913
6923
6914 * Made prompt separators configurable.
6924 * Made prompt separators configurable.
6915
6925
6916 2001-11-22 Fernando Perez <fperez@colorado.edu>
6926 2001-11-22 Fernando Perez <fperez@colorado.edu>
6917
6927
6918 * Small bugfixes in many places.
6928 * Small bugfixes in many places.
6919
6929
6920 * Removed the MyCompleter class from ipplib. It seemed redundant
6930 * Removed the MyCompleter class from ipplib. It seemed redundant
6921 with the C-p,C-n history search functionality. Less code to
6931 with the C-p,C-n history search functionality. Less code to
6922 maintain.
6932 maintain.
6923
6933
6924 * Moved all the original ipython.py code into ipythonlib.py. Right
6934 * Moved all the original ipython.py code into ipythonlib.py. Right
6925 now it's just one big dump into a function called make_IPython, so
6935 now it's just one big dump into a function called make_IPython, so
6926 no real modularity has been gained. But at least it makes the
6936 no real modularity has been gained. But at least it makes the
6927 wrapper script tiny, and since ipythonlib is a module, it gets
6937 wrapper script tiny, and since ipythonlib is a module, it gets
6928 compiled and startup is much faster.
6938 compiled and startup is much faster.
6929
6939
6930 This is a reasobably 'deep' change, so we should test it for a
6940 This is a reasobably 'deep' change, so we should test it for a
6931 while without messing too much more with the code.
6941 while without messing too much more with the code.
6932
6942
6933 2001-11-21 Fernando Perez <fperez@colorado.edu>
6943 2001-11-21 Fernando Perez <fperez@colorado.edu>
6934
6944
6935 * Version 0.1.11 released, 0.1.12 opened for further work.
6945 * Version 0.1.11 released, 0.1.12 opened for further work.
6936
6946
6937 * Removed dependency on Itpl. It was only needed in one place. It
6947 * Removed dependency on Itpl. It was only needed in one place. It
6938 would be nice if this became part of python, though. It makes life
6948 would be nice if this became part of python, though. It makes life
6939 *a lot* easier in some cases.
6949 *a lot* easier in some cases.
6940
6950
6941 * Simplified the prefilter code a bit. Now all handlers are
6951 * Simplified the prefilter code a bit. Now all handlers are
6942 expected to explicitly return a value (at least a blank string).
6952 expected to explicitly return a value (at least a blank string).
6943
6953
6944 * Heavy edits in ipplib. Removed the help system altogether. Now
6954 * Heavy edits in ipplib. Removed the help system altogether. Now
6945 obj?/?? is used for inspecting objects, a magic @doc prints
6955 obj?/?? is used for inspecting objects, a magic @doc prints
6946 docstrings, and full-blown Python help is accessed via the 'help'
6956 docstrings, and full-blown Python help is accessed via the 'help'
6947 keyword. This cleans up a lot of code (less to maintain) and does
6957 keyword. This cleans up a lot of code (less to maintain) and does
6948 the job. Since 'help' is now a standard Python component, might as
6958 the job. Since 'help' is now a standard Python component, might as
6949 well use it and remove duplicate functionality.
6959 well use it and remove duplicate functionality.
6950
6960
6951 Also removed the option to use ipplib as a standalone program. By
6961 Also removed the option to use ipplib as a standalone program. By
6952 now it's too dependent on other parts of IPython to function alone.
6962 now it's too dependent on other parts of IPython to function alone.
6953
6963
6954 * Fixed bug in genutils.pager. It would crash if the pager was
6964 * Fixed bug in genutils.pager. It would crash if the pager was
6955 exited immediately after opening (broken pipe).
6965 exited immediately after opening (broken pipe).
6956
6966
6957 * Trimmed down the VerboseTB reporting a little. The header is
6967 * Trimmed down the VerboseTB reporting a little. The header is
6958 much shorter now and the repeated exception arguments at the end
6968 much shorter now and the repeated exception arguments at the end
6959 have been removed. For interactive use the old header seemed a bit
6969 have been removed. For interactive use the old header seemed a bit
6960 excessive.
6970 excessive.
6961
6971
6962 * Fixed small bug in output of @whos for variables with multi-word
6972 * Fixed small bug in output of @whos for variables with multi-word
6963 types (only first word was displayed).
6973 types (only first word was displayed).
6964
6974
6965 2001-11-17 Fernando Perez <fperez@colorado.edu>
6975 2001-11-17 Fernando Perez <fperez@colorado.edu>
6966
6976
6967 * Version 0.1.10 released, 0.1.11 opened for further work.
6977 * Version 0.1.10 released, 0.1.11 opened for further work.
6968
6978
6969 * Modified dirs and friends. dirs now *returns* the stack (not
6979 * Modified dirs and friends. dirs now *returns* the stack (not
6970 prints), so one can manipulate it as a variable. Convenient to
6980 prints), so one can manipulate it as a variable. Convenient to
6971 travel along many directories.
6981 travel along many directories.
6972
6982
6973 * Fixed bug in magic_pdef: would only work with functions with
6983 * Fixed bug in magic_pdef: would only work with functions with
6974 arguments with default values.
6984 arguments with default values.
6975
6985
6976 2001-11-14 Fernando Perez <fperez@colorado.edu>
6986 2001-11-14 Fernando Perez <fperez@colorado.edu>
6977
6987
6978 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6988 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6979 example with IPython. Various other minor fixes and cleanups.
6989 example with IPython. Various other minor fixes and cleanups.
6980
6990
6981 * Version 0.1.9 released, 0.1.10 opened for further work.
6991 * Version 0.1.9 released, 0.1.10 opened for further work.
6982
6992
6983 * Added sys.path to the list of directories searched in the
6993 * Added sys.path to the list of directories searched in the
6984 execfile= option. It used to be the current directory and the
6994 execfile= option. It used to be the current directory and the
6985 user's IPYTHONDIR only.
6995 user's IPYTHONDIR only.
6986
6996
6987 2001-11-13 Fernando Perez <fperez@colorado.edu>
6997 2001-11-13 Fernando Perez <fperez@colorado.edu>
6988
6998
6989 * Reinstated the raw_input/prefilter separation that Janko had
6999 * Reinstated the raw_input/prefilter separation that Janko had
6990 initially. This gives a more convenient setup for extending the
7000 initially. This gives a more convenient setup for extending the
6991 pre-processor from the outside: raw_input always gets a string,
7001 pre-processor from the outside: raw_input always gets a string,
6992 and prefilter has to process it. We can then redefine prefilter
7002 and prefilter has to process it. We can then redefine prefilter
6993 from the outside and implement extensions for special
7003 from the outside and implement extensions for special
6994 purposes.
7004 purposes.
6995
7005
6996 Today I got one for inputting PhysicalQuantity objects
7006 Today I got one for inputting PhysicalQuantity objects
6997 (from Scientific) without needing any function calls at
7007 (from Scientific) without needing any function calls at
6998 all. Extremely convenient, and it's all done as a user-level
7008 all. Extremely convenient, and it's all done as a user-level
6999 extension (no IPython code was touched). Now instead of:
7009 extension (no IPython code was touched). Now instead of:
7000 a = PhysicalQuantity(4.2,'m/s**2')
7010 a = PhysicalQuantity(4.2,'m/s**2')
7001 one can simply say
7011 one can simply say
7002 a = 4.2 m/s**2
7012 a = 4.2 m/s**2
7003 or even
7013 or even
7004 a = 4.2 m/s^2
7014 a = 4.2 m/s^2
7005
7015
7006 I use this, but it's also a proof of concept: IPython really is
7016 I use this, but it's also a proof of concept: IPython really is
7007 fully user-extensible, even at the level of the parsing of the
7017 fully user-extensible, even at the level of the parsing of the
7008 command line. It's not trivial, but it's perfectly doable.
7018 command line. It's not trivial, but it's perfectly doable.
7009
7019
7010 * Added 'add_flip' method to inclusion conflict resolver. Fixes
7020 * Added 'add_flip' method to inclusion conflict resolver. Fixes
7011 the problem of modules being loaded in the inverse order in which
7021 the problem of modules being loaded in the inverse order in which
7012 they were defined in
7022 they were defined in
7013
7023
7014 * Version 0.1.8 released, 0.1.9 opened for further work.
7024 * Version 0.1.8 released, 0.1.9 opened for further work.
7015
7025
7016 * Added magics pdef, source and file. They respectively show the
7026 * Added magics pdef, source and file. They respectively show the
7017 definition line ('prototype' in C), source code and full python
7027 definition line ('prototype' in C), source code and full python
7018 file for any callable object. The object inspector oinfo uses
7028 file for any callable object. The object inspector oinfo uses
7019 these to show the same information.
7029 these to show the same information.
7020
7030
7021 * Version 0.1.7 released, 0.1.8 opened for further work.
7031 * Version 0.1.7 released, 0.1.8 opened for further work.
7022
7032
7023 * Separated all the magic functions into a class called Magic. The
7033 * Separated all the magic functions into a class called Magic. The
7024 InteractiveShell class was becoming too big for Xemacs to handle
7034 InteractiveShell class was becoming too big for Xemacs to handle
7025 (de-indenting a line would lock it up for 10 seconds while it
7035 (de-indenting a line would lock it up for 10 seconds while it
7026 backtracked on the whole class!)
7036 backtracked on the whole class!)
7027
7037
7028 FIXME: didn't work. It can be done, but right now namespaces are
7038 FIXME: didn't work. It can be done, but right now namespaces are
7029 all messed up. Do it later (reverted it for now, so at least
7039 all messed up. Do it later (reverted it for now, so at least
7030 everything works as before).
7040 everything works as before).
7031
7041
7032 * Got the object introspection system (magic_oinfo) working! I
7042 * Got the object introspection system (magic_oinfo) working! I
7033 think this is pretty much ready for release to Janko, so he can
7043 think this is pretty much ready for release to Janko, so he can
7034 test it for a while and then announce it. Pretty much 100% of what
7044 test it for a while and then announce it. Pretty much 100% of what
7035 I wanted for the 'phase 1' release is ready. Happy, tired.
7045 I wanted for the 'phase 1' release is ready. Happy, tired.
7036
7046
7037 2001-11-12 Fernando Perez <fperez@colorado.edu>
7047 2001-11-12 Fernando Perez <fperez@colorado.edu>
7038
7048
7039 * Version 0.1.6 released, 0.1.7 opened for further work.
7049 * Version 0.1.6 released, 0.1.7 opened for further work.
7040
7050
7041 * Fixed bug in printing: it used to test for truth before
7051 * Fixed bug in printing: it used to test for truth before
7042 printing, so 0 wouldn't print. Now checks for None.
7052 printing, so 0 wouldn't print. Now checks for None.
7043
7053
7044 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
7054 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
7045 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
7055 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
7046 reaches by hand into the outputcache. Think of a better way to do
7056 reaches by hand into the outputcache. Think of a better way to do
7047 this later.
7057 this later.
7048
7058
7049 * Various small fixes thanks to Nathan's comments.
7059 * Various small fixes thanks to Nathan's comments.
7050
7060
7051 * Changed magic_pprint to magic_Pprint. This way it doesn't
7061 * Changed magic_pprint to magic_Pprint. This way it doesn't
7052 collide with pprint() and the name is consistent with the command
7062 collide with pprint() and the name is consistent with the command
7053 line option.
7063 line option.
7054
7064
7055 * Changed prompt counter behavior to be fully like
7065 * Changed prompt counter behavior to be fully like
7056 Mathematica's. That is, even input that doesn't return a result
7066 Mathematica's. That is, even input that doesn't return a result
7057 raises the prompt counter. The old behavior was kind of confusing
7067 raises the prompt counter. The old behavior was kind of confusing
7058 (getting the same prompt number several times if the operation
7068 (getting the same prompt number several times if the operation
7059 didn't return a result).
7069 didn't return a result).
7060
7070
7061 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
7071 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
7062
7072
7063 * Fixed -Classic mode (wasn't working anymore).
7073 * Fixed -Classic mode (wasn't working anymore).
7064
7074
7065 * Added colored prompts using Nathan's new code. Colors are
7075 * Added colored prompts using Nathan's new code. Colors are
7066 currently hardwired, they can be user-configurable. For
7076 currently hardwired, they can be user-configurable. For
7067 developers, they can be chosen in file ipythonlib.py, at the
7077 developers, they can be chosen in file ipythonlib.py, at the
7068 beginning of the CachedOutput class def.
7078 beginning of the CachedOutput class def.
7069
7079
7070 2001-11-11 Fernando Perez <fperez@colorado.edu>
7080 2001-11-11 Fernando Perez <fperez@colorado.edu>
7071
7081
7072 * Version 0.1.5 released, 0.1.6 opened for further work.
7082 * Version 0.1.5 released, 0.1.6 opened for further work.
7073
7083
7074 * Changed magic_env to *return* the environment as a dict (not to
7084 * Changed magic_env to *return* the environment as a dict (not to
7075 print it). This way it prints, but it can also be processed.
7085 print it). This way it prints, but it can also be processed.
7076
7086
7077 * Added Verbose exception reporting to interactive
7087 * Added Verbose exception reporting to interactive
7078 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
7088 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
7079 traceback. Had to make some changes to the ultraTB file. This is
7089 traceback. Had to make some changes to the ultraTB file. This is
7080 probably the last 'big' thing in my mental todo list. This ties
7090 probably the last 'big' thing in my mental todo list. This ties
7081 in with the next entry:
7091 in with the next entry:
7082
7092
7083 * Changed -Xi and -Xf to a single -xmode option. Now all the user
7093 * Changed -Xi and -Xf to a single -xmode option. Now all the user
7084 has to specify is Plain, Color or Verbose for all exception
7094 has to specify is Plain, Color or Verbose for all exception
7085 handling.
7095 handling.
7086
7096
7087 * Removed ShellServices option. All this can really be done via
7097 * Removed ShellServices option. All this can really be done via
7088 the magic system. It's easier to extend, cleaner and has automatic
7098 the magic system. It's easier to extend, cleaner and has automatic
7089 namespace protection and documentation.
7099 namespace protection and documentation.
7090
7100
7091 2001-11-09 Fernando Perez <fperez@colorado.edu>
7101 2001-11-09 Fernando Perez <fperez@colorado.edu>
7092
7102
7093 * Fixed bug in output cache flushing (missing parameter to
7103 * Fixed bug in output cache flushing (missing parameter to
7094 __init__). Other small bugs fixed (found using pychecker).
7104 __init__). Other small bugs fixed (found using pychecker).
7095
7105
7096 * Version 0.1.4 opened for bugfixing.
7106 * Version 0.1.4 opened for bugfixing.
7097
7107
7098 2001-11-07 Fernando Perez <fperez@colorado.edu>
7108 2001-11-07 Fernando Perez <fperez@colorado.edu>
7099
7109
7100 * Version 0.1.3 released, mainly because of the raw_input bug.
7110 * Version 0.1.3 released, mainly because of the raw_input bug.
7101
7111
7102 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7112 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7103 and when testing for whether things were callable, a call could
7113 and when testing for whether things were callable, a call could
7104 actually be made to certain functions. They would get called again
7114 actually be made to certain functions. They would get called again
7105 once 'really' executed, with a resulting double call. A disaster
7115 once 'really' executed, with a resulting double call. A disaster
7106 in many cases (list.reverse() would never work!).
7116 in many cases (list.reverse() would never work!).
7107
7117
7108 * Removed prefilter() function, moved its code to raw_input (which
7118 * Removed prefilter() function, moved its code to raw_input (which
7109 after all was just a near-empty caller for prefilter). This saves
7119 after all was just a near-empty caller for prefilter). This saves
7110 a function call on every prompt, and simplifies the class a tiny bit.
7120 a function call on every prompt, and simplifies the class a tiny bit.
7111
7121
7112 * Fix _ip to __ip name in magic example file.
7122 * Fix _ip to __ip name in magic example file.
7113
7123
7114 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7124 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7115 work with non-gnu versions of tar.
7125 work with non-gnu versions of tar.
7116
7126
7117 2001-11-06 Fernando Perez <fperez@colorado.edu>
7127 2001-11-06 Fernando Perez <fperez@colorado.edu>
7118
7128
7119 * Version 0.1.2. Just to keep track of the recent changes.
7129 * Version 0.1.2. Just to keep track of the recent changes.
7120
7130
7121 * Fixed nasty bug in output prompt routine. It used to check 'if
7131 * Fixed nasty bug in output prompt routine. It used to check 'if
7122 arg != None...'. Problem is, this fails if arg implements a
7132 arg != None...'. Problem is, this fails if arg implements a
7123 special comparison (__cmp__) which disallows comparing to
7133 special comparison (__cmp__) which disallows comparing to
7124 None. Found it when trying to use the PhysicalQuantity module from
7134 None. Found it when trying to use the PhysicalQuantity module from
7125 ScientificPython.
7135 ScientificPython.
7126
7136
7127 2001-11-05 Fernando Perez <fperez@colorado.edu>
7137 2001-11-05 Fernando Perez <fperez@colorado.edu>
7128
7138
7129 * Also added dirs. Now the pushd/popd/dirs family functions
7139 * Also added dirs. Now the pushd/popd/dirs family functions
7130 basically like the shell, with the added convenience of going home
7140 basically like the shell, with the added convenience of going home
7131 when called with no args.
7141 when called with no args.
7132
7142
7133 * pushd/popd slightly modified to mimic shell behavior more
7143 * pushd/popd slightly modified to mimic shell behavior more
7134 closely.
7144 closely.
7135
7145
7136 * Added env,pushd,popd from ShellServices as magic functions. I
7146 * Added env,pushd,popd from ShellServices as magic functions. I
7137 think the cleanest will be to port all desired functions from
7147 think the cleanest will be to port all desired functions from
7138 ShellServices as magics and remove ShellServices altogether. This
7148 ShellServices as magics and remove ShellServices altogether. This
7139 will provide a single, clean way of adding functionality
7149 will provide a single, clean way of adding functionality
7140 (shell-type or otherwise) to IP.
7150 (shell-type or otherwise) to IP.
7141
7151
7142 2001-11-04 Fernando Perez <fperez@colorado.edu>
7152 2001-11-04 Fernando Perez <fperez@colorado.edu>
7143
7153
7144 * Added .ipython/ directory to sys.path. This way users can keep
7154 * Added .ipython/ directory to sys.path. This way users can keep
7145 customizations there and access them via import.
7155 customizations there and access them via import.
7146
7156
7147 2001-11-03 Fernando Perez <fperez@colorado.edu>
7157 2001-11-03 Fernando Perez <fperez@colorado.edu>
7148
7158
7149 * Opened version 0.1.1 for new changes.
7159 * Opened version 0.1.1 for new changes.
7150
7160
7151 * Changed version number to 0.1.0: first 'public' release, sent to
7161 * Changed version number to 0.1.0: first 'public' release, sent to
7152 Nathan and Janko.
7162 Nathan and Janko.
7153
7163
7154 * Lots of small fixes and tweaks.
7164 * Lots of small fixes and tweaks.
7155
7165
7156 * Minor changes to whos format. Now strings are shown, snipped if
7166 * Minor changes to whos format. Now strings are shown, snipped if
7157 too long.
7167 too long.
7158
7168
7159 * Changed ShellServices to work on __main__ so they show up in @who
7169 * Changed ShellServices to work on __main__ so they show up in @who
7160
7170
7161 * Help also works with ? at the end of a line:
7171 * Help also works with ? at the end of a line:
7162 ?sin and sin?
7172 ?sin and sin?
7163 both produce the same effect. This is nice, as often I use the
7173 both produce the same effect. This is nice, as often I use the
7164 tab-complete to find the name of a method, but I used to then have
7174 tab-complete to find the name of a method, but I used to then have
7165 to go to the beginning of the line to put a ? if I wanted more
7175 to go to the beginning of the line to put a ? if I wanted more
7166 info. Now I can just add the ? and hit return. Convenient.
7176 info. Now I can just add the ? and hit return. Convenient.
7167
7177
7168 2001-11-02 Fernando Perez <fperez@colorado.edu>
7178 2001-11-02 Fernando Perez <fperez@colorado.edu>
7169
7179
7170 * Python version check (>=2.1) added.
7180 * Python version check (>=2.1) added.
7171
7181
7172 * Added LazyPython documentation. At this point the docs are quite
7182 * Added LazyPython documentation. At this point the docs are quite
7173 a mess. A cleanup is in order.
7183 a mess. A cleanup is in order.
7174
7184
7175 * Auto-installer created. For some bizarre reason, the zipfiles
7185 * Auto-installer created. For some bizarre reason, the zipfiles
7176 module isn't working on my system. So I made a tar version
7186 module isn't working on my system. So I made a tar version
7177 (hopefully the command line options in various systems won't kill
7187 (hopefully the command line options in various systems won't kill
7178 me).
7188 me).
7179
7189
7180 * Fixes to Struct in genutils. Now all dictionary-like methods are
7190 * Fixes to Struct in genutils. Now all dictionary-like methods are
7181 protected (reasonably).
7191 protected (reasonably).
7182
7192
7183 * Added pager function to genutils and changed ? to print usage
7193 * Added pager function to genutils and changed ? to print usage
7184 note through it (it was too long).
7194 note through it (it was too long).
7185
7195
7186 * Added the LazyPython functionality. Works great! I changed the
7196 * Added the LazyPython functionality. Works great! I changed the
7187 auto-quote escape to ';', it's on home row and next to '. But
7197 auto-quote escape to ';', it's on home row and next to '. But
7188 both auto-quote and auto-paren (still /) escapes are command-line
7198 both auto-quote and auto-paren (still /) escapes are command-line
7189 parameters.
7199 parameters.
7190
7200
7191
7201
7192 2001-11-01 Fernando Perez <fperez@colorado.edu>
7202 2001-11-01 Fernando Perez <fperez@colorado.edu>
7193
7203
7194 * Version changed to 0.0.7. Fairly large change: configuration now
7204 * Version changed to 0.0.7. Fairly large change: configuration now
7195 is all stored in a directory, by default .ipython. There, all
7205 is all stored in a directory, by default .ipython. There, all
7196 config files have normal looking names (not .names)
7206 config files have normal looking names (not .names)
7197
7207
7198 * Version 0.0.6 Released first to Lucas and Archie as a test
7208 * Version 0.0.6 Released first to Lucas and Archie as a test
7199 run. Since it's the first 'semi-public' release, change version to
7209 run. Since it's the first 'semi-public' release, change version to
7200 > 0.0.6 for any changes now.
7210 > 0.0.6 for any changes now.
7201
7211
7202 * Stuff I had put in the ipplib.py changelog:
7212 * Stuff I had put in the ipplib.py changelog:
7203
7213
7204 Changes to InteractiveShell:
7214 Changes to InteractiveShell:
7205
7215
7206 - Made the usage message a parameter.
7216 - Made the usage message a parameter.
7207
7217
7208 - Require the name of the shell variable to be given. It's a bit
7218 - Require the name of the shell variable to be given. It's a bit
7209 of a hack, but allows the name 'shell' not to be hardwired in the
7219 of a hack, but allows the name 'shell' not to be hardwired in the
7210 magic (@) handler, which is problematic b/c it requires
7220 magic (@) handler, which is problematic b/c it requires
7211 polluting the global namespace with 'shell'. This in turn is
7221 polluting the global namespace with 'shell'. This in turn is
7212 fragile: if a user redefines a variable called shell, things
7222 fragile: if a user redefines a variable called shell, things
7213 break.
7223 break.
7214
7224
7215 - magic @: all functions available through @ need to be defined
7225 - magic @: all functions available through @ need to be defined
7216 as magic_<name>, even though they can be called simply as
7226 as magic_<name>, even though they can be called simply as
7217 @<name>. This allows the special command @magic to gather
7227 @<name>. This allows the special command @magic to gather
7218 information automatically about all existing magic functions,
7228 information automatically about all existing magic functions,
7219 even if they are run-time user extensions, by parsing the shell
7229 even if they are run-time user extensions, by parsing the shell
7220 instance __dict__ looking for special magic_ names.
7230 instance __dict__ looking for special magic_ names.
7221
7231
7222 - mainloop: added *two* local namespace parameters. This allows
7232 - mainloop: added *two* local namespace parameters. This allows
7223 the class to differentiate between parameters which were there
7233 the class to differentiate between parameters which were there
7224 before and after command line initialization was processed. This
7234 before and after command line initialization was processed. This
7225 way, later @who can show things loaded at startup by the
7235 way, later @who can show things loaded at startup by the
7226 user. This trick was necessary to make session saving/reloading
7236 user. This trick was necessary to make session saving/reloading
7227 really work: ideally after saving/exiting/reloading a session,
7237 really work: ideally after saving/exiting/reloading a session,
7228 *everything* should look the same, including the output of @who. I
7238 *everything* should look the same, including the output of @who. I
7229 was only able to make this work with this double namespace
7239 was only able to make this work with this double namespace
7230 trick.
7240 trick.
7231
7241
7232 - added a header to the logfile which allows (almost) full
7242 - added a header to the logfile which allows (almost) full
7233 session restoring.
7243 session restoring.
7234
7244
7235 - prepend lines beginning with @ or !, with a and log
7245 - prepend lines beginning with @ or !, with a and log
7236 them. Why? !lines: may be useful to know what you did @lines:
7246 them. Why? !lines: may be useful to know what you did @lines:
7237 they may affect session state. So when restoring a session, at
7247 they may affect session state. So when restoring a session, at
7238 least inform the user of their presence. I couldn't quite get
7248 least inform the user of their presence. I couldn't quite get
7239 them to properly re-execute, but at least the user is warned.
7249 them to properly re-execute, but at least the user is warned.
7240
7250
7241 * Started ChangeLog.
7251 * Started ChangeLog.
@@ -1,94 +1,96 b''
1 #!/bin/sh
1 #!/bin/sh
2 # IPython release script
2 # IPython release script
3
3
4 PYVER=`python -V 2>&1 | awk '{print $2}' | awk -F '.' '{print $1$2}' `
4 PYVER=`python -V 2>&1 | awk '{print $2}' | awk -F '.' '{print $1$2}' `
5 version=`ipython -Version`
5 version=`ipython -Version`
6 ipdir=~/ipython/ipython
6 ipdir=~/ipython/ipython
7
7
8 echo
8 echo
9 echo "Releasing IPython version $version"
9 echo "Releasing IPython version $version"
10 echo "=================================="
10 echo "=================================="
11
11
12 echo "Marking ChangeLog with release information and making NEWS file..."
12 echo "Marking ChangeLog with release information and making NEWS file..."
13
13
14 # Stamp changelog and save a copy of the status at each version, in case later
14 # Stamp changelog and save a copy of the status at each version, in case later
15 # we want the NEWS file to start from a point before the very last release (if
15 # we want the NEWS file to start from a point before the very last release (if
16 # very small interim releases have no significant changes).
16 # very small interim releases have no significant changes).
17
17
18 cd $ipdir/doc
18 cd $ipdir/doc
19 cp ChangeLog ChangeLog.old
19 cp ChangeLog ChangeLog.old
20 cp ChangeLog ChangeLog.$version
20 cp ChangeLog ChangeLog.$version
21 daystamp=`date +%Y-%m-%d`
21 daystamp=`date +%Y-%m-%d`
22 echo $daystamp " ***" Released version $version > ChangeLog
22 echo $daystamp " ***" Released version $version > ChangeLog
23 echo >> ChangeLog
23 echo >> ChangeLog
24 cat ChangeLog.old >> ChangeLog
24 cat ChangeLog.old >> ChangeLog
25 rm ChangeLog.old
25 rm ChangeLog.old
26
26
27 # Build NEWS file
27 # Build NEWS file
28 echo "Changes between the last two releases (major or minor)" > NEWS
28 echo "Changes between the last two releases (major or minor)" > NEWS
29 echo "Note that this is an auto-generated diff of the ChangeLogs" >> NEWS
29 echo "Note that this is an auto-generated diff of the ChangeLogs" >> NEWS
30 echo >> NEWS
30 echo >> NEWS
31 diff ChangeLog.previous ChangeLog | grep -v '^0a' | sed 's/^> //g' >> NEWS
31 diff ChangeLog.previous ChangeLog | grep -v '^0a' | sed 's/^> //g' >> NEWS
32 cp ChangeLog ChangeLog.previous
32 cp ChangeLog ChangeLog.previous
33
33
34 # Clean up build/dist directories
34 # Clean up build/dist directories
35 rm -rf $ipdir/build/*
35 rm -rf $ipdir/build/*
36 rm -rf $ipdir/dist/*
36 rm -rf $ipdir/dist/*
37
37
38 # Perform local backup
38 # Perform local backup
39 cd $ipdir/tools
39 cd $ipdir/tools
40 ./bkp.sh
40 ./bkp.sh
41
41
42 # Build source and binary distros
42 # Build source and binary distros
43 cd $ipdir
43 cd $ipdir
44 ./setup.py sdist --formats=gztar
44 ./setup.py sdist --formats=gztar
45
45
46 # Build version-specific RPMs, where we must use the --python option to ensure
46 # Build version-specific RPMs, where we must use the --python option to ensure
47 # that the resulting RPM is really built with the requested python version (so
47 # that the resulting RPM is really built with the requested python version (so
48 # things go to lib/python2.X/...)
48 # things go to lib/python2.X/...)
49 python2.4 ./setup.py bdist_rpm --binary-only --release=py24 --python=/usr/bin/python2.4
49 python2.4 ./setup.py bdist_rpm --binary-only --release=py24 --python=/usr/bin/python2.4
50 python2.5 ./setup.py bdist_rpm --binary-only --release=py25 --python=/usr/bin/python2.5
50
51
51 # Build egg
52 # Build eggs
52 ./eggsetup.py bdist_egg
53 python2.4 ./eggsetup.py bdist_egg
54 python2.5 ./eggsetup.py bdist_egg
53
55
54 # Call the windows build separately, so that the extra Windows scripts don't
56 # Call the windows build separately, so that the extra Windows scripts don't
55 # get pulled into Unix builds (setup.py has code which checks for
57 # get pulled into Unix builds (setup.py has code which checks for
56 # bdist_wininst)
58 # bdist_wininst)
57 ./setup.py bdist_wininst --install-script=ipython_win_post_install.py
59 ./setup.py bdist_wininst --install-script=ipython_win_post_install.py
58
60
59 # Register with the Python Package Index (PyPI)
61 # Register with the Python Package Index (PyPI)
60 echo "Registering with PyPI..."
62 echo "Registering with PyPI..."
61 cd $ipdir
63 cd $ipdir
62 ./setup.py register
64 ./setup.py register
63
65
64 # Upload all files
66 # Upload all files
65 cd $ipdir/dist
67 cd $ipdir/dist
66 echo "Uploading distribution files..."
68 echo "Uploading distribution files..."
67 scp * ipython@ipython.scipy.org:www/dist/
69 scp * ipython@ipython.scipy.org:www/dist/
68
70
69 echo "Uploading backup files..."
71 echo "Uploading backup files..."
70 cd ~/ipython/backup
72 cd ~/ipython/backup
71 scp `ls -1tr | tail -1` ipython@ipython.scipy.org:www/backup/
73 scp `ls -1tr | tail -1` ipython@ipython.scipy.org:www/backup/
72
74
73 echo "Updating webpage..."
75 echo "Updating webpage..."
74 cd $ipdir/doc
76 cd $ipdir/doc
75 www=~/ipython/homepage
77 www=~/ipython/homepage
76 cp ChangeLog NEWS $www
78 cp ChangeLog NEWS $www
77 rm -rf $www/doc/*
79 rm -rf $www/doc/*
78 cp -r manual.pdf manual/ $www/doc
80 cp -r manual.pdf manual/ $www/doc
79 cd $www
81 cd $www
80 ./update
82 ./update
81
83
82 # Alert package maintainers
84 # Alert package maintainers
83 echo "Alerting package maintainers..."
85 echo "Alerting package maintainers..."
84 maintainers='fperez@colorado.edu ariciputi@users.sourceforge.net jack@xiph.org tretkowski@inittab.de dryice@hotpop.com willmaier@ml1.net'
86 maintainers='fperez@colorado.edu ariciputi@users.sourceforge.net jack@xiph.org tretkowski@inittab.de dryice@hotpop.com willmaier@ml1.net'
85 #maintainers='fperez@colorado.edu'
87 #maintainers='fperez@colorado.edu'
86
88
87 for email in $maintainers
89 for email in $maintainers
88 do
90 do
89 echo "Emailing $email..."
91 echo "Emailing $email..."
90 mail -s "[Package maintainer notice] A new IPython is out. Version: $version" \
92 mail -s "[Package maintainer notice] A new IPython is out. Version: $version" \
91 $email < NEWS
93 $email < NEWS
92 done
94 done
93
95
94 echo "Done!"
96 echo "Done!"
@@ -1,29 +1,25 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 # release test
3 # release test
4
4
5 # clean up build/dist directories
5 # clean up build/dist directories
6 rm -rf ~/ipython/ipython/build/*
6 rm -rf ~/ipython/ipython/build/*
7 rm -rf ~/ipython/ipython/dist/*
7 rm -rf ~/ipython/ipython/dist/*
8
8
9 # build source distros
9 # build source distros
10 cd ~/ipython/ipython
10 cd ~/ipython/ipython
11
11
12 ./setup.py sdist --formats=gztar
12 ./setup.py sdist --formats=gztar
13
13
14 # Build rpm
14 # Build rpms
15 #python2.4 ./setup.py bdist_rpm --binary-only --release=py24 --python=/usr/bin/python2.4
15 python2.4 ./setup.py bdist_rpm --binary-only --release=py24 --python=/usr/bin/python2.4
16 python2.5 ./setup.py bdist_rpm --binary-only --release=py25 --python=/usr/bin/python2.5
16
17
17 # Build eggs
18 # Build eggs
18 ./eggsetup.py bdist_egg
19 python2.4 ./eggsetup.py bdist_egg
20 python2.5 ./eggsetup.py bdist_egg
19
21
20 # Call the windows build separately, so that the extra Windows scripts don't
22 # Call the windows build separately, so that the extra Windows scripts don't
21 # get pulled into Unix builds (setup.py has code which checks for
23 # get pulled into Unix builds (setup.py has code which checks for
22 # bdist_wininst)
24 # bdist_wininst)
23
24 # For now, make the win32 installer with a hand-built 2.3.5 python, which is
25 # the only one that fixes a crash in the post-install phase.
26 #$HOME/tmp/local/bin/python2.3 setup.py bdist_wininst \
27 # --install-script=ipython_win_post_install.py
28
29 ./setup.py bdist_wininst --install-script=ipython_win_post_install.py
25 ./setup.py bdist_wininst --install-script=ipython_win_post_install.py
General Comments 0
You need to be logged in to leave comments. Login now