##// END OF EJS Templates
Jorgen Stenarson's patch (minor mods) to support network shares under win32.
fperez -
Show More
@@ -1,1680 +1,1705 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 General purpose utilities.
3 General purpose utilities.
4
4
5 This is a grab-bag of stuff I find useful in most programs I write. Some of
5 This is a grab-bag of stuff I find useful in most programs I write. Some of
6 these things are also convenient when working at the command line.
6 these things are also convenient when working at the command line.
7
7
8 $Id: genutils.py 971 2005-12-29 18:30:45Z fperez $"""
8 $Id: genutils.py 972 2005-12-29 18:45:19Z fperez $"""
9
9
10 #*****************************************************************************
10 #*****************************************************************************
11 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
11 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
12 #
12 #
13 # Distributed under the terms of the BSD License. The full license is in
13 # Distributed under the terms of the BSD License. The full license is in
14 # the file COPYING, distributed as part of this software.
14 # the file COPYING, distributed as part of this software.
15 #*****************************************************************************
15 #*****************************************************************************
16
16
17 from __future__ import generators # 2.2 compatibility
17 from __future__ import generators # 2.2 compatibility
18
18
19 from IPython import Release
19 from IPython import Release
20 __author__ = '%s <%s>' % Release.authors['Fernando']
20 __author__ = '%s <%s>' % Release.authors['Fernando']
21 __license__ = Release.license
21 __license__ = Release.license
22
22
23 #****************************************************************************
23 #****************************************************************************
24 # required modules from the Python standard library
24 # required modules from the Python standard library
25 import __main__
25 import __main__
26 import commands
26 import commands
27 import os
27 import os
28 import re
28 import re
29 import shlex
29 import shlex
30 import shutil
30 import shutil
31 import sys
31 import sys
32 import tempfile
32 import tempfile
33 import time
33 import time
34 import types
34 import types
35
35
36 # Other IPython utilities
36 # Other IPython utilities
37 from IPython.Itpl import Itpl,itpl,printpl
37 from IPython.Itpl import Itpl,itpl,printpl
38 from IPython import DPyGetOpt
38 from IPython import DPyGetOpt
39
39
40 if os.name == "nt":
40 if os.name == "nt":
41 from IPython.winconsole import get_console_size
41 from IPython.winconsole import get_console_size
42
42
43 # Build objects which appeared in Python 2.3 for 2.2, to make ipython
43 # Build objects which appeared in Python 2.3 for 2.2, to make ipython
44 # 2.2-friendly
44 # 2.2-friendly
45 try:
45 try:
46 basestring
46 basestring
47 except NameError:
47 except NameError:
48 import types
48 import types
49 basestring = (types.StringType, types.UnicodeType)
49 basestring = (types.StringType, types.UnicodeType)
50 True = 1==1
50 True = 1==1
51 False = 1==0
51 False = 1==0
52
52
53 def enumerate(obj):
53 def enumerate(obj):
54 i = -1
54 i = -1
55 for item in obj:
55 for item in obj:
56 i += 1
56 i += 1
57 yield i, item
57 yield i, item
58
58
59 # add these to the builtin namespace, so that all modules find them
59 # add these to the builtin namespace, so that all modules find them
60 import __builtin__
60 import __builtin__
61 __builtin__.basestring = basestring
61 __builtin__.basestring = basestring
62 __builtin__.True = True
62 __builtin__.True = True
63 __builtin__.False = False
63 __builtin__.False = False
64 __builtin__.enumerate = enumerate
64 __builtin__.enumerate = enumerate
65
65
66 # Try to use shlex.split for converting an input string into a sys.argv-type
66 # Try to use shlex.split for converting an input string into a sys.argv-type
67 # list. This appeared in Python 2.3, so here's a quick backport for 2.2.
67 # list. This appeared in Python 2.3, so here's a quick backport for 2.2.
68 try:
68 try:
69 shlex_split = shlex.split
69 shlex_split = shlex.split
70 except AttributeError:
70 except AttributeError:
71 _quotesre = re.compile(r'[\'"](.*)[\'"]')
71 _quotesre = re.compile(r'[\'"](.*)[\'"]')
72 _wordchars = ('abcdfeghijklmnopqrstuvwxyz'
72 _wordchars = ('abcdfeghijklmnopqrstuvwxyz'
73 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.~*?'
73 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.~*?'
74 'ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ'
74 'ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ'
75 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ%s'
75 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ%s'
76 % os.sep)
76 % os.sep)
77
77
78 def shlex_split(s):
78 def shlex_split(s):
79 """Simplified backport to Python 2.2 of shlex.split().
79 """Simplified backport to Python 2.2 of shlex.split().
80
80
81 This is a quick and dirty hack, since the shlex module under 2.2 lacks
81 This is a quick and dirty hack, since the shlex module under 2.2 lacks
82 several of the features needed to really match the functionality of
82 several of the features needed to really match the functionality of
83 shlex.split() in 2.3."""
83 shlex.split() in 2.3."""
84
84
85 lex = shlex.shlex(StringIO(s))
85 lex = shlex.shlex(StringIO(s))
86 # Try to get options, extensions and path separators as characters
86 # Try to get options, extensions and path separators as characters
87 lex.wordchars = _wordchars
87 lex.wordchars = _wordchars
88 lex.commenters = ''
88 lex.commenters = ''
89 # Make a list out of the lexer by hand, since in 2.2 it's not an
89 # Make a list out of the lexer by hand, since in 2.2 it's not an
90 # iterator.
90 # iterator.
91 lout = []
91 lout = []
92 while 1:
92 while 1:
93 token = lex.get_token()
93 token = lex.get_token()
94 if token == '':
94 if token == '':
95 break
95 break
96 # Try to handle quoted tokens correctly
96 # Try to handle quoted tokens correctly
97 quotes = _quotesre.match(token)
97 quotes = _quotesre.match(token)
98 if quotes:
98 if quotes:
99 token = quotes.group(1)
99 token = quotes.group(1)
100 lout.append(token)
100 lout.append(token)
101 return lout
101 return lout
102
102
103 #****************************************************************************
103 #****************************************************************************
104 # Exceptions
104 # Exceptions
105 class Error(Exception):
105 class Error(Exception):
106 """Base class for exceptions in this module."""
106 """Base class for exceptions in this module."""
107 pass
107 pass
108
108
109 #----------------------------------------------------------------------------
109 #----------------------------------------------------------------------------
110 class IOStream:
110 class IOStream:
111 def __init__(self,stream,fallback):
111 def __init__(self,stream,fallback):
112 if not hasattr(stream,'write') or not hasattr(stream,'flush'):
112 if not hasattr(stream,'write') or not hasattr(stream,'flush'):
113 stream = fallback
113 stream = fallback
114 self.stream = stream
114 self.stream = stream
115 self._swrite = stream.write
115 self._swrite = stream.write
116 self.flush = stream.flush
116 self.flush = stream.flush
117
117
118 def write(self,data):
118 def write(self,data):
119 try:
119 try:
120 self._swrite(data)
120 self._swrite(data)
121 except:
121 except:
122 try:
122 try:
123 # print handles some unicode issues which may trip a plain
123 # print handles some unicode issues which may trip a plain
124 # write() call. Attempt to emulate write() by using a
124 # write() call. Attempt to emulate write() by using a
125 # trailing comma
125 # trailing comma
126 print >> self.stream, data,
126 print >> self.stream, data,
127 except:
127 except:
128 # if we get here, something is seriously broken.
128 # if we get here, something is seriously broken.
129 print >> sys.stderr, \
129 print >> sys.stderr, \
130 'ERROR - failed to write data to stream:', stream
130 'ERROR - failed to write data to stream:', stream
131
131
132 class IOTerm:
132 class IOTerm:
133 """ Term holds the file or file-like objects for handling I/O operations.
133 """ Term holds the file or file-like objects for handling I/O operations.
134
134
135 These are normally just sys.stdin, sys.stdout and sys.stderr but for
135 These are normally just sys.stdin, sys.stdout and sys.stderr but for
136 Windows they can can replaced to allow editing the strings before they are
136 Windows they can can replaced to allow editing the strings before they are
137 displayed."""
137 displayed."""
138
138
139 # In the future, having IPython channel all its I/O operations through
139 # In the future, having IPython channel all its I/O operations through
140 # this class will make it easier to embed it into other environments which
140 # this class will make it easier to embed it into other environments which
141 # are not a normal terminal (such as a GUI-based shell)
141 # are not a normal terminal (such as a GUI-based shell)
142 def __init__(self,cin=None,cout=None,cerr=None):
142 def __init__(self,cin=None,cout=None,cerr=None):
143 self.cin = IOStream(cin,sys.stdin)
143 self.cin = IOStream(cin,sys.stdin)
144 self.cout = IOStream(cout,sys.stdout)
144 self.cout = IOStream(cout,sys.stdout)
145 self.cerr = IOStream(cerr,sys.stderr)
145 self.cerr = IOStream(cerr,sys.stderr)
146
146
147 # Global variable to be used for all I/O
147 # Global variable to be used for all I/O
148 Term = IOTerm()
148 Term = IOTerm()
149
149
150 # Windows-specific code to load Gary Bishop's readline and configure it
150 # Windows-specific code to load Gary Bishop's readline and configure it
151 # automatically for the users
151 # automatically for the users
152 # Note: os.name on cygwin returns posix, so this should only pick up 'native'
152 # Note: os.name on cygwin returns posix, so this should only pick up 'native'
153 # windows. Cygwin returns 'cygwin' for sys.platform.
153 # windows. Cygwin returns 'cygwin' for sys.platform.
154 if os.name == 'nt':
154 if os.name == 'nt':
155 try:
155 try:
156 import readline
156 import readline
157 except ImportError:
157 except ImportError:
158 pass
158 pass
159 else:
159 else:
160 try:
160 try:
161 _out = readline.GetOutputFile()
161 _out = readline.GetOutputFile()
162 except AttributeError:
162 except AttributeError:
163 pass
163 pass
164 else:
164 else:
165 # Remake Term to use the readline i/o facilities
165 # Remake Term to use the readline i/o facilities
166 Term = IOTerm(cout=_out,cerr=_out)
166 Term = IOTerm(cout=_out,cerr=_out)
167 del _out
167 del _out
168
168
169 #****************************************************************************
169 #****************************************************************************
170 # Generic warning/error printer, used by everything else
170 # Generic warning/error printer, used by everything else
171 def warn(msg,level=2,exit_val=1):
171 def warn(msg,level=2,exit_val=1):
172 """Standard warning printer. Gives formatting consistency.
172 """Standard warning printer. Gives formatting consistency.
173
173
174 Output is sent to Term.cerr (sys.stderr by default).
174 Output is sent to Term.cerr (sys.stderr by default).
175
175
176 Options:
176 Options:
177
177
178 -level(2): allows finer control:
178 -level(2): allows finer control:
179 0 -> Do nothing, dummy function.
179 0 -> Do nothing, dummy function.
180 1 -> Print message.
180 1 -> Print message.
181 2 -> Print 'WARNING:' + message. (Default level).
181 2 -> Print 'WARNING:' + message. (Default level).
182 3 -> Print 'ERROR:' + message.
182 3 -> Print 'ERROR:' + message.
183 4 -> Print 'FATAL ERROR:' + message and trigger a sys.exit(exit_val).
183 4 -> Print 'FATAL ERROR:' + message and trigger a sys.exit(exit_val).
184
184
185 -exit_val (1): exit value returned by sys.exit() for a level 4
185 -exit_val (1): exit value returned by sys.exit() for a level 4
186 warning. Ignored for all other levels."""
186 warning. Ignored for all other levels."""
187
187
188 if level>0:
188 if level>0:
189 header = ['','','WARNING: ','ERROR: ','FATAL ERROR: ']
189 header = ['','','WARNING: ','ERROR: ','FATAL ERROR: ']
190 print >> Term.cerr, '%s%s' % (header[level],msg)
190 print >> Term.cerr, '%s%s' % (header[level],msg)
191 if level == 4:
191 if level == 4:
192 print >> Term.cerr,'Exiting.\n'
192 print >> Term.cerr,'Exiting.\n'
193 sys.exit(exit_val)
193 sys.exit(exit_val)
194
194
195 def info(msg):
195 def info(msg):
196 """Equivalent to warn(msg,level=1)."""
196 """Equivalent to warn(msg,level=1)."""
197
197
198 warn(msg,level=1)
198 warn(msg,level=1)
199
199
200 def error(msg):
200 def error(msg):
201 """Equivalent to warn(msg,level=3)."""
201 """Equivalent to warn(msg,level=3)."""
202
202
203 warn(msg,level=3)
203 warn(msg,level=3)
204
204
205 def fatal(msg,exit_val=1):
205 def fatal(msg,exit_val=1):
206 """Equivalent to warn(msg,exit_val=exit_val,level=4)."""
206 """Equivalent to warn(msg,exit_val=exit_val,level=4)."""
207
207
208 warn(msg,exit_val=exit_val,level=4)
208 warn(msg,exit_val=exit_val,level=4)
209
209
210 #----------------------------------------------------------------------------
210 #----------------------------------------------------------------------------
211 StringTypes = types.StringTypes
211 StringTypes = types.StringTypes
212
212
213 # Basic timing functionality
213 # Basic timing functionality
214
214
215 # If possible (Unix), use the resource module instead of time.clock()
215 # If possible (Unix), use the resource module instead of time.clock()
216 try:
216 try:
217 import resource
217 import resource
218 def clock():
218 def clock():
219 """clock() -> floating point number
219 """clock() -> floating point number
220
220
221 Return the CPU time in seconds (user time only, system time is
221 Return the CPU time in seconds (user time only, system time is
222 ignored) since the start of the process. This is done via a call to
222 ignored) since the start of the process. This is done via a call to
223 resource.getrusage, so it avoids the wraparound problems in
223 resource.getrusage, so it avoids the wraparound problems in
224 time.clock()."""
224 time.clock()."""
225
225
226 return resource.getrusage(resource.RUSAGE_SELF)[0]
226 return resource.getrusage(resource.RUSAGE_SELF)[0]
227
227
228 def clock2():
228 def clock2():
229 """clock2() -> (t_user,t_system)
229 """clock2() -> (t_user,t_system)
230
230
231 Similar to clock(), but return a tuple of user/system times."""
231 Similar to clock(), but return a tuple of user/system times."""
232 return resource.getrusage(resource.RUSAGE_SELF)[:2]
232 return resource.getrusage(resource.RUSAGE_SELF)[:2]
233
233
234 except ImportError:
234 except ImportError:
235 clock = time.clock
235 clock = time.clock
236 def clock2():
236 def clock2():
237 """Under windows, system CPU time can't be measured.
237 """Under windows, system CPU time can't be measured.
238
238
239 This just returns clock() and zero."""
239 This just returns clock() and zero."""
240 return time.clock(),0.0
240 return time.clock(),0.0
241
241
242 def timings_out(reps,func,*args,**kw):
242 def timings_out(reps,func,*args,**kw):
243 """timings_out(reps,func,*args,**kw) -> (t_total,t_per_call,output)
243 """timings_out(reps,func,*args,**kw) -> (t_total,t_per_call,output)
244
244
245 Execute a function reps times, return a tuple with the elapsed total
245 Execute a function reps times, return a tuple with the elapsed total
246 CPU time in seconds, the time per call and the function's output.
246 CPU time in seconds, the time per call and the function's output.
247
247
248 Under Unix, the return value is the sum of user+system time consumed by
248 Under Unix, the return value is the sum of user+system time consumed by
249 the process, computed via the resource module. This prevents problems
249 the process, computed via the resource module. This prevents problems
250 related to the wraparound effect which the time.clock() function has.
250 related to the wraparound effect which the time.clock() function has.
251
251
252 Under Windows the return value is in wall clock seconds. See the
252 Under Windows the return value is in wall clock seconds. See the
253 documentation for the time module for more details."""
253 documentation for the time module for more details."""
254
254
255 reps = int(reps)
255 reps = int(reps)
256 assert reps >=1, 'reps must be >= 1'
256 assert reps >=1, 'reps must be >= 1'
257 if reps==1:
257 if reps==1:
258 start = clock()
258 start = clock()
259 out = func(*args,**kw)
259 out = func(*args,**kw)
260 tot_time = clock()-start
260 tot_time = clock()-start
261 else:
261 else:
262 rng = xrange(reps-1) # the last time is executed separately to store output
262 rng = xrange(reps-1) # the last time is executed separately to store output
263 start = clock()
263 start = clock()
264 for dummy in rng: func(*args,**kw)
264 for dummy in rng: func(*args,**kw)
265 out = func(*args,**kw) # one last time
265 out = func(*args,**kw) # one last time
266 tot_time = clock()-start
266 tot_time = clock()-start
267 av_time = tot_time / reps
267 av_time = tot_time / reps
268 return tot_time,av_time,out
268 return tot_time,av_time,out
269
269
270 def timings(reps,func,*args,**kw):
270 def timings(reps,func,*args,**kw):
271 """timings(reps,func,*args,**kw) -> (t_total,t_per_call)
271 """timings(reps,func,*args,**kw) -> (t_total,t_per_call)
272
272
273 Execute a function reps times, return a tuple with the elapsed total CPU
273 Execute a function reps times, return a tuple with the elapsed total CPU
274 time in seconds and the time per call. These are just the first two values
274 time in seconds and the time per call. These are just the first two values
275 in timings_out()."""
275 in timings_out()."""
276
276
277 return timings_out(reps,func,*args,**kw)[0:2]
277 return timings_out(reps,func,*args,**kw)[0:2]
278
278
279 def timing(func,*args,**kw):
279 def timing(func,*args,**kw):
280 """timing(func,*args,**kw) -> t_total
280 """timing(func,*args,**kw) -> t_total
281
281
282 Execute a function once, return the elapsed total CPU time in
282 Execute a function once, return the elapsed total CPU time in
283 seconds. This is just the first value in timings_out()."""
283 seconds. This is just the first value in timings_out()."""
284
284
285 return timings_out(1,func,*args,**kw)[0]
285 return timings_out(1,func,*args,**kw)[0]
286
286
287 #****************************************************************************
287 #****************************************************************************
288 # file and system
288 # file and system
289
289
290 def system(cmd,verbose=0,debug=0,header=''):
290 def system(cmd,verbose=0,debug=0,header=''):
291 """Execute a system command, return its exit status.
291 """Execute a system command, return its exit status.
292
292
293 Options:
293 Options:
294
294
295 - verbose (0): print the command to be executed.
295 - verbose (0): print the command to be executed.
296
296
297 - debug (0): only print, do not actually execute.
297 - debug (0): only print, do not actually execute.
298
298
299 - header (''): Header to print on screen prior to the executed command (it
299 - header (''): Header to print on screen prior to the executed command (it
300 is only prepended to the command, no newlines are added).
300 is only prepended to the command, no newlines are added).
301
301
302 Note: a stateful version of this function is available through the
302 Note: a stateful version of this function is available through the
303 SystemExec class."""
303 SystemExec class."""
304
304
305 stat = 0
305 stat = 0
306 if verbose or debug: print header+cmd
306 if verbose or debug: print header+cmd
307 sys.stdout.flush()
307 sys.stdout.flush()
308 if not debug: stat = os.system(cmd)
308 if not debug: stat = os.system(cmd)
309 return stat
309 return stat
310
310
311 # This function is used by ipython in a lot of places to make system calls.
312 # We need it to be slightly different under win32, due to the vagaries of
313 # 'network shares'. A win32 override is below.
314
311 def shell(cmd,verbose=0,debug=0,header=''):
315 def shell(cmd,verbose=0,debug=0,header=''):
312 """Execute a command in the system shell, always return None.
316 """Execute a command in the system shell, always return None.
313
317
314 Options:
318 Options:
315
319
316 - verbose (0): print the command to be executed.
320 - verbose (0): print the command to be executed.
317
321
318 - debug (0): only print, do not actually execute.
322 - debug (0): only print, do not actually execute.
319
323
320 - header (''): Header to print on screen prior to the executed command (it
324 - header (''): Header to print on screen prior to the executed command (it
321 is only prepended to the command, no newlines are added).
325 is only prepended to the command, no newlines are added).
322
326
323 Note: this is similar to genutils.system(), but it returns None so it can
327 Note: this is similar to genutils.system(), but it returns None so it can
324 be conveniently used in interactive loops without getting the return value
328 be conveniently used in interactive loops without getting the return value
325 (typically 0) printed many times."""
329 (typically 0) printed many times."""
326
330
327 stat = 0
331 stat = 0
328 if verbose or debug: print header+cmd
332 if verbose or debug: print header+cmd
329 # flush stdout so we don't mangle python's buffering
333 # flush stdout so we don't mangle python's buffering
330 sys.stdout.flush()
334 sys.stdout.flush()
331 if not debug:
335 if not debug:
332 os.system(cmd)
336 os.system(cmd)
333
337
338 # override shell() for win32 to deal with network shares
339 if os.name in ('nt','dos'):
340
341 shell_ori = shell
342
343 def shell(cmd,verbose=0,debug=0,header=''):
344 if os.getcwd().startswith(r"\\"):
345 path = os.getcwd()
346 # change to c drive (cannot be on UNC-share when issuing os.system,
347 # as cmd.exe cannot handle UNC addresses)
348 os.chdir("c:")
349 # issue pushd to the UNC-share and then run the command
350 try:
351 shell_ori('"pushd %s&&"'%path+cmd,verbose,debug,header)
352 finally:
353 os.chdir(path)
354 else:
355 shell_ori('"pushd %s&&"'%path+cmd,verbose,debug,header)
356
357 shell.__doc__ = shell_ori.__doc__
358
334 def getoutput(cmd,verbose=0,debug=0,header='',split=0):
359 def getoutput(cmd,verbose=0,debug=0,header='',split=0):
335 """Dummy substitute for perl's backquotes.
360 """Dummy substitute for perl's backquotes.
336
361
337 Executes a command and returns the output.
362 Executes a command and returns the output.
338
363
339 Accepts the same arguments as system(), plus:
364 Accepts the same arguments as system(), plus:
340
365
341 - split(0): if true, the output is returned as a list split on newlines.
366 - split(0): if true, the output is returned as a list split on newlines.
342
367
343 Note: a stateful version of this function is available through the
368 Note: a stateful version of this function is available through the
344 SystemExec class."""
369 SystemExec class."""
345
370
346 if verbose or debug: print header+cmd
371 if verbose or debug: print header+cmd
347 if not debug:
372 if not debug:
348 output = commands.getoutput(cmd)
373 output = commands.getoutput(cmd)
349 if split:
374 if split:
350 return output.split('\n')
375 return output.split('\n')
351 else:
376 else:
352 return output
377 return output
353
378
354 def getoutputerror(cmd,verbose=0,debug=0,header='',split=0):
379 def getoutputerror(cmd,verbose=0,debug=0,header='',split=0):
355 """Return (standard output,standard error) of executing cmd in a shell.
380 """Return (standard output,standard error) of executing cmd in a shell.
356
381
357 Accepts the same arguments as system(), plus:
382 Accepts the same arguments as system(), plus:
358
383
359 - split(0): if true, each of stdout/err is returned as a list split on
384 - split(0): if true, each of stdout/err is returned as a list split on
360 newlines.
385 newlines.
361
386
362 Note: a stateful version of this function is available through the
387 Note: a stateful version of this function is available through the
363 SystemExec class."""
388 SystemExec class."""
364
389
365 if verbose or debug: print header+cmd
390 if verbose or debug: print header+cmd
366 if not cmd:
391 if not cmd:
367 if split:
392 if split:
368 return [],[]
393 return [],[]
369 else:
394 else:
370 return '',''
395 return '',''
371 if not debug:
396 if not debug:
372 pin,pout,perr = os.popen3(cmd)
397 pin,pout,perr = os.popen3(cmd)
373 tout = pout.read().rstrip()
398 tout = pout.read().rstrip()
374 terr = perr.read().rstrip()
399 terr = perr.read().rstrip()
375 pin.close()
400 pin.close()
376 pout.close()
401 pout.close()
377 perr.close()
402 perr.close()
378 if split:
403 if split:
379 return tout.split('\n'),terr.split('\n')
404 return tout.split('\n'),terr.split('\n')
380 else:
405 else:
381 return tout,terr
406 return tout,terr
382
407
383 # for compatibility with older naming conventions
408 # for compatibility with older naming conventions
384 xsys = system
409 xsys = system
385 bq = getoutput
410 bq = getoutput
386
411
387 class SystemExec:
412 class SystemExec:
388 """Access the system and getoutput functions through a stateful interface.
413 """Access the system and getoutput functions through a stateful interface.
389
414
390 Note: here we refer to the system and getoutput functions from this
415 Note: here we refer to the system and getoutput functions from this
391 library, not the ones from the standard python library.
416 library, not the ones from the standard python library.
392
417
393 This class offers the system and getoutput functions as methods, but the
418 This class offers the system and getoutput functions as methods, but the
394 verbose, debug and header parameters can be set for the instance (at
419 verbose, debug and header parameters can be set for the instance (at
395 creation time or later) so that they don't need to be specified on each
420 creation time or later) so that they don't need to be specified on each
396 call.
421 call.
397
422
398 For efficiency reasons, there's no way to override the parameters on a
423 For efficiency reasons, there's no way to override the parameters on a
399 per-call basis other than by setting instance attributes. If you need
424 per-call basis other than by setting instance attributes. If you need
400 local overrides, it's best to directly call system() or getoutput().
425 local overrides, it's best to directly call system() or getoutput().
401
426
402 The following names are provided as alternate options:
427 The following names are provided as alternate options:
403 - xsys: alias to system
428 - xsys: alias to system
404 - bq: alias to getoutput
429 - bq: alias to getoutput
405
430
406 An instance can then be created as:
431 An instance can then be created as:
407 >>> sysexec = SystemExec(verbose=1,debug=0,header='Calling: ')
432 >>> sysexec = SystemExec(verbose=1,debug=0,header='Calling: ')
408
433
409 And used as:
434 And used as:
410 >>> sysexec.xsys('pwd')
435 >>> sysexec.xsys('pwd')
411 >>> dirlist = sysexec.bq('ls -l')
436 >>> dirlist = sysexec.bq('ls -l')
412 """
437 """
413
438
414 def __init__(self,verbose=0,debug=0,header='',split=0):
439 def __init__(self,verbose=0,debug=0,header='',split=0):
415 """Specify the instance's values for verbose, debug and header."""
440 """Specify the instance's values for verbose, debug and header."""
416 setattr_list(self,'verbose debug header split')
441 setattr_list(self,'verbose debug header split')
417
442
418 def system(self,cmd):
443 def system(self,cmd):
419 """Stateful interface to system(), with the same keyword parameters."""
444 """Stateful interface to system(), with the same keyword parameters."""
420
445
421 system(cmd,self.verbose,self.debug,self.header)
446 system(cmd,self.verbose,self.debug,self.header)
422
447
423 def shell(self,cmd):
448 def shell(self,cmd):
424 """Stateful interface to shell(), with the same keyword parameters."""
449 """Stateful interface to shell(), with the same keyword parameters."""
425
450
426 shell(cmd,self.verbose,self.debug,self.header)
451 shell(cmd,self.verbose,self.debug,self.header)
427
452
428 xsys = system # alias
453 xsys = system # alias
429
454
430 def getoutput(self,cmd):
455 def getoutput(self,cmd):
431 """Stateful interface to getoutput()."""
456 """Stateful interface to getoutput()."""
432
457
433 return getoutput(cmd,self.verbose,self.debug,self.header,self.split)
458 return getoutput(cmd,self.verbose,self.debug,self.header,self.split)
434
459
435 def getoutputerror(self,cmd):
460 def getoutputerror(self,cmd):
436 """Stateful interface to getoutputerror()."""
461 """Stateful interface to getoutputerror()."""
437
462
438 return getoutputerror(cmd,self.verbose,self.debug,self.header,self.split)
463 return getoutputerror(cmd,self.verbose,self.debug,self.header,self.split)
439
464
440 bq = getoutput # alias
465 bq = getoutput # alias
441
466
442 #-----------------------------------------------------------------------------
467 #-----------------------------------------------------------------------------
443 def mutex_opts(dict,ex_op):
468 def mutex_opts(dict,ex_op):
444 """Check for presence of mutually exclusive keys in a dict.
469 """Check for presence of mutually exclusive keys in a dict.
445
470
446 Call: mutex_opts(dict,[[op1a,op1b],[op2a,op2b]...]"""
471 Call: mutex_opts(dict,[[op1a,op1b],[op2a,op2b]...]"""
447 for op1,op2 in ex_op:
472 for op1,op2 in ex_op:
448 if op1 in dict and op2 in dict:
473 if op1 in dict and op2 in dict:
449 raise ValueError,'\n*** ERROR in Arguments *** '\
474 raise ValueError,'\n*** ERROR in Arguments *** '\
450 'Options '+op1+' and '+op2+' are mutually exclusive.'
475 'Options '+op1+' and '+op2+' are mutually exclusive.'
451
476
452 #-----------------------------------------------------------------------------
477 #-----------------------------------------------------------------------------
453 def get_py_filename(name):
478 def get_py_filename(name):
454 """Return a valid python filename in the current directory.
479 """Return a valid python filename in the current directory.
455
480
456 If the given name is not a file, it adds '.py' and searches again.
481 If the given name is not a file, it adds '.py' and searches again.
457 Raises IOError with an informative message if the file isn't found."""
482 Raises IOError with an informative message if the file isn't found."""
458
483
459 name = os.path.expanduser(name)
484 name = os.path.expanduser(name)
460 if not os.path.isfile(name) and not name.endswith('.py'):
485 if not os.path.isfile(name) and not name.endswith('.py'):
461 name += '.py'
486 name += '.py'
462 if os.path.isfile(name):
487 if os.path.isfile(name):
463 return name
488 return name
464 else:
489 else:
465 raise IOError,'File `%s` not found.' % name
490 raise IOError,'File `%s` not found.' % name
466
491
467 #-----------------------------------------------------------------------------
492 #-----------------------------------------------------------------------------
468 def filefind(fname,alt_dirs = None):
493 def filefind(fname,alt_dirs = None):
469 """Return the given filename either in the current directory, if it
494 """Return the given filename either in the current directory, if it
470 exists, or in a specified list of directories.
495 exists, or in a specified list of directories.
471
496
472 ~ expansion is done on all file and directory names.
497 ~ expansion is done on all file and directory names.
473
498
474 Upon an unsuccessful search, raise an IOError exception."""
499 Upon an unsuccessful search, raise an IOError exception."""
475
500
476 if alt_dirs is None:
501 if alt_dirs is None:
477 try:
502 try:
478 alt_dirs = get_home_dir()
503 alt_dirs = get_home_dir()
479 except HomeDirError:
504 except HomeDirError:
480 alt_dirs = os.getcwd()
505 alt_dirs = os.getcwd()
481 search = [fname] + list_strings(alt_dirs)
506 search = [fname] + list_strings(alt_dirs)
482 search = map(os.path.expanduser,search)
507 search = map(os.path.expanduser,search)
483 #print 'search list for',fname,'list:',search # dbg
508 #print 'search list for',fname,'list:',search # dbg
484 fname = search[0]
509 fname = search[0]
485 if os.path.isfile(fname):
510 if os.path.isfile(fname):
486 return fname
511 return fname
487 for direc in search[1:]:
512 for direc in search[1:]:
488 testname = os.path.join(direc,fname)
513 testname = os.path.join(direc,fname)
489 #print 'testname',testname # dbg
514 #print 'testname',testname # dbg
490 if os.path.isfile(testname):
515 if os.path.isfile(testname):
491 return testname
516 return testname
492 raise IOError,'File' + `fname` + \
517 raise IOError,'File' + `fname` + \
493 ' not found in current or supplied directories:' + `alt_dirs`
518 ' not found in current or supplied directories:' + `alt_dirs`
494
519
495 #----------------------------------------------------------------------------
520 #----------------------------------------------------------------------------
496 def file_read(filename):
521 def file_read(filename):
497 """Read a file and close it. Returns the file source."""
522 """Read a file and close it. Returns the file source."""
498 fobj=open(filename,'r');
523 fobj=open(filename,'r');
499 source = fobj.read();
524 source = fobj.read();
500 fobj.close()
525 fobj.close()
501 return source
526 return source
502
527
503 #----------------------------------------------------------------------------
528 #----------------------------------------------------------------------------
504 def target_outdated(target,deps):
529 def target_outdated(target,deps):
505 """Determine whether a target is out of date.
530 """Determine whether a target is out of date.
506
531
507 target_outdated(target,deps) -> 1/0
532 target_outdated(target,deps) -> 1/0
508
533
509 deps: list of filenames which MUST exist.
534 deps: list of filenames which MUST exist.
510 target: single filename which may or may not exist.
535 target: single filename which may or may not exist.
511
536
512 If target doesn't exist or is older than any file listed in deps, return
537 If target doesn't exist or is older than any file listed in deps, return
513 true, otherwise return false.
538 true, otherwise return false.
514 """
539 """
515 try:
540 try:
516 target_time = os.path.getmtime(target)
541 target_time = os.path.getmtime(target)
517 except os.error:
542 except os.error:
518 return 1
543 return 1
519 for dep in deps:
544 for dep in deps:
520 dep_time = os.path.getmtime(dep)
545 dep_time = os.path.getmtime(dep)
521 if dep_time > target_time:
546 if dep_time > target_time:
522 #print "For target",target,"Dep failed:",dep # dbg
547 #print "For target",target,"Dep failed:",dep # dbg
523 #print "times (dep,tar):",dep_time,target_time # dbg
548 #print "times (dep,tar):",dep_time,target_time # dbg
524 return 1
549 return 1
525 return 0
550 return 0
526
551
527 #-----------------------------------------------------------------------------
552 #-----------------------------------------------------------------------------
528 def target_update(target,deps,cmd):
553 def target_update(target,deps,cmd):
529 """Update a target with a given command given a list of dependencies.
554 """Update a target with a given command given a list of dependencies.
530
555
531 target_update(target,deps,cmd) -> runs cmd if target is outdated.
556 target_update(target,deps,cmd) -> runs cmd if target is outdated.
532
557
533 This is just a wrapper around target_outdated() which calls the given
558 This is just a wrapper around target_outdated() which calls the given
534 command if target is outdated."""
559 command if target is outdated."""
535
560
536 if target_outdated(target,deps):
561 if target_outdated(target,deps):
537 xsys(cmd)
562 xsys(cmd)
538
563
539 #----------------------------------------------------------------------------
564 #----------------------------------------------------------------------------
540 def unquote_ends(istr):
565 def unquote_ends(istr):
541 """Remove a single pair of quotes from the endpoints of a string."""
566 """Remove a single pair of quotes from the endpoints of a string."""
542
567
543 if not istr:
568 if not istr:
544 return istr
569 return istr
545 if (istr[0]=="'" and istr[-1]=="'") or \
570 if (istr[0]=="'" and istr[-1]=="'") or \
546 (istr[0]=='"' and istr[-1]=='"'):
571 (istr[0]=='"' and istr[-1]=='"'):
547 return istr[1:-1]
572 return istr[1:-1]
548 else:
573 else:
549 return istr
574 return istr
550
575
551 #----------------------------------------------------------------------------
576 #----------------------------------------------------------------------------
552 def process_cmdline(argv,names=[],defaults={},usage=''):
577 def process_cmdline(argv,names=[],defaults={},usage=''):
553 """ Process command-line options and arguments.
578 """ Process command-line options and arguments.
554
579
555 Arguments:
580 Arguments:
556
581
557 - argv: list of arguments, typically sys.argv.
582 - argv: list of arguments, typically sys.argv.
558
583
559 - names: list of option names. See DPyGetOpt docs for details on options
584 - names: list of option names. See DPyGetOpt docs for details on options
560 syntax.
585 syntax.
561
586
562 - defaults: dict of default values.
587 - defaults: dict of default values.
563
588
564 - usage: optional usage notice to print if a wrong argument is passed.
589 - usage: optional usage notice to print if a wrong argument is passed.
565
590
566 Return a dict of options and a list of free arguments."""
591 Return a dict of options and a list of free arguments."""
567
592
568 getopt = DPyGetOpt.DPyGetOpt()
593 getopt = DPyGetOpt.DPyGetOpt()
569 getopt.setIgnoreCase(0)
594 getopt.setIgnoreCase(0)
570 getopt.parseConfiguration(names)
595 getopt.parseConfiguration(names)
571
596
572 try:
597 try:
573 getopt.processArguments(argv)
598 getopt.processArguments(argv)
574 except:
599 except:
575 print usage
600 print usage
576 warn(`sys.exc_value`,level=4)
601 warn(`sys.exc_value`,level=4)
577
602
578 defaults.update(getopt.optionValues)
603 defaults.update(getopt.optionValues)
579 args = getopt.freeValues
604 args = getopt.freeValues
580
605
581 return defaults,args
606 return defaults,args
582
607
583 #----------------------------------------------------------------------------
608 #----------------------------------------------------------------------------
584 def optstr2types(ostr):
609 def optstr2types(ostr):
585 """Convert a string of option names to a dict of type mappings.
610 """Convert a string of option names to a dict of type mappings.
586
611
587 optstr2types(str) -> {None:'string_opts',int:'int_opts',float:'float_opts'}
612 optstr2types(str) -> {None:'string_opts',int:'int_opts',float:'float_opts'}
588
613
589 This is used to get the types of all the options in a string formatted
614 This is used to get the types of all the options in a string formatted
590 with the conventions of DPyGetOpt. The 'type' None is used for options
615 with the conventions of DPyGetOpt. The 'type' None is used for options
591 which are strings (they need no further conversion). This function's main
616 which are strings (they need no further conversion). This function's main
592 use is to get a typemap for use with read_dict().
617 use is to get a typemap for use with read_dict().
593 """
618 """
594
619
595 typeconv = {None:'',int:'',float:''}
620 typeconv = {None:'',int:'',float:''}
596 typemap = {'s':None,'i':int,'f':float}
621 typemap = {'s':None,'i':int,'f':float}
597 opt_re = re.compile(r'([\w]*)([^:=]*:?=?)([sif]?)')
622 opt_re = re.compile(r'([\w]*)([^:=]*:?=?)([sif]?)')
598
623
599 for w in ostr.split():
624 for w in ostr.split():
600 oname,alias,otype = opt_re.match(w).groups()
625 oname,alias,otype = opt_re.match(w).groups()
601 if otype == '' or alias == '!': # simple switches are integers too
626 if otype == '' or alias == '!': # simple switches are integers too
602 otype = 'i'
627 otype = 'i'
603 typeconv[typemap[otype]] += oname + ' '
628 typeconv[typemap[otype]] += oname + ' '
604 return typeconv
629 return typeconv
605
630
606 #----------------------------------------------------------------------------
631 #----------------------------------------------------------------------------
607 def read_dict(filename,type_conv=None,**opt):
632 def read_dict(filename,type_conv=None,**opt):
608
633
609 """Read a dictionary of key=value pairs from an input file, optionally
634 """Read a dictionary of key=value pairs from an input file, optionally
610 performing conversions on the resulting values.
635 performing conversions on the resulting values.
611
636
612 read_dict(filename,type_conv,**opt) -> dict
637 read_dict(filename,type_conv,**opt) -> dict
613
638
614 Only one value per line is accepted, the format should be
639 Only one value per line is accepted, the format should be
615 # optional comments are ignored
640 # optional comments are ignored
616 key value\n
641 key value\n
617
642
618 Args:
643 Args:
619
644
620 - type_conv: A dictionary specifying which keys need to be converted to
645 - type_conv: A dictionary specifying which keys need to be converted to
621 which types. By default all keys are read as strings. This dictionary
646 which types. By default all keys are read as strings. This dictionary
622 should have as its keys valid conversion functions for strings
647 should have as its keys valid conversion functions for strings
623 (int,long,float,complex, or your own). The value for each key
648 (int,long,float,complex, or your own). The value for each key
624 (converter) should be a whitespace separated string containing the names
649 (converter) should be a whitespace separated string containing the names
625 of all the entries in the file to be converted using that function. For
650 of all the entries in the file to be converted using that function. For
626 keys to be left alone, use None as the conversion function (only needed
651 keys to be left alone, use None as the conversion function (only needed
627 with purge=1, see below).
652 with purge=1, see below).
628
653
629 - opt: dictionary with extra options as below (default in parens)
654 - opt: dictionary with extra options as below (default in parens)
630
655
631 purge(0): if set to 1, all keys *not* listed in type_conv are purged out
656 purge(0): if set to 1, all keys *not* listed in type_conv are purged out
632 of the dictionary to be returned. If purge is going to be used, the
657 of the dictionary to be returned. If purge is going to be used, the
633 set of keys to be left as strings also has to be explicitly specified
658 set of keys to be left as strings also has to be explicitly specified
634 using the (non-existent) conversion function None.
659 using the (non-existent) conversion function None.
635
660
636 fs(None): field separator. This is the key/value separator to be used
661 fs(None): field separator. This is the key/value separator to be used
637 when parsing the file. The None default means any whitespace [behavior
662 when parsing the file. The None default means any whitespace [behavior
638 of string.split()].
663 of string.split()].
639
664
640 strip(0): if 1, strip string values of leading/trailinig whitespace.
665 strip(0): if 1, strip string values of leading/trailinig whitespace.
641
666
642 warn(1): warning level if requested keys are not found in file.
667 warn(1): warning level if requested keys are not found in file.
643 - 0: silently ignore.
668 - 0: silently ignore.
644 - 1: inform but proceed.
669 - 1: inform but proceed.
645 - 2: raise KeyError exception.
670 - 2: raise KeyError exception.
646
671
647 no_empty(0): if 1, remove keys with whitespace strings as a value.
672 no_empty(0): if 1, remove keys with whitespace strings as a value.
648
673
649 unique([]): list of keys (or space separated string) which can't be
674 unique([]): list of keys (or space separated string) which can't be
650 repeated. If one such key is found in the file, each new instance
675 repeated. If one such key is found in the file, each new instance
651 overwrites the previous one. For keys not listed here, the behavior is
676 overwrites the previous one. For keys not listed here, the behavior is
652 to make a list of all appearances.
677 to make a list of all appearances.
653
678
654 Example:
679 Example:
655 If the input file test.ini has:
680 If the input file test.ini has:
656 i 3
681 i 3
657 x 4.5
682 x 4.5
658 y 5.5
683 y 5.5
659 s hi ho
684 s hi ho
660 Then:
685 Then:
661
686
662 >>> type_conv={int:'i',float:'x',None:'s'}
687 >>> type_conv={int:'i',float:'x',None:'s'}
663 >>> read_dict('test.ini')
688 >>> read_dict('test.ini')
664 {'i': '3', 's': 'hi ho', 'x': '4.5', 'y': '5.5'}
689 {'i': '3', 's': 'hi ho', 'x': '4.5', 'y': '5.5'}
665 >>> read_dict('test.ini',type_conv)
690 >>> read_dict('test.ini',type_conv)
666 {'i': 3, 's': 'hi ho', 'x': 4.5, 'y': '5.5'}
691 {'i': 3, 's': 'hi ho', 'x': 4.5, 'y': '5.5'}
667 >>> read_dict('test.ini',type_conv,purge=1)
692 >>> read_dict('test.ini',type_conv,purge=1)
668 {'i': 3, 's': 'hi ho', 'x': 4.5}
693 {'i': 3, 's': 'hi ho', 'x': 4.5}
669 """
694 """
670
695
671 # starting config
696 # starting config
672 opt.setdefault('purge',0)
697 opt.setdefault('purge',0)
673 opt.setdefault('fs',None) # field sep defaults to any whitespace
698 opt.setdefault('fs',None) # field sep defaults to any whitespace
674 opt.setdefault('strip',0)
699 opt.setdefault('strip',0)
675 opt.setdefault('warn',1)
700 opt.setdefault('warn',1)
676 opt.setdefault('no_empty',0)
701 opt.setdefault('no_empty',0)
677 opt.setdefault('unique','')
702 opt.setdefault('unique','')
678 if type(opt['unique']) in StringTypes:
703 if type(opt['unique']) in StringTypes:
679 unique_keys = qw(opt['unique'])
704 unique_keys = qw(opt['unique'])
680 elif type(opt['unique']) in (types.TupleType,types.ListType):
705 elif type(opt['unique']) in (types.TupleType,types.ListType):
681 unique_keys = opt['unique']
706 unique_keys = opt['unique']
682 else:
707 else:
683 raise ValueError, 'Unique keys must be given as a string, List or Tuple'
708 raise ValueError, 'Unique keys must be given as a string, List or Tuple'
684
709
685 dict = {}
710 dict = {}
686 # first read in table of values as strings
711 # first read in table of values as strings
687 file = open(filename,'r')
712 file = open(filename,'r')
688 for line in file.readlines():
713 for line in file.readlines():
689 line = line.strip()
714 line = line.strip()
690 if len(line) and line[0]=='#': continue
715 if len(line) and line[0]=='#': continue
691 if len(line)>0:
716 if len(line)>0:
692 lsplit = line.split(opt['fs'],1)
717 lsplit = line.split(opt['fs'],1)
693 try:
718 try:
694 key,val = lsplit
719 key,val = lsplit
695 except ValueError:
720 except ValueError:
696 key,val = lsplit[0],''
721 key,val = lsplit[0],''
697 key = key.strip()
722 key = key.strip()
698 if opt['strip']: val = val.strip()
723 if opt['strip']: val = val.strip()
699 if val == "''" or val == '""': val = ''
724 if val == "''" or val == '""': val = ''
700 if opt['no_empty'] and (val=='' or val.isspace()):
725 if opt['no_empty'] and (val=='' or val.isspace()):
701 continue
726 continue
702 # if a key is found more than once in the file, build a list
727 # if a key is found more than once in the file, build a list
703 # unless it's in the 'unique' list. In that case, last found in file
728 # unless it's in the 'unique' list. In that case, last found in file
704 # takes precedence. User beware.
729 # takes precedence. User beware.
705 try:
730 try:
706 if dict[key] and key in unique_keys:
731 if dict[key] and key in unique_keys:
707 dict[key] = val
732 dict[key] = val
708 elif type(dict[key]) is types.ListType:
733 elif type(dict[key]) is types.ListType:
709 dict[key].append(val)
734 dict[key].append(val)
710 else:
735 else:
711 dict[key] = [dict[key],val]
736 dict[key] = [dict[key],val]
712 except KeyError:
737 except KeyError:
713 dict[key] = val
738 dict[key] = val
714 # purge if requested
739 # purge if requested
715 if opt['purge']:
740 if opt['purge']:
716 accepted_keys = qwflat(type_conv.values())
741 accepted_keys = qwflat(type_conv.values())
717 for key in dict.keys():
742 for key in dict.keys():
718 if key in accepted_keys: continue
743 if key in accepted_keys: continue
719 del(dict[key])
744 del(dict[key])
720 # now convert if requested
745 # now convert if requested
721 if type_conv==None: return dict
746 if type_conv==None: return dict
722 conversions = type_conv.keys()
747 conversions = type_conv.keys()
723 try: conversions.remove(None)
748 try: conversions.remove(None)
724 except: pass
749 except: pass
725 for convert in conversions:
750 for convert in conversions:
726 for val in qw(type_conv[convert]):
751 for val in qw(type_conv[convert]):
727 try:
752 try:
728 dict[val] = convert(dict[val])
753 dict[val] = convert(dict[val])
729 except KeyError,e:
754 except KeyError,e:
730 if opt['warn'] == 0:
755 if opt['warn'] == 0:
731 pass
756 pass
732 elif opt['warn'] == 1:
757 elif opt['warn'] == 1:
733 print >>sys.stderr, 'Warning: key',val,\
758 print >>sys.stderr, 'Warning: key',val,\
734 'not found in file',filename
759 'not found in file',filename
735 elif opt['warn'] == 2:
760 elif opt['warn'] == 2:
736 raise KeyError,e
761 raise KeyError,e
737 else:
762 else:
738 raise ValueError,'Warning level must be 0,1 or 2'
763 raise ValueError,'Warning level must be 0,1 or 2'
739
764
740 return dict
765 return dict
741
766
742 #----------------------------------------------------------------------------
767 #----------------------------------------------------------------------------
743 def flag_calls(func):
768 def flag_calls(func):
744 """Wrap a function to detect and flag when it gets called.
769 """Wrap a function to detect and flag when it gets called.
745
770
746 This is a decorator which takes a function and wraps it in a function with
771 This is a decorator which takes a function and wraps it in a function with
747 a 'called' attribute. wrapper.called is initialized to False.
772 a 'called' attribute. wrapper.called is initialized to False.
748
773
749 The wrapper.called attribute is set to False right before each call to the
774 The wrapper.called attribute is set to False right before each call to the
750 wrapped function, so if the call fails it remains False. After the call
775 wrapped function, so if the call fails it remains False. After the call
751 completes, wrapper.called is set to True and the output is returned.
776 completes, wrapper.called is set to True and the output is returned.
752
777
753 Testing for truth in wrapper.called allows you to determine if a call to
778 Testing for truth in wrapper.called allows you to determine if a call to
754 func() was attempted and succeeded."""
779 func() was attempted and succeeded."""
755
780
756 def wrapper(*args,**kw):
781 def wrapper(*args,**kw):
757 wrapper.called = False
782 wrapper.called = False
758 out = func(*args,**kw)
783 out = func(*args,**kw)
759 wrapper.called = True
784 wrapper.called = True
760 return out
785 return out
761
786
762 wrapper.called = False
787 wrapper.called = False
763 wrapper.__doc__ = func.__doc__
788 wrapper.__doc__ = func.__doc__
764 return wrapper
789 return wrapper
765
790
766 #----------------------------------------------------------------------------
791 #----------------------------------------------------------------------------
767 class HomeDirError(Error):
792 class HomeDirError(Error):
768 pass
793 pass
769
794
770 def get_home_dir():
795 def get_home_dir():
771 """Return the closest possible equivalent to a 'home' directory.
796 """Return the closest possible equivalent to a 'home' directory.
772
797
773 We first try $HOME. Absent that, on NT it's $HOMEDRIVE\$HOMEPATH.
798 We first try $HOME. Absent that, on NT it's $HOMEDRIVE\$HOMEPATH.
774
799
775 Currently only Posix and NT are implemented, a HomeDirError exception is
800 Currently only Posix and NT are implemented, a HomeDirError exception is
776 raised for all other OSes. """
801 raised for all other OSes. """
777
802
778 isdir = os.path.isdir
803 isdir = os.path.isdir
779 env = os.environ
804 env = os.environ
780 try:
805 try:
781 homedir = env['HOME']
806 homedir = env['HOME']
782 if not isdir(homedir):
807 if not isdir(homedir):
783 # in case a user stuck some string which does NOT resolve to a
808 # in case a user stuck some string which does NOT resolve to a
784 # valid path, it's as good as if we hadn't foud it
809 # valid path, it's as good as if we hadn't foud it
785 raise KeyError
810 raise KeyError
786 return homedir
811 return homedir
787 except KeyError:
812 except KeyError:
788 if os.name == 'posix':
813 if os.name == 'posix':
789 raise HomeDirError,'undefined $HOME, IPython can not proceed.'
814 raise HomeDirError,'undefined $HOME, IPython can not proceed.'
790 elif os.name == 'nt':
815 elif os.name == 'nt':
791 # For some strange reason, win9x returns 'nt' for os.name.
816 # For some strange reason, win9x returns 'nt' for os.name.
792 try:
817 try:
793 homedir = os.path.join(env['HOMEDRIVE'],env['HOMEPATH'])
818 homedir = os.path.join(env['HOMEDRIVE'],env['HOMEPATH'])
794 if not isdir(homedir):
819 if not isdir(homedir):
795 homedir = os.path.join(env['USERPROFILE'])
820 homedir = os.path.join(env['USERPROFILE'])
796 if not isdir(homedir):
821 if not isdir(homedir):
797 raise HomeDirError
822 raise HomeDirError
798 return homedir
823 return homedir
799 except:
824 except:
800 try:
825 try:
801 # Use the registry to get the 'My Documents' folder.
826 # Use the registry to get the 'My Documents' folder.
802 import _winreg as wreg
827 import _winreg as wreg
803 key = wreg.OpenKey(wreg.HKEY_CURRENT_USER,
828 key = wreg.OpenKey(wreg.HKEY_CURRENT_USER,
804 "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders")
829 "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders")
805 homedir = wreg.QueryValueEx(key,'Personal')[0]
830 homedir = wreg.QueryValueEx(key,'Personal')[0]
806 key.Close()
831 key.Close()
807 if not isdir(homedir):
832 if not isdir(homedir):
808 e = ('Invalid "Personal" folder registry key '
833 e = ('Invalid "Personal" folder registry key '
809 'typically "My Documents".\n'
834 'typically "My Documents".\n'
810 'Value: %s\n'
835 'Value: %s\n'
811 'This is not a valid directory on your system.' %
836 'This is not a valid directory on your system.' %
812 homedir)
837 homedir)
813 raise HomeDirError(e)
838 raise HomeDirError(e)
814 return homedir
839 return homedir
815 except HomeDirError:
840 except HomeDirError:
816 raise
841 raise
817 except:
842 except:
818 return 'C:\\'
843 return 'C:\\'
819 elif os.name == 'dos':
844 elif os.name == 'dos':
820 # Desperate, may do absurd things in classic MacOS. May work under DOS.
845 # Desperate, may do absurd things in classic MacOS. May work under DOS.
821 return 'C:\\'
846 return 'C:\\'
822 else:
847 else:
823 raise HomeDirError,'support for your operating system not implemented.'
848 raise HomeDirError,'support for your operating system not implemented.'
824
849
825 #****************************************************************************
850 #****************************************************************************
826 # strings and text
851 # strings and text
827
852
828 class LSString(str):
853 class LSString(str):
829 """String derivative with a special access attributes.
854 """String derivative with a special access attributes.
830
855
831 These are normal strings, but with the special attributes:
856 These are normal strings, but with the special attributes:
832
857
833 .l (or .list) : value as list (split on newlines).
858 .l (or .list) : value as list (split on newlines).
834 .n (or .nlstr): original value (the string itself).
859 .n (or .nlstr): original value (the string itself).
835 .s (or .spstr): value as whitespace-separated string.
860 .s (or .spstr): value as whitespace-separated string.
836
861
837 Any values which require transformations are computed only once and
862 Any values which require transformations are computed only once and
838 cached.
863 cached.
839
864
840 Such strings are very useful to efficiently interact with the shell, which
865 Such strings are very useful to efficiently interact with the shell, which
841 typically only understands whitespace-separated options for commands."""
866 typically only understands whitespace-separated options for commands."""
842
867
843 def get_list(self):
868 def get_list(self):
844 try:
869 try:
845 return self.__list
870 return self.__list
846 except AttributeError:
871 except AttributeError:
847 self.__list = self.split('\n')
872 self.__list = self.split('\n')
848 return self.__list
873 return self.__list
849
874
850 l = list = property(get_list)
875 l = list = property(get_list)
851
876
852 def get_spstr(self):
877 def get_spstr(self):
853 try:
878 try:
854 return self.__spstr
879 return self.__spstr
855 except AttributeError:
880 except AttributeError:
856 self.__spstr = self.replace('\n',' ')
881 self.__spstr = self.replace('\n',' ')
857 return self.__spstr
882 return self.__spstr
858
883
859 s = spstr = property(get_spstr)
884 s = spstr = property(get_spstr)
860
885
861 def get_nlstr(self):
886 def get_nlstr(self):
862 return self
887 return self
863
888
864 n = nlstr = property(get_nlstr)
889 n = nlstr = property(get_nlstr)
865
890
866 #----------------------------------------------------------------------------
891 #----------------------------------------------------------------------------
867 class SList(list):
892 class SList(list):
868 """List derivative with a special access attributes.
893 """List derivative with a special access attributes.
869
894
870 These are normal lists, but with the special attributes:
895 These are normal lists, but with the special attributes:
871
896
872 .l (or .list) : value as list (the list itself).
897 .l (or .list) : value as list (the list itself).
873 .n (or .nlstr): value as a string, joined on newlines.
898 .n (or .nlstr): value as a string, joined on newlines.
874 .s (or .spstr): value as a string, joined on spaces.
899 .s (or .spstr): value as a string, joined on spaces.
875
900
876 Any values which require transformations are computed only once and
901 Any values which require transformations are computed only once and
877 cached."""
902 cached."""
878
903
879 def get_list(self):
904 def get_list(self):
880 return self
905 return self
881
906
882 l = list = property(get_list)
907 l = list = property(get_list)
883
908
884 def get_spstr(self):
909 def get_spstr(self):
885 try:
910 try:
886 return self.__spstr
911 return self.__spstr
887 except AttributeError:
912 except AttributeError:
888 self.__spstr = ' '.join(self)
913 self.__spstr = ' '.join(self)
889 return self.__spstr
914 return self.__spstr
890
915
891 s = spstr = property(get_spstr)
916 s = spstr = property(get_spstr)
892
917
893 def get_nlstr(self):
918 def get_nlstr(self):
894 try:
919 try:
895 return self.__nlstr
920 return self.__nlstr
896 except AttributeError:
921 except AttributeError:
897 self.__nlstr = '\n'.join(self)
922 self.__nlstr = '\n'.join(self)
898 return self.__nlstr
923 return self.__nlstr
899
924
900 n = nlstr = property(get_nlstr)
925 n = nlstr = property(get_nlstr)
901
926
902 #----------------------------------------------------------------------------
927 #----------------------------------------------------------------------------
903 # This can be replaced with an isspace() call once we drop 2.2 compatibility
928 # This can be replaced with an isspace() call once we drop 2.2 compatibility
904 _isspace_match = re.compile(r'^\s+$').match
929 _isspace_match = re.compile(r'^\s+$').match
905 def isspace(s):
930 def isspace(s):
906 return bool(_isspace_match(s))
931 return bool(_isspace_match(s))
907
932
908 #----------------------------------------------------------------------------
933 #----------------------------------------------------------------------------
909 def esc_quotes(strng):
934 def esc_quotes(strng):
910 """Return the input string with single and double quotes escaped out"""
935 """Return the input string with single and double quotes escaped out"""
911
936
912 return strng.replace('"','\\"').replace("'","\\'")
937 return strng.replace('"','\\"').replace("'","\\'")
913
938
914 #----------------------------------------------------------------------------
939 #----------------------------------------------------------------------------
915 def raw_input_multi(header='', ps1='==> ', ps2='..> ',terminate_str = '.'):
940 def raw_input_multi(header='', ps1='==> ', ps2='..> ',terminate_str = '.'):
916 """Take multiple lines of input.
941 """Take multiple lines of input.
917
942
918 A list with each line of input as a separate element is returned when a
943 A list with each line of input as a separate element is returned when a
919 termination string is entered (defaults to a single '.'). Input can also
944 termination string is entered (defaults to a single '.'). Input can also
920 terminate via EOF (^D in Unix, ^Z-RET in Windows).
945 terminate via EOF (^D in Unix, ^Z-RET in Windows).
921
946
922 Lines of input which end in \\ are joined into single entries (and a
947 Lines of input which end in \\ are joined into single entries (and a
923 secondary continuation prompt is issued as long as the user terminates
948 secondary continuation prompt is issued as long as the user terminates
924 lines with \\). This allows entering very long strings which are still
949 lines with \\). This allows entering very long strings which are still
925 meant to be treated as single entities.
950 meant to be treated as single entities.
926 """
951 """
927
952
928 try:
953 try:
929 if header:
954 if header:
930 header += '\n'
955 header += '\n'
931 lines = [raw_input(header + ps1)]
956 lines = [raw_input(header + ps1)]
932 except EOFError:
957 except EOFError:
933 return []
958 return []
934 terminate = [terminate_str]
959 terminate = [terminate_str]
935 try:
960 try:
936 while lines[-1:] != terminate:
961 while lines[-1:] != terminate:
937 new_line = raw_input(ps1)
962 new_line = raw_input(ps1)
938 while new_line.endswith('\\'):
963 while new_line.endswith('\\'):
939 new_line = new_line[:-1] + raw_input(ps2)
964 new_line = new_line[:-1] + raw_input(ps2)
940 lines.append(new_line)
965 lines.append(new_line)
941
966
942 return lines[:-1] # don't return the termination command
967 return lines[:-1] # don't return the termination command
943 except EOFError:
968 except EOFError:
944 print
969 print
945 return lines
970 return lines
946
971
947 #----------------------------------------------------------------------------
972 #----------------------------------------------------------------------------
948 def raw_input_ext(prompt='', ps2='... '):
973 def raw_input_ext(prompt='', ps2='... '):
949 """Similar to raw_input(), but accepts extended lines if input ends with \\."""
974 """Similar to raw_input(), but accepts extended lines if input ends with \\."""
950
975
951 line = raw_input(prompt)
976 line = raw_input(prompt)
952 while line.endswith('\\'):
977 while line.endswith('\\'):
953 line = line[:-1] + raw_input(ps2)
978 line = line[:-1] + raw_input(ps2)
954 return line
979 return line
955
980
956 #----------------------------------------------------------------------------
981 #----------------------------------------------------------------------------
957 def ask_yes_no(prompt,default=None):
982 def ask_yes_no(prompt,default=None):
958 """Asks a question and returns an integer 1/0 (y/n) answer.
983 """Asks a question and returns an integer 1/0 (y/n) answer.
959
984
960 If default is given (one of 'y','n'), it is used if the user input is
985 If default is given (one of 'y','n'), it is used if the user input is
961 empty. Otherwise the question is repeated until an answer is given.
986 empty. Otherwise the question is repeated until an answer is given.
962 If EOF occurs 20 times consecutively, the default answer is assumed,
987 If EOF occurs 20 times consecutively, the default answer is assumed,
963 or if there is no default, an exception is raised to prevent infinite
988 or if there is no default, an exception is raised to prevent infinite
964 loops.
989 loops.
965
990
966 Valid answers are: y/yes/n/no (match is not case sensitive)."""
991 Valid answers are: y/yes/n/no (match is not case sensitive)."""
967
992
968 answers = {'y':True,'n':False,'yes':True,'no':False}
993 answers = {'y':True,'n':False,'yes':True,'no':False}
969 ans = None
994 ans = None
970 eofs, max_eofs = 0, 20
995 eofs, max_eofs = 0, 20
971 while ans not in answers.keys():
996 while ans not in answers.keys():
972 try:
997 try:
973 ans = raw_input(prompt+' ').lower()
998 ans = raw_input(prompt+' ').lower()
974 if not ans: # response was an empty string
999 if not ans: # response was an empty string
975 ans = default
1000 ans = default
976 eofs = 0
1001 eofs = 0
977 except (EOFError,KeyboardInterrupt):
1002 except (EOFError,KeyboardInterrupt):
978 eofs = eofs + 1
1003 eofs = eofs + 1
979 if eofs >= max_eofs:
1004 if eofs >= max_eofs:
980 if default in answers.keys():
1005 if default in answers.keys():
981 ans = default
1006 ans = default
982 else:
1007 else:
983 raise
1008 raise
984
1009
985 return answers[ans]
1010 return answers[ans]
986
1011
987 #----------------------------------------------------------------------------
1012 #----------------------------------------------------------------------------
988 def marquee(txt='',width=78,mark='*'):
1013 def marquee(txt='',width=78,mark='*'):
989 """Return the input string centered in a 'marquee'."""
1014 """Return the input string centered in a 'marquee'."""
990 if not txt:
1015 if not txt:
991 return (mark*width)[:width]
1016 return (mark*width)[:width]
992 nmark = (width-len(txt)-2)/len(mark)/2
1017 nmark = (width-len(txt)-2)/len(mark)/2
993 if nmark < 0: nmark =0
1018 if nmark < 0: nmark =0
994 marks = mark*nmark
1019 marks = mark*nmark
995 return '%s %s %s' % (marks,txt,marks)
1020 return '%s %s %s' % (marks,txt,marks)
996
1021
997 #----------------------------------------------------------------------------
1022 #----------------------------------------------------------------------------
998 class EvalDict:
1023 class EvalDict:
999 """
1024 """
1000 Emulate a dict which evaluates its contents in the caller's frame.
1025 Emulate a dict which evaluates its contents in the caller's frame.
1001
1026
1002 Usage:
1027 Usage:
1003 >>>number = 19
1028 >>>number = 19
1004 >>>text = "python"
1029 >>>text = "python"
1005 >>>print "%(text.capitalize())s %(number/9.0).1f rules!" % EvalDict()
1030 >>>print "%(text.capitalize())s %(number/9.0).1f rules!" % EvalDict()
1006 """
1031 """
1007
1032
1008 # This version is due to sismex01@hebmex.com on c.l.py, and is basically a
1033 # This version is due to sismex01@hebmex.com on c.l.py, and is basically a
1009 # modified (shorter) version of:
1034 # modified (shorter) version of:
1010 # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66018 by
1035 # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66018 by
1011 # Skip Montanaro (skip@pobox.com).
1036 # Skip Montanaro (skip@pobox.com).
1012
1037
1013 def __getitem__(self, name):
1038 def __getitem__(self, name):
1014 frame = sys._getframe(1)
1039 frame = sys._getframe(1)
1015 return eval(name, frame.f_globals, frame.f_locals)
1040 return eval(name, frame.f_globals, frame.f_locals)
1016
1041
1017 EvalString = EvalDict # for backwards compatibility
1042 EvalString = EvalDict # for backwards compatibility
1018 #----------------------------------------------------------------------------
1043 #----------------------------------------------------------------------------
1019 def qw(words,flat=0,sep=None,maxsplit=-1):
1044 def qw(words,flat=0,sep=None,maxsplit=-1):
1020 """Similar to Perl's qw() operator, but with some more options.
1045 """Similar to Perl's qw() operator, but with some more options.
1021
1046
1022 qw(words,flat=0,sep=' ',maxsplit=-1) -> words.split(sep,maxsplit)
1047 qw(words,flat=0,sep=' ',maxsplit=-1) -> words.split(sep,maxsplit)
1023
1048
1024 words can also be a list itself, and with flat=1, the output will be
1049 words can also be a list itself, and with flat=1, the output will be
1025 recursively flattened. Examples:
1050 recursively flattened. Examples:
1026
1051
1027 >>> qw('1 2')
1052 >>> qw('1 2')
1028 ['1', '2']
1053 ['1', '2']
1029 >>> qw(['a b','1 2',['m n','p q']])
1054 >>> qw(['a b','1 2',['m n','p q']])
1030 [['a', 'b'], ['1', '2'], [['m', 'n'], ['p', 'q']]]
1055 [['a', 'b'], ['1', '2'], [['m', 'n'], ['p', 'q']]]
1031 >>> qw(['a b','1 2',['m n','p q']],flat=1)
1056 >>> qw(['a b','1 2',['m n','p q']],flat=1)
1032 ['a', 'b', '1', '2', 'm', 'n', 'p', 'q'] """
1057 ['a', 'b', '1', '2', 'm', 'n', 'p', 'q'] """
1033
1058
1034 if type(words) in StringTypes:
1059 if type(words) in StringTypes:
1035 return [word.strip() for word in words.split(sep,maxsplit)
1060 return [word.strip() for word in words.split(sep,maxsplit)
1036 if word and not word.isspace() ]
1061 if word and not word.isspace() ]
1037 if flat:
1062 if flat:
1038 return flatten(map(qw,words,[1]*len(words)))
1063 return flatten(map(qw,words,[1]*len(words)))
1039 return map(qw,words)
1064 return map(qw,words)
1040
1065
1041 #----------------------------------------------------------------------------
1066 #----------------------------------------------------------------------------
1042 def qwflat(words,sep=None,maxsplit=-1):
1067 def qwflat(words,sep=None,maxsplit=-1):
1043 """Calls qw(words) in flat mode. It's just a convenient shorthand."""
1068 """Calls qw(words) in flat mode. It's just a convenient shorthand."""
1044 return qw(words,1,sep,maxsplit)
1069 return qw(words,1,sep,maxsplit)
1045
1070
1046 #----------------------------------------------------------------------------
1071 #----------------------------------------------------------------------------
1047 def qw_lol(indata):
1072 def qw_lol(indata):
1048 """qw_lol('a b') -> [['a','b']],
1073 """qw_lol('a b') -> [['a','b']],
1049 otherwise it's just a call to qw().
1074 otherwise it's just a call to qw().
1050
1075
1051 We need this to make sure the modules_some keys *always* end up as a
1076 We need this to make sure the modules_some keys *always* end up as a
1052 list of lists."""
1077 list of lists."""
1053
1078
1054 if type(indata) in StringTypes:
1079 if type(indata) in StringTypes:
1055 return [qw(indata)]
1080 return [qw(indata)]
1056 else:
1081 else:
1057 return qw(indata)
1082 return qw(indata)
1058
1083
1059 #-----------------------------------------------------------------------------
1084 #-----------------------------------------------------------------------------
1060 def list_strings(arg):
1085 def list_strings(arg):
1061 """Always return a list of strings, given a string or list of strings
1086 """Always return a list of strings, given a string or list of strings
1062 as input."""
1087 as input."""
1063
1088
1064 if type(arg) in StringTypes: return [arg]
1089 if type(arg) in StringTypes: return [arg]
1065 else: return arg
1090 else: return arg
1066
1091
1067 #----------------------------------------------------------------------------
1092 #----------------------------------------------------------------------------
1068 def grep(pat,list,case=1):
1093 def grep(pat,list,case=1):
1069 """Simple minded grep-like function.
1094 """Simple minded grep-like function.
1070 grep(pat,list) returns occurrences of pat in list, None on failure.
1095 grep(pat,list) returns occurrences of pat in list, None on failure.
1071
1096
1072 It only does simple string matching, with no support for regexps. Use the
1097 It only does simple string matching, with no support for regexps. Use the
1073 option case=0 for case-insensitive matching."""
1098 option case=0 for case-insensitive matching."""
1074
1099
1075 # This is pretty crude. At least it should implement copying only references
1100 # This is pretty crude. At least it should implement copying only references
1076 # to the original data in case it's big. Now it copies the data for output.
1101 # to the original data in case it's big. Now it copies the data for output.
1077 out=[]
1102 out=[]
1078 if case:
1103 if case:
1079 for term in list:
1104 for term in list:
1080 if term.find(pat)>-1: out.append(term)
1105 if term.find(pat)>-1: out.append(term)
1081 else:
1106 else:
1082 lpat=pat.lower()
1107 lpat=pat.lower()
1083 for term in list:
1108 for term in list:
1084 if term.lower().find(lpat)>-1: out.append(term)
1109 if term.lower().find(lpat)>-1: out.append(term)
1085
1110
1086 if len(out): return out
1111 if len(out): return out
1087 else: return None
1112 else: return None
1088
1113
1089 #----------------------------------------------------------------------------
1114 #----------------------------------------------------------------------------
1090 def dgrep(pat,*opts):
1115 def dgrep(pat,*opts):
1091 """Return grep() on dir()+dir(__builtins__).
1116 """Return grep() on dir()+dir(__builtins__).
1092
1117
1093 A very common use of grep() when working interactively."""
1118 A very common use of grep() when working interactively."""
1094
1119
1095 return grep(pat,dir(__main__)+dir(__main__.__builtins__),*opts)
1120 return grep(pat,dir(__main__)+dir(__main__.__builtins__),*opts)
1096
1121
1097 #----------------------------------------------------------------------------
1122 #----------------------------------------------------------------------------
1098 def idgrep(pat):
1123 def idgrep(pat):
1099 """Case-insensitive dgrep()"""
1124 """Case-insensitive dgrep()"""
1100
1125
1101 return dgrep(pat,0)
1126 return dgrep(pat,0)
1102
1127
1103 #----------------------------------------------------------------------------
1128 #----------------------------------------------------------------------------
1104 def igrep(pat,list):
1129 def igrep(pat,list):
1105 """Synonym for case-insensitive grep."""
1130 """Synonym for case-insensitive grep."""
1106
1131
1107 return grep(pat,list,case=0)
1132 return grep(pat,list,case=0)
1108
1133
1109 #----------------------------------------------------------------------------
1134 #----------------------------------------------------------------------------
1110 def indent(str,nspaces=4,ntabs=0):
1135 def indent(str,nspaces=4,ntabs=0):
1111 """Indent a string a given number of spaces or tabstops.
1136 """Indent a string a given number of spaces or tabstops.
1112
1137
1113 indent(str,nspaces=4,ntabs=0) -> indent str by ntabs+nspaces.
1138 indent(str,nspaces=4,ntabs=0) -> indent str by ntabs+nspaces.
1114 """
1139 """
1115 if str is None:
1140 if str is None:
1116 return
1141 return
1117 ind = '\t'*ntabs+' '*nspaces
1142 ind = '\t'*ntabs+' '*nspaces
1118 outstr = '%s%s' % (ind,str.replace(os.linesep,os.linesep+ind))
1143 outstr = '%s%s' % (ind,str.replace(os.linesep,os.linesep+ind))
1119 if outstr.endswith(os.linesep+ind):
1144 if outstr.endswith(os.linesep+ind):
1120 return outstr[:-len(ind)]
1145 return outstr[:-len(ind)]
1121 else:
1146 else:
1122 return outstr
1147 return outstr
1123
1148
1124 #-----------------------------------------------------------------------------
1149 #-----------------------------------------------------------------------------
1125 def native_line_ends(filename,backup=1):
1150 def native_line_ends(filename,backup=1):
1126 """Convert (in-place) a file to line-ends native to the current OS.
1151 """Convert (in-place) a file to line-ends native to the current OS.
1127
1152
1128 If the optional backup argument is given as false, no backup of the
1153 If the optional backup argument is given as false, no backup of the
1129 original file is left. """
1154 original file is left. """
1130
1155
1131 backup_suffixes = {'posix':'~','dos':'.bak','nt':'.bak','mac':'.bak'}
1156 backup_suffixes = {'posix':'~','dos':'.bak','nt':'.bak','mac':'.bak'}
1132
1157
1133 bak_filename = filename + backup_suffixes[os.name]
1158 bak_filename = filename + backup_suffixes[os.name]
1134
1159
1135 original = open(filename).read()
1160 original = open(filename).read()
1136 shutil.copy2(filename,bak_filename)
1161 shutil.copy2(filename,bak_filename)
1137 try:
1162 try:
1138 new = open(filename,'wb')
1163 new = open(filename,'wb')
1139 new.write(os.linesep.join(original.splitlines()))
1164 new.write(os.linesep.join(original.splitlines()))
1140 new.write(os.linesep) # ALWAYS put an eol at the end of the file
1165 new.write(os.linesep) # ALWAYS put an eol at the end of the file
1141 new.close()
1166 new.close()
1142 except:
1167 except:
1143 os.rename(bak_filename,filename)
1168 os.rename(bak_filename,filename)
1144 if not backup:
1169 if not backup:
1145 try:
1170 try:
1146 os.remove(bak_filename)
1171 os.remove(bak_filename)
1147 except:
1172 except:
1148 pass
1173 pass
1149
1174
1150 #----------------------------------------------------------------------------
1175 #----------------------------------------------------------------------------
1151 def get_pager_cmd(pager_cmd = None):
1176 def get_pager_cmd(pager_cmd = None):
1152 """Return a pager command.
1177 """Return a pager command.
1153
1178
1154 Makes some attempts at finding an OS-correct one."""
1179 Makes some attempts at finding an OS-correct one."""
1155
1180
1156 if os.name == 'posix':
1181 if os.name == 'posix':
1157 default_pager_cmd = 'less -r' # -r for color control sequences
1182 default_pager_cmd = 'less -r' # -r for color control sequences
1158 elif os.name in ['nt','dos']:
1183 elif os.name in ['nt','dos']:
1159 default_pager_cmd = 'type'
1184 default_pager_cmd = 'type'
1160
1185
1161 if pager_cmd is None:
1186 if pager_cmd is None:
1162 try:
1187 try:
1163 pager_cmd = os.environ['PAGER']
1188 pager_cmd = os.environ['PAGER']
1164 except:
1189 except:
1165 pager_cmd = default_pager_cmd
1190 pager_cmd = default_pager_cmd
1166 return pager_cmd
1191 return pager_cmd
1167
1192
1168 #-----------------------------------------------------------------------------
1193 #-----------------------------------------------------------------------------
1169 def get_pager_start(pager,start):
1194 def get_pager_start(pager,start):
1170 """Return the string for paging files with an offset.
1195 """Return the string for paging files with an offset.
1171
1196
1172 This is the '+N' argument which less and more (under Unix) accept.
1197 This is the '+N' argument which less and more (under Unix) accept.
1173 """
1198 """
1174
1199
1175 if pager in ['less','more']:
1200 if pager in ['less','more']:
1176 if start:
1201 if start:
1177 start_string = '+' + str(start)
1202 start_string = '+' + str(start)
1178 else:
1203 else:
1179 start_string = ''
1204 start_string = ''
1180 else:
1205 else:
1181 start_string = ''
1206 start_string = ''
1182 return start_string
1207 return start_string
1183
1208
1184 #----------------------------------------------------------------------------
1209 #----------------------------------------------------------------------------
1185 if os.name == "nt":
1210 if os.name == "nt":
1186 import msvcrt
1211 import msvcrt
1187 def page_more():
1212 def page_more():
1188 """ Smart pausing between pages
1213 """ Smart pausing between pages
1189
1214
1190 @return: True if need print more lines, False if quit
1215 @return: True if need print more lines, False if quit
1191 """
1216 """
1192 Term.cout.write('---Return to continue, q to quit--- ')
1217 Term.cout.write('---Return to continue, q to quit--- ')
1193 ans = msvcrt.getch()
1218 ans = msvcrt.getch()
1194 if ans in ("q", "Q"):
1219 if ans in ("q", "Q"):
1195 result = False
1220 result = False
1196 else:
1221 else:
1197 result = True
1222 result = True
1198 Term.cout.write("\b"*37 + " "*37 + "\b"*37)
1223 Term.cout.write("\b"*37 + " "*37 + "\b"*37)
1199 return result
1224 return result
1200 else:
1225 else:
1201 def page_more():
1226 def page_more():
1202 ans = raw_input('---Return to continue, q to quit--- ')
1227 ans = raw_input('---Return to continue, q to quit--- ')
1203 if ans.lower().startswith('q'):
1228 if ans.lower().startswith('q'):
1204 return False
1229 return False
1205 else:
1230 else:
1206 return True
1231 return True
1207
1232
1208 esc_re = re.compile(r"(\x1b[^m]+m)")
1233 esc_re = re.compile(r"(\x1b[^m]+m)")
1209
1234
1210 def page_dumb(strng,start=0,screen_lines=25):
1235 def page_dumb(strng,start=0,screen_lines=25):
1211 """Very dumb 'pager' in Python, for when nothing else works.
1236 """Very dumb 'pager' in Python, for when nothing else works.
1212
1237
1213 Only moves forward, same interface as page(), except for pager_cmd and
1238 Only moves forward, same interface as page(), except for pager_cmd and
1214 mode."""
1239 mode."""
1215
1240
1216 out_ln = strng.splitlines()[start:]
1241 out_ln = strng.splitlines()[start:]
1217 screens = chop(out_ln,screen_lines-1)
1242 screens = chop(out_ln,screen_lines-1)
1218 if len(screens) == 1:
1243 if len(screens) == 1:
1219 print >>Term.cout, os.linesep.join(screens[0])
1244 print >>Term.cout, os.linesep.join(screens[0])
1220 else:
1245 else:
1221 last_escape = ""
1246 last_escape = ""
1222 for scr in screens[0:-1]:
1247 for scr in screens[0:-1]:
1223 hunk = os.linesep.join(scr)
1248 hunk = os.linesep.join(scr)
1224 print >>Term.cout, last_escape + hunk
1249 print >>Term.cout, last_escape + hunk
1225 if not page_more():
1250 if not page_more():
1226 return
1251 return
1227 esc_list = esc_re.findall(hunk)
1252 esc_list = esc_re.findall(hunk)
1228 if len(esc_list) > 0:
1253 if len(esc_list) > 0:
1229 last_escape = esc_list[-1]
1254 last_escape = esc_list[-1]
1230 print >>Term.cout, last_escape + os.linesep.join(screens[-1])
1255 print >>Term.cout, last_escape + os.linesep.join(screens[-1])
1231
1256
1232 #----------------------------------------------------------------------------
1257 #----------------------------------------------------------------------------
1233 def page(strng,start=0,screen_lines=0,pager_cmd = None):
1258 def page(strng,start=0,screen_lines=0,pager_cmd = None):
1234 """Print a string, piping through a pager after a certain length.
1259 """Print a string, piping through a pager after a certain length.
1235
1260
1236 The screen_lines parameter specifies the number of *usable* lines of your
1261 The screen_lines parameter specifies the number of *usable* lines of your
1237 terminal screen (total lines minus lines you need to reserve to show other
1262 terminal screen (total lines minus lines you need to reserve to show other
1238 information).
1263 information).
1239
1264
1240 If you set screen_lines to a number <=0, page() will try to auto-determine
1265 If you set screen_lines to a number <=0, page() will try to auto-determine
1241 your screen size and will only use up to (screen_size+screen_lines) for
1266 your screen size and will only use up to (screen_size+screen_lines) for
1242 printing, paging after that. That is, if you want auto-detection but need
1267 printing, paging after that. That is, if you want auto-detection but need
1243 to reserve the bottom 3 lines of the screen, use screen_lines = -3, and for
1268 to reserve the bottom 3 lines of the screen, use screen_lines = -3, and for
1244 auto-detection without any lines reserved simply use screen_lines = 0.
1269 auto-detection without any lines reserved simply use screen_lines = 0.
1245
1270
1246 If a string won't fit in the allowed lines, it is sent through the
1271 If a string won't fit in the allowed lines, it is sent through the
1247 specified pager command. If none given, look for PAGER in the environment,
1272 specified pager command. If none given, look for PAGER in the environment,
1248 and ultimately default to less.
1273 and ultimately default to less.
1249
1274
1250 If no system pager works, the string is sent through a 'dumb pager'
1275 If no system pager works, the string is sent through a 'dumb pager'
1251 written in python, very simplistic.
1276 written in python, very simplistic.
1252 """
1277 """
1253
1278
1254 # Ugly kludge, but calling curses.initscr() flat out crashes in emacs
1279 # Ugly kludge, but calling curses.initscr() flat out crashes in emacs
1255 TERM = os.environ.get('TERM','dumb')
1280 TERM = os.environ.get('TERM','dumb')
1256 if TERM in ['dumb','emacs'] and os.name != 'nt':
1281 if TERM in ['dumb','emacs'] and os.name != 'nt':
1257 print strng
1282 print strng
1258 return
1283 return
1259 # chop off the topmost part of the string we don't want to see
1284 # chop off the topmost part of the string we don't want to see
1260 str_lines = strng.split(os.linesep)[start:]
1285 str_lines = strng.split(os.linesep)[start:]
1261 str_toprint = os.linesep.join(str_lines)
1286 str_toprint = os.linesep.join(str_lines)
1262 num_newlines = len(str_lines)
1287 num_newlines = len(str_lines)
1263 len_str = len(str_toprint)
1288 len_str = len(str_toprint)
1264
1289
1265 # Dumb heuristics to guesstimate number of on-screen lines the string
1290 # Dumb heuristics to guesstimate number of on-screen lines the string
1266 # takes. Very basic, but good enough for docstrings in reasonable
1291 # takes. Very basic, but good enough for docstrings in reasonable
1267 # terminals. If someone later feels like refining it, it's not hard.
1292 # terminals. If someone later feels like refining it, it's not hard.
1268 numlines = max(num_newlines,int(len_str/80)+1)
1293 numlines = max(num_newlines,int(len_str/80)+1)
1269
1294
1270 if os.name == "nt":
1295 if os.name == "nt":
1271 screen_lines_def = get_console_size(defaulty=25)[1]
1296 screen_lines_def = get_console_size(defaulty=25)[1]
1272 else:
1297 else:
1273 screen_lines_def = 25 # default value if we can't auto-determine
1298 screen_lines_def = 25 # default value if we can't auto-determine
1274
1299
1275 # auto-determine screen size
1300 # auto-determine screen size
1276 if screen_lines <= 0:
1301 if screen_lines <= 0:
1277 if TERM=='xterm':
1302 if TERM=='xterm':
1278 try:
1303 try:
1279 import curses
1304 import curses
1280 if hasattr(curses,'initscr'):
1305 if hasattr(curses,'initscr'):
1281 use_curses = 1
1306 use_curses = 1
1282 else:
1307 else:
1283 use_curses = 0
1308 use_curses = 0
1284 except ImportError:
1309 except ImportError:
1285 use_curses = 0
1310 use_curses = 0
1286 else:
1311 else:
1287 # curses causes problems on many terminals other than xterm.
1312 # curses causes problems on many terminals other than xterm.
1288 use_curses = 0
1313 use_curses = 0
1289 if use_curses:
1314 if use_curses:
1290 scr = curses.initscr()
1315 scr = curses.initscr()
1291 screen_lines_real,screen_cols = scr.getmaxyx()
1316 screen_lines_real,screen_cols = scr.getmaxyx()
1292 curses.endwin()
1317 curses.endwin()
1293 screen_lines += screen_lines_real
1318 screen_lines += screen_lines_real
1294 #print '***Screen size:',screen_lines_real,'lines x',\
1319 #print '***Screen size:',screen_lines_real,'lines x',\
1295 #screen_cols,'columns.' # dbg
1320 #screen_cols,'columns.' # dbg
1296 else:
1321 else:
1297 screen_lines += screen_lines_def
1322 screen_lines += screen_lines_def
1298
1323
1299 #print 'numlines',numlines,'screenlines',screen_lines # dbg
1324 #print 'numlines',numlines,'screenlines',screen_lines # dbg
1300 if numlines <= screen_lines :
1325 if numlines <= screen_lines :
1301 #print '*** normal print' # dbg
1326 #print '*** normal print' # dbg
1302 print >>Term.cout, str_toprint
1327 print >>Term.cout, str_toprint
1303 else:
1328 else:
1304 # Try to open pager and default to internal one if that fails.
1329 # Try to open pager and default to internal one if that fails.
1305 # All failure modes are tagged as 'retval=1', to match the return
1330 # All failure modes are tagged as 'retval=1', to match the return
1306 # value of a failed system command. If any intermediate attempt
1331 # value of a failed system command. If any intermediate attempt
1307 # sets retval to 1, at the end we resort to our own page_dumb() pager.
1332 # sets retval to 1, at the end we resort to our own page_dumb() pager.
1308 pager_cmd = get_pager_cmd(pager_cmd)
1333 pager_cmd = get_pager_cmd(pager_cmd)
1309 pager_cmd += ' ' + get_pager_start(pager_cmd,start)
1334 pager_cmd += ' ' + get_pager_start(pager_cmd,start)
1310 if os.name == 'nt':
1335 if os.name == 'nt':
1311 if pager_cmd.startswith('type'):
1336 if pager_cmd.startswith('type'):
1312 # The default WinXP 'type' command is failing on complex strings.
1337 # The default WinXP 'type' command is failing on complex strings.
1313 retval = 1
1338 retval = 1
1314 else:
1339 else:
1315 tmpname = tempfile.mktemp('.txt')
1340 tmpname = tempfile.mktemp('.txt')
1316 tmpfile = file(tmpname,'wt')
1341 tmpfile = file(tmpname,'wt')
1317 tmpfile.write(strng)
1342 tmpfile.write(strng)
1318 tmpfile.close()
1343 tmpfile.close()
1319 cmd = "%s < %s" % (pager_cmd,tmpname)
1344 cmd = "%s < %s" % (pager_cmd,tmpname)
1320 if os.system(cmd):
1345 if os.system(cmd):
1321 retval = 1
1346 retval = 1
1322 else:
1347 else:
1323 retval = None
1348 retval = None
1324 os.remove(tmpname)
1349 os.remove(tmpname)
1325 else:
1350 else:
1326 try:
1351 try:
1327 retval = None
1352 retval = None
1328 # if I use popen4, things hang. No idea why.
1353 # if I use popen4, things hang. No idea why.
1329 #pager,shell_out = os.popen4(pager_cmd)
1354 #pager,shell_out = os.popen4(pager_cmd)
1330 pager = os.popen(pager_cmd,'w')
1355 pager = os.popen(pager_cmd,'w')
1331 pager.write(strng)
1356 pager.write(strng)
1332 pager.close()
1357 pager.close()
1333 retval = pager.close() # success returns None
1358 retval = pager.close() # success returns None
1334 except IOError,msg: # broken pipe when user quits
1359 except IOError,msg: # broken pipe when user quits
1335 if msg.args == (32,'Broken pipe'):
1360 if msg.args == (32,'Broken pipe'):
1336 retval = None
1361 retval = None
1337 else:
1362 else:
1338 retval = 1
1363 retval = 1
1339 except OSError:
1364 except OSError:
1340 # Other strange problems, sometimes seen in Win2k/cygwin
1365 # Other strange problems, sometimes seen in Win2k/cygwin
1341 retval = 1
1366 retval = 1
1342 if retval is not None:
1367 if retval is not None:
1343 page_dumb(strng,screen_lines=screen_lines)
1368 page_dumb(strng,screen_lines=screen_lines)
1344
1369
1345 #----------------------------------------------------------------------------
1370 #----------------------------------------------------------------------------
1346 def page_file(fname,start = 0, pager_cmd = None):
1371 def page_file(fname,start = 0, pager_cmd = None):
1347 """Page a file, using an optional pager command and starting line.
1372 """Page a file, using an optional pager command and starting line.
1348 """
1373 """
1349
1374
1350 pager_cmd = get_pager_cmd(pager_cmd)
1375 pager_cmd = get_pager_cmd(pager_cmd)
1351 pager_cmd += ' ' + get_pager_start(pager_cmd,start)
1376 pager_cmd += ' ' + get_pager_start(pager_cmd,start)
1352
1377
1353 try:
1378 try:
1354 if os.environ['TERM'] in ['emacs','dumb']:
1379 if os.environ['TERM'] in ['emacs','dumb']:
1355 raise EnvironmentError
1380 raise EnvironmentError
1356 xsys(pager_cmd + ' ' + fname)
1381 xsys(pager_cmd + ' ' + fname)
1357 except:
1382 except:
1358 try:
1383 try:
1359 if start > 0:
1384 if start > 0:
1360 start -= 1
1385 start -= 1
1361 page(open(fname).read(),start)
1386 page(open(fname).read(),start)
1362 except:
1387 except:
1363 print 'Unable to show file',`fname`
1388 print 'Unable to show file',`fname`
1364
1389
1365 #----------------------------------------------------------------------------
1390 #----------------------------------------------------------------------------
1366 def snip_print(str,width = 75,print_full = 0,header = ''):
1391 def snip_print(str,width = 75,print_full = 0,header = ''):
1367 """Print a string snipping the midsection to fit in width.
1392 """Print a string snipping the midsection to fit in width.
1368
1393
1369 print_full: mode control:
1394 print_full: mode control:
1370 - 0: only snip long strings
1395 - 0: only snip long strings
1371 - 1: send to page() directly.
1396 - 1: send to page() directly.
1372 - 2: snip long strings and ask for full length viewing with page()
1397 - 2: snip long strings and ask for full length viewing with page()
1373 Return 1 if snipping was necessary, 0 otherwise."""
1398 Return 1 if snipping was necessary, 0 otherwise."""
1374
1399
1375 if print_full == 1:
1400 if print_full == 1:
1376 page(header+str)
1401 page(header+str)
1377 return 0
1402 return 0
1378
1403
1379 print header,
1404 print header,
1380 if len(str) < width:
1405 if len(str) < width:
1381 print str
1406 print str
1382 snip = 0
1407 snip = 0
1383 else:
1408 else:
1384 whalf = int((width -5)/2)
1409 whalf = int((width -5)/2)
1385 print str[:whalf] + ' <...> ' + str[-whalf:]
1410 print str[:whalf] + ' <...> ' + str[-whalf:]
1386 snip = 1
1411 snip = 1
1387 if snip and print_full == 2:
1412 if snip and print_full == 2:
1388 if raw_input(header+' Snipped. View (y/n)? [N]').lower() == 'y':
1413 if raw_input(header+' Snipped. View (y/n)? [N]').lower() == 'y':
1389 page(str)
1414 page(str)
1390 return snip
1415 return snip
1391
1416
1392 #****************************************************************************
1417 #****************************************************************************
1393 # lists, dicts and structures
1418 # lists, dicts and structures
1394
1419
1395 def belong(candidates,checklist):
1420 def belong(candidates,checklist):
1396 """Check whether a list of items appear in a given list of options.
1421 """Check whether a list of items appear in a given list of options.
1397
1422
1398 Returns a list of 1 and 0, one for each candidate given."""
1423 Returns a list of 1 and 0, one for each candidate given."""
1399
1424
1400 return [x in checklist for x in candidates]
1425 return [x in checklist for x in candidates]
1401
1426
1402 #----------------------------------------------------------------------------
1427 #----------------------------------------------------------------------------
1403 def uniq_stable(elems):
1428 def uniq_stable(elems):
1404 """uniq_stable(elems) -> list
1429 """uniq_stable(elems) -> list
1405
1430
1406 Return from an iterable, a list of all the unique elements in the input,
1431 Return from an iterable, a list of all the unique elements in the input,
1407 but maintaining the order in which they first appear.
1432 but maintaining the order in which they first appear.
1408
1433
1409 A naive solution to this problem which just makes a dictionary with the
1434 A naive solution to this problem which just makes a dictionary with the
1410 elements as keys fails to respect the stability condition, since
1435 elements as keys fails to respect the stability condition, since
1411 dictionaries are unsorted by nature.
1436 dictionaries are unsorted by nature.
1412
1437
1413 Note: All elements in the input must be valid dictionary keys for this
1438 Note: All elements in the input must be valid dictionary keys for this
1414 routine to work, as it internally uses a dictionary for efficiency
1439 routine to work, as it internally uses a dictionary for efficiency
1415 reasons."""
1440 reasons."""
1416
1441
1417 unique = []
1442 unique = []
1418 unique_dict = {}
1443 unique_dict = {}
1419 for nn in elems:
1444 for nn in elems:
1420 if nn not in unique_dict:
1445 if nn not in unique_dict:
1421 unique.append(nn)
1446 unique.append(nn)
1422 unique_dict[nn] = None
1447 unique_dict[nn] = None
1423 return unique
1448 return unique
1424
1449
1425 #----------------------------------------------------------------------------
1450 #----------------------------------------------------------------------------
1426 class NLprinter:
1451 class NLprinter:
1427 """Print an arbitrarily nested list, indicating index numbers.
1452 """Print an arbitrarily nested list, indicating index numbers.
1428
1453
1429 An instance of this class called nlprint is available and callable as a
1454 An instance of this class called nlprint is available and callable as a
1430 function.
1455 function.
1431
1456
1432 nlprint(list,indent=' ',sep=': ') -> prints indenting each level by 'indent'
1457 nlprint(list,indent=' ',sep=': ') -> prints indenting each level by 'indent'
1433 and using 'sep' to separate the index from the value. """
1458 and using 'sep' to separate the index from the value. """
1434
1459
1435 def __init__(self):
1460 def __init__(self):
1436 self.depth = 0
1461 self.depth = 0
1437
1462
1438 def __call__(self,lst,pos='',**kw):
1463 def __call__(self,lst,pos='',**kw):
1439 """Prints the nested list numbering levels."""
1464 """Prints the nested list numbering levels."""
1440 kw.setdefault('indent',' ')
1465 kw.setdefault('indent',' ')
1441 kw.setdefault('sep',': ')
1466 kw.setdefault('sep',': ')
1442 kw.setdefault('start',0)
1467 kw.setdefault('start',0)
1443 kw.setdefault('stop',len(lst))
1468 kw.setdefault('stop',len(lst))
1444 # we need to remove start and stop from kw so they don't propagate
1469 # we need to remove start and stop from kw so they don't propagate
1445 # into a recursive call for a nested list.
1470 # into a recursive call for a nested list.
1446 start = kw['start']; del kw['start']
1471 start = kw['start']; del kw['start']
1447 stop = kw['stop']; del kw['stop']
1472 stop = kw['stop']; del kw['stop']
1448 if self.depth == 0 and 'header' in kw.keys():
1473 if self.depth == 0 and 'header' in kw.keys():
1449 print kw['header']
1474 print kw['header']
1450
1475
1451 for idx in range(start,stop):
1476 for idx in range(start,stop):
1452 elem = lst[idx]
1477 elem = lst[idx]
1453 if type(elem)==type([]):
1478 if type(elem)==type([]):
1454 self.depth += 1
1479 self.depth += 1
1455 self.__call__(elem,itpl('$pos$idx,'),**kw)
1480 self.__call__(elem,itpl('$pos$idx,'),**kw)
1456 self.depth -= 1
1481 self.depth -= 1
1457 else:
1482 else:
1458 printpl(kw['indent']*self.depth+'$pos$idx$kw["sep"]$elem')
1483 printpl(kw['indent']*self.depth+'$pos$idx$kw["sep"]$elem')
1459
1484
1460 nlprint = NLprinter()
1485 nlprint = NLprinter()
1461 #----------------------------------------------------------------------------
1486 #----------------------------------------------------------------------------
1462 def all_belong(candidates,checklist):
1487 def all_belong(candidates,checklist):
1463 """Check whether a list of items ALL appear in a given list of options.
1488 """Check whether a list of items ALL appear in a given list of options.
1464
1489
1465 Returns a single 1 or 0 value."""
1490 Returns a single 1 or 0 value."""
1466
1491
1467 return 1-(0 in [x in checklist for x in candidates])
1492 return 1-(0 in [x in checklist for x in candidates])
1468
1493
1469 #----------------------------------------------------------------------------
1494 #----------------------------------------------------------------------------
1470 def sort_compare(lst1,lst2,inplace = 1):
1495 def sort_compare(lst1,lst2,inplace = 1):
1471 """Sort and compare two lists.
1496 """Sort and compare two lists.
1472
1497
1473 By default it does it in place, thus modifying the lists. Use inplace = 0
1498 By default it does it in place, thus modifying the lists. Use inplace = 0
1474 to avoid that (at the cost of temporary copy creation)."""
1499 to avoid that (at the cost of temporary copy creation)."""
1475 if not inplace:
1500 if not inplace:
1476 lst1 = lst1[:]
1501 lst1 = lst1[:]
1477 lst2 = lst2[:]
1502 lst2 = lst2[:]
1478 lst1.sort(); lst2.sort()
1503 lst1.sort(); lst2.sort()
1479 return lst1 == lst2
1504 return lst1 == lst2
1480
1505
1481 #----------------------------------------------------------------------------
1506 #----------------------------------------------------------------------------
1482 def mkdict(**kwargs):
1507 def mkdict(**kwargs):
1483 """Return a dict from a keyword list.
1508 """Return a dict from a keyword list.
1484
1509
1485 It's just syntactic sugar for making ditcionary creation more convenient:
1510 It's just syntactic sugar for making ditcionary creation more convenient:
1486 # the standard way
1511 # the standard way
1487 >>>data = { 'red' : 1, 'green' : 2, 'blue' : 3 }
1512 >>>data = { 'red' : 1, 'green' : 2, 'blue' : 3 }
1488 # a cleaner way
1513 # a cleaner way
1489 >>>data = dict(red=1, green=2, blue=3)
1514 >>>data = dict(red=1, green=2, blue=3)
1490
1515
1491 If you need more than this, look at the Struct() class."""
1516 If you need more than this, look at the Struct() class."""
1492
1517
1493 return kwargs
1518 return kwargs
1494
1519
1495 #----------------------------------------------------------------------------
1520 #----------------------------------------------------------------------------
1496 def list2dict(lst):
1521 def list2dict(lst):
1497 """Takes a list of (key,value) pairs and turns it into a dict."""
1522 """Takes a list of (key,value) pairs and turns it into a dict."""
1498
1523
1499 dic = {}
1524 dic = {}
1500 for k,v in lst: dic[k] = v
1525 for k,v in lst: dic[k] = v
1501 return dic
1526 return dic
1502
1527
1503 #----------------------------------------------------------------------------
1528 #----------------------------------------------------------------------------
1504 def list2dict2(lst,default=''):
1529 def list2dict2(lst,default=''):
1505 """Takes a list and turns it into a dict.
1530 """Takes a list and turns it into a dict.
1506 Much slower than list2dict, but more versatile. This version can take
1531 Much slower than list2dict, but more versatile. This version can take
1507 lists with sublists of arbitrary length (including sclars)."""
1532 lists with sublists of arbitrary length (including sclars)."""
1508
1533
1509 dic = {}
1534 dic = {}
1510 for elem in lst:
1535 for elem in lst:
1511 if type(elem) in (types.ListType,types.TupleType):
1536 if type(elem) in (types.ListType,types.TupleType):
1512 size = len(elem)
1537 size = len(elem)
1513 if size == 0:
1538 if size == 0:
1514 pass
1539 pass
1515 elif size == 1:
1540 elif size == 1:
1516 dic[elem] = default
1541 dic[elem] = default
1517 else:
1542 else:
1518 k,v = elem[0], elem[1:]
1543 k,v = elem[0], elem[1:]
1519 if len(v) == 1: v = v[0]
1544 if len(v) == 1: v = v[0]
1520 dic[k] = v
1545 dic[k] = v
1521 else:
1546 else:
1522 dic[elem] = default
1547 dic[elem] = default
1523 return dic
1548 return dic
1524
1549
1525 #----------------------------------------------------------------------------
1550 #----------------------------------------------------------------------------
1526 def flatten(seq):
1551 def flatten(seq):
1527 """Flatten a list of lists (NOT recursive, only works for 2d lists)."""
1552 """Flatten a list of lists (NOT recursive, only works for 2d lists)."""
1528
1553
1529 # bug in python??? (YES. Fixed in 2.2, let's leave the kludgy fix in).
1554 # bug in python??? (YES. Fixed in 2.2, let's leave the kludgy fix in).
1530
1555
1531 # if the x=0 isn't made, a *global* variable x is left over after calling
1556 # if the x=0 isn't made, a *global* variable x is left over after calling
1532 # this function, with the value of the last element in the return
1557 # this function, with the value of the last element in the return
1533 # list. This does seem like a bug big time to me.
1558 # list. This does seem like a bug big time to me.
1534
1559
1535 # the problem is fixed with the x=0, which seems to force the creation of
1560 # the problem is fixed with the x=0, which seems to force the creation of
1536 # a local name
1561 # a local name
1537
1562
1538 x = 0
1563 x = 0
1539 return [x for subseq in seq for x in subseq]
1564 return [x for subseq in seq for x in subseq]
1540
1565
1541 #----------------------------------------------------------------------------
1566 #----------------------------------------------------------------------------
1542 def get_slice(seq,start=0,stop=None,step=1):
1567 def get_slice(seq,start=0,stop=None,step=1):
1543 """Get a slice of a sequence with variable step. Specify start,stop,step."""
1568 """Get a slice of a sequence with variable step. Specify start,stop,step."""
1544 if stop == None:
1569 if stop == None:
1545 stop = len(seq)
1570 stop = len(seq)
1546 item = lambda i: seq[i]
1571 item = lambda i: seq[i]
1547 return map(item,xrange(start,stop,step))
1572 return map(item,xrange(start,stop,step))
1548
1573
1549 #----------------------------------------------------------------------------
1574 #----------------------------------------------------------------------------
1550 def chop(seq,size):
1575 def chop(seq,size):
1551 """Chop a sequence into chunks of the given size."""
1576 """Chop a sequence into chunks of the given size."""
1552 chunk = lambda i: seq[i:i+size]
1577 chunk = lambda i: seq[i:i+size]
1553 return map(chunk,xrange(0,len(seq),size))
1578 return map(chunk,xrange(0,len(seq),size))
1554
1579
1555 #----------------------------------------------------------------------------
1580 #----------------------------------------------------------------------------
1556 def with(object, **args):
1581 def with(object, **args):
1557 """Set multiple attributes for an object, similar to Pascal's with.
1582 """Set multiple attributes for an object, similar to Pascal's with.
1558
1583
1559 Example:
1584 Example:
1560 with(jim,
1585 with(jim,
1561 born = 1960,
1586 born = 1960,
1562 haircolour = 'Brown',
1587 haircolour = 'Brown',
1563 eyecolour = 'Green')
1588 eyecolour = 'Green')
1564
1589
1565 Credit: Greg Ewing, in
1590 Credit: Greg Ewing, in
1566 http://mail.python.org/pipermail/python-list/2001-May/040703.html"""
1591 http://mail.python.org/pipermail/python-list/2001-May/040703.html"""
1567
1592
1568 object.__dict__.update(args)
1593 object.__dict__.update(args)
1569
1594
1570 #----------------------------------------------------------------------------
1595 #----------------------------------------------------------------------------
1571 def setattr_list(obj,alist,nspace = None):
1596 def setattr_list(obj,alist,nspace = None):
1572 """Set a list of attributes for an object taken from a namespace.
1597 """Set a list of attributes for an object taken from a namespace.
1573
1598
1574 setattr_list(obj,alist,nspace) -> sets in obj all the attributes listed in
1599 setattr_list(obj,alist,nspace) -> sets in obj all the attributes listed in
1575 alist with their values taken from nspace, which must be a dict (something
1600 alist with their values taken from nspace, which must be a dict (something
1576 like locals() will often do) If nspace isn't given, locals() of the
1601 like locals() will often do) If nspace isn't given, locals() of the
1577 *caller* is used, so in most cases you can omit it.
1602 *caller* is used, so in most cases you can omit it.
1578
1603
1579 Note that alist can be given as a string, which will be automatically
1604 Note that alist can be given as a string, which will be automatically
1580 split into a list on whitespace. If given as a list, it must be a list of
1605 split into a list on whitespace. If given as a list, it must be a list of
1581 *strings* (the variable names themselves), not of variables."""
1606 *strings* (the variable names themselves), not of variables."""
1582
1607
1583 # this grabs the local variables from the *previous* call frame -- that is
1608 # this grabs the local variables from the *previous* call frame -- that is
1584 # the locals from the function that called setattr_list().
1609 # the locals from the function that called setattr_list().
1585 # - snipped from weave.inline()
1610 # - snipped from weave.inline()
1586 if nspace is None:
1611 if nspace is None:
1587 call_frame = sys._getframe().f_back
1612 call_frame = sys._getframe().f_back
1588 nspace = call_frame.f_locals
1613 nspace = call_frame.f_locals
1589
1614
1590 if type(alist) in StringTypes:
1615 if type(alist) in StringTypes:
1591 alist = alist.split()
1616 alist = alist.split()
1592 for attr in alist:
1617 for attr in alist:
1593 val = eval(attr,nspace)
1618 val = eval(attr,nspace)
1594 setattr(obj,attr,val)
1619 setattr(obj,attr,val)
1595
1620
1596 #----------------------------------------------------------------------------
1621 #----------------------------------------------------------------------------
1597 def getattr_list(obj,alist,*args):
1622 def getattr_list(obj,alist,*args):
1598 """getattr_list(obj,alist[, default]) -> attribute list.
1623 """getattr_list(obj,alist[, default]) -> attribute list.
1599
1624
1600 Get a list of named attributes for an object. When a default argument is
1625 Get a list of named attributes for an object. When a default argument is
1601 given, it is returned when the attribute doesn't exist; without it, an
1626 given, it is returned when the attribute doesn't exist; without it, an
1602 exception is raised in that case.
1627 exception is raised in that case.
1603
1628
1604 Note that alist can be given as a string, which will be automatically
1629 Note that alist can be given as a string, which will be automatically
1605 split into a list on whitespace. If given as a list, it must be a list of
1630 split into a list on whitespace. If given as a list, it must be a list of
1606 *strings* (the variable names themselves), not of variables."""
1631 *strings* (the variable names themselves), not of variables."""
1607
1632
1608 if type(alist) in StringTypes:
1633 if type(alist) in StringTypes:
1609 alist = alist.split()
1634 alist = alist.split()
1610 if args:
1635 if args:
1611 if len(args)==1:
1636 if len(args)==1:
1612 default = args[0]
1637 default = args[0]
1613 return map(lambda attr: getattr(obj,attr,default),alist)
1638 return map(lambda attr: getattr(obj,attr,default),alist)
1614 else:
1639 else:
1615 raise ValueError,'getattr_list() takes only one optional argument'
1640 raise ValueError,'getattr_list() takes only one optional argument'
1616 else:
1641 else:
1617 return map(lambda attr: getattr(obj,attr),alist)
1642 return map(lambda attr: getattr(obj,attr),alist)
1618
1643
1619 #----------------------------------------------------------------------------
1644 #----------------------------------------------------------------------------
1620 def map_method(method,object_list,*argseq,**kw):
1645 def map_method(method,object_list,*argseq,**kw):
1621 """map_method(method,object_list,*args,**kw) -> list
1646 """map_method(method,object_list,*args,**kw) -> list
1622
1647
1623 Return a list of the results of applying the methods to the items of the
1648 Return a list of the results of applying the methods to the items of the
1624 argument sequence(s). If more than one sequence is given, the method is
1649 argument sequence(s). If more than one sequence is given, the method is
1625 called with an argument list consisting of the corresponding item of each
1650 called with an argument list consisting of the corresponding item of each
1626 sequence. All sequences must be of the same length.
1651 sequence. All sequences must be of the same length.
1627
1652
1628 Keyword arguments are passed verbatim to all objects called.
1653 Keyword arguments are passed verbatim to all objects called.
1629
1654
1630 This is Python code, so it's not nearly as fast as the builtin map()."""
1655 This is Python code, so it's not nearly as fast as the builtin map()."""
1631
1656
1632 out_list = []
1657 out_list = []
1633 idx = 0
1658 idx = 0
1634 for object in object_list:
1659 for object in object_list:
1635 try:
1660 try:
1636 handler = getattr(object, method)
1661 handler = getattr(object, method)
1637 except AttributeError:
1662 except AttributeError:
1638 out_list.append(None)
1663 out_list.append(None)
1639 else:
1664 else:
1640 if argseq:
1665 if argseq:
1641 args = map(lambda lst:lst[idx],argseq)
1666 args = map(lambda lst:lst[idx],argseq)
1642 #print 'ob',object,'hand',handler,'ar',args # dbg
1667 #print 'ob',object,'hand',handler,'ar',args # dbg
1643 out_list.append(handler(args,**kw))
1668 out_list.append(handler(args,**kw))
1644 else:
1669 else:
1645 out_list.append(handler(**kw))
1670 out_list.append(handler(**kw))
1646 idx += 1
1671 idx += 1
1647 return out_list
1672 return out_list
1648
1673
1649 #----------------------------------------------------------------------------
1674 #----------------------------------------------------------------------------
1650 def import_fail_info(mod_name,fns=None):
1675 def import_fail_info(mod_name,fns=None):
1651 """Inform load failure for a module."""
1676 """Inform load failure for a module."""
1652
1677
1653 if fns == None:
1678 if fns == None:
1654 warn("Loading of %s failed.\n" % (mod_name,))
1679 warn("Loading of %s failed.\n" % (mod_name,))
1655 else:
1680 else:
1656 warn("Loading of %s from %s failed.\n" % (fns,mod_name))
1681 warn("Loading of %s from %s failed.\n" % (fns,mod_name))
1657
1682
1658 #----------------------------------------------------------------------------
1683 #----------------------------------------------------------------------------
1659 # Proposed popitem() extension, written as a method
1684 # Proposed popitem() extension, written as a method
1660
1685
1661 class NotGiven: pass
1686 class NotGiven: pass
1662
1687
1663 def popkey(dct,key,default=NotGiven):
1688 def popkey(dct,key,default=NotGiven):
1664 """Return dct[key] and delete dct[key].
1689 """Return dct[key] and delete dct[key].
1665
1690
1666 If default is given, return it if dct[key] doesn't exist, otherwise raise
1691 If default is given, return it if dct[key] doesn't exist, otherwise raise
1667 KeyError. """
1692 KeyError. """
1668
1693
1669 try:
1694 try:
1670 val = dct[key]
1695 val = dct[key]
1671 except KeyError:
1696 except KeyError:
1672 if default is NotGiven:
1697 if default is NotGiven:
1673 raise
1698 raise
1674 else:
1699 else:
1675 return default
1700 return default
1676 else:
1701 else:
1677 del dct[key]
1702 del dct[key]
1678 return val
1703 return val
1679 #*************************** end of file <genutils.py> **********************
1704 #*************************** end of file <genutils.py> **********************
1680
1705
@@ -1,4635 +1,4638 b''
1 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2
2
3 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
4 (minor mods) to support network shares under win32.
5
3 * IPython/winconsole.py (get_console_size): add new winconsole
6 * IPython/winconsole.py (get_console_size): add new winconsole
4 module and fixes to page_dumb() to improve its behavior under
7 module and fixes to page_dumb() to improve its behavior under
5 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
8 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
6
9
7 * IPython/Magic.py (Macro): simplified Macro class to just
10 * IPython/Magic.py (Macro): simplified Macro class to just
8 subclass list. We've had only 2.2 compatibility for a very long
11 subclass list. We've had only 2.2 compatibility for a very long
9 time, yet I was still avoiding subclassing the builtin types. No
12 time, yet I was still avoiding subclassing the builtin types. No
10 more (I'm also starting to use properties, though I won't shift to
13 more (I'm also starting to use properties, though I won't shift to
11 2.3-specific features quite yet).
14 2.3-specific features quite yet).
12 (magic_store): added Ville's patch for lightweight variable
15 (magic_store): added Ville's patch for lightweight variable
13 persistence, after a request on the user list by Matt Wilkie
16 persistence, after a request on the user list by Matt Wilkie
14 <maphew-AT-gmail.com>. The new %store magic's docstring has full
17 <maphew-AT-gmail.com>. The new %store magic's docstring has full
15 details.
18 details.
16
19
17 * IPython/iplib.py (InteractiveShell.post_config_initialization):
20 * IPython/iplib.py (InteractiveShell.post_config_initialization):
18 changed the default logfile name from 'ipython.log' to
21 changed the default logfile name from 'ipython.log' to
19 'ipython_log.py'. These logs are real python files, and now that
22 'ipython_log.py'. These logs are real python files, and now that
20 we have much better multiline support, people are more likely to
23 we have much better multiline support, people are more likely to
21 want to use them as such. Might as well name them correctly.
24 want to use them as such. Might as well name them correctly.
22
25
23 * IPython/Magic.py: substantial cleanup. While we can't stop
26 * IPython/Magic.py: substantial cleanup. While we can't stop
24 using magics as mixins, due to the existing customizations 'out
27 using magics as mixins, due to the existing customizations 'out
25 there' which rely on the mixin naming conventions, at least I
28 there' which rely on the mixin naming conventions, at least I
26 cleaned out all cross-class name usage. So once we are OK with
29 cleaned out all cross-class name usage. So once we are OK with
27 breaking compatibility, the two systems can be separated.
30 breaking compatibility, the two systems can be separated.
28
31
29 * IPython/Logger.py: major cleanup. This one is NOT a mixin
32 * IPython/Logger.py: major cleanup. This one is NOT a mixin
30 anymore, and the class is a fair bit less hideous as well. New
33 anymore, and the class is a fair bit less hideous as well. New
31 features were also introduced: timestamping of input, and logging
34 features were also introduced: timestamping of input, and logging
32 of output results. These are user-visible with the -t and -o
35 of output results. These are user-visible with the -t and -o
33 options to %logstart. Closes
36 options to %logstart. Closes
34 http://www.scipy.net/roundup/ipython/issue11 and a request by
37 http://www.scipy.net/roundup/ipython/issue11 and a request by
35 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
38 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
36
39
37 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
40 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
38
41
39 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
42 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
40 better hadnle backslashes in paths. See the thread 'More Windows
43 better hadnle backslashes in paths. See the thread 'More Windows
41 questions part 2 - \/ characters revisited' on the iypthon user
44 questions part 2 - \/ characters revisited' on the iypthon user
42 list:
45 list:
43 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
46 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
44
47
45 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
48 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
46
49
47 (InteractiveShell.__init__): change threaded shells to not use the
50 (InteractiveShell.__init__): change threaded shells to not use the
48 ipython crash handler. This was causing more problems than not,
51 ipython crash handler. This was causing more problems than not,
49 as exceptions in the main thread (GUI code, typically) would
52 as exceptions in the main thread (GUI code, typically) would
50 always show up as a 'crash', when they really weren't.
53 always show up as a 'crash', when they really weren't.
51
54
52 The colors and exception mode commands (%colors/%xmode) have been
55 The colors and exception mode commands (%colors/%xmode) have been
53 synchronized to also take this into account, so users can get
56 synchronized to also take this into account, so users can get
54 verbose exceptions for their threaded code as well. I also added
57 verbose exceptions for their threaded code as well. I also added
55 support for activating pdb inside this exception handler as well,
58 support for activating pdb inside this exception handler as well,
56 so now GUI authors can use IPython's enhanced pdb at runtime.
59 so now GUI authors can use IPython's enhanced pdb at runtime.
57
60
58 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
61 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
59 true by default, and add it to the shipped ipythonrc file. Since
62 true by default, and add it to the shipped ipythonrc file. Since
60 this asks the user before proceeding, I think it's OK to make it
63 this asks the user before proceeding, I think it's OK to make it
61 true by default.
64 true by default.
62
65
63 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
66 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
64 of the previous special-casing of input in the eval loop. I think
67 of the previous special-casing of input in the eval loop. I think
65 this is cleaner, as they really are commands and shouldn't have
68 this is cleaner, as they really are commands and shouldn't have
66 a special role in the middle of the core code.
69 a special role in the middle of the core code.
67
70
68 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
71 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
69
72
70 * IPython/iplib.py (edit_syntax_error): added support for
73 * IPython/iplib.py (edit_syntax_error): added support for
71 automatically reopening the editor if the file had a syntax error
74 automatically reopening the editor if the file had a syntax error
72 in it. Thanks to scottt who provided the patch at:
75 in it. Thanks to scottt who provided the patch at:
73 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
76 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
74 version committed).
77 version committed).
75
78
76 * IPython/iplib.py (handle_normal): add suport for multi-line
79 * IPython/iplib.py (handle_normal): add suport for multi-line
77 input with emtpy lines. This fixes
80 input with emtpy lines. This fixes
78 http://www.scipy.net/roundup/ipython/issue43 and a similar
81 http://www.scipy.net/roundup/ipython/issue43 and a similar
79 discussion on the user list.
82 discussion on the user list.
80
83
81 WARNING: a behavior change is necessarily introduced to support
84 WARNING: a behavior change is necessarily introduced to support
82 blank lines: now a single blank line with whitespace does NOT
85 blank lines: now a single blank line with whitespace does NOT
83 break the input loop, which means that when autoindent is on, by
86 break the input loop, which means that when autoindent is on, by
84 default hitting return on the next (indented) line does NOT exit.
87 default hitting return on the next (indented) line does NOT exit.
85
88
86 Instead, to exit a multiline input you can either have:
89 Instead, to exit a multiline input you can either have:
87
90
88 - TWO whitespace lines (just hit return again), or
91 - TWO whitespace lines (just hit return again), or
89 - a single whitespace line of a different length than provided
92 - a single whitespace line of a different length than provided
90 by the autoindent (add or remove a space).
93 by the autoindent (add or remove a space).
91
94
92 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
95 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
93 module to better organize all readline-related functionality.
96 module to better organize all readline-related functionality.
94 I've deleted FlexCompleter and put all completion clases here.
97 I've deleted FlexCompleter and put all completion clases here.
95
98
96 * IPython/iplib.py (raw_input): improve indentation management.
99 * IPython/iplib.py (raw_input): improve indentation management.
97 It is now possible to paste indented code with autoindent on, and
100 It is now possible to paste indented code with autoindent on, and
98 the code is interpreted correctly (though it still looks bad on
101 the code is interpreted correctly (though it still looks bad on
99 screen, due to the line-oriented nature of ipython).
102 screen, due to the line-oriented nature of ipython).
100 (MagicCompleter.complete): change behavior so that a TAB key on an
103 (MagicCompleter.complete): change behavior so that a TAB key on an
101 otherwise empty line actually inserts a tab, instead of completing
104 otherwise empty line actually inserts a tab, instead of completing
102 on the entire global namespace. This makes it easier to use the
105 on the entire global namespace. This makes it easier to use the
103 TAB key for indentation. After a request by Hans Meine
106 TAB key for indentation. After a request by Hans Meine
104 <hans_meine-AT-gmx.net>
107 <hans_meine-AT-gmx.net>
105 (_prefilter): add support so that typing plain 'exit' or 'quit'
108 (_prefilter): add support so that typing plain 'exit' or 'quit'
106 does a sensible thing. Originally I tried to deviate as little as
109 does a sensible thing. Originally I tried to deviate as little as
107 possible from the default python behavior, but even that one may
110 possible from the default python behavior, but even that one may
108 change in this direction (thread on python-dev to that effect).
111 change in this direction (thread on python-dev to that effect).
109 Regardless, ipython should do the right thing even if CPython's
112 Regardless, ipython should do the right thing even if CPython's
110 '>>>' prompt doesn't.
113 '>>>' prompt doesn't.
111 (InteractiveShell): removed subclassing code.InteractiveConsole
114 (InteractiveShell): removed subclassing code.InteractiveConsole
112 class. By now we'd overridden just about all of its methods: I've
115 class. By now we'd overridden just about all of its methods: I've
113 copied the remaining two over, and now ipython is a standalone
116 copied the remaining two over, and now ipython is a standalone
114 class. This will provide a clearer picture for the chainsaw
117 class. This will provide a clearer picture for the chainsaw
115 branch refactoring.
118 branch refactoring.
116
119
117 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
120 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
118
121
119 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
122 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
120 failures for objects which break when dir() is called on them.
123 failures for objects which break when dir() is called on them.
121
124
122 * IPython/FlexCompleter.py (Completer.__init__): Added support for
125 * IPython/FlexCompleter.py (Completer.__init__): Added support for
123 distinct local and global namespaces in the completer API. This
126 distinct local and global namespaces in the completer API. This
124 change allows us top properly handle completion with distinct
127 change allows us top properly handle completion with distinct
125 scopes, including in embedded instances (this had never really
128 scopes, including in embedded instances (this had never really
126 worked correctly).
129 worked correctly).
127
130
128 Note: this introduces a change in the constructor for
131 Note: this introduces a change in the constructor for
129 MagicCompleter, as a new global_namespace parameter is now the
132 MagicCompleter, as a new global_namespace parameter is now the
130 second argument (the others were bumped one position).
133 second argument (the others were bumped one position).
131
134
132 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
135 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
133
136
134 * IPython/iplib.py (embed_mainloop): fix tab-completion in
137 * IPython/iplib.py (embed_mainloop): fix tab-completion in
135 embedded instances (which can be done now thanks to Vivian's
138 embedded instances (which can be done now thanks to Vivian's
136 frame-handling fixes for pdb).
139 frame-handling fixes for pdb).
137 (InteractiveShell.__init__): Fix namespace handling problem in
140 (InteractiveShell.__init__): Fix namespace handling problem in
138 embedded instances. We were overwriting __main__ unconditionally,
141 embedded instances. We were overwriting __main__ unconditionally,
139 and this should only be done for 'full' (non-embedded) IPython;
142 and this should only be done for 'full' (non-embedded) IPython;
140 embedded instances must respect the caller's __main__. Thanks to
143 embedded instances must respect the caller's __main__. Thanks to
141 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
144 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
142
145
143 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
146 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
144
147
145 * setup.py: added download_url to setup(). This registers the
148 * setup.py: added download_url to setup(). This registers the
146 download address at PyPI, which is not only useful to humans
149 download address at PyPI, which is not only useful to humans
147 browsing the site, but is also picked up by setuptools (the Eggs
150 browsing the site, but is also picked up by setuptools (the Eggs
148 machinery). Thanks to Ville and R. Kern for the info/discussion
151 machinery). Thanks to Ville and R. Kern for the info/discussion
149 on this.
152 on this.
150
153
151 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
154 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
152
155
153 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
156 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
154 This brings a lot of nice functionality to the pdb mode, which now
157 This brings a lot of nice functionality to the pdb mode, which now
155 has tab-completion, syntax highlighting, and better stack handling
158 has tab-completion, syntax highlighting, and better stack handling
156 than before. Many thanks to Vivian De Smedt
159 than before. Many thanks to Vivian De Smedt
157 <vivian-AT-vdesmedt.com> for the original patches.
160 <vivian-AT-vdesmedt.com> for the original patches.
158
161
159 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
162 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
160
163
161 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
164 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
162 sequence to consistently accept the banner argument. The
165 sequence to consistently accept the banner argument. The
163 inconsistency was tripping SAGE, thanks to Gary Zablackis
166 inconsistency was tripping SAGE, thanks to Gary Zablackis
164 <gzabl-AT-yahoo.com> for the report.
167 <gzabl-AT-yahoo.com> for the report.
165
168
166 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
169 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
167
170
168 * IPython/iplib.py (InteractiveShell.post_config_initialization):
171 * IPython/iplib.py (InteractiveShell.post_config_initialization):
169 Fix bug where a naked 'alias' call in the ipythonrc file would
172 Fix bug where a naked 'alias' call in the ipythonrc file would
170 cause a crash. Bug reported by Jorgen Stenarson.
173 cause a crash. Bug reported by Jorgen Stenarson.
171
174
172 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
175 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
173
176
174 * IPython/ipmaker.py (make_IPython): cleanups which should improve
177 * IPython/ipmaker.py (make_IPython): cleanups which should improve
175 startup time.
178 startup time.
176
179
177 * IPython/iplib.py (runcode): my globals 'fix' for embedded
180 * IPython/iplib.py (runcode): my globals 'fix' for embedded
178 instances had introduced a bug with globals in normal code. Now
181 instances had introduced a bug with globals in normal code. Now
179 it's working in all cases.
182 it's working in all cases.
180
183
181 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
184 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
182 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
185 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
183 has been introduced to set the default case sensitivity of the
186 has been introduced to set the default case sensitivity of the
184 searches. Users can still select either mode at runtime on a
187 searches. Users can still select either mode at runtime on a
185 per-search basis.
188 per-search basis.
186
189
187 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
190 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
188
191
189 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
192 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
190 attributes in wildcard searches for subclasses. Modified version
193 attributes in wildcard searches for subclasses. Modified version
191 of a patch by Jorgen.
194 of a patch by Jorgen.
192
195
193 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
196 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
194
197
195 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
198 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
196 embedded instances. I added a user_global_ns attribute to the
199 embedded instances. I added a user_global_ns attribute to the
197 InteractiveShell class to handle this.
200 InteractiveShell class to handle this.
198
201
199 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
202 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
200
203
201 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
204 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
202 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
205 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
203 (reported under win32, but may happen also in other platforms).
206 (reported under win32, but may happen also in other platforms).
204 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
207 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
205
208
206 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
209 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
207
210
208 * IPython/Magic.py (magic_psearch): new support for wildcard
211 * IPython/Magic.py (magic_psearch): new support for wildcard
209 patterns. Now, typing ?a*b will list all names which begin with a
212 patterns. Now, typing ?a*b will list all names which begin with a
210 and end in b, for example. The %psearch magic has full
213 and end in b, for example. The %psearch magic has full
211 docstrings. Many thanks to Jörgen Stenarson
214 docstrings. Many thanks to Jörgen Stenarson
212 <jorgen.stenarson-AT-bostream.nu>, author of the patches
215 <jorgen.stenarson-AT-bostream.nu>, author of the patches
213 implementing this functionality.
216 implementing this functionality.
214
217
215 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
218 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
216
219
217 * Manual: fixed long-standing annoyance of double-dashes (as in
220 * Manual: fixed long-standing annoyance of double-dashes (as in
218 --prefix=~, for example) being stripped in the HTML version. This
221 --prefix=~, for example) being stripped in the HTML version. This
219 is a latex2html bug, but a workaround was provided. Many thanks
222 is a latex2html bug, but a workaround was provided. Many thanks
220 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
223 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
221 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
224 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
222 rolling. This seemingly small issue had tripped a number of users
225 rolling. This seemingly small issue had tripped a number of users
223 when first installing, so I'm glad to see it gone.
226 when first installing, so I'm glad to see it gone.
224
227
225 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
228 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
226
229
227 * IPython/Extensions/numeric_formats.py: fix missing import,
230 * IPython/Extensions/numeric_formats.py: fix missing import,
228 reported by Stephen Walton.
231 reported by Stephen Walton.
229
232
230 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
233 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
231
234
232 * IPython/demo.py: finish demo module, fully documented now.
235 * IPython/demo.py: finish demo module, fully documented now.
233
236
234 * IPython/genutils.py (file_read): simple little utility to read a
237 * IPython/genutils.py (file_read): simple little utility to read a
235 file and ensure it's closed afterwards.
238 file and ensure it's closed afterwards.
236
239
237 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
240 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
238
241
239 * IPython/demo.py (Demo.__init__): added support for individually
242 * IPython/demo.py (Demo.__init__): added support for individually
240 tagging blocks for automatic execution.
243 tagging blocks for automatic execution.
241
244
242 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
245 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
243 syntax-highlighted python sources, requested by John.
246 syntax-highlighted python sources, requested by John.
244
247
245 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
248 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
246
249
247 * IPython/demo.py (Demo.again): fix bug where again() blocks after
250 * IPython/demo.py (Demo.again): fix bug where again() blocks after
248 finishing.
251 finishing.
249
252
250 * IPython/genutils.py (shlex_split): moved from Magic to here,
253 * IPython/genutils.py (shlex_split): moved from Magic to here,
251 where all 2.2 compatibility stuff lives. I needed it for demo.py.
254 where all 2.2 compatibility stuff lives. I needed it for demo.py.
252
255
253 * IPython/demo.py (Demo.__init__): added support for silent
256 * IPython/demo.py (Demo.__init__): added support for silent
254 blocks, improved marks as regexps, docstrings written.
257 blocks, improved marks as regexps, docstrings written.
255 (Demo.__init__): better docstring, added support for sys.argv.
258 (Demo.__init__): better docstring, added support for sys.argv.
256
259
257 * IPython/genutils.py (marquee): little utility used by the demo
260 * IPython/genutils.py (marquee): little utility used by the demo
258 code, handy in general.
261 code, handy in general.
259
262
260 * IPython/demo.py (Demo.__init__): new class for interactive
263 * IPython/demo.py (Demo.__init__): new class for interactive
261 demos. Not documented yet, I just wrote it in a hurry for
264 demos. Not documented yet, I just wrote it in a hurry for
262 scipy'05. Will docstring later.
265 scipy'05. Will docstring later.
263
266
264 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
267 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
265
268
266 * IPython/Shell.py (sigint_handler): Drastic simplification which
269 * IPython/Shell.py (sigint_handler): Drastic simplification which
267 also seems to make Ctrl-C work correctly across threads! This is
270 also seems to make Ctrl-C work correctly across threads! This is
268 so simple, that I can't beleive I'd missed it before. Needs more
271 so simple, that I can't beleive I'd missed it before. Needs more
269 testing, though.
272 testing, though.
270 (KBINT): Never mind, revert changes. I'm sure I'd tried something
273 (KBINT): Never mind, revert changes. I'm sure I'd tried something
271 like this before...
274 like this before...
272
275
273 * IPython/genutils.py (get_home_dir): add protection against
276 * IPython/genutils.py (get_home_dir): add protection against
274 non-dirs in win32 registry.
277 non-dirs in win32 registry.
275
278
276 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
279 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
277 bug where dict was mutated while iterating (pysh crash).
280 bug where dict was mutated while iterating (pysh crash).
278
281
279 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
282 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
280
283
281 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
284 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
282 spurious newlines added by this routine. After a report by
285 spurious newlines added by this routine. After a report by
283 F. Mantegazza.
286 F. Mantegazza.
284
287
285 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
288 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
286
289
287 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
290 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
288 calls. These were a leftover from the GTK 1.x days, and can cause
291 calls. These were a leftover from the GTK 1.x days, and can cause
289 problems in certain cases (after a report by John Hunter).
292 problems in certain cases (after a report by John Hunter).
290
293
291 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
294 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
292 os.getcwd() fails at init time. Thanks to patch from David Remahl
295 os.getcwd() fails at init time. Thanks to patch from David Remahl
293 <chmod007-AT-mac.com>.
296 <chmod007-AT-mac.com>.
294 (InteractiveShell.__init__): prevent certain special magics from
297 (InteractiveShell.__init__): prevent certain special magics from
295 being shadowed by aliases. Closes
298 being shadowed by aliases. Closes
296 http://www.scipy.net/roundup/ipython/issue41.
299 http://www.scipy.net/roundup/ipython/issue41.
297
300
298 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
301 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
299
302
300 * IPython/iplib.py (InteractiveShell.complete): Added new
303 * IPython/iplib.py (InteractiveShell.complete): Added new
301 top-level completion method to expose the completion mechanism
304 top-level completion method to expose the completion mechanism
302 beyond readline-based environments.
305 beyond readline-based environments.
303
306
304 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
307 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
305
308
306 * tools/ipsvnc (svnversion): fix svnversion capture.
309 * tools/ipsvnc (svnversion): fix svnversion capture.
307
310
308 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
311 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
309 attribute to self, which was missing. Before, it was set by a
312 attribute to self, which was missing. Before, it was set by a
310 routine which in certain cases wasn't being called, so the
313 routine which in certain cases wasn't being called, so the
311 instance could end up missing the attribute. This caused a crash.
314 instance could end up missing the attribute. This caused a crash.
312 Closes http://www.scipy.net/roundup/ipython/issue40.
315 Closes http://www.scipy.net/roundup/ipython/issue40.
313
316
314 2005-08-16 Fernando Perez <fperez@colorado.edu>
317 2005-08-16 Fernando Perez <fperez@colorado.edu>
315
318
316 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
319 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
317 contains non-string attribute. Closes
320 contains non-string attribute. Closes
318 http://www.scipy.net/roundup/ipython/issue38.
321 http://www.scipy.net/roundup/ipython/issue38.
319
322
320 2005-08-14 Fernando Perez <fperez@colorado.edu>
323 2005-08-14 Fernando Perez <fperez@colorado.edu>
321
324
322 * tools/ipsvnc: Minor improvements, to add changeset info.
325 * tools/ipsvnc: Minor improvements, to add changeset info.
323
326
324 2005-08-12 Fernando Perez <fperez@colorado.edu>
327 2005-08-12 Fernando Perez <fperez@colorado.edu>
325
328
326 * IPython/iplib.py (runsource): remove self.code_to_run_src
329 * IPython/iplib.py (runsource): remove self.code_to_run_src
327 attribute. I realized this is nothing more than
330 attribute. I realized this is nothing more than
328 '\n'.join(self.buffer), and having the same data in two different
331 '\n'.join(self.buffer), and having the same data in two different
329 places is just asking for synchronization bugs. This may impact
332 places is just asking for synchronization bugs. This may impact
330 people who have custom exception handlers, so I need to warn
333 people who have custom exception handlers, so I need to warn
331 ipython-dev about it (F. Mantegazza may use them).
334 ipython-dev about it (F. Mantegazza may use them).
332
335
333 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
336 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
334
337
335 * IPython/genutils.py: fix 2.2 compatibility (generators)
338 * IPython/genutils.py: fix 2.2 compatibility (generators)
336
339
337 2005-07-18 Fernando Perez <fperez@colorado.edu>
340 2005-07-18 Fernando Perez <fperez@colorado.edu>
338
341
339 * IPython/genutils.py (get_home_dir): fix to help users with
342 * IPython/genutils.py (get_home_dir): fix to help users with
340 invalid $HOME under win32.
343 invalid $HOME under win32.
341
344
342 2005-07-17 Fernando Perez <fperez@colorado.edu>
345 2005-07-17 Fernando Perez <fperez@colorado.edu>
343
346
344 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
347 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
345 some old hacks and clean up a bit other routines; code should be
348 some old hacks and clean up a bit other routines; code should be
346 simpler and a bit faster.
349 simpler and a bit faster.
347
350
348 * IPython/iplib.py (interact): removed some last-resort attempts
351 * IPython/iplib.py (interact): removed some last-resort attempts
349 to survive broken stdout/stderr. That code was only making it
352 to survive broken stdout/stderr. That code was only making it
350 harder to abstract out the i/o (necessary for gui integration),
353 harder to abstract out the i/o (necessary for gui integration),
351 and the crashes it could prevent were extremely rare in practice
354 and the crashes it could prevent were extremely rare in practice
352 (besides being fully user-induced in a pretty violent manner).
355 (besides being fully user-induced in a pretty violent manner).
353
356
354 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
357 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
355 Nothing major yet, but the code is simpler to read; this should
358 Nothing major yet, but the code is simpler to read; this should
356 make it easier to do more serious modifications in the future.
359 make it easier to do more serious modifications in the future.
357
360
358 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
361 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
359 which broke in .15 (thanks to a report by Ville).
362 which broke in .15 (thanks to a report by Ville).
360
363
361 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
364 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
362 be quite correct, I know next to nothing about unicode). This
365 be quite correct, I know next to nothing about unicode). This
363 will allow unicode strings to be used in prompts, amongst other
366 will allow unicode strings to be used in prompts, amongst other
364 cases. It also will prevent ipython from crashing when unicode
367 cases. It also will prevent ipython from crashing when unicode
365 shows up unexpectedly in many places. If ascii encoding fails, we
368 shows up unexpectedly in many places. If ascii encoding fails, we
366 assume utf_8. Currently the encoding is not a user-visible
369 assume utf_8. Currently the encoding is not a user-visible
367 setting, though it could be made so if there is demand for it.
370 setting, though it could be made so if there is demand for it.
368
371
369 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
372 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
370
373
371 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
374 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
372
375
373 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
376 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
374
377
375 * IPython/genutils.py: Add 2.2 compatibility here, so all other
378 * IPython/genutils.py: Add 2.2 compatibility here, so all other
376 code can work transparently for 2.2/2.3.
379 code can work transparently for 2.2/2.3.
377
380
378 2005-07-16 Fernando Perez <fperez@colorado.edu>
381 2005-07-16 Fernando Perez <fperez@colorado.edu>
379
382
380 * IPython/ultraTB.py (ExceptionColors): Make a global variable
383 * IPython/ultraTB.py (ExceptionColors): Make a global variable
381 out of the color scheme table used for coloring exception
384 out of the color scheme table used for coloring exception
382 tracebacks. This allows user code to add new schemes at runtime.
385 tracebacks. This allows user code to add new schemes at runtime.
383 This is a minimally modified version of the patch at
386 This is a minimally modified version of the patch at
384 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
387 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
385 for the contribution.
388 for the contribution.
386
389
387 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
390 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
388 slightly modified version of the patch in
391 slightly modified version of the patch in
389 http://www.scipy.net/roundup/ipython/issue34, which also allows me
392 http://www.scipy.net/roundup/ipython/issue34, which also allows me
390 to remove the previous try/except solution (which was costlier).
393 to remove the previous try/except solution (which was costlier).
391 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
394 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
392
395
393 2005-06-08 Fernando Perez <fperez@colorado.edu>
396 2005-06-08 Fernando Perez <fperez@colorado.edu>
394
397
395 * IPython/iplib.py (write/write_err): Add methods to abstract all
398 * IPython/iplib.py (write/write_err): Add methods to abstract all
396 I/O a bit more.
399 I/O a bit more.
397
400
398 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
401 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
399 warning, reported by Aric Hagberg, fix by JD Hunter.
402 warning, reported by Aric Hagberg, fix by JD Hunter.
400
403
401 2005-06-02 *** Released version 0.6.15
404 2005-06-02 *** Released version 0.6.15
402
405
403 2005-06-01 Fernando Perez <fperez@colorado.edu>
406 2005-06-01 Fernando Perez <fperez@colorado.edu>
404
407
405 * IPython/iplib.py (MagicCompleter.file_matches): Fix
408 * IPython/iplib.py (MagicCompleter.file_matches): Fix
406 tab-completion of filenames within open-quoted strings. Note that
409 tab-completion of filenames within open-quoted strings. Note that
407 this requires that in ~/.ipython/ipythonrc, users change the
410 this requires that in ~/.ipython/ipythonrc, users change the
408 readline delimiters configuration to read:
411 readline delimiters configuration to read:
409
412
410 readline_remove_delims -/~
413 readline_remove_delims -/~
411
414
412
415
413 2005-05-31 *** Released version 0.6.14
416 2005-05-31 *** Released version 0.6.14
414
417
415 2005-05-29 Fernando Perez <fperez@colorado.edu>
418 2005-05-29 Fernando Perez <fperez@colorado.edu>
416
419
417 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
420 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
418 with files not on the filesystem. Reported by Eliyahu Sandler
421 with files not on the filesystem. Reported by Eliyahu Sandler
419 <eli@gondolin.net>
422 <eli@gondolin.net>
420
423
421 2005-05-22 Fernando Perez <fperez@colorado.edu>
424 2005-05-22 Fernando Perez <fperez@colorado.edu>
422
425
423 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
426 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
424 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
427 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
425
428
426 2005-05-19 Fernando Perez <fperez@colorado.edu>
429 2005-05-19 Fernando Perez <fperez@colorado.edu>
427
430
428 * IPython/iplib.py (safe_execfile): close a file which could be
431 * IPython/iplib.py (safe_execfile): close a file which could be
429 left open (causing problems in win32, which locks open files).
432 left open (causing problems in win32, which locks open files).
430 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
433 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
431
434
432 2005-05-18 Fernando Perez <fperez@colorado.edu>
435 2005-05-18 Fernando Perez <fperez@colorado.edu>
433
436
434 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
437 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
435 keyword arguments correctly to safe_execfile().
438 keyword arguments correctly to safe_execfile().
436
439
437 2005-05-13 Fernando Perez <fperez@colorado.edu>
440 2005-05-13 Fernando Perez <fperez@colorado.edu>
438
441
439 * ipython.1: Added info about Qt to manpage, and threads warning
442 * ipython.1: Added info about Qt to manpage, and threads warning
440 to usage page (invoked with --help).
443 to usage page (invoked with --help).
441
444
442 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
445 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
443 new matcher (it goes at the end of the priority list) to do
446 new matcher (it goes at the end of the priority list) to do
444 tab-completion on named function arguments. Submitted by George
447 tab-completion on named function arguments. Submitted by George
445 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
448 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
446 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
449 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
447 for more details.
450 for more details.
448
451
449 * IPython/Magic.py (magic_run): Added new -e flag to ignore
452 * IPython/Magic.py (magic_run): Added new -e flag to ignore
450 SystemExit exceptions in the script being run. Thanks to a report
453 SystemExit exceptions in the script being run. Thanks to a report
451 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
454 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
452 producing very annoying behavior when running unit tests.
455 producing very annoying behavior when running unit tests.
453
456
454 2005-05-12 Fernando Perez <fperez@colorado.edu>
457 2005-05-12 Fernando Perez <fperez@colorado.edu>
455
458
456 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
459 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
457 which I'd broken (again) due to a changed regexp. In the process,
460 which I'd broken (again) due to a changed regexp. In the process,
458 added ';' as an escape to auto-quote the whole line without
461 added ';' as an escape to auto-quote the whole line without
459 splitting its arguments. Thanks to a report by Jerry McRae
462 splitting its arguments. Thanks to a report by Jerry McRae
460 <qrs0xyc02-AT-sneakemail.com>.
463 <qrs0xyc02-AT-sneakemail.com>.
461
464
462 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
465 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
463 possible crashes caused by a TokenError. Reported by Ed Schofield
466 possible crashes caused by a TokenError. Reported by Ed Schofield
464 <schofield-AT-ftw.at>.
467 <schofield-AT-ftw.at>.
465
468
466 2005-05-06 Fernando Perez <fperez@colorado.edu>
469 2005-05-06 Fernando Perez <fperez@colorado.edu>
467
470
468 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
471 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
469
472
470 2005-04-29 Fernando Perez <fperez@colorado.edu>
473 2005-04-29 Fernando Perez <fperez@colorado.edu>
471
474
472 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
475 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
473 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
476 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
474 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
477 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
475 which provides support for Qt interactive usage (similar to the
478 which provides support for Qt interactive usage (similar to the
476 existing one for WX and GTK). This had been often requested.
479 existing one for WX and GTK). This had been often requested.
477
480
478 2005-04-14 *** Released version 0.6.13
481 2005-04-14 *** Released version 0.6.13
479
482
480 2005-04-08 Fernando Perez <fperez@colorado.edu>
483 2005-04-08 Fernando Perez <fperez@colorado.edu>
481
484
482 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
485 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
483 from _ofind, which gets called on almost every input line. Now,
486 from _ofind, which gets called on almost every input line. Now,
484 we only try to get docstrings if they are actually going to be
487 we only try to get docstrings if they are actually going to be
485 used (the overhead of fetching unnecessary docstrings can be
488 used (the overhead of fetching unnecessary docstrings can be
486 noticeable for certain objects, such as Pyro proxies).
489 noticeable for certain objects, such as Pyro proxies).
487
490
488 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
491 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
489 for completers. For some reason I had been passing them the state
492 for completers. For some reason I had been passing them the state
490 variable, which completers never actually need, and was in
493 variable, which completers never actually need, and was in
491 conflict with the rlcompleter API. Custom completers ONLY need to
494 conflict with the rlcompleter API. Custom completers ONLY need to
492 take the text parameter.
495 take the text parameter.
493
496
494 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
497 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
495 work correctly in pysh. I've also moved all the logic which used
498 work correctly in pysh. I've also moved all the logic which used
496 to be in pysh.py here, which will prevent problems with future
499 to be in pysh.py here, which will prevent problems with future
497 upgrades. However, this time I must warn users to update their
500 upgrades. However, this time I must warn users to update their
498 pysh profile to include the line
501 pysh profile to include the line
499
502
500 import_all IPython.Extensions.InterpreterExec
503 import_all IPython.Extensions.InterpreterExec
501
504
502 because otherwise things won't work for them. They MUST also
505 because otherwise things won't work for them. They MUST also
503 delete pysh.py and the line
506 delete pysh.py and the line
504
507
505 execfile pysh.py
508 execfile pysh.py
506
509
507 from their ipythonrc-pysh.
510 from their ipythonrc-pysh.
508
511
509 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
512 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
510 robust in the face of objects whose dir() returns non-strings
513 robust in the face of objects whose dir() returns non-strings
511 (which it shouldn't, but some broken libs like ITK do). Thanks to
514 (which it shouldn't, but some broken libs like ITK do). Thanks to
512 a patch by John Hunter (implemented differently, though). Also
515 a patch by John Hunter (implemented differently, though). Also
513 minor improvements by using .extend instead of + on lists.
516 minor improvements by using .extend instead of + on lists.
514
517
515 * pysh.py:
518 * pysh.py:
516
519
517 2005-04-06 Fernando Perez <fperez@colorado.edu>
520 2005-04-06 Fernando Perez <fperez@colorado.edu>
518
521
519 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
522 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
520 by default, so that all users benefit from it. Those who don't
523 by default, so that all users benefit from it. Those who don't
521 want it can still turn it off.
524 want it can still turn it off.
522
525
523 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
526 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
524 config file, I'd forgotten about this, so users were getting it
527 config file, I'd forgotten about this, so users were getting it
525 off by default.
528 off by default.
526
529
527 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
530 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
528 consistency. Now magics can be called in multiline statements,
531 consistency. Now magics can be called in multiline statements,
529 and python variables can be expanded in magic calls via $var.
532 and python variables can be expanded in magic calls via $var.
530 This makes the magic system behave just like aliases or !system
533 This makes the magic system behave just like aliases or !system
531 calls.
534 calls.
532
535
533 2005-03-28 Fernando Perez <fperez@colorado.edu>
536 2005-03-28 Fernando Perez <fperez@colorado.edu>
534
537
535 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
538 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
536 expensive string additions for building command. Add support for
539 expensive string additions for building command. Add support for
537 trailing ';' when autocall is used.
540 trailing ';' when autocall is used.
538
541
539 2005-03-26 Fernando Perez <fperez@colorado.edu>
542 2005-03-26 Fernando Perez <fperez@colorado.edu>
540
543
541 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
544 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
542 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
545 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
543 ipython.el robust against prompts with any number of spaces
546 ipython.el robust against prompts with any number of spaces
544 (including 0) after the ':' character.
547 (including 0) after the ':' character.
545
548
546 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
549 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
547 continuation prompt, which misled users to think the line was
550 continuation prompt, which misled users to think the line was
548 already indented. Closes debian Bug#300847, reported to me by
551 already indented. Closes debian Bug#300847, reported to me by
549 Norbert Tretkowski <tretkowski-AT-inittab.de>.
552 Norbert Tretkowski <tretkowski-AT-inittab.de>.
550
553
551 2005-03-23 Fernando Perez <fperez@colorado.edu>
554 2005-03-23 Fernando Perez <fperez@colorado.edu>
552
555
553 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
556 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
554 properly aligned if they have embedded newlines.
557 properly aligned if they have embedded newlines.
555
558
556 * IPython/iplib.py (runlines): Add a public method to expose
559 * IPython/iplib.py (runlines): Add a public method to expose
557 IPython's code execution machinery, so that users can run strings
560 IPython's code execution machinery, so that users can run strings
558 as if they had been typed at the prompt interactively.
561 as if they had been typed at the prompt interactively.
559 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
562 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
560 methods which can call the system shell, but with python variable
563 methods which can call the system shell, but with python variable
561 expansion. The three such methods are: __IPYTHON__.system,
564 expansion. The three such methods are: __IPYTHON__.system,
562 .getoutput and .getoutputerror. These need to be documented in a
565 .getoutput and .getoutputerror. These need to be documented in a
563 'public API' section (to be written) of the manual.
566 'public API' section (to be written) of the manual.
564
567
565 2005-03-20 Fernando Perez <fperez@colorado.edu>
568 2005-03-20 Fernando Perez <fperez@colorado.edu>
566
569
567 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
570 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
568 for custom exception handling. This is quite powerful, and it
571 for custom exception handling. This is quite powerful, and it
569 allows for user-installable exception handlers which can trap
572 allows for user-installable exception handlers which can trap
570 custom exceptions at runtime and treat them separately from
573 custom exceptions at runtime and treat them separately from
571 IPython's default mechanisms. At the request of Frédéric
574 IPython's default mechanisms. At the request of Frédéric
572 Mantegazza <mantegazza-AT-ill.fr>.
575 Mantegazza <mantegazza-AT-ill.fr>.
573 (InteractiveShell.set_custom_completer): public API function to
576 (InteractiveShell.set_custom_completer): public API function to
574 add new completers at runtime.
577 add new completers at runtime.
575
578
576 2005-03-19 Fernando Perez <fperez@colorado.edu>
579 2005-03-19 Fernando Perez <fperez@colorado.edu>
577
580
578 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
581 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
579 allow objects which provide their docstrings via non-standard
582 allow objects which provide their docstrings via non-standard
580 mechanisms (like Pyro proxies) to still be inspected by ipython's
583 mechanisms (like Pyro proxies) to still be inspected by ipython's
581 ? system.
584 ? system.
582
585
583 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
586 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
584 automatic capture system. I tried quite hard to make it work
587 automatic capture system. I tried quite hard to make it work
585 reliably, and simply failed. I tried many combinations with the
588 reliably, and simply failed. I tried many combinations with the
586 subprocess module, but eventually nothing worked in all needed
589 subprocess module, but eventually nothing worked in all needed
587 cases (not blocking stdin for the child, duplicating stdout
590 cases (not blocking stdin for the child, duplicating stdout
588 without blocking, etc). The new %sc/%sx still do capture to these
591 without blocking, etc). The new %sc/%sx still do capture to these
589 magical list/string objects which make shell use much more
592 magical list/string objects which make shell use much more
590 conveninent, so not all is lost.
593 conveninent, so not all is lost.
591
594
592 XXX - FIX MANUAL for the change above!
595 XXX - FIX MANUAL for the change above!
593
596
594 (runsource): I copied code.py's runsource() into ipython to modify
597 (runsource): I copied code.py's runsource() into ipython to modify
595 it a bit. Now the code object and source to be executed are
598 it a bit. Now the code object and source to be executed are
596 stored in ipython. This makes this info accessible to third-party
599 stored in ipython. This makes this info accessible to third-party
597 tools, like custom exception handlers. After a request by Frédéric
600 tools, like custom exception handlers. After a request by Frédéric
598 Mantegazza <mantegazza-AT-ill.fr>.
601 Mantegazza <mantegazza-AT-ill.fr>.
599
602
600 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
603 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
601 history-search via readline (like C-p/C-n). I'd wanted this for a
604 history-search via readline (like C-p/C-n). I'd wanted this for a
602 long time, but only recently found out how to do it. For users
605 long time, but only recently found out how to do it. For users
603 who already have their ipythonrc files made and want this, just
606 who already have their ipythonrc files made and want this, just
604 add:
607 add:
605
608
606 readline_parse_and_bind "\e[A": history-search-backward
609 readline_parse_and_bind "\e[A": history-search-backward
607 readline_parse_and_bind "\e[B": history-search-forward
610 readline_parse_and_bind "\e[B": history-search-forward
608
611
609 2005-03-18 Fernando Perez <fperez@colorado.edu>
612 2005-03-18 Fernando Perez <fperez@colorado.edu>
610
613
611 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
614 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
612 LSString and SList classes which allow transparent conversions
615 LSString and SList classes which allow transparent conversions
613 between list mode and whitespace-separated string.
616 between list mode and whitespace-separated string.
614 (magic_r): Fix recursion problem in %r.
617 (magic_r): Fix recursion problem in %r.
615
618
616 * IPython/genutils.py (LSString): New class to be used for
619 * IPython/genutils.py (LSString): New class to be used for
617 automatic storage of the results of all alias/system calls in _o
620 automatic storage of the results of all alias/system calls in _o
618 and _e (stdout/err). These provide a .l/.list attribute which
621 and _e (stdout/err). These provide a .l/.list attribute which
619 does automatic splitting on newlines. This means that for most
622 does automatic splitting on newlines. This means that for most
620 uses, you'll never need to do capturing of output with %sc/%sx
623 uses, you'll never need to do capturing of output with %sc/%sx
621 anymore, since ipython keeps this always done for you. Note that
624 anymore, since ipython keeps this always done for you. Note that
622 only the LAST results are stored, the _o/e variables are
625 only the LAST results are stored, the _o/e variables are
623 overwritten on each call. If you need to save their contents
626 overwritten on each call. If you need to save their contents
624 further, simply bind them to any other name.
627 further, simply bind them to any other name.
625
628
626 2005-03-17 Fernando Perez <fperez@colorado.edu>
629 2005-03-17 Fernando Perez <fperez@colorado.edu>
627
630
628 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
631 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
629 prompt namespace handling.
632 prompt namespace handling.
630
633
631 2005-03-16 Fernando Perez <fperez@colorado.edu>
634 2005-03-16 Fernando Perez <fperez@colorado.edu>
632
635
633 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
636 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
634 classic prompts to be '>>> ' (final space was missing, and it
637 classic prompts to be '>>> ' (final space was missing, and it
635 trips the emacs python mode).
638 trips the emacs python mode).
636 (BasePrompt.__str__): Added safe support for dynamic prompt
639 (BasePrompt.__str__): Added safe support for dynamic prompt
637 strings. Now you can set your prompt string to be '$x', and the
640 strings. Now you can set your prompt string to be '$x', and the
638 value of x will be printed from your interactive namespace. The
641 value of x will be printed from your interactive namespace. The
639 interpolation syntax includes the full Itpl support, so
642 interpolation syntax includes the full Itpl support, so
640 ${foo()+x+bar()} is a valid prompt string now, and the function
643 ${foo()+x+bar()} is a valid prompt string now, and the function
641 calls will be made at runtime.
644 calls will be made at runtime.
642
645
643 2005-03-15 Fernando Perez <fperez@colorado.edu>
646 2005-03-15 Fernando Perez <fperez@colorado.edu>
644
647
645 * IPython/Magic.py (magic_history): renamed %hist to %history, to
648 * IPython/Magic.py (magic_history): renamed %hist to %history, to
646 avoid name clashes in pylab. %hist still works, it just forwards
649 avoid name clashes in pylab. %hist still works, it just forwards
647 the call to %history.
650 the call to %history.
648
651
649 2005-03-02 *** Released version 0.6.12
652 2005-03-02 *** Released version 0.6.12
650
653
651 2005-03-02 Fernando Perez <fperez@colorado.edu>
654 2005-03-02 Fernando Perez <fperez@colorado.edu>
652
655
653 * IPython/iplib.py (handle_magic): log magic calls properly as
656 * IPython/iplib.py (handle_magic): log magic calls properly as
654 ipmagic() function calls.
657 ipmagic() function calls.
655
658
656 * IPython/Magic.py (magic_time): Improved %time to support
659 * IPython/Magic.py (magic_time): Improved %time to support
657 statements and provide wall-clock as well as CPU time.
660 statements and provide wall-clock as well as CPU time.
658
661
659 2005-02-27 Fernando Perez <fperez@colorado.edu>
662 2005-02-27 Fernando Perez <fperez@colorado.edu>
660
663
661 * IPython/hooks.py: New hooks module, to expose user-modifiable
664 * IPython/hooks.py: New hooks module, to expose user-modifiable
662 IPython functionality in a clean manner. For now only the editor
665 IPython functionality in a clean manner. For now only the editor
663 hook is actually written, and other thigns which I intend to turn
666 hook is actually written, and other thigns which I intend to turn
664 into proper hooks aren't yet there. The display and prefilter
667 into proper hooks aren't yet there. The display and prefilter
665 stuff, for example, should be hooks. But at least now the
668 stuff, for example, should be hooks. But at least now the
666 framework is in place, and the rest can be moved here with more
669 framework is in place, and the rest can be moved here with more
667 time later. IPython had had a .hooks variable for a long time for
670 time later. IPython had had a .hooks variable for a long time for
668 this purpose, but I'd never actually used it for anything.
671 this purpose, but I'd never actually used it for anything.
669
672
670 2005-02-26 Fernando Perez <fperez@colorado.edu>
673 2005-02-26 Fernando Perez <fperez@colorado.edu>
671
674
672 * IPython/ipmaker.py (make_IPython): make the default ipython
675 * IPython/ipmaker.py (make_IPython): make the default ipython
673 directory be called _ipython under win32, to follow more the
676 directory be called _ipython under win32, to follow more the
674 naming peculiarities of that platform (where buggy software like
677 naming peculiarities of that platform (where buggy software like
675 Visual Sourcesafe breaks with .named directories). Reported by
678 Visual Sourcesafe breaks with .named directories). Reported by
676 Ville Vainio.
679 Ville Vainio.
677
680
678 2005-02-23 Fernando Perez <fperez@colorado.edu>
681 2005-02-23 Fernando Perez <fperez@colorado.edu>
679
682
680 * IPython/iplib.py (InteractiveShell.__init__): removed a few
683 * IPython/iplib.py (InteractiveShell.__init__): removed a few
681 auto_aliases for win32 which were causing problems. Users can
684 auto_aliases for win32 which were causing problems. Users can
682 define the ones they personally like.
685 define the ones they personally like.
683
686
684 2005-02-21 Fernando Perez <fperez@colorado.edu>
687 2005-02-21 Fernando Perez <fperez@colorado.edu>
685
688
686 * IPython/Magic.py (magic_time): new magic to time execution of
689 * IPython/Magic.py (magic_time): new magic to time execution of
687 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
690 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
688
691
689 2005-02-19 Fernando Perez <fperez@colorado.edu>
692 2005-02-19 Fernando Perez <fperez@colorado.edu>
690
693
691 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
694 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
692 into keys (for prompts, for example).
695 into keys (for prompts, for example).
693
696
694 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
697 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
695 prompts in case users want them. This introduces a small behavior
698 prompts in case users want them. This introduces a small behavior
696 change: ipython does not automatically add a space to all prompts
699 change: ipython does not automatically add a space to all prompts
697 anymore. To get the old prompts with a space, users should add it
700 anymore. To get the old prompts with a space, users should add it
698 manually to their ipythonrc file, so for example prompt_in1 should
701 manually to their ipythonrc file, so for example prompt_in1 should
699 now read 'In [\#]: ' instead of 'In [\#]:'.
702 now read 'In [\#]: ' instead of 'In [\#]:'.
700 (BasePrompt.__init__): New option prompts_pad_left (only in rc
703 (BasePrompt.__init__): New option prompts_pad_left (only in rc
701 file) to control left-padding of secondary prompts.
704 file) to control left-padding of secondary prompts.
702
705
703 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
706 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
704 the profiler can't be imported. Fix for Debian, which removed
707 the profiler can't be imported. Fix for Debian, which removed
705 profile.py because of License issues. I applied a slightly
708 profile.py because of License issues. I applied a slightly
706 modified version of the original Debian patch at
709 modified version of the original Debian patch at
707 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
710 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
708
711
709 2005-02-17 Fernando Perez <fperez@colorado.edu>
712 2005-02-17 Fernando Perez <fperez@colorado.edu>
710
713
711 * IPython/genutils.py (native_line_ends): Fix bug which would
714 * IPython/genutils.py (native_line_ends): Fix bug which would
712 cause improper line-ends under win32 b/c I was not opening files
715 cause improper line-ends under win32 b/c I was not opening files
713 in binary mode. Bug report and fix thanks to Ville.
716 in binary mode. Bug report and fix thanks to Ville.
714
717
715 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
718 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
716 trying to catch spurious foo[1] autocalls. My fix actually broke
719 trying to catch spurious foo[1] autocalls. My fix actually broke
717 ',/' autoquote/call with explicit escape (bad regexp).
720 ',/' autoquote/call with explicit escape (bad regexp).
718
721
719 2005-02-15 *** Released version 0.6.11
722 2005-02-15 *** Released version 0.6.11
720
723
721 2005-02-14 Fernando Perez <fperez@colorado.edu>
724 2005-02-14 Fernando Perez <fperez@colorado.edu>
722
725
723 * IPython/background_jobs.py: New background job management
726 * IPython/background_jobs.py: New background job management
724 subsystem. This is implemented via a new set of classes, and
727 subsystem. This is implemented via a new set of classes, and
725 IPython now provides a builtin 'jobs' object for background job
728 IPython now provides a builtin 'jobs' object for background job
726 execution. A convenience %bg magic serves as a lightweight
729 execution. A convenience %bg magic serves as a lightweight
727 frontend for starting the more common type of calls. This was
730 frontend for starting the more common type of calls. This was
728 inspired by discussions with B. Granger and the BackgroundCommand
731 inspired by discussions with B. Granger and the BackgroundCommand
729 class described in the book Python Scripting for Computational
732 class described in the book Python Scripting for Computational
730 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
733 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
731 (although ultimately no code from this text was used, as IPython's
734 (although ultimately no code from this text was used, as IPython's
732 system is a separate implementation).
735 system is a separate implementation).
733
736
734 * IPython/iplib.py (MagicCompleter.python_matches): add new option
737 * IPython/iplib.py (MagicCompleter.python_matches): add new option
735 to control the completion of single/double underscore names
738 to control the completion of single/double underscore names
736 separately. As documented in the example ipytonrc file, the
739 separately. As documented in the example ipytonrc file, the
737 readline_omit__names variable can now be set to 2, to omit even
740 readline_omit__names variable can now be set to 2, to omit even
738 single underscore names. Thanks to a patch by Brian Wong
741 single underscore names. Thanks to a patch by Brian Wong
739 <BrianWong-AT-AirgoNetworks.Com>.
742 <BrianWong-AT-AirgoNetworks.Com>.
740 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
743 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
741 be autocalled as foo([1]) if foo were callable. A problem for
744 be autocalled as foo([1]) if foo were callable. A problem for
742 things which are both callable and implement __getitem__.
745 things which are both callable and implement __getitem__.
743 (init_readline): Fix autoindentation for win32. Thanks to a patch
746 (init_readline): Fix autoindentation for win32. Thanks to a patch
744 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
747 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
745
748
746 2005-02-12 Fernando Perez <fperez@colorado.edu>
749 2005-02-12 Fernando Perez <fperez@colorado.edu>
747
750
748 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
751 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
749 which I had written long ago to sort out user error messages which
752 which I had written long ago to sort out user error messages which
750 may occur during startup. This seemed like a good idea initially,
753 may occur during startup. This seemed like a good idea initially,
751 but it has proven a disaster in retrospect. I don't want to
754 but it has proven a disaster in retrospect. I don't want to
752 change much code for now, so my fix is to set the internal 'debug'
755 change much code for now, so my fix is to set the internal 'debug'
753 flag to true everywhere, whose only job was precisely to control
756 flag to true everywhere, whose only job was precisely to control
754 this subsystem. This closes issue 28 (as well as avoiding all
757 this subsystem. This closes issue 28 (as well as avoiding all
755 sorts of strange hangups which occur from time to time).
758 sorts of strange hangups which occur from time to time).
756
759
757 2005-02-07 Fernando Perez <fperez@colorado.edu>
760 2005-02-07 Fernando Perez <fperez@colorado.edu>
758
761
759 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
762 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
760 previous call produced a syntax error.
763 previous call produced a syntax error.
761
764
762 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
765 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
763 classes without constructor.
766 classes without constructor.
764
767
765 2005-02-06 Fernando Perez <fperez@colorado.edu>
768 2005-02-06 Fernando Perez <fperez@colorado.edu>
766
769
767 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
770 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
768 completions with the results of each matcher, so we return results
771 completions with the results of each matcher, so we return results
769 to the user from all namespaces. This breaks with ipython
772 to the user from all namespaces. This breaks with ipython
770 tradition, but I think it's a nicer behavior. Now you get all
773 tradition, but I think it's a nicer behavior. Now you get all
771 possible completions listed, from all possible namespaces (python,
774 possible completions listed, from all possible namespaces (python,
772 filesystem, magics...) After a request by John Hunter
775 filesystem, magics...) After a request by John Hunter
773 <jdhunter-AT-nitace.bsd.uchicago.edu>.
776 <jdhunter-AT-nitace.bsd.uchicago.edu>.
774
777
775 2005-02-05 Fernando Perez <fperez@colorado.edu>
778 2005-02-05 Fernando Perez <fperez@colorado.edu>
776
779
777 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
780 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
778 the call had quote characters in it (the quotes were stripped).
781 the call had quote characters in it (the quotes were stripped).
779
782
780 2005-01-31 Fernando Perez <fperez@colorado.edu>
783 2005-01-31 Fernando Perez <fperez@colorado.edu>
781
784
782 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
785 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
783 Itpl.itpl() to make the code more robust against psyco
786 Itpl.itpl() to make the code more robust against psyco
784 optimizations.
787 optimizations.
785
788
786 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
789 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
787 of causing an exception. Quicker, cleaner.
790 of causing an exception. Quicker, cleaner.
788
791
789 2005-01-28 Fernando Perez <fperez@colorado.edu>
792 2005-01-28 Fernando Perez <fperez@colorado.edu>
790
793
791 * scripts/ipython_win_post_install.py (install): hardcode
794 * scripts/ipython_win_post_install.py (install): hardcode
792 sys.prefix+'python.exe' as the executable path. It turns out that
795 sys.prefix+'python.exe' as the executable path. It turns out that
793 during the post-installation run, sys.executable resolves to the
796 during the post-installation run, sys.executable resolves to the
794 name of the binary installer! I should report this as a distutils
797 name of the binary installer! I should report this as a distutils
795 bug, I think. I updated the .10 release with this tiny fix, to
798 bug, I think. I updated the .10 release with this tiny fix, to
796 avoid annoying the lists further.
799 avoid annoying the lists further.
797
800
798 2005-01-27 *** Released version 0.6.10
801 2005-01-27 *** Released version 0.6.10
799
802
800 2005-01-27 Fernando Perez <fperez@colorado.edu>
803 2005-01-27 Fernando Perez <fperez@colorado.edu>
801
804
802 * IPython/numutils.py (norm): Added 'inf' as optional name for
805 * IPython/numutils.py (norm): Added 'inf' as optional name for
803 L-infinity norm, included references to mathworld.com for vector
806 L-infinity norm, included references to mathworld.com for vector
804 norm definitions.
807 norm definitions.
805 (amin/amax): added amin/amax for array min/max. Similar to what
808 (amin/amax): added amin/amax for array min/max. Similar to what
806 pylab ships with after the recent reorganization of names.
809 pylab ships with after the recent reorganization of names.
807 (spike/spike_odd): removed deprecated spike/spike_odd functions.
810 (spike/spike_odd): removed deprecated spike/spike_odd functions.
808
811
809 * ipython.el: committed Alex's recent fixes and improvements.
812 * ipython.el: committed Alex's recent fixes and improvements.
810 Tested with python-mode from CVS, and it looks excellent. Since
813 Tested with python-mode from CVS, and it looks excellent. Since
811 python-mode hasn't released anything in a while, I'm temporarily
814 python-mode hasn't released anything in a while, I'm temporarily
812 putting a copy of today's CVS (v 4.70) of python-mode in:
815 putting a copy of today's CVS (v 4.70) of python-mode in:
813 http://ipython.scipy.org/tmp/python-mode.el
816 http://ipython.scipy.org/tmp/python-mode.el
814
817
815 * scripts/ipython_win_post_install.py (install): Win32 fix to use
818 * scripts/ipython_win_post_install.py (install): Win32 fix to use
816 sys.executable for the executable name, instead of assuming it's
819 sys.executable for the executable name, instead of assuming it's
817 called 'python.exe' (the post-installer would have produced broken
820 called 'python.exe' (the post-installer would have produced broken
818 setups on systems with a differently named python binary).
821 setups on systems with a differently named python binary).
819
822
820 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
823 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
821 references to os.linesep, to make the code more
824 references to os.linesep, to make the code more
822 platform-independent. This is also part of the win32 coloring
825 platform-independent. This is also part of the win32 coloring
823 fixes.
826 fixes.
824
827
825 * IPython/genutils.py (page_dumb): Remove attempts to chop long
828 * IPython/genutils.py (page_dumb): Remove attempts to chop long
826 lines, which actually cause coloring bugs because the length of
829 lines, which actually cause coloring bugs because the length of
827 the line is very difficult to correctly compute with embedded
830 the line is very difficult to correctly compute with embedded
828 escapes. This was the source of all the coloring problems under
831 escapes. This was the source of all the coloring problems under
829 Win32. I think that _finally_, Win32 users have a properly
832 Win32. I think that _finally_, Win32 users have a properly
830 working ipython in all respects. This would never have happened
833 working ipython in all respects. This would never have happened
831 if not for Gary Bishop and Viktor Ransmayr's great help and work.
834 if not for Gary Bishop and Viktor Ransmayr's great help and work.
832
835
833 2005-01-26 *** Released version 0.6.9
836 2005-01-26 *** Released version 0.6.9
834
837
835 2005-01-25 Fernando Perez <fperez@colorado.edu>
838 2005-01-25 Fernando Perez <fperez@colorado.edu>
836
839
837 * setup.py: finally, we have a true Windows installer, thanks to
840 * setup.py: finally, we have a true Windows installer, thanks to
838 the excellent work of Viktor Ransmayr
841 the excellent work of Viktor Ransmayr
839 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
842 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
840 Windows users. The setup routine is quite a bit cleaner thanks to
843 Windows users. The setup routine is quite a bit cleaner thanks to
841 this, and the post-install script uses the proper functions to
844 this, and the post-install script uses the proper functions to
842 allow a clean de-installation using the standard Windows Control
845 allow a clean de-installation using the standard Windows Control
843 Panel.
846 Panel.
844
847
845 * IPython/genutils.py (get_home_dir): changed to use the $HOME
848 * IPython/genutils.py (get_home_dir): changed to use the $HOME
846 environment variable under all OSes (including win32) if
849 environment variable under all OSes (including win32) if
847 available. This will give consistency to win32 users who have set
850 available. This will give consistency to win32 users who have set
848 this variable for any reason. If os.environ['HOME'] fails, the
851 this variable for any reason. If os.environ['HOME'] fails, the
849 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
852 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
850
853
851 2005-01-24 Fernando Perez <fperez@colorado.edu>
854 2005-01-24 Fernando Perez <fperez@colorado.edu>
852
855
853 * IPython/numutils.py (empty_like): add empty_like(), similar to
856 * IPython/numutils.py (empty_like): add empty_like(), similar to
854 zeros_like() but taking advantage of the new empty() Numeric routine.
857 zeros_like() but taking advantage of the new empty() Numeric routine.
855
858
856 2005-01-23 *** Released version 0.6.8
859 2005-01-23 *** Released version 0.6.8
857
860
858 2005-01-22 Fernando Perez <fperez@colorado.edu>
861 2005-01-22 Fernando Perez <fperez@colorado.edu>
859
862
860 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
863 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
861 automatic show() calls. After discussing things with JDH, it
864 automatic show() calls. After discussing things with JDH, it
862 turns out there are too many corner cases where this can go wrong.
865 turns out there are too many corner cases where this can go wrong.
863 It's best not to try to be 'too smart', and simply have ipython
866 It's best not to try to be 'too smart', and simply have ipython
864 reproduce as much as possible the default behavior of a normal
867 reproduce as much as possible the default behavior of a normal
865 python shell.
868 python shell.
866
869
867 * IPython/iplib.py (InteractiveShell.__init__): Modified the
870 * IPython/iplib.py (InteractiveShell.__init__): Modified the
868 line-splitting regexp and _prefilter() to avoid calling getattr()
871 line-splitting regexp and _prefilter() to avoid calling getattr()
869 on assignments. This closes
872 on assignments. This closes
870 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
873 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
871 readline uses getattr(), so a simple <TAB> keypress is still
874 readline uses getattr(), so a simple <TAB> keypress is still
872 enough to trigger getattr() calls on an object.
875 enough to trigger getattr() calls on an object.
873
876
874 2005-01-21 Fernando Perez <fperez@colorado.edu>
877 2005-01-21 Fernando Perez <fperez@colorado.edu>
875
878
876 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
879 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
877 docstring under pylab so it doesn't mask the original.
880 docstring under pylab so it doesn't mask the original.
878
881
879 2005-01-21 *** Released version 0.6.7
882 2005-01-21 *** Released version 0.6.7
880
883
881 2005-01-21 Fernando Perez <fperez@colorado.edu>
884 2005-01-21 Fernando Perez <fperez@colorado.edu>
882
885
883 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
886 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
884 signal handling for win32 users in multithreaded mode.
887 signal handling for win32 users in multithreaded mode.
885
888
886 2005-01-17 Fernando Perez <fperez@colorado.edu>
889 2005-01-17 Fernando Perez <fperez@colorado.edu>
887
890
888 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
891 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
889 instances with no __init__. After a crash report by Norbert Nemec
892 instances with no __init__. After a crash report by Norbert Nemec
890 <Norbert-AT-nemec-online.de>.
893 <Norbert-AT-nemec-online.de>.
891
894
892 2005-01-14 Fernando Perez <fperez@colorado.edu>
895 2005-01-14 Fernando Perez <fperez@colorado.edu>
893
896
894 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
897 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
895 names for verbose exceptions, when multiple dotted names and the
898 names for verbose exceptions, when multiple dotted names and the
896 'parent' object were present on the same line.
899 'parent' object were present on the same line.
897
900
898 2005-01-11 Fernando Perez <fperez@colorado.edu>
901 2005-01-11 Fernando Perez <fperez@colorado.edu>
899
902
900 * IPython/genutils.py (flag_calls): new utility to trap and flag
903 * IPython/genutils.py (flag_calls): new utility to trap and flag
901 calls in functions. I need it to clean up matplotlib support.
904 calls in functions. I need it to clean up matplotlib support.
902 Also removed some deprecated code in genutils.
905 Also removed some deprecated code in genutils.
903
906
904 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
907 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
905 that matplotlib scripts called with %run, which don't call show()
908 that matplotlib scripts called with %run, which don't call show()
906 themselves, still have their plotting windows open.
909 themselves, still have their plotting windows open.
907
910
908 2005-01-05 Fernando Perez <fperez@colorado.edu>
911 2005-01-05 Fernando Perez <fperez@colorado.edu>
909
912
910 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
913 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
911 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
914 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
912
915
913 2004-12-19 Fernando Perez <fperez@colorado.edu>
916 2004-12-19 Fernando Perez <fperez@colorado.edu>
914
917
915 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
918 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
916 parent_runcode, which was an eyesore. The same result can be
919 parent_runcode, which was an eyesore. The same result can be
917 obtained with Python's regular superclass mechanisms.
920 obtained with Python's regular superclass mechanisms.
918
921
919 2004-12-17 Fernando Perez <fperez@colorado.edu>
922 2004-12-17 Fernando Perez <fperez@colorado.edu>
920
923
921 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
924 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
922 reported by Prabhu.
925 reported by Prabhu.
923 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
926 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
924 sys.stderr) instead of explicitly calling sys.stderr. This helps
927 sys.stderr) instead of explicitly calling sys.stderr. This helps
925 maintain our I/O abstractions clean, for future GUI embeddings.
928 maintain our I/O abstractions clean, for future GUI embeddings.
926
929
927 * IPython/genutils.py (info): added new utility for sys.stderr
930 * IPython/genutils.py (info): added new utility for sys.stderr
928 unified info message handling (thin wrapper around warn()).
931 unified info message handling (thin wrapper around warn()).
929
932
930 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
933 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
931 composite (dotted) names on verbose exceptions.
934 composite (dotted) names on verbose exceptions.
932 (VerboseTB.nullrepr): harden against another kind of errors which
935 (VerboseTB.nullrepr): harden against another kind of errors which
933 Python's inspect module can trigger, and which were crashing
936 Python's inspect module can trigger, and which were crashing
934 IPython. Thanks to a report by Marco Lombardi
937 IPython. Thanks to a report by Marco Lombardi
935 <mlombard-AT-ma010192.hq.eso.org>.
938 <mlombard-AT-ma010192.hq.eso.org>.
936
939
937 2004-12-13 *** Released version 0.6.6
940 2004-12-13 *** Released version 0.6.6
938
941
939 2004-12-12 Fernando Perez <fperez@colorado.edu>
942 2004-12-12 Fernando Perez <fperez@colorado.edu>
940
943
941 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
944 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
942 generated by pygtk upon initialization if it was built without
945 generated by pygtk upon initialization if it was built without
943 threads (for matplotlib users). After a crash reported by
946 threads (for matplotlib users). After a crash reported by
944 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
947 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
945
948
946 * IPython/ipmaker.py (make_IPython): fix small bug in the
949 * IPython/ipmaker.py (make_IPython): fix small bug in the
947 import_some parameter for multiple imports.
950 import_some parameter for multiple imports.
948
951
949 * IPython/iplib.py (ipmagic): simplified the interface of
952 * IPython/iplib.py (ipmagic): simplified the interface of
950 ipmagic() to take a single string argument, just as it would be
953 ipmagic() to take a single string argument, just as it would be
951 typed at the IPython cmd line.
954 typed at the IPython cmd line.
952 (ipalias): Added new ipalias() with an interface identical to
955 (ipalias): Added new ipalias() with an interface identical to
953 ipmagic(). This completes exposing a pure python interface to the
956 ipmagic(). This completes exposing a pure python interface to the
954 alias and magic system, which can be used in loops or more complex
957 alias and magic system, which can be used in loops or more complex
955 code where IPython's automatic line mangling is not active.
958 code where IPython's automatic line mangling is not active.
956
959
957 * IPython/genutils.py (timing): changed interface of timing to
960 * IPython/genutils.py (timing): changed interface of timing to
958 simply run code once, which is the most common case. timings()
961 simply run code once, which is the most common case. timings()
959 remains unchanged, for the cases where you want multiple runs.
962 remains unchanged, for the cases where you want multiple runs.
960
963
961 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
964 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
962 bug where Python2.2 crashes with exec'ing code which does not end
965 bug where Python2.2 crashes with exec'ing code which does not end
963 in a single newline. Python 2.3 is OK, so I hadn't noticed this
966 in a single newline. Python 2.3 is OK, so I hadn't noticed this
964 before.
967 before.
965
968
966 2004-12-10 Fernando Perez <fperez@colorado.edu>
969 2004-12-10 Fernando Perez <fperez@colorado.edu>
967
970
968 * IPython/Magic.py (Magic.magic_prun): changed name of option from
971 * IPython/Magic.py (Magic.magic_prun): changed name of option from
969 -t to -T, to accomodate the new -t flag in %run (the %run and
972 -t to -T, to accomodate the new -t flag in %run (the %run and
970 %prun options are kind of intermixed, and it's not easy to change
973 %prun options are kind of intermixed, and it's not easy to change
971 this with the limitations of python's getopt).
974 this with the limitations of python's getopt).
972
975
973 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
976 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
974 the execution of scripts. It's not as fine-tuned as timeit.py,
977 the execution of scripts. It's not as fine-tuned as timeit.py,
975 but it works from inside ipython (and under 2.2, which lacks
978 but it works from inside ipython (and under 2.2, which lacks
976 timeit.py). Optionally a number of runs > 1 can be given for
979 timeit.py). Optionally a number of runs > 1 can be given for
977 timing very short-running code.
980 timing very short-running code.
978
981
979 * IPython/genutils.py (uniq_stable): new routine which returns a
982 * IPython/genutils.py (uniq_stable): new routine which returns a
980 list of unique elements in any iterable, but in stable order of
983 list of unique elements in any iterable, but in stable order of
981 appearance. I needed this for the ultraTB fixes, and it's a handy
984 appearance. I needed this for the ultraTB fixes, and it's a handy
982 utility.
985 utility.
983
986
984 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
987 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
985 dotted names in Verbose exceptions. This had been broken since
988 dotted names in Verbose exceptions. This had been broken since
986 the very start, now x.y will properly be printed in a Verbose
989 the very start, now x.y will properly be printed in a Verbose
987 traceback, instead of x being shown and y appearing always as an
990 traceback, instead of x being shown and y appearing always as an
988 'undefined global'. Getting this to work was a bit tricky,
991 'undefined global'. Getting this to work was a bit tricky,
989 because by default python tokenizers are stateless. Saved by
992 because by default python tokenizers are stateless. Saved by
990 python's ability to easily add a bit of state to an arbitrary
993 python's ability to easily add a bit of state to an arbitrary
991 function (without needing to build a full-blown callable object).
994 function (without needing to build a full-blown callable object).
992
995
993 Also big cleanup of this code, which had horrendous runtime
996 Also big cleanup of this code, which had horrendous runtime
994 lookups of zillions of attributes for colorization. Moved all
997 lookups of zillions of attributes for colorization. Moved all
995 this code into a few templates, which make it cleaner and quicker.
998 this code into a few templates, which make it cleaner and quicker.
996
999
997 Printout quality was also improved for Verbose exceptions: one
1000 Printout quality was also improved for Verbose exceptions: one
998 variable per line, and memory addresses are printed (this can be
1001 variable per line, and memory addresses are printed (this can be
999 quite handy in nasty debugging situations, which is what Verbose
1002 quite handy in nasty debugging situations, which is what Verbose
1000 is for).
1003 is for).
1001
1004
1002 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1005 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1003 the command line as scripts to be loaded by embedded instances.
1006 the command line as scripts to be loaded by embedded instances.
1004 Doing so has the potential for an infinite recursion if there are
1007 Doing so has the potential for an infinite recursion if there are
1005 exceptions thrown in the process. This fixes a strange crash
1008 exceptions thrown in the process. This fixes a strange crash
1006 reported by Philippe MULLER <muller-AT-irit.fr>.
1009 reported by Philippe MULLER <muller-AT-irit.fr>.
1007
1010
1008 2004-12-09 Fernando Perez <fperez@colorado.edu>
1011 2004-12-09 Fernando Perez <fperez@colorado.edu>
1009
1012
1010 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1013 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1011 to reflect new names in matplotlib, which now expose the
1014 to reflect new names in matplotlib, which now expose the
1012 matlab-compatible interface via a pylab module instead of the
1015 matlab-compatible interface via a pylab module instead of the
1013 'matlab' name. The new code is backwards compatible, so users of
1016 'matlab' name. The new code is backwards compatible, so users of
1014 all matplotlib versions are OK. Patch by J. Hunter.
1017 all matplotlib versions are OK. Patch by J. Hunter.
1015
1018
1016 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1019 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1017 of __init__ docstrings for instances (class docstrings are already
1020 of __init__ docstrings for instances (class docstrings are already
1018 automatically printed). Instances with customized docstrings
1021 automatically printed). Instances with customized docstrings
1019 (indep. of the class) are also recognized and all 3 separate
1022 (indep. of the class) are also recognized and all 3 separate
1020 docstrings are printed (instance, class, constructor). After some
1023 docstrings are printed (instance, class, constructor). After some
1021 comments/suggestions by J. Hunter.
1024 comments/suggestions by J. Hunter.
1022
1025
1023 2004-12-05 Fernando Perez <fperez@colorado.edu>
1026 2004-12-05 Fernando Perez <fperez@colorado.edu>
1024
1027
1025 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1028 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1026 warnings when tab-completion fails and triggers an exception.
1029 warnings when tab-completion fails and triggers an exception.
1027
1030
1028 2004-12-03 Fernando Perez <fperez@colorado.edu>
1031 2004-12-03 Fernando Perez <fperez@colorado.edu>
1029
1032
1030 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1033 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1031 be triggered when using 'run -p'. An incorrect option flag was
1034 be triggered when using 'run -p'. An incorrect option flag was
1032 being set ('d' instead of 'D').
1035 being set ('d' instead of 'D').
1033 (manpage): fix missing escaped \- sign.
1036 (manpage): fix missing escaped \- sign.
1034
1037
1035 2004-11-30 *** Released version 0.6.5
1038 2004-11-30 *** Released version 0.6.5
1036
1039
1037 2004-11-30 Fernando Perez <fperez@colorado.edu>
1040 2004-11-30 Fernando Perez <fperez@colorado.edu>
1038
1041
1039 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1042 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1040 setting with -d option.
1043 setting with -d option.
1041
1044
1042 * setup.py (docfiles): Fix problem where the doc glob I was using
1045 * setup.py (docfiles): Fix problem where the doc glob I was using
1043 was COMPLETELY BROKEN. It was giving the right files by pure
1046 was COMPLETELY BROKEN. It was giving the right files by pure
1044 accident, but failed once I tried to include ipython.el. Note:
1047 accident, but failed once I tried to include ipython.el. Note:
1045 glob() does NOT allow you to do exclusion on multiple endings!
1048 glob() does NOT allow you to do exclusion on multiple endings!
1046
1049
1047 2004-11-29 Fernando Perez <fperez@colorado.edu>
1050 2004-11-29 Fernando Perez <fperez@colorado.edu>
1048
1051
1049 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1052 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1050 the manpage as the source. Better formatting & consistency.
1053 the manpage as the source. Better formatting & consistency.
1051
1054
1052 * IPython/Magic.py (magic_run): Added new -d option, to run
1055 * IPython/Magic.py (magic_run): Added new -d option, to run
1053 scripts under the control of the python pdb debugger. Note that
1056 scripts under the control of the python pdb debugger. Note that
1054 this required changing the %prun option -d to -D, to avoid a clash
1057 this required changing the %prun option -d to -D, to avoid a clash
1055 (since %run must pass options to %prun, and getopt is too dumb to
1058 (since %run must pass options to %prun, and getopt is too dumb to
1056 handle options with string values with embedded spaces). Thanks
1059 handle options with string values with embedded spaces). Thanks
1057 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1060 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1058 (magic_who_ls): added type matching to %who and %whos, so that one
1061 (magic_who_ls): added type matching to %who and %whos, so that one
1059 can filter their output to only include variables of certain
1062 can filter their output to only include variables of certain
1060 types. Another suggestion by Matthew.
1063 types. Another suggestion by Matthew.
1061 (magic_whos): Added memory summaries in kb and Mb for arrays.
1064 (magic_whos): Added memory summaries in kb and Mb for arrays.
1062 (magic_who): Improve formatting (break lines every 9 vars).
1065 (magic_who): Improve formatting (break lines every 9 vars).
1063
1066
1064 2004-11-28 Fernando Perez <fperez@colorado.edu>
1067 2004-11-28 Fernando Perez <fperez@colorado.edu>
1065
1068
1066 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1069 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1067 cache when empty lines were present.
1070 cache when empty lines were present.
1068
1071
1069 2004-11-24 Fernando Perez <fperez@colorado.edu>
1072 2004-11-24 Fernando Perez <fperez@colorado.edu>
1070
1073
1071 * IPython/usage.py (__doc__): document the re-activated threading
1074 * IPython/usage.py (__doc__): document the re-activated threading
1072 options for WX and GTK.
1075 options for WX and GTK.
1073
1076
1074 2004-11-23 Fernando Perez <fperez@colorado.edu>
1077 2004-11-23 Fernando Perez <fperez@colorado.edu>
1075
1078
1076 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1079 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1077 the -wthread and -gthread options, along with a new -tk one to try
1080 the -wthread and -gthread options, along with a new -tk one to try
1078 and coordinate Tk threading with wx/gtk. The tk support is very
1081 and coordinate Tk threading with wx/gtk. The tk support is very
1079 platform dependent, since it seems to require Tcl and Tk to be
1082 platform dependent, since it seems to require Tcl and Tk to be
1080 built with threads (Fedora1/2 appears NOT to have it, but in
1083 built with threads (Fedora1/2 appears NOT to have it, but in
1081 Prabhu's Debian boxes it works OK). But even with some Tk
1084 Prabhu's Debian boxes it works OK). But even with some Tk
1082 limitations, this is a great improvement.
1085 limitations, this is a great improvement.
1083
1086
1084 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1087 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1085 info in user prompts. Patch by Prabhu.
1088 info in user prompts. Patch by Prabhu.
1086
1089
1087 2004-11-18 Fernando Perez <fperez@colorado.edu>
1090 2004-11-18 Fernando Perez <fperez@colorado.edu>
1088
1091
1089 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1092 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1090 EOFErrors and bail, to avoid infinite loops if a non-terminating
1093 EOFErrors and bail, to avoid infinite loops if a non-terminating
1091 file is fed into ipython. Patch submitted in issue 19 by user,
1094 file is fed into ipython. Patch submitted in issue 19 by user,
1092 many thanks.
1095 many thanks.
1093
1096
1094 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1097 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1095 autoquote/parens in continuation prompts, which can cause lots of
1098 autoquote/parens in continuation prompts, which can cause lots of
1096 problems. Closes roundup issue 20.
1099 problems. Closes roundup issue 20.
1097
1100
1098 2004-11-17 Fernando Perez <fperez@colorado.edu>
1101 2004-11-17 Fernando Perez <fperez@colorado.edu>
1099
1102
1100 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1103 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1101 reported as debian bug #280505. I'm not sure my local changelog
1104 reported as debian bug #280505. I'm not sure my local changelog
1102 entry has the proper debian format (Jack?).
1105 entry has the proper debian format (Jack?).
1103
1106
1104 2004-11-08 *** Released version 0.6.4
1107 2004-11-08 *** Released version 0.6.4
1105
1108
1106 2004-11-08 Fernando Perez <fperez@colorado.edu>
1109 2004-11-08 Fernando Perez <fperez@colorado.edu>
1107
1110
1108 * IPython/iplib.py (init_readline): Fix exit message for Windows
1111 * IPython/iplib.py (init_readline): Fix exit message for Windows
1109 when readline is active. Thanks to a report by Eric Jones
1112 when readline is active. Thanks to a report by Eric Jones
1110 <eric-AT-enthought.com>.
1113 <eric-AT-enthought.com>.
1111
1114
1112 2004-11-07 Fernando Perez <fperez@colorado.edu>
1115 2004-11-07 Fernando Perez <fperez@colorado.edu>
1113
1116
1114 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1117 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1115 sometimes seen by win2k/cygwin users.
1118 sometimes seen by win2k/cygwin users.
1116
1119
1117 2004-11-06 Fernando Perez <fperez@colorado.edu>
1120 2004-11-06 Fernando Perez <fperez@colorado.edu>
1118
1121
1119 * IPython/iplib.py (interact): Change the handling of %Exit from
1122 * IPython/iplib.py (interact): Change the handling of %Exit from
1120 trying to propagate a SystemExit to an internal ipython flag.
1123 trying to propagate a SystemExit to an internal ipython flag.
1121 This is less elegant than using Python's exception mechanism, but
1124 This is less elegant than using Python's exception mechanism, but
1122 I can't get that to work reliably with threads, so under -pylab
1125 I can't get that to work reliably with threads, so under -pylab
1123 %Exit was hanging IPython. Cross-thread exception handling is
1126 %Exit was hanging IPython. Cross-thread exception handling is
1124 really a bitch. Thaks to a bug report by Stephen Walton
1127 really a bitch. Thaks to a bug report by Stephen Walton
1125 <stephen.walton-AT-csun.edu>.
1128 <stephen.walton-AT-csun.edu>.
1126
1129
1127 2004-11-04 Fernando Perez <fperez@colorado.edu>
1130 2004-11-04 Fernando Perez <fperez@colorado.edu>
1128
1131
1129 * IPython/iplib.py (raw_input_original): store a pointer to the
1132 * IPython/iplib.py (raw_input_original): store a pointer to the
1130 true raw_input to harden against code which can modify it
1133 true raw_input to harden against code which can modify it
1131 (wx.py.PyShell does this and would otherwise crash ipython).
1134 (wx.py.PyShell does this and would otherwise crash ipython).
1132 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1135 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1133
1136
1134 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1137 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1135 Ctrl-C problem, which does not mess up the input line.
1138 Ctrl-C problem, which does not mess up the input line.
1136
1139
1137 2004-11-03 Fernando Perez <fperez@colorado.edu>
1140 2004-11-03 Fernando Perez <fperez@colorado.edu>
1138
1141
1139 * IPython/Release.py: Changed licensing to BSD, in all files.
1142 * IPython/Release.py: Changed licensing to BSD, in all files.
1140 (name): lowercase name for tarball/RPM release.
1143 (name): lowercase name for tarball/RPM release.
1141
1144
1142 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1145 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1143 use throughout ipython.
1146 use throughout ipython.
1144
1147
1145 * IPython/Magic.py (Magic._ofind): Switch to using the new
1148 * IPython/Magic.py (Magic._ofind): Switch to using the new
1146 OInspect.getdoc() function.
1149 OInspect.getdoc() function.
1147
1150
1148 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1151 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1149 of the line currently being canceled via Ctrl-C. It's extremely
1152 of the line currently being canceled via Ctrl-C. It's extremely
1150 ugly, but I don't know how to do it better (the problem is one of
1153 ugly, but I don't know how to do it better (the problem is one of
1151 handling cross-thread exceptions).
1154 handling cross-thread exceptions).
1152
1155
1153 2004-10-28 Fernando Perez <fperez@colorado.edu>
1156 2004-10-28 Fernando Perez <fperez@colorado.edu>
1154
1157
1155 * IPython/Shell.py (signal_handler): add signal handlers to trap
1158 * IPython/Shell.py (signal_handler): add signal handlers to trap
1156 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1159 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1157 report by Francesc Alted.
1160 report by Francesc Alted.
1158
1161
1159 2004-10-21 Fernando Perez <fperez@colorado.edu>
1162 2004-10-21 Fernando Perez <fperez@colorado.edu>
1160
1163
1161 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1164 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1162 to % for pysh syntax extensions.
1165 to % for pysh syntax extensions.
1163
1166
1164 2004-10-09 Fernando Perez <fperez@colorado.edu>
1167 2004-10-09 Fernando Perez <fperez@colorado.edu>
1165
1168
1166 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1169 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1167 arrays to print a more useful summary, without calling str(arr).
1170 arrays to print a more useful summary, without calling str(arr).
1168 This avoids the problem of extremely lengthy computations which
1171 This avoids the problem of extremely lengthy computations which
1169 occur if arr is large, and appear to the user as a system lockup
1172 occur if arr is large, and appear to the user as a system lockup
1170 with 100% cpu activity. After a suggestion by Kristian Sandberg
1173 with 100% cpu activity. After a suggestion by Kristian Sandberg
1171 <Kristian.Sandberg@colorado.edu>.
1174 <Kristian.Sandberg@colorado.edu>.
1172 (Magic.__init__): fix bug in global magic escapes not being
1175 (Magic.__init__): fix bug in global magic escapes not being
1173 correctly set.
1176 correctly set.
1174
1177
1175 2004-10-08 Fernando Perez <fperez@colorado.edu>
1178 2004-10-08 Fernando Perez <fperez@colorado.edu>
1176
1179
1177 * IPython/Magic.py (__license__): change to absolute imports of
1180 * IPython/Magic.py (__license__): change to absolute imports of
1178 ipython's own internal packages, to start adapting to the absolute
1181 ipython's own internal packages, to start adapting to the absolute
1179 import requirement of PEP-328.
1182 import requirement of PEP-328.
1180
1183
1181 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1184 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1182 files, and standardize author/license marks through the Release
1185 files, and standardize author/license marks through the Release
1183 module instead of having per/file stuff (except for files with
1186 module instead of having per/file stuff (except for files with
1184 particular licenses, like the MIT/PSF-licensed codes).
1187 particular licenses, like the MIT/PSF-licensed codes).
1185
1188
1186 * IPython/Debugger.py: remove dead code for python 2.1
1189 * IPython/Debugger.py: remove dead code for python 2.1
1187
1190
1188 2004-10-04 Fernando Perez <fperez@colorado.edu>
1191 2004-10-04 Fernando Perez <fperez@colorado.edu>
1189
1192
1190 * IPython/iplib.py (ipmagic): New function for accessing magics
1193 * IPython/iplib.py (ipmagic): New function for accessing magics
1191 via a normal python function call.
1194 via a normal python function call.
1192
1195
1193 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1196 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1194 from '@' to '%', to accomodate the new @decorator syntax of python
1197 from '@' to '%', to accomodate the new @decorator syntax of python
1195 2.4.
1198 2.4.
1196
1199
1197 2004-09-29 Fernando Perez <fperez@colorado.edu>
1200 2004-09-29 Fernando Perez <fperez@colorado.edu>
1198
1201
1199 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1202 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1200 matplotlib.use to prevent running scripts which try to switch
1203 matplotlib.use to prevent running scripts which try to switch
1201 interactive backends from within ipython. This will just crash
1204 interactive backends from within ipython. This will just crash
1202 the python interpreter, so we can't allow it (but a detailed error
1205 the python interpreter, so we can't allow it (but a detailed error
1203 is given to the user).
1206 is given to the user).
1204
1207
1205 2004-09-28 Fernando Perez <fperez@colorado.edu>
1208 2004-09-28 Fernando Perez <fperez@colorado.edu>
1206
1209
1207 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1210 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1208 matplotlib-related fixes so that using @run with non-matplotlib
1211 matplotlib-related fixes so that using @run with non-matplotlib
1209 scripts doesn't pop up spurious plot windows. This requires
1212 scripts doesn't pop up spurious plot windows. This requires
1210 matplotlib >= 0.63, where I had to make some changes as well.
1213 matplotlib >= 0.63, where I had to make some changes as well.
1211
1214
1212 * IPython/ipmaker.py (make_IPython): update version requirement to
1215 * IPython/ipmaker.py (make_IPython): update version requirement to
1213 python 2.2.
1216 python 2.2.
1214
1217
1215 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1218 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1216 banner arg for embedded customization.
1219 banner arg for embedded customization.
1217
1220
1218 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1221 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1219 explicit uses of __IP as the IPython's instance name. Now things
1222 explicit uses of __IP as the IPython's instance name. Now things
1220 are properly handled via the shell.name value. The actual code
1223 are properly handled via the shell.name value. The actual code
1221 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1224 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1222 is much better than before. I'll clean things completely when the
1225 is much better than before. I'll clean things completely when the
1223 magic stuff gets a real overhaul.
1226 magic stuff gets a real overhaul.
1224
1227
1225 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1228 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1226 minor changes to debian dir.
1229 minor changes to debian dir.
1227
1230
1228 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
1231 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
1229 pointer to the shell itself in the interactive namespace even when
1232 pointer to the shell itself in the interactive namespace even when
1230 a user-supplied dict is provided. This is needed for embedding
1233 a user-supplied dict is provided. This is needed for embedding
1231 purposes (found by tests with Michel Sanner).
1234 purposes (found by tests with Michel Sanner).
1232
1235
1233 2004-09-27 Fernando Perez <fperez@colorado.edu>
1236 2004-09-27 Fernando Perez <fperez@colorado.edu>
1234
1237
1235 * IPython/UserConfig/ipythonrc: remove []{} from
1238 * IPython/UserConfig/ipythonrc: remove []{} from
1236 readline_remove_delims, so that things like [modname.<TAB> do
1239 readline_remove_delims, so that things like [modname.<TAB> do
1237 proper completion. This disables [].TAB, but that's a less common
1240 proper completion. This disables [].TAB, but that's a less common
1238 case than module names in list comprehensions, for example.
1241 case than module names in list comprehensions, for example.
1239 Thanks to a report by Andrea Riciputi.
1242 Thanks to a report by Andrea Riciputi.
1240
1243
1241 2004-09-09 Fernando Perez <fperez@colorado.edu>
1244 2004-09-09 Fernando Perez <fperez@colorado.edu>
1242
1245
1243 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
1246 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
1244 blocking problems in win32 and osx. Fix by John.
1247 blocking problems in win32 and osx. Fix by John.
1245
1248
1246 2004-09-08 Fernando Perez <fperez@colorado.edu>
1249 2004-09-08 Fernando Perez <fperez@colorado.edu>
1247
1250
1248 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
1251 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
1249 for Win32 and OSX. Fix by John Hunter.
1252 for Win32 and OSX. Fix by John Hunter.
1250
1253
1251 2004-08-30 *** Released version 0.6.3
1254 2004-08-30 *** Released version 0.6.3
1252
1255
1253 2004-08-30 Fernando Perez <fperez@colorado.edu>
1256 2004-08-30 Fernando Perez <fperez@colorado.edu>
1254
1257
1255 * setup.py (isfile): Add manpages to list of dependent files to be
1258 * setup.py (isfile): Add manpages to list of dependent files to be
1256 updated.
1259 updated.
1257
1260
1258 2004-08-27 Fernando Perez <fperez@colorado.edu>
1261 2004-08-27 Fernando Perez <fperez@colorado.edu>
1259
1262
1260 * IPython/Shell.py (start): I've disabled -wthread and -gthread
1263 * IPython/Shell.py (start): I've disabled -wthread and -gthread
1261 for now. They don't really work with standalone WX/GTK code
1264 for now. They don't really work with standalone WX/GTK code
1262 (though matplotlib IS working fine with both of those backends).
1265 (though matplotlib IS working fine with both of those backends).
1263 This will neeed much more testing. I disabled most things with
1266 This will neeed much more testing. I disabled most things with
1264 comments, so turning it back on later should be pretty easy.
1267 comments, so turning it back on later should be pretty easy.
1265
1268
1266 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
1269 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
1267 autocalling of expressions like r'foo', by modifying the line
1270 autocalling of expressions like r'foo', by modifying the line
1268 split regexp. Closes
1271 split regexp. Closes
1269 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
1272 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
1270 Riley <ipythonbugs-AT-sabi.net>.
1273 Riley <ipythonbugs-AT-sabi.net>.
1271 (InteractiveShell.mainloop): honor --nobanner with banner
1274 (InteractiveShell.mainloop): honor --nobanner with banner
1272 extensions.
1275 extensions.
1273
1276
1274 * IPython/Shell.py: Significant refactoring of all classes, so
1277 * IPython/Shell.py: Significant refactoring of all classes, so
1275 that we can really support ALL matplotlib backends and threading
1278 that we can really support ALL matplotlib backends and threading
1276 models (John spotted a bug with Tk which required this). Now we
1279 models (John spotted a bug with Tk which required this). Now we
1277 should support single-threaded, WX-threads and GTK-threads, both
1280 should support single-threaded, WX-threads and GTK-threads, both
1278 for generic code and for matplotlib.
1281 for generic code and for matplotlib.
1279
1282
1280 * IPython/ipmaker.py (__call__): Changed -mpthread option to
1283 * IPython/ipmaker.py (__call__): Changed -mpthread option to
1281 -pylab, to simplify things for users. Will also remove the pylab
1284 -pylab, to simplify things for users. Will also remove the pylab
1282 profile, since now all of matplotlib configuration is directly
1285 profile, since now all of matplotlib configuration is directly
1283 handled here. This also reduces startup time.
1286 handled here. This also reduces startup time.
1284
1287
1285 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
1288 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
1286 shell wasn't being correctly called. Also in IPShellWX.
1289 shell wasn't being correctly called. Also in IPShellWX.
1287
1290
1288 * IPython/iplib.py (InteractiveShell.__init__): Added option to
1291 * IPython/iplib.py (InteractiveShell.__init__): Added option to
1289 fine-tune banner.
1292 fine-tune banner.
1290
1293
1291 * IPython/numutils.py (spike): Deprecate these spike functions,
1294 * IPython/numutils.py (spike): Deprecate these spike functions,
1292 delete (long deprecated) gnuplot_exec handler.
1295 delete (long deprecated) gnuplot_exec handler.
1293
1296
1294 2004-08-26 Fernando Perez <fperez@colorado.edu>
1297 2004-08-26 Fernando Perez <fperez@colorado.edu>
1295
1298
1296 * ipython.1: Update for threading options, plus some others which
1299 * ipython.1: Update for threading options, plus some others which
1297 were missing.
1300 were missing.
1298
1301
1299 * IPython/ipmaker.py (__call__): Added -wthread option for
1302 * IPython/ipmaker.py (__call__): Added -wthread option for
1300 wxpython thread handling. Make sure threading options are only
1303 wxpython thread handling. Make sure threading options are only
1301 valid at the command line.
1304 valid at the command line.
1302
1305
1303 * scripts/ipython: moved shell selection into a factory function
1306 * scripts/ipython: moved shell selection into a factory function
1304 in Shell.py, to keep the starter script to a minimum.
1307 in Shell.py, to keep the starter script to a minimum.
1305
1308
1306 2004-08-25 Fernando Perez <fperez@colorado.edu>
1309 2004-08-25 Fernando Perez <fperez@colorado.edu>
1307
1310
1308 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
1311 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
1309 John. Along with some recent changes he made to matplotlib, the
1312 John. Along with some recent changes he made to matplotlib, the
1310 next versions of both systems should work very well together.
1313 next versions of both systems should work very well together.
1311
1314
1312 2004-08-24 Fernando Perez <fperez@colorado.edu>
1315 2004-08-24 Fernando Perez <fperez@colorado.edu>
1313
1316
1314 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
1317 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
1315 tried to switch the profiling to using hotshot, but I'm getting
1318 tried to switch the profiling to using hotshot, but I'm getting
1316 strange errors from prof.runctx() there. I may be misreading the
1319 strange errors from prof.runctx() there. I may be misreading the
1317 docs, but it looks weird. For now the profiling code will
1320 docs, but it looks weird. For now the profiling code will
1318 continue to use the standard profiler.
1321 continue to use the standard profiler.
1319
1322
1320 2004-08-23 Fernando Perez <fperez@colorado.edu>
1323 2004-08-23 Fernando Perez <fperez@colorado.edu>
1321
1324
1322 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
1325 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
1323 threaded shell, by John Hunter. It's not quite ready yet, but
1326 threaded shell, by John Hunter. It's not quite ready yet, but
1324 close.
1327 close.
1325
1328
1326 2004-08-22 Fernando Perez <fperez@colorado.edu>
1329 2004-08-22 Fernando Perez <fperez@colorado.edu>
1327
1330
1328 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
1331 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
1329 in Magic and ultraTB.
1332 in Magic and ultraTB.
1330
1333
1331 * ipython.1: document threading options in manpage.
1334 * ipython.1: document threading options in manpage.
1332
1335
1333 * scripts/ipython: Changed name of -thread option to -gthread,
1336 * scripts/ipython: Changed name of -thread option to -gthread,
1334 since this is GTK specific. I want to leave the door open for a
1337 since this is GTK specific. I want to leave the door open for a
1335 -wthread option for WX, which will most likely be necessary. This
1338 -wthread option for WX, which will most likely be necessary. This
1336 change affects usage and ipmaker as well.
1339 change affects usage and ipmaker as well.
1337
1340
1338 * IPython/Shell.py (matplotlib_shell): Add a factory function to
1341 * IPython/Shell.py (matplotlib_shell): Add a factory function to
1339 handle the matplotlib shell issues. Code by John Hunter
1342 handle the matplotlib shell issues. Code by John Hunter
1340 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1343 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1341 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
1344 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
1342 broken (and disabled for end users) for now, but it puts the
1345 broken (and disabled for end users) for now, but it puts the
1343 infrastructure in place.
1346 infrastructure in place.
1344
1347
1345 2004-08-21 Fernando Perez <fperez@colorado.edu>
1348 2004-08-21 Fernando Perez <fperez@colorado.edu>
1346
1349
1347 * ipythonrc-pylab: Add matplotlib support.
1350 * ipythonrc-pylab: Add matplotlib support.
1348
1351
1349 * matplotlib_config.py: new files for matplotlib support, part of
1352 * matplotlib_config.py: new files for matplotlib support, part of
1350 the pylab profile.
1353 the pylab profile.
1351
1354
1352 * IPython/usage.py (__doc__): documented the threading options.
1355 * IPython/usage.py (__doc__): documented the threading options.
1353
1356
1354 2004-08-20 Fernando Perez <fperez@colorado.edu>
1357 2004-08-20 Fernando Perez <fperez@colorado.edu>
1355
1358
1356 * ipython: Modified the main calling routine to handle the -thread
1359 * ipython: Modified the main calling routine to handle the -thread
1357 and -mpthread options. This needs to be done as a top-level hack,
1360 and -mpthread options. This needs to be done as a top-level hack,
1358 because it determines which class to instantiate for IPython
1361 because it determines which class to instantiate for IPython
1359 itself.
1362 itself.
1360
1363
1361 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
1364 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
1362 classes to support multithreaded GTK operation without blocking,
1365 classes to support multithreaded GTK operation without blocking,
1363 and matplotlib with all backends. This is a lot of still very
1366 and matplotlib with all backends. This is a lot of still very
1364 experimental code, and threads are tricky. So it may still have a
1367 experimental code, and threads are tricky. So it may still have a
1365 few rough edges... This code owes a lot to
1368 few rough edges... This code owes a lot to
1366 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
1369 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
1367 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
1370 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
1368 to John Hunter for all the matplotlib work.
1371 to John Hunter for all the matplotlib work.
1369
1372
1370 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
1373 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
1371 options for gtk thread and matplotlib support.
1374 options for gtk thread and matplotlib support.
1372
1375
1373 2004-08-16 Fernando Perez <fperez@colorado.edu>
1376 2004-08-16 Fernando Perez <fperez@colorado.edu>
1374
1377
1375 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
1378 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
1376 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
1379 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
1377 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
1380 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
1378
1381
1379 2004-08-11 Fernando Perez <fperez@colorado.edu>
1382 2004-08-11 Fernando Perez <fperez@colorado.edu>
1380
1383
1381 * setup.py (isfile): Fix build so documentation gets updated for
1384 * setup.py (isfile): Fix build so documentation gets updated for
1382 rpms (it was only done for .tgz builds).
1385 rpms (it was only done for .tgz builds).
1383
1386
1384 2004-08-10 Fernando Perez <fperez@colorado.edu>
1387 2004-08-10 Fernando Perez <fperez@colorado.edu>
1385
1388
1386 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
1389 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
1387
1390
1388 * iplib.py : Silence syntax error exceptions in tab-completion.
1391 * iplib.py : Silence syntax error exceptions in tab-completion.
1389
1392
1390 2004-08-05 Fernando Perez <fperez@colorado.edu>
1393 2004-08-05 Fernando Perez <fperez@colorado.edu>
1391
1394
1392 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
1395 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
1393 'color off' mark for continuation prompts. This was causing long
1396 'color off' mark for continuation prompts. This was causing long
1394 continuation lines to mis-wrap.
1397 continuation lines to mis-wrap.
1395
1398
1396 2004-08-01 Fernando Perez <fperez@colorado.edu>
1399 2004-08-01 Fernando Perez <fperez@colorado.edu>
1397
1400
1398 * IPython/ipmaker.py (make_IPython): Allow the shell class used
1401 * IPython/ipmaker.py (make_IPython): Allow the shell class used
1399 for building ipython to be a parameter. All this is necessary
1402 for building ipython to be a parameter. All this is necessary
1400 right now to have a multithreaded version, but this insane
1403 right now to have a multithreaded version, but this insane
1401 non-design will be cleaned up soon. For now, it's a hack that
1404 non-design will be cleaned up soon. For now, it's a hack that
1402 works.
1405 works.
1403
1406
1404 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
1407 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
1405 args in various places. No bugs so far, but it's a dangerous
1408 args in various places. No bugs so far, but it's a dangerous
1406 practice.
1409 practice.
1407
1410
1408 2004-07-31 Fernando Perez <fperez@colorado.edu>
1411 2004-07-31 Fernando Perez <fperez@colorado.edu>
1409
1412
1410 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
1413 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
1411 fix completion of files with dots in their names under most
1414 fix completion of files with dots in their names under most
1412 profiles (pysh was OK because the completion order is different).
1415 profiles (pysh was OK because the completion order is different).
1413
1416
1414 2004-07-27 Fernando Perez <fperez@colorado.edu>
1417 2004-07-27 Fernando Perez <fperez@colorado.edu>
1415
1418
1416 * IPython/iplib.py (InteractiveShell.__init__): build dict of
1419 * IPython/iplib.py (InteractiveShell.__init__): build dict of
1417 keywords manually, b/c the one in keyword.py was removed in python
1420 keywords manually, b/c the one in keyword.py was removed in python
1418 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
1421 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
1419 This is NOT a bug under python 2.3 and earlier.
1422 This is NOT a bug under python 2.3 and earlier.
1420
1423
1421 2004-07-26 Fernando Perez <fperez@colorado.edu>
1424 2004-07-26 Fernando Perez <fperez@colorado.edu>
1422
1425
1423 * IPython/ultraTB.py (VerboseTB.text): Add another
1426 * IPython/ultraTB.py (VerboseTB.text): Add another
1424 linecache.checkcache() call to try to prevent inspect.py from
1427 linecache.checkcache() call to try to prevent inspect.py from
1425 crashing under python 2.3. I think this fixes
1428 crashing under python 2.3. I think this fixes
1426 http://www.scipy.net/roundup/ipython/issue17.
1429 http://www.scipy.net/roundup/ipython/issue17.
1427
1430
1428 2004-07-26 *** Released version 0.6.2
1431 2004-07-26 *** Released version 0.6.2
1429
1432
1430 2004-07-26 Fernando Perez <fperez@colorado.edu>
1433 2004-07-26 Fernando Perez <fperez@colorado.edu>
1431
1434
1432 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
1435 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
1433 fail for any number.
1436 fail for any number.
1434 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
1437 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
1435 empty bookmarks.
1438 empty bookmarks.
1436
1439
1437 2004-07-26 *** Released version 0.6.1
1440 2004-07-26 *** Released version 0.6.1
1438
1441
1439 2004-07-26 Fernando Perez <fperez@colorado.edu>
1442 2004-07-26 Fernando Perez <fperez@colorado.edu>
1440
1443
1441 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
1444 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
1442
1445
1443 * IPython/iplib.py (protect_filename): Applied Ville's patch for
1446 * IPython/iplib.py (protect_filename): Applied Ville's patch for
1444 escaping '()[]{}' in filenames.
1447 escaping '()[]{}' in filenames.
1445
1448
1446 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
1449 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
1447 Python 2.2 users who lack a proper shlex.split.
1450 Python 2.2 users who lack a proper shlex.split.
1448
1451
1449 2004-07-19 Fernando Perez <fperez@colorado.edu>
1452 2004-07-19 Fernando Perez <fperez@colorado.edu>
1450
1453
1451 * IPython/iplib.py (InteractiveShell.init_readline): Add support
1454 * IPython/iplib.py (InteractiveShell.init_readline): Add support
1452 for reading readline's init file. I follow the normal chain:
1455 for reading readline's init file. I follow the normal chain:
1453 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
1456 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
1454 report by Mike Heeter. This closes
1457 report by Mike Heeter. This closes
1455 http://www.scipy.net/roundup/ipython/issue16.
1458 http://www.scipy.net/roundup/ipython/issue16.
1456
1459
1457 2004-07-18 Fernando Perez <fperez@colorado.edu>
1460 2004-07-18 Fernando Perez <fperez@colorado.edu>
1458
1461
1459 * IPython/iplib.py (__init__): Add better handling of '\' under
1462 * IPython/iplib.py (__init__): Add better handling of '\' under
1460 Win32 for filenames. After a patch by Ville.
1463 Win32 for filenames. After a patch by Ville.
1461
1464
1462 2004-07-17 Fernando Perez <fperez@colorado.edu>
1465 2004-07-17 Fernando Perez <fperez@colorado.edu>
1463
1466
1464 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
1467 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
1465 autocalling would be triggered for 'foo is bar' if foo is
1468 autocalling would be triggered for 'foo is bar' if foo is
1466 callable. I also cleaned up the autocall detection code to use a
1469 callable. I also cleaned up the autocall detection code to use a
1467 regexp, which is faster. Bug reported by Alexander Schmolck.
1470 regexp, which is faster. Bug reported by Alexander Schmolck.
1468
1471
1469 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
1472 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
1470 '?' in them would confuse the help system. Reported by Alex
1473 '?' in them would confuse the help system. Reported by Alex
1471 Schmolck.
1474 Schmolck.
1472
1475
1473 2004-07-16 Fernando Perez <fperez@colorado.edu>
1476 2004-07-16 Fernando Perez <fperez@colorado.edu>
1474
1477
1475 * IPython/GnuplotInteractive.py (__all__): added plot2.
1478 * IPython/GnuplotInteractive.py (__all__): added plot2.
1476
1479
1477 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
1480 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
1478 plotting dictionaries, lists or tuples of 1d arrays.
1481 plotting dictionaries, lists or tuples of 1d arrays.
1479
1482
1480 * IPython/Magic.py (Magic.magic_hist): small clenaups and
1483 * IPython/Magic.py (Magic.magic_hist): small clenaups and
1481 optimizations.
1484 optimizations.
1482
1485
1483 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
1486 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
1484 the information which was there from Janko's original IPP code:
1487 the information which was there from Janko's original IPP code:
1485
1488
1486 03.05.99 20:53 porto.ifm.uni-kiel.de
1489 03.05.99 20:53 porto.ifm.uni-kiel.de
1487 --Started changelog.
1490 --Started changelog.
1488 --make clear do what it say it does
1491 --make clear do what it say it does
1489 --added pretty output of lines from inputcache
1492 --added pretty output of lines from inputcache
1490 --Made Logger a mixin class, simplifies handling of switches
1493 --Made Logger a mixin class, simplifies handling of switches
1491 --Added own completer class. .string<TAB> expands to last history
1494 --Added own completer class. .string<TAB> expands to last history
1492 line which starts with string. The new expansion is also present
1495 line which starts with string. The new expansion is also present
1493 with Ctrl-r from the readline library. But this shows, who this
1496 with Ctrl-r from the readline library. But this shows, who this
1494 can be done for other cases.
1497 can be done for other cases.
1495 --Added convention that all shell functions should accept a
1498 --Added convention that all shell functions should accept a
1496 parameter_string This opens the door for different behaviour for
1499 parameter_string This opens the door for different behaviour for
1497 each function. @cd is a good example of this.
1500 each function. @cd is a good example of this.
1498
1501
1499 04.05.99 12:12 porto.ifm.uni-kiel.de
1502 04.05.99 12:12 porto.ifm.uni-kiel.de
1500 --added logfile rotation
1503 --added logfile rotation
1501 --added new mainloop method which freezes first the namespace
1504 --added new mainloop method which freezes first the namespace
1502
1505
1503 07.05.99 21:24 porto.ifm.uni-kiel.de
1506 07.05.99 21:24 porto.ifm.uni-kiel.de
1504 --added the docreader classes. Now there is a help system.
1507 --added the docreader classes. Now there is a help system.
1505 -This is only a first try. Currently it's not easy to put new
1508 -This is only a first try. Currently it's not easy to put new
1506 stuff in the indices. But this is the way to go. Info would be
1509 stuff in the indices. But this is the way to go. Info would be
1507 better, but HTML is every where and not everybody has an info
1510 better, but HTML is every where and not everybody has an info
1508 system installed and it's not so easy to change html-docs to info.
1511 system installed and it's not so easy to change html-docs to info.
1509 --added global logfile option
1512 --added global logfile option
1510 --there is now a hook for object inspection method pinfo needs to
1513 --there is now a hook for object inspection method pinfo needs to
1511 be provided for this. Can be reached by two '??'.
1514 be provided for this. Can be reached by two '??'.
1512
1515
1513 08.05.99 20:51 porto.ifm.uni-kiel.de
1516 08.05.99 20:51 porto.ifm.uni-kiel.de
1514 --added a README
1517 --added a README
1515 --bug in rc file. Something has changed so functions in the rc
1518 --bug in rc file. Something has changed so functions in the rc
1516 file need to reference the shell and not self. Not clear if it's a
1519 file need to reference the shell and not self. Not clear if it's a
1517 bug or feature.
1520 bug or feature.
1518 --changed rc file for new behavior
1521 --changed rc file for new behavior
1519
1522
1520 2004-07-15 Fernando Perez <fperez@colorado.edu>
1523 2004-07-15 Fernando Perez <fperez@colorado.edu>
1521
1524
1522 * IPython/Logger.py (Logger.log): fixed recent bug where the input
1525 * IPython/Logger.py (Logger.log): fixed recent bug where the input
1523 cache was falling out of sync in bizarre manners when multi-line
1526 cache was falling out of sync in bizarre manners when multi-line
1524 input was present. Minor optimizations and cleanup.
1527 input was present. Minor optimizations and cleanup.
1525
1528
1526 (Logger): Remove old Changelog info for cleanup. This is the
1529 (Logger): Remove old Changelog info for cleanup. This is the
1527 information which was there from Janko's original code:
1530 information which was there from Janko's original code:
1528
1531
1529 Changes to Logger: - made the default log filename a parameter
1532 Changes to Logger: - made the default log filename a parameter
1530
1533
1531 - put a check for lines beginning with !@? in log(). Needed
1534 - put a check for lines beginning with !@? in log(). Needed
1532 (even if the handlers properly log their lines) for mid-session
1535 (even if the handlers properly log their lines) for mid-session
1533 logging activation to work properly. Without this, lines logged
1536 logging activation to work properly. Without this, lines logged
1534 in mid session, which get read from the cache, would end up
1537 in mid session, which get read from the cache, would end up
1535 'bare' (with !@? in the open) in the log. Now they are caught
1538 'bare' (with !@? in the open) in the log. Now they are caught
1536 and prepended with a #.
1539 and prepended with a #.
1537
1540
1538 * IPython/iplib.py (InteractiveShell.init_readline): added check
1541 * IPython/iplib.py (InteractiveShell.init_readline): added check
1539 in case MagicCompleter fails to be defined, so we don't crash.
1542 in case MagicCompleter fails to be defined, so we don't crash.
1540
1543
1541 2004-07-13 Fernando Perez <fperez@colorado.edu>
1544 2004-07-13 Fernando Perez <fperez@colorado.edu>
1542
1545
1543 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
1546 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
1544 of EPS if the requested filename ends in '.eps'.
1547 of EPS if the requested filename ends in '.eps'.
1545
1548
1546 2004-07-04 Fernando Perez <fperez@colorado.edu>
1549 2004-07-04 Fernando Perez <fperez@colorado.edu>
1547
1550
1548 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
1551 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
1549 escaping of quotes when calling the shell.
1552 escaping of quotes when calling the shell.
1550
1553
1551 2004-07-02 Fernando Perez <fperez@colorado.edu>
1554 2004-07-02 Fernando Perez <fperez@colorado.edu>
1552
1555
1553 * IPython/Prompts.py (CachedOutput.update): Fix problem with
1556 * IPython/Prompts.py (CachedOutput.update): Fix problem with
1554 gettext not working because we were clobbering '_'. Fixes
1557 gettext not working because we were clobbering '_'. Fixes
1555 http://www.scipy.net/roundup/ipython/issue6.
1558 http://www.scipy.net/roundup/ipython/issue6.
1556
1559
1557 2004-07-01 Fernando Perez <fperez@colorado.edu>
1560 2004-07-01 Fernando Perez <fperez@colorado.edu>
1558
1561
1559 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
1562 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
1560 into @cd. Patch by Ville.
1563 into @cd. Patch by Ville.
1561
1564
1562 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1565 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1563 new function to store things after ipmaker runs. Patch by Ville.
1566 new function to store things after ipmaker runs. Patch by Ville.
1564 Eventually this will go away once ipmaker is removed and the class
1567 Eventually this will go away once ipmaker is removed and the class
1565 gets cleaned up, but for now it's ok. Key functionality here is
1568 gets cleaned up, but for now it's ok. Key functionality here is
1566 the addition of the persistent storage mechanism, a dict for
1569 the addition of the persistent storage mechanism, a dict for
1567 keeping data across sessions (for now just bookmarks, but more can
1570 keeping data across sessions (for now just bookmarks, but more can
1568 be implemented later).
1571 be implemented later).
1569
1572
1570 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
1573 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
1571 persistent across sections. Patch by Ville, I modified it
1574 persistent across sections. Patch by Ville, I modified it
1572 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
1575 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
1573 added a '-l' option to list all bookmarks.
1576 added a '-l' option to list all bookmarks.
1574
1577
1575 * IPython/iplib.py (InteractiveShell.atexit_operations): new
1578 * IPython/iplib.py (InteractiveShell.atexit_operations): new
1576 center for cleanup. Registered with atexit.register(). I moved
1579 center for cleanup. Registered with atexit.register(). I moved
1577 here the old exit_cleanup(). After a patch by Ville.
1580 here the old exit_cleanup(). After a patch by Ville.
1578
1581
1579 * IPython/Magic.py (get_py_filename): added '~' to the accepted
1582 * IPython/Magic.py (get_py_filename): added '~' to the accepted
1580 characters in the hacked shlex_split for python 2.2.
1583 characters in the hacked shlex_split for python 2.2.
1581
1584
1582 * IPython/iplib.py (file_matches): more fixes to filenames with
1585 * IPython/iplib.py (file_matches): more fixes to filenames with
1583 whitespace in them. It's not perfect, but limitations in python's
1586 whitespace in them. It's not perfect, but limitations in python's
1584 readline make it impossible to go further.
1587 readline make it impossible to go further.
1585
1588
1586 2004-06-29 Fernando Perez <fperez@colorado.edu>
1589 2004-06-29 Fernando Perez <fperez@colorado.edu>
1587
1590
1588 * IPython/iplib.py (file_matches): escape whitespace correctly in
1591 * IPython/iplib.py (file_matches): escape whitespace correctly in
1589 filename completions. Bug reported by Ville.
1592 filename completions. Bug reported by Ville.
1590
1593
1591 2004-06-28 Fernando Perez <fperez@colorado.edu>
1594 2004-06-28 Fernando Perez <fperez@colorado.edu>
1592
1595
1593 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
1596 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
1594 the history file will be called 'history-PROFNAME' (or just
1597 the history file will be called 'history-PROFNAME' (or just
1595 'history' if no profile is loaded). I was getting annoyed at
1598 'history' if no profile is loaded). I was getting annoyed at
1596 getting my Numerical work history clobbered by pysh sessions.
1599 getting my Numerical work history clobbered by pysh sessions.
1597
1600
1598 * IPython/iplib.py (InteractiveShell.__init__): Internal
1601 * IPython/iplib.py (InteractiveShell.__init__): Internal
1599 getoutputerror() function so that we can honor the system_verbose
1602 getoutputerror() function so that we can honor the system_verbose
1600 flag for _all_ system calls. I also added escaping of #
1603 flag for _all_ system calls. I also added escaping of #
1601 characters here to avoid confusing Itpl.
1604 characters here to avoid confusing Itpl.
1602
1605
1603 * IPython/Magic.py (shlex_split): removed call to shell in
1606 * IPython/Magic.py (shlex_split): removed call to shell in
1604 parse_options and replaced it with shlex.split(). The annoying
1607 parse_options and replaced it with shlex.split(). The annoying
1605 part was that in Python 2.2, shlex.split() doesn't exist, so I had
1608 part was that in Python 2.2, shlex.split() doesn't exist, so I had
1606 to backport it from 2.3, with several frail hacks (the shlex
1609 to backport it from 2.3, with several frail hacks (the shlex
1607 module is rather limited in 2.2). Thanks to a suggestion by Ville
1610 module is rather limited in 2.2). Thanks to a suggestion by Ville
1608 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
1611 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
1609 problem.
1612 problem.
1610
1613
1611 (Magic.magic_system_verbose): new toggle to print the actual
1614 (Magic.magic_system_verbose): new toggle to print the actual
1612 system calls made by ipython. Mainly for debugging purposes.
1615 system calls made by ipython. Mainly for debugging purposes.
1613
1616
1614 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
1617 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
1615 doesn't support persistence. Reported (and fix suggested) by
1618 doesn't support persistence. Reported (and fix suggested) by
1616 Travis Caldwell <travis_caldwell2000@yahoo.com>.
1619 Travis Caldwell <travis_caldwell2000@yahoo.com>.
1617
1620
1618 2004-06-26 Fernando Perez <fperez@colorado.edu>
1621 2004-06-26 Fernando Perez <fperez@colorado.edu>
1619
1622
1620 * IPython/Logger.py (Logger.log): fix to handle correctly empty
1623 * IPython/Logger.py (Logger.log): fix to handle correctly empty
1621 continue prompts.
1624 continue prompts.
1622
1625
1623 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
1626 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
1624 function (basically a big docstring) and a few more things here to
1627 function (basically a big docstring) and a few more things here to
1625 speedup startup. pysh.py is now very lightweight. We want because
1628 speedup startup. pysh.py is now very lightweight. We want because
1626 it gets execfile'd, while InterpreterExec gets imported, so
1629 it gets execfile'd, while InterpreterExec gets imported, so
1627 byte-compilation saves time.
1630 byte-compilation saves time.
1628
1631
1629 2004-06-25 Fernando Perez <fperez@colorado.edu>
1632 2004-06-25 Fernando Perez <fperez@colorado.edu>
1630
1633
1631 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
1634 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
1632 -NUM', which was recently broken.
1635 -NUM', which was recently broken.
1633
1636
1634 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
1637 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
1635 in multi-line input (but not !!, which doesn't make sense there).
1638 in multi-line input (but not !!, which doesn't make sense there).
1636
1639
1637 * IPython/UserConfig/ipythonrc: made autoindent on by default.
1640 * IPython/UserConfig/ipythonrc: made autoindent on by default.
1638 It's just too useful, and people can turn it off in the less
1641 It's just too useful, and people can turn it off in the less
1639 common cases where it's a problem.
1642 common cases where it's a problem.
1640
1643
1641 2004-06-24 Fernando Perez <fperez@colorado.edu>
1644 2004-06-24 Fernando Perez <fperez@colorado.edu>
1642
1645
1643 * IPython/iplib.py (InteractiveShell._prefilter): big change -
1646 * IPython/iplib.py (InteractiveShell._prefilter): big change -
1644 special syntaxes (like alias calling) is now allied in multi-line
1647 special syntaxes (like alias calling) is now allied in multi-line
1645 input. This is still _very_ experimental, but it's necessary for
1648 input. This is still _very_ experimental, but it's necessary for
1646 efficient shell usage combining python looping syntax with system
1649 efficient shell usage combining python looping syntax with system
1647 calls. For now it's restricted to aliases, I don't think it
1650 calls. For now it's restricted to aliases, I don't think it
1648 really even makes sense to have this for magics.
1651 really even makes sense to have this for magics.
1649
1652
1650 2004-06-23 Fernando Perez <fperez@colorado.edu>
1653 2004-06-23 Fernando Perez <fperez@colorado.edu>
1651
1654
1652 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
1655 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
1653 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
1656 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
1654
1657
1655 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
1658 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
1656 extensions under Windows (after code sent by Gary Bishop). The
1659 extensions under Windows (after code sent by Gary Bishop). The
1657 extensions considered 'executable' are stored in IPython's rc
1660 extensions considered 'executable' are stored in IPython's rc
1658 structure as win_exec_ext.
1661 structure as win_exec_ext.
1659
1662
1660 * IPython/genutils.py (shell): new function, like system() but
1663 * IPython/genutils.py (shell): new function, like system() but
1661 without return value. Very useful for interactive shell work.
1664 without return value. Very useful for interactive shell work.
1662
1665
1663 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
1666 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
1664 delete aliases.
1667 delete aliases.
1665
1668
1666 * IPython/iplib.py (InteractiveShell.alias_table_update): make
1669 * IPython/iplib.py (InteractiveShell.alias_table_update): make
1667 sure that the alias table doesn't contain python keywords.
1670 sure that the alias table doesn't contain python keywords.
1668
1671
1669 2004-06-21 Fernando Perez <fperez@colorado.edu>
1672 2004-06-21 Fernando Perez <fperez@colorado.edu>
1670
1673
1671 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
1674 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
1672 non-existent items are found in $PATH. Reported by Thorsten.
1675 non-existent items are found in $PATH. Reported by Thorsten.
1673
1676
1674 2004-06-20 Fernando Perez <fperez@colorado.edu>
1677 2004-06-20 Fernando Perez <fperez@colorado.edu>
1675
1678
1676 * IPython/iplib.py (complete): modified the completer so that the
1679 * IPython/iplib.py (complete): modified the completer so that the
1677 order of priorities can be easily changed at runtime.
1680 order of priorities can be easily changed at runtime.
1678
1681
1679 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
1682 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
1680 Modified to auto-execute all lines beginning with '~', '/' or '.'.
1683 Modified to auto-execute all lines beginning with '~', '/' or '.'.
1681
1684
1682 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
1685 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
1683 expand Python variables prepended with $ in all system calls. The
1686 expand Python variables prepended with $ in all system calls. The
1684 same was done to InteractiveShell.handle_shell_escape. Now all
1687 same was done to InteractiveShell.handle_shell_escape. Now all
1685 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
1688 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
1686 expansion of python variables and expressions according to the
1689 expansion of python variables and expressions according to the
1687 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
1690 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
1688
1691
1689 Though PEP-215 has been rejected, a similar (but simpler) one
1692 Though PEP-215 has been rejected, a similar (but simpler) one
1690 seems like it will go into Python 2.4, PEP-292 -
1693 seems like it will go into Python 2.4, PEP-292 -
1691 http://www.python.org/peps/pep-0292.html.
1694 http://www.python.org/peps/pep-0292.html.
1692
1695
1693 I'll keep the full syntax of PEP-215, since IPython has since the
1696 I'll keep the full syntax of PEP-215, since IPython has since the
1694 start used Ka-Ping Yee's reference implementation discussed there
1697 start used Ka-Ping Yee's reference implementation discussed there
1695 (Itpl), and I actually like the powerful semantics it offers.
1698 (Itpl), and I actually like the powerful semantics it offers.
1696
1699
1697 In order to access normal shell variables, the $ has to be escaped
1700 In order to access normal shell variables, the $ has to be escaped
1698 via an extra $. For example:
1701 via an extra $. For example:
1699
1702
1700 In [7]: PATH='a python variable'
1703 In [7]: PATH='a python variable'
1701
1704
1702 In [8]: !echo $PATH
1705 In [8]: !echo $PATH
1703 a python variable
1706 a python variable
1704
1707
1705 In [9]: !echo $$PATH
1708 In [9]: !echo $$PATH
1706 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
1709 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
1707
1710
1708 (Magic.parse_options): escape $ so the shell doesn't evaluate
1711 (Magic.parse_options): escape $ so the shell doesn't evaluate
1709 things prematurely.
1712 things prematurely.
1710
1713
1711 * IPython/iplib.py (InteractiveShell.call_alias): added the
1714 * IPython/iplib.py (InteractiveShell.call_alias): added the
1712 ability for aliases to expand python variables via $.
1715 ability for aliases to expand python variables via $.
1713
1716
1714 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
1717 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
1715 system, now there's a @rehash/@rehashx pair of magics. These work
1718 system, now there's a @rehash/@rehashx pair of magics. These work
1716 like the csh rehash command, and can be invoked at any time. They
1719 like the csh rehash command, and can be invoked at any time. They
1717 build a table of aliases to everything in the user's $PATH
1720 build a table of aliases to everything in the user's $PATH
1718 (@rehash uses everything, @rehashx is slower but only adds
1721 (@rehash uses everything, @rehashx is slower but only adds
1719 executable files). With this, the pysh.py-based shell profile can
1722 executable files). With this, the pysh.py-based shell profile can
1720 now simply call rehash upon startup, and full access to all
1723 now simply call rehash upon startup, and full access to all
1721 programs in the user's path is obtained.
1724 programs in the user's path is obtained.
1722
1725
1723 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
1726 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
1724 functionality is now fully in place. I removed the old dynamic
1727 functionality is now fully in place. I removed the old dynamic
1725 code generation based approach, in favor of a much lighter one
1728 code generation based approach, in favor of a much lighter one
1726 based on a simple dict. The advantage is that this allows me to
1729 based on a simple dict. The advantage is that this allows me to
1727 now have thousands of aliases with negligible cost (unthinkable
1730 now have thousands of aliases with negligible cost (unthinkable
1728 with the old system).
1731 with the old system).
1729
1732
1730 2004-06-19 Fernando Perez <fperez@colorado.edu>
1733 2004-06-19 Fernando Perez <fperez@colorado.edu>
1731
1734
1732 * IPython/iplib.py (__init__): extended MagicCompleter class to
1735 * IPython/iplib.py (__init__): extended MagicCompleter class to
1733 also complete (last in priority) on user aliases.
1736 also complete (last in priority) on user aliases.
1734
1737
1735 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
1738 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
1736 call to eval.
1739 call to eval.
1737 (ItplNS.__init__): Added a new class which functions like Itpl,
1740 (ItplNS.__init__): Added a new class which functions like Itpl,
1738 but allows configuring the namespace for the evaluation to occur
1741 but allows configuring the namespace for the evaluation to occur
1739 in.
1742 in.
1740
1743
1741 2004-06-18 Fernando Perez <fperez@colorado.edu>
1744 2004-06-18 Fernando Perez <fperez@colorado.edu>
1742
1745
1743 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
1746 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
1744 better message when 'exit' or 'quit' are typed (a common newbie
1747 better message when 'exit' or 'quit' are typed (a common newbie
1745 confusion).
1748 confusion).
1746
1749
1747 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
1750 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
1748 check for Windows users.
1751 check for Windows users.
1749
1752
1750 * IPython/iplib.py (InteractiveShell.user_setup): removed
1753 * IPython/iplib.py (InteractiveShell.user_setup): removed
1751 disabling of colors for Windows. I'll test at runtime and issue a
1754 disabling of colors for Windows. I'll test at runtime and issue a
1752 warning if Gary's readline isn't found, as to nudge users to
1755 warning if Gary's readline isn't found, as to nudge users to
1753 download it.
1756 download it.
1754
1757
1755 2004-06-16 Fernando Perez <fperez@colorado.edu>
1758 2004-06-16 Fernando Perez <fperez@colorado.edu>
1756
1759
1757 * IPython/genutils.py (Stream.__init__): changed to print errors
1760 * IPython/genutils.py (Stream.__init__): changed to print errors
1758 to sys.stderr. I had a circular dependency here. Now it's
1761 to sys.stderr. I had a circular dependency here. Now it's
1759 possible to run ipython as IDLE's shell (consider this pre-alpha,
1762 possible to run ipython as IDLE's shell (consider this pre-alpha,
1760 since true stdout things end up in the starting terminal instead
1763 since true stdout things end up in the starting terminal instead
1761 of IDLE's out).
1764 of IDLE's out).
1762
1765
1763 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
1766 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
1764 users who haven't # updated their prompt_in2 definitions. Remove
1767 users who haven't # updated their prompt_in2 definitions. Remove
1765 eventually.
1768 eventually.
1766 (multiple_replace): added credit to original ASPN recipe.
1769 (multiple_replace): added credit to original ASPN recipe.
1767
1770
1768 2004-06-15 Fernando Perez <fperez@colorado.edu>
1771 2004-06-15 Fernando Perez <fperez@colorado.edu>
1769
1772
1770 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
1773 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
1771 list of auto-defined aliases.
1774 list of auto-defined aliases.
1772
1775
1773 2004-06-13 Fernando Perez <fperez@colorado.edu>
1776 2004-06-13 Fernando Perez <fperez@colorado.edu>
1774
1777
1775 * setup.py (scriptfiles): Don't trigger win_post_install unless an
1778 * setup.py (scriptfiles): Don't trigger win_post_install unless an
1776 install was really requested (so setup.py can be used for other
1779 install was really requested (so setup.py can be used for other
1777 things under Windows).
1780 things under Windows).
1778
1781
1779 2004-06-10 Fernando Perez <fperez@colorado.edu>
1782 2004-06-10 Fernando Perez <fperez@colorado.edu>
1780
1783
1781 * IPython/Logger.py (Logger.create_log): Manually remove any old
1784 * IPython/Logger.py (Logger.create_log): Manually remove any old
1782 backup, since os.remove may fail under Windows. Fixes bug
1785 backup, since os.remove may fail under Windows. Fixes bug
1783 reported by Thorsten.
1786 reported by Thorsten.
1784
1787
1785 2004-06-09 Fernando Perez <fperez@colorado.edu>
1788 2004-06-09 Fernando Perez <fperez@colorado.edu>
1786
1789
1787 * examples/example-embed.py: fixed all references to %n (replaced
1790 * examples/example-embed.py: fixed all references to %n (replaced
1788 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
1791 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
1789 for all examples and the manual as well.
1792 for all examples and the manual as well.
1790
1793
1791 2004-06-08 Fernando Perez <fperez@colorado.edu>
1794 2004-06-08 Fernando Perez <fperez@colorado.edu>
1792
1795
1793 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
1796 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
1794 alignment and color management. All 3 prompt subsystems now
1797 alignment and color management. All 3 prompt subsystems now
1795 inherit from BasePrompt.
1798 inherit from BasePrompt.
1796
1799
1797 * tools/release: updates for windows installer build and tag rpms
1800 * tools/release: updates for windows installer build and tag rpms
1798 with python version (since paths are fixed).
1801 with python version (since paths are fixed).
1799
1802
1800 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
1803 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
1801 which will become eventually obsolete. Also fixed the default
1804 which will become eventually obsolete. Also fixed the default
1802 prompt_in2 to use \D, so at least new users start with the correct
1805 prompt_in2 to use \D, so at least new users start with the correct
1803 defaults.
1806 defaults.
1804 WARNING: Users with existing ipythonrc files will need to apply
1807 WARNING: Users with existing ipythonrc files will need to apply
1805 this fix manually!
1808 this fix manually!
1806
1809
1807 * setup.py: make windows installer (.exe). This is finally the
1810 * setup.py: make windows installer (.exe). This is finally the
1808 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
1811 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
1809 which I hadn't included because it required Python 2.3 (or recent
1812 which I hadn't included because it required Python 2.3 (or recent
1810 distutils).
1813 distutils).
1811
1814
1812 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
1815 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
1813 usage of new '\D' escape.
1816 usage of new '\D' escape.
1814
1817
1815 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
1818 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
1816 lacks os.getuid())
1819 lacks os.getuid())
1817 (CachedOutput.set_colors): Added the ability to turn coloring
1820 (CachedOutput.set_colors): Added the ability to turn coloring
1818 on/off with @colors even for manually defined prompt colors. It
1821 on/off with @colors even for manually defined prompt colors. It
1819 uses a nasty global, but it works safely and via the generic color
1822 uses a nasty global, but it works safely and via the generic color
1820 handling mechanism.
1823 handling mechanism.
1821 (Prompt2.__init__): Introduced new escape '\D' for continuation
1824 (Prompt2.__init__): Introduced new escape '\D' for continuation
1822 prompts. It represents the counter ('\#') as dots.
1825 prompts. It represents the counter ('\#') as dots.
1823 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
1826 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
1824 need to update their ipythonrc files and replace '%n' with '\D' in
1827 need to update their ipythonrc files and replace '%n' with '\D' in
1825 their prompt_in2 settings everywhere. Sorry, but there's
1828 their prompt_in2 settings everywhere. Sorry, but there's
1826 otherwise no clean way to get all prompts to properly align. The
1829 otherwise no clean way to get all prompts to properly align. The
1827 ipythonrc shipped with IPython has been updated.
1830 ipythonrc shipped with IPython has been updated.
1828
1831
1829 2004-06-07 Fernando Perez <fperez@colorado.edu>
1832 2004-06-07 Fernando Perez <fperez@colorado.edu>
1830
1833
1831 * setup.py (isfile): Pass local_icons option to latex2html, so the
1834 * setup.py (isfile): Pass local_icons option to latex2html, so the
1832 resulting HTML file is self-contained. Thanks to
1835 resulting HTML file is self-contained. Thanks to
1833 dryice-AT-liu.com.cn for the tip.
1836 dryice-AT-liu.com.cn for the tip.
1834
1837
1835 * pysh.py: I created a new profile 'shell', which implements a
1838 * pysh.py: I created a new profile 'shell', which implements a
1836 _rudimentary_ IPython-based shell. This is in NO WAY a realy
1839 _rudimentary_ IPython-based shell. This is in NO WAY a realy
1837 system shell, nor will it become one anytime soon. It's mainly
1840 system shell, nor will it become one anytime soon. It's mainly
1838 meant to illustrate the use of the new flexible bash-like prompts.
1841 meant to illustrate the use of the new flexible bash-like prompts.
1839 I guess it could be used by hardy souls for true shell management,
1842 I guess it could be used by hardy souls for true shell management,
1840 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
1843 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
1841 profile. This uses the InterpreterExec extension provided by
1844 profile. This uses the InterpreterExec extension provided by
1842 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
1845 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
1843
1846
1844 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
1847 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
1845 auto-align itself with the length of the previous input prompt
1848 auto-align itself with the length of the previous input prompt
1846 (taking into account the invisible color escapes).
1849 (taking into account the invisible color escapes).
1847 (CachedOutput.__init__): Large restructuring of this class. Now
1850 (CachedOutput.__init__): Large restructuring of this class. Now
1848 all three prompts (primary1, primary2, output) are proper objects,
1851 all three prompts (primary1, primary2, output) are proper objects,
1849 managed by the 'parent' CachedOutput class. The code is still a
1852 managed by the 'parent' CachedOutput class. The code is still a
1850 bit hackish (all prompts share state via a pointer to the cache),
1853 bit hackish (all prompts share state via a pointer to the cache),
1851 but it's overall far cleaner than before.
1854 but it's overall far cleaner than before.
1852
1855
1853 * IPython/genutils.py (getoutputerror): modified to add verbose,
1856 * IPython/genutils.py (getoutputerror): modified to add verbose,
1854 debug and header options. This makes the interface of all getout*
1857 debug and header options. This makes the interface of all getout*
1855 functions uniform.
1858 functions uniform.
1856 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
1859 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
1857
1860
1858 * IPython/Magic.py (Magic.default_option): added a function to
1861 * IPython/Magic.py (Magic.default_option): added a function to
1859 allow registering default options for any magic command. This
1862 allow registering default options for any magic command. This
1860 makes it easy to have profiles which customize the magics globally
1863 makes it easy to have profiles which customize the magics globally
1861 for a certain use. The values set through this function are
1864 for a certain use. The values set through this function are
1862 picked up by the parse_options() method, which all magics should
1865 picked up by the parse_options() method, which all magics should
1863 use to parse their options.
1866 use to parse their options.
1864
1867
1865 * IPython/genutils.py (warn): modified the warnings framework to
1868 * IPython/genutils.py (warn): modified the warnings framework to
1866 use the Term I/O class. I'm trying to slowly unify all of
1869 use the Term I/O class. I'm trying to slowly unify all of
1867 IPython's I/O operations to pass through Term.
1870 IPython's I/O operations to pass through Term.
1868
1871
1869 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
1872 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
1870 the secondary prompt to correctly match the length of the primary
1873 the secondary prompt to correctly match the length of the primary
1871 one for any prompt. Now multi-line code will properly line up
1874 one for any prompt. Now multi-line code will properly line up
1872 even for path dependent prompts, such as the new ones available
1875 even for path dependent prompts, such as the new ones available
1873 via the prompt_specials.
1876 via the prompt_specials.
1874
1877
1875 2004-06-06 Fernando Perez <fperez@colorado.edu>
1878 2004-06-06 Fernando Perez <fperez@colorado.edu>
1876
1879
1877 * IPython/Prompts.py (prompt_specials): Added the ability to have
1880 * IPython/Prompts.py (prompt_specials): Added the ability to have
1878 bash-like special sequences in the prompts, which get
1881 bash-like special sequences in the prompts, which get
1879 automatically expanded. Things like hostname, current working
1882 automatically expanded. Things like hostname, current working
1880 directory and username are implemented already, but it's easy to
1883 directory and username are implemented already, but it's easy to
1881 add more in the future. Thanks to a patch by W.J. van der Laan
1884 add more in the future. Thanks to a patch by W.J. van der Laan
1882 <gnufnork-AT-hetdigitalegat.nl>
1885 <gnufnork-AT-hetdigitalegat.nl>
1883 (prompt_specials): Added color support for prompt strings, so
1886 (prompt_specials): Added color support for prompt strings, so
1884 users can define arbitrary color setups for their prompts.
1887 users can define arbitrary color setups for their prompts.
1885
1888
1886 2004-06-05 Fernando Perez <fperez@colorado.edu>
1889 2004-06-05 Fernando Perez <fperez@colorado.edu>
1887
1890
1888 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
1891 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
1889 code to load Gary Bishop's readline and configure it
1892 code to load Gary Bishop's readline and configure it
1890 automatically. Thanks to Gary for help on this.
1893 automatically. Thanks to Gary for help on this.
1891
1894
1892 2004-06-01 Fernando Perez <fperez@colorado.edu>
1895 2004-06-01 Fernando Perez <fperez@colorado.edu>
1893
1896
1894 * IPython/Logger.py (Logger.create_log): fix bug for logging
1897 * IPython/Logger.py (Logger.create_log): fix bug for logging
1895 with no filename (previous fix was incomplete).
1898 with no filename (previous fix was incomplete).
1896
1899
1897 2004-05-25 Fernando Perez <fperez@colorado.edu>
1900 2004-05-25 Fernando Perez <fperez@colorado.edu>
1898
1901
1899 * IPython/Magic.py (Magic.parse_options): fix bug where naked
1902 * IPython/Magic.py (Magic.parse_options): fix bug where naked
1900 parens would get passed to the shell.
1903 parens would get passed to the shell.
1901
1904
1902 2004-05-20 Fernando Perez <fperez@colorado.edu>
1905 2004-05-20 Fernando Perez <fperez@colorado.edu>
1903
1906
1904 * IPython/Magic.py (Magic.magic_prun): changed default profile
1907 * IPython/Magic.py (Magic.magic_prun): changed default profile
1905 sort order to 'time' (the more common profiling need).
1908 sort order to 'time' (the more common profiling need).
1906
1909
1907 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
1910 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
1908 so that source code shown is guaranteed in sync with the file on
1911 so that source code shown is guaranteed in sync with the file on
1909 disk (also changed in psource). Similar fix to the one for
1912 disk (also changed in psource). Similar fix to the one for
1910 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
1913 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
1911 <yann.ledu-AT-noos.fr>.
1914 <yann.ledu-AT-noos.fr>.
1912
1915
1913 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
1916 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
1914 with a single option would not be correctly parsed. Closes
1917 with a single option would not be correctly parsed. Closes
1915 http://www.scipy.net/roundup/ipython/issue14. This bug had been
1918 http://www.scipy.net/roundup/ipython/issue14. This bug had been
1916 introduced in 0.6.0 (on 2004-05-06).
1919 introduced in 0.6.0 (on 2004-05-06).
1917
1920
1918 2004-05-13 *** Released version 0.6.0
1921 2004-05-13 *** Released version 0.6.0
1919
1922
1920 2004-05-13 Fernando Perez <fperez@colorado.edu>
1923 2004-05-13 Fernando Perez <fperez@colorado.edu>
1921
1924
1922 * debian/: Added debian/ directory to CVS, so that debian support
1925 * debian/: Added debian/ directory to CVS, so that debian support
1923 is publicly accessible. The debian package is maintained by Jack
1926 is publicly accessible. The debian package is maintained by Jack
1924 Moffit <jack-AT-xiph.org>.
1927 Moffit <jack-AT-xiph.org>.
1925
1928
1926 * Documentation: included the notes about an ipython-based system
1929 * Documentation: included the notes about an ipython-based system
1927 shell (the hypothetical 'pysh') into the new_design.pdf document,
1930 shell (the hypothetical 'pysh') into the new_design.pdf document,
1928 so that these ideas get distributed to users along with the
1931 so that these ideas get distributed to users along with the
1929 official documentation.
1932 official documentation.
1930
1933
1931 2004-05-10 Fernando Perez <fperez@colorado.edu>
1934 2004-05-10 Fernando Perez <fperez@colorado.edu>
1932
1935
1933 * IPython/Logger.py (Logger.create_log): fix recently introduced
1936 * IPython/Logger.py (Logger.create_log): fix recently introduced
1934 bug (misindented line) where logstart would fail when not given an
1937 bug (misindented line) where logstart would fail when not given an
1935 explicit filename.
1938 explicit filename.
1936
1939
1937 2004-05-09 Fernando Perez <fperez@colorado.edu>
1940 2004-05-09 Fernando Perez <fperez@colorado.edu>
1938
1941
1939 * IPython/Magic.py (Magic.parse_options): skip system call when
1942 * IPython/Magic.py (Magic.parse_options): skip system call when
1940 there are no options to look for. Faster, cleaner for the common
1943 there are no options to look for. Faster, cleaner for the common
1941 case.
1944 case.
1942
1945
1943 * Documentation: many updates to the manual: describing Windows
1946 * Documentation: many updates to the manual: describing Windows
1944 support better, Gnuplot updates, credits, misc small stuff. Also
1947 support better, Gnuplot updates, credits, misc small stuff. Also
1945 updated the new_design doc a bit.
1948 updated the new_design doc a bit.
1946
1949
1947 2004-05-06 *** Released version 0.6.0.rc1
1950 2004-05-06 *** Released version 0.6.0.rc1
1948
1951
1949 2004-05-06 Fernando Perez <fperez@colorado.edu>
1952 2004-05-06 Fernando Perez <fperez@colorado.edu>
1950
1953
1951 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
1954 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
1952 operations to use the vastly more efficient list/''.join() method.
1955 operations to use the vastly more efficient list/''.join() method.
1953 (FormattedTB.text): Fix
1956 (FormattedTB.text): Fix
1954 http://www.scipy.net/roundup/ipython/issue12 - exception source
1957 http://www.scipy.net/roundup/ipython/issue12 - exception source
1955 extract not updated after reload. Thanks to Mike Salib
1958 extract not updated after reload. Thanks to Mike Salib
1956 <msalib-AT-mit.edu> for pinning the source of the problem.
1959 <msalib-AT-mit.edu> for pinning the source of the problem.
1957 Fortunately, the solution works inside ipython and doesn't require
1960 Fortunately, the solution works inside ipython and doesn't require
1958 any changes to python proper.
1961 any changes to python proper.
1959
1962
1960 * IPython/Magic.py (Magic.parse_options): Improved to process the
1963 * IPython/Magic.py (Magic.parse_options): Improved to process the
1961 argument list as a true shell would (by actually using the
1964 argument list as a true shell would (by actually using the
1962 underlying system shell). This way, all @magics automatically get
1965 underlying system shell). This way, all @magics automatically get
1963 shell expansion for variables. Thanks to a comment by Alex
1966 shell expansion for variables. Thanks to a comment by Alex
1964 Schmolck.
1967 Schmolck.
1965
1968
1966 2004-04-04 Fernando Perez <fperez@colorado.edu>
1969 2004-04-04 Fernando Perez <fperez@colorado.edu>
1967
1970
1968 * IPython/iplib.py (InteractiveShell.interact): Added a special
1971 * IPython/iplib.py (InteractiveShell.interact): Added a special
1969 trap for a debugger quit exception, which is basically impossible
1972 trap for a debugger quit exception, which is basically impossible
1970 to handle by normal mechanisms, given what pdb does to the stack.
1973 to handle by normal mechanisms, given what pdb does to the stack.
1971 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
1974 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
1972
1975
1973 2004-04-03 Fernando Perez <fperez@colorado.edu>
1976 2004-04-03 Fernando Perez <fperez@colorado.edu>
1974
1977
1975 * IPython/genutils.py (Term): Standardized the names of the Term
1978 * IPython/genutils.py (Term): Standardized the names of the Term
1976 class streams to cin/cout/cerr, following C++ naming conventions
1979 class streams to cin/cout/cerr, following C++ naming conventions
1977 (I can't use in/out/err because 'in' is not a valid attribute
1980 (I can't use in/out/err because 'in' is not a valid attribute
1978 name).
1981 name).
1979
1982
1980 * IPython/iplib.py (InteractiveShell.interact): don't increment
1983 * IPython/iplib.py (InteractiveShell.interact): don't increment
1981 the prompt if there's no user input. By Daniel 'Dang' Griffith
1984 the prompt if there's no user input. By Daniel 'Dang' Griffith
1982 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
1985 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
1983 Francois Pinard.
1986 Francois Pinard.
1984
1987
1985 2004-04-02 Fernando Perez <fperez@colorado.edu>
1988 2004-04-02 Fernando Perez <fperez@colorado.edu>
1986
1989
1987 * IPython/genutils.py (Stream.__init__): Modified to survive at
1990 * IPython/genutils.py (Stream.__init__): Modified to survive at
1988 least importing in contexts where stdin/out/err aren't true file
1991 least importing in contexts where stdin/out/err aren't true file
1989 objects, such as PyCrust (they lack fileno() and mode). However,
1992 objects, such as PyCrust (they lack fileno() and mode). However,
1990 the recovery facilities which rely on these things existing will
1993 the recovery facilities which rely on these things existing will
1991 not work.
1994 not work.
1992
1995
1993 2004-04-01 Fernando Perez <fperez@colorado.edu>
1996 2004-04-01 Fernando Perez <fperez@colorado.edu>
1994
1997
1995 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
1998 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
1996 use the new getoutputerror() function, so it properly
1999 use the new getoutputerror() function, so it properly
1997 distinguishes stdout/err.
2000 distinguishes stdout/err.
1998
2001
1999 * IPython/genutils.py (getoutputerror): added a function to
2002 * IPython/genutils.py (getoutputerror): added a function to
2000 capture separately the standard output and error of a command.
2003 capture separately the standard output and error of a command.
2001 After a comment from dang on the mailing lists. This code is
2004 After a comment from dang on the mailing lists. This code is
2002 basically a modified version of commands.getstatusoutput(), from
2005 basically a modified version of commands.getstatusoutput(), from
2003 the standard library.
2006 the standard library.
2004
2007
2005 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2008 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2006 '!!' as a special syntax (shorthand) to access @sx.
2009 '!!' as a special syntax (shorthand) to access @sx.
2007
2010
2008 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2011 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2009 command and return its output as a list split on '\n'.
2012 command and return its output as a list split on '\n'.
2010
2013
2011 2004-03-31 Fernando Perez <fperez@colorado.edu>
2014 2004-03-31 Fernando Perez <fperez@colorado.edu>
2012
2015
2013 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2016 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2014 method to dictionaries used as FakeModule instances if they lack
2017 method to dictionaries used as FakeModule instances if they lack
2015 it. At least pydoc in python2.3 breaks for runtime-defined
2018 it. At least pydoc in python2.3 breaks for runtime-defined
2016 functions without this hack. At some point I need to _really_
2019 functions without this hack. At some point I need to _really_
2017 understand what FakeModule is doing, because it's a gross hack.
2020 understand what FakeModule is doing, because it's a gross hack.
2018 But it solves Arnd's problem for now...
2021 But it solves Arnd's problem for now...
2019
2022
2020 2004-02-27 Fernando Perez <fperez@colorado.edu>
2023 2004-02-27 Fernando Perez <fperez@colorado.edu>
2021
2024
2022 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2025 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2023 mode would behave erratically. Also increased the number of
2026 mode would behave erratically. Also increased the number of
2024 possible logs in rotate mod to 999. Thanks to Rod Holland
2027 possible logs in rotate mod to 999. Thanks to Rod Holland
2025 <rhh@StructureLABS.com> for the report and fixes.
2028 <rhh@StructureLABS.com> for the report and fixes.
2026
2029
2027 2004-02-26 Fernando Perez <fperez@colorado.edu>
2030 2004-02-26 Fernando Perez <fperez@colorado.edu>
2028
2031
2029 * IPython/genutils.py (page): Check that the curses module really
2032 * IPython/genutils.py (page): Check that the curses module really
2030 has the initscr attribute before trying to use it. For some
2033 has the initscr attribute before trying to use it. For some
2031 reason, the Solaris curses module is missing this. I think this
2034 reason, the Solaris curses module is missing this. I think this
2032 should be considered a Solaris python bug, but I'm not sure.
2035 should be considered a Solaris python bug, but I'm not sure.
2033
2036
2034 2004-01-17 Fernando Perez <fperez@colorado.edu>
2037 2004-01-17 Fernando Perez <fperez@colorado.edu>
2035
2038
2036 * IPython/genutils.py (Stream.__init__): Changes to try to make
2039 * IPython/genutils.py (Stream.__init__): Changes to try to make
2037 ipython robust against stdin/out/err being closed by the user.
2040 ipython robust against stdin/out/err being closed by the user.
2038 This is 'user error' (and blocks a normal python session, at least
2041 This is 'user error' (and blocks a normal python session, at least
2039 the stdout case). However, Ipython should be able to survive such
2042 the stdout case). However, Ipython should be able to survive such
2040 instances of abuse as gracefully as possible. To simplify the
2043 instances of abuse as gracefully as possible. To simplify the
2041 coding and maintain compatibility with Gary Bishop's Term
2044 coding and maintain compatibility with Gary Bishop's Term
2042 contributions, I've made use of classmethods for this. I think
2045 contributions, I've made use of classmethods for this. I think
2043 this introduces a dependency on python 2.2.
2046 this introduces a dependency on python 2.2.
2044
2047
2045 2004-01-13 Fernando Perez <fperez@colorado.edu>
2048 2004-01-13 Fernando Perez <fperez@colorado.edu>
2046
2049
2047 * IPython/numutils.py (exp_safe): simplified the code a bit and
2050 * IPython/numutils.py (exp_safe): simplified the code a bit and
2048 removed the need for importing the kinds module altogether.
2051 removed the need for importing the kinds module altogether.
2049
2052
2050 2004-01-06 Fernando Perez <fperez@colorado.edu>
2053 2004-01-06 Fernando Perez <fperez@colorado.edu>
2051
2054
2052 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2055 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2053 a magic function instead, after some community feedback. No
2056 a magic function instead, after some community feedback. No
2054 special syntax will exist for it, but its name is deliberately
2057 special syntax will exist for it, but its name is deliberately
2055 very short.
2058 very short.
2056
2059
2057 2003-12-20 Fernando Perez <fperez@colorado.edu>
2060 2003-12-20 Fernando Perez <fperez@colorado.edu>
2058
2061
2059 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2062 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2060 new functionality, to automagically assign the result of a shell
2063 new functionality, to automagically assign the result of a shell
2061 command to a variable. I'll solicit some community feedback on
2064 command to a variable. I'll solicit some community feedback on
2062 this before making it permanent.
2065 this before making it permanent.
2063
2066
2064 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2067 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2065 requested about callables for which inspect couldn't obtain a
2068 requested about callables for which inspect couldn't obtain a
2066 proper argspec. Thanks to a crash report sent by Etienne
2069 proper argspec. Thanks to a crash report sent by Etienne
2067 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2070 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2068
2071
2069 2003-12-09 Fernando Perez <fperez@colorado.edu>
2072 2003-12-09 Fernando Perez <fperez@colorado.edu>
2070
2073
2071 * IPython/genutils.py (page): patch for the pager to work across
2074 * IPython/genutils.py (page): patch for the pager to work across
2072 various versions of Windows. By Gary Bishop.
2075 various versions of Windows. By Gary Bishop.
2073
2076
2074 2003-12-04 Fernando Perez <fperez@colorado.edu>
2077 2003-12-04 Fernando Perez <fperez@colorado.edu>
2075
2078
2076 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2079 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2077 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2080 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2078 While I tested this and it looks ok, there may still be corner
2081 While I tested this and it looks ok, there may still be corner
2079 cases I've missed.
2082 cases I've missed.
2080
2083
2081 2003-12-01 Fernando Perez <fperez@colorado.edu>
2084 2003-12-01 Fernando Perez <fperez@colorado.edu>
2082
2085
2083 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2086 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2084 where a line like 'p,q=1,2' would fail because the automagic
2087 where a line like 'p,q=1,2' would fail because the automagic
2085 system would be triggered for @p.
2088 system would be triggered for @p.
2086
2089
2087 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2090 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2088 cleanups, code unmodified.
2091 cleanups, code unmodified.
2089
2092
2090 * IPython/genutils.py (Term): added a class for IPython to handle
2093 * IPython/genutils.py (Term): added a class for IPython to handle
2091 output. In most cases it will just be a proxy for stdout/err, but
2094 output. In most cases it will just be a proxy for stdout/err, but
2092 having this allows modifications to be made for some platforms,
2095 having this allows modifications to be made for some platforms,
2093 such as handling color escapes under Windows. All of this code
2096 such as handling color escapes under Windows. All of this code
2094 was contributed by Gary Bishop, with minor modifications by me.
2097 was contributed by Gary Bishop, with minor modifications by me.
2095 The actual changes affect many files.
2098 The actual changes affect many files.
2096
2099
2097 2003-11-30 Fernando Perez <fperez@colorado.edu>
2100 2003-11-30 Fernando Perez <fperez@colorado.edu>
2098
2101
2099 * IPython/iplib.py (file_matches): new completion code, courtesy
2102 * IPython/iplib.py (file_matches): new completion code, courtesy
2100 of Jeff Collins. This enables filename completion again under
2103 of Jeff Collins. This enables filename completion again under
2101 python 2.3, which disabled it at the C level.
2104 python 2.3, which disabled it at the C level.
2102
2105
2103 2003-11-11 Fernando Perez <fperez@colorado.edu>
2106 2003-11-11 Fernando Perez <fperez@colorado.edu>
2104
2107
2105 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2108 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2106 for Numeric.array(map(...)), but often convenient.
2109 for Numeric.array(map(...)), but often convenient.
2107
2110
2108 2003-11-05 Fernando Perez <fperez@colorado.edu>
2111 2003-11-05 Fernando Perez <fperez@colorado.edu>
2109
2112
2110 * IPython/numutils.py (frange): Changed a call from int() to
2113 * IPython/numutils.py (frange): Changed a call from int() to
2111 int(round()) to prevent a problem reported with arange() in the
2114 int(round()) to prevent a problem reported with arange() in the
2112 numpy list.
2115 numpy list.
2113
2116
2114 2003-10-06 Fernando Perez <fperez@colorado.edu>
2117 2003-10-06 Fernando Perez <fperez@colorado.edu>
2115
2118
2116 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2119 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2117 prevent crashes if sys lacks an argv attribute (it happens with
2120 prevent crashes if sys lacks an argv attribute (it happens with
2118 embedded interpreters which build a bare-bones sys module).
2121 embedded interpreters which build a bare-bones sys module).
2119 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2122 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2120
2123
2121 2003-09-24 Fernando Perez <fperez@colorado.edu>
2124 2003-09-24 Fernando Perez <fperez@colorado.edu>
2122
2125
2123 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2126 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2124 to protect against poorly written user objects where __getattr__
2127 to protect against poorly written user objects where __getattr__
2125 raises exceptions other than AttributeError. Thanks to a bug
2128 raises exceptions other than AttributeError. Thanks to a bug
2126 report by Oliver Sander <osander-AT-gmx.de>.
2129 report by Oliver Sander <osander-AT-gmx.de>.
2127
2130
2128 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2131 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2129 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2132 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2130
2133
2131 2003-09-09 Fernando Perez <fperez@colorado.edu>
2134 2003-09-09 Fernando Perez <fperez@colorado.edu>
2132
2135
2133 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2136 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2134 unpacking a list whith a callable as first element would
2137 unpacking a list whith a callable as first element would
2135 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2138 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2136 Collins.
2139 Collins.
2137
2140
2138 2003-08-25 *** Released version 0.5.0
2141 2003-08-25 *** Released version 0.5.0
2139
2142
2140 2003-08-22 Fernando Perez <fperez@colorado.edu>
2143 2003-08-22 Fernando Perez <fperez@colorado.edu>
2141
2144
2142 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2145 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2143 improperly defined user exceptions. Thanks to feedback from Mark
2146 improperly defined user exceptions. Thanks to feedback from Mark
2144 Russell <mrussell-AT-verio.net>.
2147 Russell <mrussell-AT-verio.net>.
2145
2148
2146 2003-08-20 Fernando Perez <fperez@colorado.edu>
2149 2003-08-20 Fernando Perez <fperez@colorado.edu>
2147
2150
2148 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2151 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2149 printing so that it would print multi-line string forms starting
2152 printing so that it would print multi-line string forms starting
2150 with a new line. This way the formatting is better respected for
2153 with a new line. This way the formatting is better respected for
2151 objects which work hard to make nice string forms.
2154 objects which work hard to make nice string forms.
2152
2155
2153 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2156 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2154 autocall would overtake data access for objects with both
2157 autocall would overtake data access for objects with both
2155 __getitem__ and __call__.
2158 __getitem__ and __call__.
2156
2159
2157 2003-08-19 *** Released version 0.5.0-rc1
2160 2003-08-19 *** Released version 0.5.0-rc1
2158
2161
2159 2003-08-19 Fernando Perez <fperez@colorado.edu>
2162 2003-08-19 Fernando Perez <fperez@colorado.edu>
2160
2163
2161 * IPython/deep_reload.py (load_tail): single tiny change here
2164 * IPython/deep_reload.py (load_tail): single tiny change here
2162 seems to fix the long-standing bug of dreload() failing to work
2165 seems to fix the long-standing bug of dreload() failing to work
2163 for dotted names. But this module is pretty tricky, so I may have
2166 for dotted names. But this module is pretty tricky, so I may have
2164 missed some subtlety. Needs more testing!.
2167 missed some subtlety. Needs more testing!.
2165
2168
2166 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2169 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2167 exceptions which have badly implemented __str__ methods.
2170 exceptions which have badly implemented __str__ methods.
2168 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2171 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2169 which I've been getting reports about from Python 2.3 users. I
2172 which I've been getting reports about from Python 2.3 users. I
2170 wish I had a simple test case to reproduce the problem, so I could
2173 wish I had a simple test case to reproduce the problem, so I could
2171 either write a cleaner workaround or file a bug report if
2174 either write a cleaner workaround or file a bug report if
2172 necessary.
2175 necessary.
2173
2176
2174 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2177 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2175 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2178 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2176 a bug report by Tjabo Kloppenburg.
2179 a bug report by Tjabo Kloppenburg.
2177
2180
2178 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2181 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2179 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2182 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2180 seems rather unstable. Thanks to a bug report by Tjabo
2183 seems rather unstable. Thanks to a bug report by Tjabo
2181 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2184 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2182
2185
2183 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2186 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2184 this out soon because of the critical fixes in the inner loop for
2187 this out soon because of the critical fixes in the inner loop for
2185 generators.
2188 generators.
2186
2189
2187 * IPython/Magic.py (Magic.getargspec): removed. This (and
2190 * IPython/Magic.py (Magic.getargspec): removed. This (and
2188 _get_def) have been obsoleted by OInspect for a long time, I
2191 _get_def) have been obsoleted by OInspect for a long time, I
2189 hadn't noticed that they were dead code.
2192 hadn't noticed that they were dead code.
2190 (Magic._ofind): restored _ofind functionality for a few literals
2193 (Magic._ofind): restored _ofind functionality for a few literals
2191 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2194 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2192 for things like "hello".capitalize?, since that would require a
2195 for things like "hello".capitalize?, since that would require a
2193 potentially dangerous eval() again.
2196 potentially dangerous eval() again.
2194
2197
2195 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2198 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2196 logic a bit more to clean up the escapes handling and minimize the
2199 logic a bit more to clean up the escapes handling and minimize the
2197 use of _ofind to only necessary cases. The interactive 'feel' of
2200 use of _ofind to only necessary cases. The interactive 'feel' of
2198 IPython should have improved quite a bit with the changes in
2201 IPython should have improved quite a bit with the changes in
2199 _prefilter and _ofind (besides being far safer than before).
2202 _prefilter and _ofind (besides being far safer than before).
2200
2203
2201 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2204 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2202 obscure, never reported). Edit would fail to find the object to
2205 obscure, never reported). Edit would fail to find the object to
2203 edit under some circumstances.
2206 edit under some circumstances.
2204 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2207 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2205 which were causing double-calling of generators. Those eval calls
2208 which were causing double-calling of generators. Those eval calls
2206 were _very_ dangerous, since code with side effects could be
2209 were _very_ dangerous, since code with side effects could be
2207 triggered. As they say, 'eval is evil'... These were the
2210 triggered. As they say, 'eval is evil'... These were the
2208 nastiest evals in IPython. Besides, _ofind is now far simpler,
2211 nastiest evals in IPython. Besides, _ofind is now far simpler,
2209 and it should also be quite a bit faster. Its use of inspect is
2212 and it should also be quite a bit faster. Its use of inspect is
2210 also safer, so perhaps some of the inspect-related crashes I've
2213 also safer, so perhaps some of the inspect-related crashes I've
2211 seen lately with Python 2.3 might be taken care of. That will
2214 seen lately with Python 2.3 might be taken care of. That will
2212 need more testing.
2215 need more testing.
2213
2216
2214 2003-08-17 Fernando Perez <fperez@colorado.edu>
2217 2003-08-17 Fernando Perez <fperez@colorado.edu>
2215
2218
2216 * IPython/iplib.py (InteractiveShell._prefilter): significant
2219 * IPython/iplib.py (InteractiveShell._prefilter): significant
2217 simplifications to the logic for handling user escapes. Faster
2220 simplifications to the logic for handling user escapes. Faster
2218 and simpler code.
2221 and simpler code.
2219
2222
2220 2003-08-14 Fernando Perez <fperez@colorado.edu>
2223 2003-08-14 Fernando Perez <fperez@colorado.edu>
2221
2224
2222 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2225 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2223 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2226 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2224 but it should be quite a bit faster. And the recursive version
2227 but it should be quite a bit faster. And the recursive version
2225 generated O(log N) intermediate storage for all rank>1 arrays,
2228 generated O(log N) intermediate storage for all rank>1 arrays,
2226 even if they were contiguous.
2229 even if they were contiguous.
2227 (l1norm): Added this function.
2230 (l1norm): Added this function.
2228 (norm): Added this function for arbitrary norms (including
2231 (norm): Added this function for arbitrary norms (including
2229 l-infinity). l1 and l2 are still special cases for convenience
2232 l-infinity). l1 and l2 are still special cases for convenience
2230 and speed.
2233 and speed.
2231
2234
2232 2003-08-03 Fernando Perez <fperez@colorado.edu>
2235 2003-08-03 Fernando Perez <fperez@colorado.edu>
2233
2236
2234 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
2237 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
2235 exceptions, which now raise PendingDeprecationWarnings in Python
2238 exceptions, which now raise PendingDeprecationWarnings in Python
2236 2.3. There were some in Magic and some in Gnuplot2.
2239 2.3. There were some in Magic and some in Gnuplot2.
2237
2240
2238 2003-06-30 Fernando Perez <fperez@colorado.edu>
2241 2003-06-30 Fernando Perez <fperez@colorado.edu>
2239
2242
2240 * IPython/genutils.py (page): modified to call curses only for
2243 * IPython/genutils.py (page): modified to call curses only for
2241 terminals where TERM=='xterm'. After problems under many other
2244 terminals where TERM=='xterm'. After problems under many other
2242 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
2245 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
2243
2246
2244 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
2247 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
2245 would be triggered when readline was absent. This was just an old
2248 would be triggered when readline was absent. This was just an old
2246 debugging statement I'd forgotten to take out.
2249 debugging statement I'd forgotten to take out.
2247
2250
2248 2003-06-20 Fernando Perez <fperez@colorado.edu>
2251 2003-06-20 Fernando Perez <fperez@colorado.edu>
2249
2252
2250 * IPython/genutils.py (clock): modified to return only user time
2253 * IPython/genutils.py (clock): modified to return only user time
2251 (not counting system time), after a discussion on scipy. While
2254 (not counting system time), after a discussion on scipy. While
2252 system time may be a useful quantity occasionally, it may much
2255 system time may be a useful quantity occasionally, it may much
2253 more easily be skewed by occasional swapping or other similar
2256 more easily be skewed by occasional swapping or other similar
2254 activity.
2257 activity.
2255
2258
2256 2003-06-05 Fernando Perez <fperez@colorado.edu>
2259 2003-06-05 Fernando Perez <fperez@colorado.edu>
2257
2260
2258 * IPython/numutils.py (identity): new function, for building
2261 * IPython/numutils.py (identity): new function, for building
2259 arbitrary rank Kronecker deltas (mostly backwards compatible with
2262 arbitrary rank Kronecker deltas (mostly backwards compatible with
2260 Numeric.identity)
2263 Numeric.identity)
2261
2264
2262 2003-06-03 Fernando Perez <fperez@colorado.edu>
2265 2003-06-03 Fernando Perez <fperez@colorado.edu>
2263
2266
2264 * IPython/iplib.py (InteractiveShell.handle_magic): protect
2267 * IPython/iplib.py (InteractiveShell.handle_magic): protect
2265 arguments passed to magics with spaces, to allow trailing '\' to
2268 arguments passed to magics with spaces, to allow trailing '\' to
2266 work normally (mainly for Windows users).
2269 work normally (mainly for Windows users).
2267
2270
2268 2003-05-29 Fernando Perez <fperez@colorado.edu>
2271 2003-05-29 Fernando Perez <fperez@colorado.edu>
2269
2272
2270 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
2273 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
2271 instead of pydoc.help. This fixes a bizarre behavior where
2274 instead of pydoc.help. This fixes a bizarre behavior where
2272 printing '%s' % locals() would trigger the help system. Now
2275 printing '%s' % locals() would trigger the help system. Now
2273 ipython behaves like normal python does.
2276 ipython behaves like normal python does.
2274
2277
2275 Note that if one does 'from pydoc import help', the bizarre
2278 Note that if one does 'from pydoc import help', the bizarre
2276 behavior returns, but this will also happen in normal python, so
2279 behavior returns, but this will also happen in normal python, so
2277 it's not an ipython bug anymore (it has to do with how pydoc.help
2280 it's not an ipython bug anymore (it has to do with how pydoc.help
2278 is implemented).
2281 is implemented).
2279
2282
2280 2003-05-22 Fernando Perez <fperez@colorado.edu>
2283 2003-05-22 Fernando Perez <fperez@colorado.edu>
2281
2284
2282 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
2285 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
2283 return [] instead of None when nothing matches, also match to end
2286 return [] instead of None when nothing matches, also match to end
2284 of line. Patch by Gary Bishop.
2287 of line. Patch by Gary Bishop.
2285
2288
2286 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
2289 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
2287 protection as before, for files passed on the command line. This
2290 protection as before, for files passed on the command line. This
2288 prevents the CrashHandler from kicking in if user files call into
2291 prevents the CrashHandler from kicking in if user files call into
2289 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
2292 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
2290 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2293 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2291
2294
2292 2003-05-20 *** Released version 0.4.0
2295 2003-05-20 *** Released version 0.4.0
2293
2296
2294 2003-05-20 Fernando Perez <fperez@colorado.edu>
2297 2003-05-20 Fernando Perez <fperez@colorado.edu>
2295
2298
2296 * setup.py: added support for manpages. It's a bit hackish b/c of
2299 * setup.py: added support for manpages. It's a bit hackish b/c of
2297 a bug in the way the bdist_rpm distutils target handles gzipped
2300 a bug in the way the bdist_rpm distutils target handles gzipped
2298 manpages, but it works. After a patch by Jack.
2301 manpages, but it works. After a patch by Jack.
2299
2302
2300 2003-05-19 Fernando Perez <fperez@colorado.edu>
2303 2003-05-19 Fernando Perez <fperez@colorado.edu>
2301
2304
2302 * IPython/numutils.py: added a mockup of the kinds module, since
2305 * IPython/numutils.py: added a mockup of the kinds module, since
2303 it was recently removed from Numeric. This way, numutils will
2306 it was recently removed from Numeric. This way, numutils will
2304 work for all users even if they are missing kinds.
2307 work for all users even if they are missing kinds.
2305
2308
2306 * IPython/Magic.py (Magic._ofind): Harden against an inspect
2309 * IPython/Magic.py (Magic._ofind): Harden against an inspect
2307 failure, which can occur with SWIG-wrapped extensions. After a
2310 failure, which can occur with SWIG-wrapped extensions. After a
2308 crash report from Prabhu.
2311 crash report from Prabhu.
2309
2312
2310 2003-05-16 Fernando Perez <fperez@colorado.edu>
2313 2003-05-16 Fernando Perez <fperez@colorado.edu>
2311
2314
2312 * IPython/iplib.py (InteractiveShell.excepthook): New method to
2315 * IPython/iplib.py (InteractiveShell.excepthook): New method to
2313 protect ipython from user code which may call directly
2316 protect ipython from user code which may call directly
2314 sys.excepthook (this looks like an ipython crash to the user, even
2317 sys.excepthook (this looks like an ipython crash to the user, even
2315 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2318 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2316 This is especially important to help users of WxWindows, but may
2319 This is especially important to help users of WxWindows, but may
2317 also be useful in other cases.
2320 also be useful in other cases.
2318
2321
2319 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
2322 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
2320 an optional tb_offset to be specified, and to preserve exception
2323 an optional tb_offset to be specified, and to preserve exception
2321 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2324 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2322
2325
2323 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2326 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2324
2327
2325 2003-05-15 Fernando Perez <fperez@colorado.edu>
2328 2003-05-15 Fernando Perez <fperez@colorado.edu>
2326
2329
2327 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
2330 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
2328 installing for a new user under Windows.
2331 installing for a new user under Windows.
2329
2332
2330 2003-05-12 Fernando Perez <fperez@colorado.edu>
2333 2003-05-12 Fernando Perez <fperez@colorado.edu>
2331
2334
2332 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
2335 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
2333 handler for Emacs comint-based lines. Currently it doesn't do
2336 handler for Emacs comint-based lines. Currently it doesn't do
2334 much (but importantly, it doesn't update the history cache). In
2337 much (but importantly, it doesn't update the history cache). In
2335 the future it may be expanded if Alex needs more functionality
2338 the future it may be expanded if Alex needs more functionality
2336 there.
2339 there.
2337
2340
2338 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
2341 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
2339 info to crash reports.
2342 info to crash reports.
2340
2343
2341 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
2344 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
2342 just like Python's -c. Also fixed crash with invalid -color
2345 just like Python's -c. Also fixed crash with invalid -color
2343 option value at startup. Thanks to Will French
2346 option value at startup. Thanks to Will French
2344 <wfrench-AT-bestweb.net> for the bug report.
2347 <wfrench-AT-bestweb.net> for the bug report.
2345
2348
2346 2003-05-09 Fernando Perez <fperez@colorado.edu>
2349 2003-05-09 Fernando Perez <fperez@colorado.edu>
2347
2350
2348 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
2351 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
2349 to EvalDict (it's a mapping, after all) and simplified its code
2352 to EvalDict (it's a mapping, after all) and simplified its code
2350 quite a bit, after a nice discussion on c.l.py where Gustavo
2353 quite a bit, after a nice discussion on c.l.py where Gustavo
2351 Córdova <gcordova-AT-sismex.com> suggested the new version.
2354 Córdova <gcordova-AT-sismex.com> suggested the new version.
2352
2355
2353 2003-04-30 Fernando Perez <fperez@colorado.edu>
2356 2003-04-30 Fernando Perez <fperez@colorado.edu>
2354
2357
2355 * IPython/genutils.py (timings_out): modified it to reduce its
2358 * IPython/genutils.py (timings_out): modified it to reduce its
2356 overhead in the common reps==1 case.
2359 overhead in the common reps==1 case.
2357
2360
2358 2003-04-29 Fernando Perez <fperez@colorado.edu>
2361 2003-04-29 Fernando Perez <fperez@colorado.edu>
2359
2362
2360 * IPython/genutils.py (timings_out): Modified to use the resource
2363 * IPython/genutils.py (timings_out): Modified to use the resource
2361 module, which avoids the wraparound problems of time.clock().
2364 module, which avoids the wraparound problems of time.clock().
2362
2365
2363 2003-04-17 *** Released version 0.2.15pre4
2366 2003-04-17 *** Released version 0.2.15pre4
2364
2367
2365 2003-04-17 Fernando Perez <fperez@colorado.edu>
2368 2003-04-17 Fernando Perez <fperez@colorado.edu>
2366
2369
2367 * setup.py (scriptfiles): Split windows-specific stuff over to a
2370 * setup.py (scriptfiles): Split windows-specific stuff over to a
2368 separate file, in an attempt to have a Windows GUI installer.
2371 separate file, in an attempt to have a Windows GUI installer.
2369 That didn't work, but part of the groundwork is done.
2372 That didn't work, but part of the groundwork is done.
2370
2373
2371 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
2374 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
2372 indent/unindent with 4 spaces. Particularly useful in combination
2375 indent/unindent with 4 spaces. Particularly useful in combination
2373 with the new auto-indent option.
2376 with the new auto-indent option.
2374
2377
2375 2003-04-16 Fernando Perez <fperez@colorado.edu>
2378 2003-04-16 Fernando Perez <fperez@colorado.edu>
2376
2379
2377 * IPython/Magic.py: various replacements of self.rc for
2380 * IPython/Magic.py: various replacements of self.rc for
2378 self.shell.rc. A lot more remains to be done to fully disentangle
2381 self.shell.rc. A lot more remains to be done to fully disentangle
2379 this class from the main Shell class.
2382 this class from the main Shell class.
2380
2383
2381 * IPython/GnuplotRuntime.py: added checks for mouse support so
2384 * IPython/GnuplotRuntime.py: added checks for mouse support so
2382 that we don't try to enable it if the current gnuplot doesn't
2385 that we don't try to enable it if the current gnuplot doesn't
2383 really support it. Also added checks so that we don't try to
2386 really support it. Also added checks so that we don't try to
2384 enable persist under Windows (where Gnuplot doesn't recognize the
2387 enable persist under Windows (where Gnuplot doesn't recognize the
2385 option).
2388 option).
2386
2389
2387 * IPython/iplib.py (InteractiveShell.interact): Added optional
2390 * IPython/iplib.py (InteractiveShell.interact): Added optional
2388 auto-indenting code, after a patch by King C. Shu
2391 auto-indenting code, after a patch by King C. Shu
2389 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
2392 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
2390 get along well with pasting indented code. If I ever figure out
2393 get along well with pasting indented code. If I ever figure out
2391 how to make that part go well, it will become on by default.
2394 how to make that part go well, it will become on by default.
2392
2395
2393 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
2396 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
2394 crash ipython if there was an unmatched '%' in the user's prompt
2397 crash ipython if there was an unmatched '%' in the user's prompt
2395 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2398 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2396
2399
2397 * IPython/iplib.py (InteractiveShell.interact): removed the
2400 * IPython/iplib.py (InteractiveShell.interact): removed the
2398 ability to ask the user whether he wants to crash or not at the
2401 ability to ask the user whether he wants to crash or not at the
2399 'last line' exception handler. Calling functions at that point
2402 'last line' exception handler. Calling functions at that point
2400 changes the stack, and the error reports would have incorrect
2403 changes the stack, and the error reports would have incorrect
2401 tracebacks.
2404 tracebacks.
2402
2405
2403 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
2406 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
2404 pass through a peger a pretty-printed form of any object. After a
2407 pass through a peger a pretty-printed form of any object. After a
2405 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
2408 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
2406
2409
2407 2003-04-14 Fernando Perez <fperez@colorado.edu>
2410 2003-04-14 Fernando Perez <fperez@colorado.edu>
2408
2411
2409 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
2412 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
2410 all files in ~ would be modified at first install (instead of
2413 all files in ~ would be modified at first install (instead of
2411 ~/.ipython). This could be potentially disastrous, as the
2414 ~/.ipython). This could be potentially disastrous, as the
2412 modification (make line-endings native) could damage binary files.
2415 modification (make line-endings native) could damage binary files.
2413
2416
2414 2003-04-10 Fernando Perez <fperez@colorado.edu>
2417 2003-04-10 Fernando Perez <fperez@colorado.edu>
2415
2418
2416 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
2419 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
2417 handle only lines which are invalid python. This now means that
2420 handle only lines which are invalid python. This now means that
2418 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
2421 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
2419 for the bug report.
2422 for the bug report.
2420
2423
2421 2003-04-01 Fernando Perez <fperez@colorado.edu>
2424 2003-04-01 Fernando Perez <fperez@colorado.edu>
2422
2425
2423 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
2426 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
2424 where failing to set sys.last_traceback would crash pdb.pm().
2427 where failing to set sys.last_traceback would crash pdb.pm().
2425 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
2428 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
2426 report.
2429 report.
2427
2430
2428 2003-03-25 Fernando Perez <fperez@colorado.edu>
2431 2003-03-25 Fernando Perez <fperez@colorado.edu>
2429
2432
2430 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
2433 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
2431 before printing it (it had a lot of spurious blank lines at the
2434 before printing it (it had a lot of spurious blank lines at the
2432 end).
2435 end).
2433
2436
2434 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
2437 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
2435 output would be sent 21 times! Obviously people don't use this
2438 output would be sent 21 times! Obviously people don't use this
2436 too often, or I would have heard about it.
2439 too often, or I would have heard about it.
2437
2440
2438 2003-03-24 Fernando Perez <fperez@colorado.edu>
2441 2003-03-24 Fernando Perez <fperez@colorado.edu>
2439
2442
2440 * setup.py (scriptfiles): renamed the data_files parameter from
2443 * setup.py (scriptfiles): renamed the data_files parameter from
2441 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
2444 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
2442 for the patch.
2445 for the patch.
2443
2446
2444 2003-03-20 Fernando Perez <fperez@colorado.edu>
2447 2003-03-20 Fernando Perez <fperez@colorado.edu>
2445
2448
2446 * IPython/genutils.py (error): added error() and fatal()
2449 * IPython/genutils.py (error): added error() and fatal()
2447 functions.
2450 functions.
2448
2451
2449 2003-03-18 *** Released version 0.2.15pre3
2452 2003-03-18 *** Released version 0.2.15pre3
2450
2453
2451 2003-03-18 Fernando Perez <fperez@colorado.edu>
2454 2003-03-18 Fernando Perez <fperez@colorado.edu>
2452
2455
2453 * setupext/install_data_ext.py
2456 * setupext/install_data_ext.py
2454 (install_data_ext.initialize_options): Class contributed by Jack
2457 (install_data_ext.initialize_options): Class contributed by Jack
2455 Moffit for fixing the old distutils hack. He is sending this to
2458 Moffit for fixing the old distutils hack. He is sending this to
2456 the distutils folks so in the future we may not need it as a
2459 the distutils folks so in the future we may not need it as a
2457 private fix.
2460 private fix.
2458
2461
2459 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
2462 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
2460 changes for Debian packaging. See his patch for full details.
2463 changes for Debian packaging. See his patch for full details.
2461 The old distutils hack of making the ipythonrc* files carry a
2464 The old distutils hack of making the ipythonrc* files carry a
2462 bogus .py extension is gone, at last. Examples were moved to a
2465 bogus .py extension is gone, at last. Examples were moved to a
2463 separate subdir under doc/, and the separate executable scripts
2466 separate subdir under doc/, and the separate executable scripts
2464 now live in their own directory. Overall a great cleanup. The
2467 now live in their own directory. Overall a great cleanup. The
2465 manual was updated to use the new files, and setup.py has been
2468 manual was updated to use the new files, and setup.py has been
2466 fixed for this setup.
2469 fixed for this setup.
2467
2470
2468 * IPython/PyColorize.py (Parser.usage): made non-executable and
2471 * IPython/PyColorize.py (Parser.usage): made non-executable and
2469 created a pycolor wrapper around it to be included as a script.
2472 created a pycolor wrapper around it to be included as a script.
2470
2473
2471 2003-03-12 *** Released version 0.2.15pre2
2474 2003-03-12 *** Released version 0.2.15pre2
2472
2475
2473 2003-03-12 Fernando Perez <fperez@colorado.edu>
2476 2003-03-12 Fernando Perez <fperez@colorado.edu>
2474
2477
2475 * IPython/ColorANSI.py (make_color_table): Finally fixed the
2478 * IPython/ColorANSI.py (make_color_table): Finally fixed the
2476 long-standing problem with garbage characters in some terminals.
2479 long-standing problem with garbage characters in some terminals.
2477 The issue was really that the \001 and \002 escapes must _only_ be
2480 The issue was really that the \001 and \002 escapes must _only_ be
2478 passed to input prompts (which call readline), but _never_ to
2481 passed to input prompts (which call readline), but _never_ to
2479 normal text to be printed on screen. I changed ColorANSI to have
2482 normal text to be printed on screen. I changed ColorANSI to have
2480 two classes: TermColors and InputTermColors, each with the
2483 two classes: TermColors and InputTermColors, each with the
2481 appropriate escapes for input prompts or normal text. The code in
2484 appropriate escapes for input prompts or normal text. The code in
2482 Prompts.py got slightly more complicated, but this very old and
2485 Prompts.py got slightly more complicated, but this very old and
2483 annoying bug is finally fixed.
2486 annoying bug is finally fixed.
2484
2487
2485 All the credit for nailing down the real origin of this problem
2488 All the credit for nailing down the real origin of this problem
2486 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
2489 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
2487 *Many* thanks to him for spending quite a bit of effort on this.
2490 *Many* thanks to him for spending quite a bit of effort on this.
2488
2491
2489 2003-03-05 *** Released version 0.2.15pre1
2492 2003-03-05 *** Released version 0.2.15pre1
2490
2493
2491 2003-03-03 Fernando Perez <fperez@colorado.edu>
2494 2003-03-03 Fernando Perez <fperez@colorado.edu>
2492
2495
2493 * IPython/FakeModule.py: Moved the former _FakeModule to a
2496 * IPython/FakeModule.py: Moved the former _FakeModule to a
2494 separate file, because it's also needed by Magic (to fix a similar
2497 separate file, because it's also needed by Magic (to fix a similar
2495 pickle-related issue in @run).
2498 pickle-related issue in @run).
2496
2499
2497 2003-03-02 Fernando Perez <fperez@colorado.edu>
2500 2003-03-02 Fernando Perez <fperez@colorado.edu>
2498
2501
2499 * IPython/Magic.py (Magic.magic_autocall): new magic to control
2502 * IPython/Magic.py (Magic.magic_autocall): new magic to control
2500 the autocall option at runtime.
2503 the autocall option at runtime.
2501 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
2504 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
2502 across Magic.py to start separating Magic from InteractiveShell.
2505 across Magic.py to start separating Magic from InteractiveShell.
2503 (Magic._ofind): Fixed to return proper namespace for dotted
2506 (Magic._ofind): Fixed to return proper namespace for dotted
2504 names. Before, a dotted name would always return 'not currently
2507 names. Before, a dotted name would always return 'not currently
2505 defined', because it would find the 'parent'. s.x would be found,
2508 defined', because it would find the 'parent'. s.x would be found,
2506 but since 'x' isn't defined by itself, it would get confused.
2509 but since 'x' isn't defined by itself, it would get confused.
2507 (Magic.magic_run): Fixed pickling problems reported by Ralf
2510 (Magic.magic_run): Fixed pickling problems reported by Ralf
2508 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
2511 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
2509 that I'd used when Mike Heeter reported similar issues at the
2512 that I'd used when Mike Heeter reported similar issues at the
2510 top-level, but now for @run. It boils down to injecting the
2513 top-level, but now for @run. It boils down to injecting the
2511 namespace where code is being executed with something that looks
2514 namespace where code is being executed with something that looks
2512 enough like a module to fool pickle.dump(). Since a pickle stores
2515 enough like a module to fool pickle.dump(). Since a pickle stores
2513 a named reference to the importing module, we need this for
2516 a named reference to the importing module, we need this for
2514 pickles to save something sensible.
2517 pickles to save something sensible.
2515
2518
2516 * IPython/ipmaker.py (make_IPython): added an autocall option.
2519 * IPython/ipmaker.py (make_IPython): added an autocall option.
2517
2520
2518 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
2521 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
2519 the auto-eval code. Now autocalling is an option, and the code is
2522 the auto-eval code. Now autocalling is an option, and the code is
2520 also vastly safer. There is no more eval() involved at all.
2523 also vastly safer. There is no more eval() involved at all.
2521
2524
2522 2003-03-01 Fernando Perez <fperez@colorado.edu>
2525 2003-03-01 Fernando Perez <fperez@colorado.edu>
2523
2526
2524 * IPython/Magic.py (Magic._ofind): Changed interface to return a
2527 * IPython/Magic.py (Magic._ofind): Changed interface to return a
2525 dict with named keys instead of a tuple.
2528 dict with named keys instead of a tuple.
2526
2529
2527 * IPython: Started using CVS for IPython as of 0.2.15pre1.
2530 * IPython: Started using CVS for IPython as of 0.2.15pre1.
2528
2531
2529 * setup.py (make_shortcut): Fixed message about directories
2532 * setup.py (make_shortcut): Fixed message about directories
2530 created during Windows installation (the directories were ok, just
2533 created during Windows installation (the directories were ok, just
2531 the printed message was misleading). Thanks to Chris Liechti
2534 the printed message was misleading). Thanks to Chris Liechti
2532 <cliechti-AT-gmx.net> for the heads up.
2535 <cliechti-AT-gmx.net> for the heads up.
2533
2536
2534 2003-02-21 Fernando Perez <fperez@colorado.edu>
2537 2003-02-21 Fernando Perez <fperez@colorado.edu>
2535
2538
2536 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
2539 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
2537 of ValueError exception when checking for auto-execution. This
2540 of ValueError exception when checking for auto-execution. This
2538 one is raised by things like Numeric arrays arr.flat when the
2541 one is raised by things like Numeric arrays arr.flat when the
2539 array is non-contiguous.
2542 array is non-contiguous.
2540
2543
2541 2003-01-31 Fernando Perez <fperez@colorado.edu>
2544 2003-01-31 Fernando Perez <fperez@colorado.edu>
2542
2545
2543 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
2546 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
2544 not return any value at all (even though the command would get
2547 not return any value at all (even though the command would get
2545 executed).
2548 executed).
2546 (xsys): Flush stdout right after printing the command to ensure
2549 (xsys): Flush stdout right after printing the command to ensure
2547 proper ordering of commands and command output in the total
2550 proper ordering of commands and command output in the total
2548 output.
2551 output.
2549 (SystemExec/xsys/bq): Switched the names of xsys/bq and
2552 (SystemExec/xsys/bq): Switched the names of xsys/bq and
2550 system/getoutput as defaults. The old ones are kept for
2553 system/getoutput as defaults. The old ones are kept for
2551 compatibility reasons, so no code which uses this library needs
2554 compatibility reasons, so no code which uses this library needs
2552 changing.
2555 changing.
2553
2556
2554 2003-01-27 *** Released version 0.2.14
2557 2003-01-27 *** Released version 0.2.14
2555
2558
2556 2003-01-25 Fernando Perez <fperez@colorado.edu>
2559 2003-01-25 Fernando Perez <fperez@colorado.edu>
2557
2560
2558 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
2561 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
2559 functions defined in previous edit sessions could not be re-edited
2562 functions defined in previous edit sessions could not be re-edited
2560 (because the temp files were immediately removed). Now temp files
2563 (because the temp files were immediately removed). Now temp files
2561 are removed only at IPython's exit.
2564 are removed only at IPython's exit.
2562 (Magic.magic_run): Improved @run to perform shell-like expansions
2565 (Magic.magic_run): Improved @run to perform shell-like expansions
2563 on its arguments (~users and $VARS). With this, @run becomes more
2566 on its arguments (~users and $VARS). With this, @run becomes more
2564 like a normal command-line.
2567 like a normal command-line.
2565
2568
2566 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
2569 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
2567 bugs related to embedding and cleaned up that code. A fairly
2570 bugs related to embedding and cleaned up that code. A fairly
2568 important one was the impossibility to access the global namespace
2571 important one was the impossibility to access the global namespace
2569 through the embedded IPython (only local variables were visible).
2572 through the embedded IPython (only local variables were visible).
2570
2573
2571 2003-01-14 Fernando Perez <fperez@colorado.edu>
2574 2003-01-14 Fernando Perez <fperez@colorado.edu>
2572
2575
2573 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
2576 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
2574 auto-calling to be a bit more conservative. Now it doesn't get
2577 auto-calling to be a bit more conservative. Now it doesn't get
2575 triggered if any of '!=()<>' are in the rest of the input line, to
2578 triggered if any of '!=()<>' are in the rest of the input line, to
2576 allow comparing callables. Thanks to Alex for the heads up.
2579 allow comparing callables. Thanks to Alex for the heads up.
2577
2580
2578 2003-01-07 Fernando Perez <fperez@colorado.edu>
2581 2003-01-07 Fernando Perez <fperez@colorado.edu>
2579
2582
2580 * IPython/genutils.py (page): fixed estimation of the number of
2583 * IPython/genutils.py (page): fixed estimation of the number of
2581 lines in a string to be paged to simply count newlines. This
2584 lines in a string to be paged to simply count newlines. This
2582 prevents over-guessing due to embedded escape sequences. A better
2585 prevents over-guessing due to embedded escape sequences. A better
2583 long-term solution would involve stripping out the control chars
2586 long-term solution would involve stripping out the control chars
2584 for the count, but it's potentially so expensive I just don't
2587 for the count, but it's potentially so expensive I just don't
2585 think it's worth doing.
2588 think it's worth doing.
2586
2589
2587 2002-12-19 *** Released version 0.2.14pre50
2590 2002-12-19 *** Released version 0.2.14pre50
2588
2591
2589 2002-12-19 Fernando Perez <fperez@colorado.edu>
2592 2002-12-19 Fernando Perez <fperez@colorado.edu>
2590
2593
2591 * tools/release (version): Changed release scripts to inform
2594 * tools/release (version): Changed release scripts to inform
2592 Andrea and build a NEWS file with a list of recent changes.
2595 Andrea and build a NEWS file with a list of recent changes.
2593
2596
2594 * IPython/ColorANSI.py (__all__): changed terminal detection
2597 * IPython/ColorANSI.py (__all__): changed terminal detection
2595 code. Seems to work better for xterms without breaking
2598 code. Seems to work better for xterms without breaking
2596 konsole. Will need more testing to determine if WinXP and Mac OSX
2599 konsole. Will need more testing to determine if WinXP and Mac OSX
2597 also work ok.
2600 also work ok.
2598
2601
2599 2002-12-18 *** Released version 0.2.14pre49
2602 2002-12-18 *** Released version 0.2.14pre49
2600
2603
2601 2002-12-18 Fernando Perez <fperez@colorado.edu>
2604 2002-12-18 Fernando Perez <fperez@colorado.edu>
2602
2605
2603 * Docs: added new info about Mac OSX, from Andrea.
2606 * Docs: added new info about Mac OSX, from Andrea.
2604
2607
2605 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
2608 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
2606 allow direct plotting of python strings whose format is the same
2609 allow direct plotting of python strings whose format is the same
2607 of gnuplot data files.
2610 of gnuplot data files.
2608
2611
2609 2002-12-16 Fernando Perez <fperez@colorado.edu>
2612 2002-12-16 Fernando Perez <fperez@colorado.edu>
2610
2613
2611 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
2614 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
2612 value of exit question to be acknowledged.
2615 value of exit question to be acknowledged.
2613
2616
2614 2002-12-03 Fernando Perez <fperez@colorado.edu>
2617 2002-12-03 Fernando Perez <fperez@colorado.edu>
2615
2618
2616 * IPython/ipmaker.py: removed generators, which had been added
2619 * IPython/ipmaker.py: removed generators, which had been added
2617 by mistake in an earlier debugging run. This was causing trouble
2620 by mistake in an earlier debugging run. This was causing trouble
2618 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
2621 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
2619 for pointing this out.
2622 for pointing this out.
2620
2623
2621 2002-11-17 Fernando Perez <fperez@colorado.edu>
2624 2002-11-17 Fernando Perez <fperez@colorado.edu>
2622
2625
2623 * Manual: updated the Gnuplot section.
2626 * Manual: updated the Gnuplot section.
2624
2627
2625 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
2628 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
2626 a much better split of what goes in Runtime and what goes in
2629 a much better split of what goes in Runtime and what goes in
2627 Interactive.
2630 Interactive.
2628
2631
2629 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
2632 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
2630 being imported from iplib.
2633 being imported from iplib.
2631
2634
2632 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
2635 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
2633 for command-passing. Now the global Gnuplot instance is called
2636 for command-passing. Now the global Gnuplot instance is called
2634 'gp' instead of 'g', which was really a far too fragile and
2637 'gp' instead of 'g', which was really a far too fragile and
2635 common name.
2638 common name.
2636
2639
2637 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
2640 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
2638 bounding boxes generated by Gnuplot for square plots.
2641 bounding boxes generated by Gnuplot for square plots.
2639
2642
2640 * IPython/genutils.py (popkey): new function added. I should
2643 * IPython/genutils.py (popkey): new function added. I should
2641 suggest this on c.l.py as a dict method, it seems useful.
2644 suggest this on c.l.py as a dict method, it seems useful.
2642
2645
2643 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
2646 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
2644 to transparently handle PostScript generation. MUCH better than
2647 to transparently handle PostScript generation. MUCH better than
2645 the previous plot_eps/replot_eps (which I removed now). The code
2648 the previous plot_eps/replot_eps (which I removed now). The code
2646 is also fairly clean and well documented now (including
2649 is also fairly clean and well documented now (including
2647 docstrings).
2650 docstrings).
2648
2651
2649 2002-11-13 Fernando Perez <fperez@colorado.edu>
2652 2002-11-13 Fernando Perez <fperez@colorado.edu>
2650
2653
2651 * IPython/Magic.py (Magic.magic_edit): fixed docstring
2654 * IPython/Magic.py (Magic.magic_edit): fixed docstring
2652 (inconsistent with options).
2655 (inconsistent with options).
2653
2656
2654 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
2657 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
2655 manually disabled, I don't know why. Fixed it.
2658 manually disabled, I don't know why. Fixed it.
2656 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
2659 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
2657 eps output.
2660 eps output.
2658
2661
2659 2002-11-12 Fernando Perez <fperez@colorado.edu>
2662 2002-11-12 Fernando Perez <fperez@colorado.edu>
2660
2663
2661 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
2664 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
2662 don't propagate up to caller. Fixes crash reported by François
2665 don't propagate up to caller. Fixes crash reported by François
2663 Pinard.
2666 Pinard.
2664
2667
2665 2002-11-09 Fernando Perez <fperez@colorado.edu>
2668 2002-11-09 Fernando Perez <fperez@colorado.edu>
2666
2669
2667 * IPython/ipmaker.py (make_IPython): fixed problem with writing
2670 * IPython/ipmaker.py (make_IPython): fixed problem with writing
2668 history file for new users.
2671 history file for new users.
2669 (make_IPython): fixed bug where initial install would leave the
2672 (make_IPython): fixed bug where initial install would leave the
2670 user running in the .ipython dir.
2673 user running in the .ipython dir.
2671 (make_IPython): fixed bug where config dir .ipython would be
2674 (make_IPython): fixed bug where config dir .ipython would be
2672 created regardless of the given -ipythondir option. Thanks to Cory
2675 created regardless of the given -ipythondir option. Thanks to Cory
2673 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
2676 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
2674
2677
2675 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
2678 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
2676 type confirmations. Will need to use it in all of IPython's code
2679 type confirmations. Will need to use it in all of IPython's code
2677 consistently.
2680 consistently.
2678
2681
2679 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
2682 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
2680 context to print 31 lines instead of the default 5. This will make
2683 context to print 31 lines instead of the default 5. This will make
2681 the crash reports extremely detailed in case the problem is in
2684 the crash reports extremely detailed in case the problem is in
2682 libraries I don't have access to.
2685 libraries I don't have access to.
2683
2686
2684 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
2687 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
2685 line of defense' code to still crash, but giving users fair
2688 line of defense' code to still crash, but giving users fair
2686 warning. I don't want internal errors to go unreported: if there's
2689 warning. I don't want internal errors to go unreported: if there's
2687 an internal problem, IPython should crash and generate a full
2690 an internal problem, IPython should crash and generate a full
2688 report.
2691 report.
2689
2692
2690 2002-11-08 Fernando Perez <fperez@colorado.edu>
2693 2002-11-08 Fernando Perez <fperez@colorado.edu>
2691
2694
2692 * IPython/iplib.py (InteractiveShell.interact): added code to trap
2695 * IPython/iplib.py (InteractiveShell.interact): added code to trap
2693 otherwise uncaught exceptions which can appear if people set
2696 otherwise uncaught exceptions which can appear if people set
2694 sys.stdout to something badly broken. Thanks to a crash report
2697 sys.stdout to something badly broken. Thanks to a crash report
2695 from henni-AT-mail.brainbot.com.
2698 from henni-AT-mail.brainbot.com.
2696
2699
2697 2002-11-04 Fernando Perez <fperez@colorado.edu>
2700 2002-11-04 Fernando Perez <fperez@colorado.edu>
2698
2701
2699 * IPython/iplib.py (InteractiveShell.interact): added
2702 * IPython/iplib.py (InteractiveShell.interact): added
2700 __IPYTHON__active to the builtins. It's a flag which goes on when
2703 __IPYTHON__active to the builtins. It's a flag which goes on when
2701 the interaction starts and goes off again when it stops. This
2704 the interaction starts and goes off again when it stops. This
2702 allows embedding code to detect being inside IPython. Before this
2705 allows embedding code to detect being inside IPython. Before this
2703 was done via __IPYTHON__, but that only shows that an IPython
2706 was done via __IPYTHON__, but that only shows that an IPython
2704 instance has been created.
2707 instance has been created.
2705
2708
2706 * IPython/Magic.py (Magic.magic_env): I realized that in a
2709 * IPython/Magic.py (Magic.magic_env): I realized that in a
2707 UserDict, instance.data holds the data as a normal dict. So I
2710 UserDict, instance.data holds the data as a normal dict. So I
2708 modified @env to return os.environ.data instead of rebuilding a
2711 modified @env to return os.environ.data instead of rebuilding a
2709 dict by hand.
2712 dict by hand.
2710
2713
2711 2002-11-02 Fernando Perez <fperez@colorado.edu>
2714 2002-11-02 Fernando Perez <fperez@colorado.edu>
2712
2715
2713 * IPython/genutils.py (warn): changed so that level 1 prints no
2716 * IPython/genutils.py (warn): changed so that level 1 prints no
2714 header. Level 2 is now the default (with 'WARNING' header, as
2717 header. Level 2 is now the default (with 'WARNING' header, as
2715 before). I think I tracked all places where changes were needed in
2718 before). I think I tracked all places where changes were needed in
2716 IPython, but outside code using the old level numbering may have
2719 IPython, but outside code using the old level numbering may have
2717 broken.
2720 broken.
2718
2721
2719 * IPython/iplib.py (InteractiveShell.runcode): added this to
2722 * IPython/iplib.py (InteractiveShell.runcode): added this to
2720 handle the tracebacks in SystemExit traps correctly. The previous
2723 handle the tracebacks in SystemExit traps correctly. The previous
2721 code (through interact) was printing more of the stack than
2724 code (through interact) was printing more of the stack than
2722 necessary, showing IPython internal code to the user.
2725 necessary, showing IPython internal code to the user.
2723
2726
2724 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
2727 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
2725 default. Now that the default at the confirmation prompt is yes,
2728 default. Now that the default at the confirmation prompt is yes,
2726 it's not so intrusive. François' argument that ipython sessions
2729 it's not so intrusive. François' argument that ipython sessions
2727 tend to be complex enough not to lose them from an accidental C-d,
2730 tend to be complex enough not to lose them from an accidental C-d,
2728 is a valid one.
2731 is a valid one.
2729
2732
2730 * IPython/iplib.py (InteractiveShell.interact): added a
2733 * IPython/iplib.py (InteractiveShell.interact): added a
2731 showtraceback() call to the SystemExit trap, and modified the exit
2734 showtraceback() call to the SystemExit trap, and modified the exit
2732 confirmation to have yes as the default.
2735 confirmation to have yes as the default.
2733
2736
2734 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
2737 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
2735 this file. It's been gone from the code for a long time, this was
2738 this file. It's been gone from the code for a long time, this was
2736 simply leftover junk.
2739 simply leftover junk.
2737
2740
2738 2002-11-01 Fernando Perez <fperez@colorado.edu>
2741 2002-11-01 Fernando Perez <fperez@colorado.edu>
2739
2742
2740 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
2743 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
2741 added. If set, IPython now traps EOF and asks for
2744 added. If set, IPython now traps EOF and asks for
2742 confirmation. After a request by François Pinard.
2745 confirmation. After a request by François Pinard.
2743
2746
2744 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
2747 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
2745 of @abort, and with a new (better) mechanism for handling the
2748 of @abort, and with a new (better) mechanism for handling the
2746 exceptions.
2749 exceptions.
2747
2750
2748 2002-10-27 Fernando Perez <fperez@colorado.edu>
2751 2002-10-27 Fernando Perez <fperez@colorado.edu>
2749
2752
2750 * IPython/usage.py (__doc__): updated the --help information and
2753 * IPython/usage.py (__doc__): updated the --help information and
2751 the ipythonrc file to indicate that -log generates
2754 the ipythonrc file to indicate that -log generates
2752 ./ipython.log. Also fixed the corresponding info in @logstart.
2755 ./ipython.log. Also fixed the corresponding info in @logstart.
2753 This and several other fixes in the manuals thanks to reports by
2756 This and several other fixes in the manuals thanks to reports by
2754 François Pinard <pinard-AT-iro.umontreal.ca>.
2757 François Pinard <pinard-AT-iro.umontreal.ca>.
2755
2758
2756 * IPython/Logger.py (Logger.switch_log): Fixed error message to
2759 * IPython/Logger.py (Logger.switch_log): Fixed error message to
2757 refer to @logstart (instead of @log, which doesn't exist).
2760 refer to @logstart (instead of @log, which doesn't exist).
2758
2761
2759 * IPython/iplib.py (InteractiveShell._prefilter): fixed
2762 * IPython/iplib.py (InteractiveShell._prefilter): fixed
2760 AttributeError crash. Thanks to Christopher Armstrong
2763 AttributeError crash. Thanks to Christopher Armstrong
2761 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
2764 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
2762 introduced recently (in 0.2.14pre37) with the fix to the eval
2765 introduced recently (in 0.2.14pre37) with the fix to the eval
2763 problem mentioned below.
2766 problem mentioned below.
2764
2767
2765 2002-10-17 Fernando Perez <fperez@colorado.edu>
2768 2002-10-17 Fernando Perez <fperez@colorado.edu>
2766
2769
2767 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
2770 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
2768 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
2771 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
2769
2772
2770 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
2773 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
2771 this function to fix a problem reported by Alex Schmolck. He saw
2774 this function to fix a problem reported by Alex Schmolck. He saw
2772 it with list comprehensions and generators, which were getting
2775 it with list comprehensions and generators, which were getting
2773 called twice. The real problem was an 'eval' call in testing for
2776 called twice. The real problem was an 'eval' call in testing for
2774 automagic which was evaluating the input line silently.
2777 automagic which was evaluating the input line silently.
2775
2778
2776 This is a potentially very nasty bug, if the input has side
2779 This is a potentially very nasty bug, if the input has side
2777 effects which must not be repeated. The code is much cleaner now,
2780 effects which must not be repeated. The code is much cleaner now,
2778 without any blanket 'except' left and with a regexp test for
2781 without any blanket 'except' left and with a regexp test for
2779 actual function names.
2782 actual function names.
2780
2783
2781 But an eval remains, which I'm not fully comfortable with. I just
2784 But an eval remains, which I'm not fully comfortable with. I just
2782 don't know how to find out if an expression could be a callable in
2785 don't know how to find out if an expression could be a callable in
2783 the user's namespace without doing an eval on the string. However
2786 the user's namespace without doing an eval on the string. However
2784 that string is now much more strictly checked so that no code
2787 that string is now much more strictly checked so that no code
2785 slips by, so the eval should only happen for things that can
2788 slips by, so the eval should only happen for things that can
2786 really be only function/method names.
2789 really be only function/method names.
2787
2790
2788 2002-10-15 Fernando Perez <fperez@colorado.edu>
2791 2002-10-15 Fernando Perez <fperez@colorado.edu>
2789
2792
2790 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
2793 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
2791 OSX information to main manual, removed README_Mac_OSX file from
2794 OSX information to main manual, removed README_Mac_OSX file from
2792 distribution. Also updated credits for recent additions.
2795 distribution. Also updated credits for recent additions.
2793
2796
2794 2002-10-10 Fernando Perez <fperez@colorado.edu>
2797 2002-10-10 Fernando Perez <fperez@colorado.edu>
2795
2798
2796 * README_Mac_OSX: Added a README for Mac OSX users for fixing
2799 * README_Mac_OSX: Added a README for Mac OSX users for fixing
2797 terminal-related issues. Many thanks to Andrea Riciputi
2800 terminal-related issues. Many thanks to Andrea Riciputi
2798 <andrea.riciputi-AT-libero.it> for writing it.
2801 <andrea.riciputi-AT-libero.it> for writing it.
2799
2802
2800 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
2803 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
2801 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2804 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2802
2805
2803 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
2806 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
2804 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
2807 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
2805 <syver-en-AT-online.no> who both submitted patches for this problem.
2808 <syver-en-AT-online.no> who both submitted patches for this problem.
2806
2809
2807 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
2810 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
2808 global embedding to make sure that things don't overwrite user
2811 global embedding to make sure that things don't overwrite user
2809 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
2812 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
2810
2813
2811 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
2814 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
2812 compatibility. Thanks to Hayden Callow
2815 compatibility. Thanks to Hayden Callow
2813 <h.callow-AT-elec.canterbury.ac.nz>
2816 <h.callow-AT-elec.canterbury.ac.nz>
2814
2817
2815 2002-10-04 Fernando Perez <fperez@colorado.edu>
2818 2002-10-04 Fernando Perez <fperez@colorado.edu>
2816
2819
2817 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
2820 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
2818 Gnuplot.File objects.
2821 Gnuplot.File objects.
2819
2822
2820 2002-07-23 Fernando Perez <fperez@colorado.edu>
2823 2002-07-23 Fernando Perez <fperez@colorado.edu>
2821
2824
2822 * IPython/genutils.py (timing): Added timings() and timing() for
2825 * IPython/genutils.py (timing): Added timings() and timing() for
2823 quick access to the most commonly needed data, the execution
2826 quick access to the most commonly needed data, the execution
2824 times. Old timing() renamed to timings_out().
2827 times. Old timing() renamed to timings_out().
2825
2828
2826 2002-07-18 Fernando Perez <fperez@colorado.edu>
2829 2002-07-18 Fernando Perez <fperez@colorado.edu>
2827
2830
2828 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
2831 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
2829 bug with nested instances disrupting the parent's tab completion.
2832 bug with nested instances disrupting the parent's tab completion.
2830
2833
2831 * IPython/iplib.py (all_completions): Added Alex Schmolck's
2834 * IPython/iplib.py (all_completions): Added Alex Schmolck's
2832 all_completions code to begin the emacs integration.
2835 all_completions code to begin the emacs integration.
2833
2836
2834 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
2837 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
2835 argument to allow titling individual arrays when plotting.
2838 argument to allow titling individual arrays when plotting.
2836
2839
2837 2002-07-15 Fernando Perez <fperez@colorado.edu>
2840 2002-07-15 Fernando Perez <fperez@colorado.edu>
2838
2841
2839 * setup.py (make_shortcut): changed to retrieve the value of
2842 * setup.py (make_shortcut): changed to retrieve the value of
2840 'Program Files' directory from the registry (this value changes in
2843 'Program Files' directory from the registry (this value changes in
2841 non-english versions of Windows). Thanks to Thomas Fanslau
2844 non-english versions of Windows). Thanks to Thomas Fanslau
2842 <tfanslau-AT-gmx.de> for the report.
2845 <tfanslau-AT-gmx.de> for the report.
2843
2846
2844 2002-07-10 Fernando Perez <fperez@colorado.edu>
2847 2002-07-10 Fernando Perez <fperez@colorado.edu>
2845
2848
2846 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
2849 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
2847 a bug in pdb, which crashes if a line with only whitespace is
2850 a bug in pdb, which crashes if a line with only whitespace is
2848 entered. Bug report submitted to sourceforge.
2851 entered. Bug report submitted to sourceforge.
2849
2852
2850 2002-07-09 Fernando Perez <fperez@colorado.edu>
2853 2002-07-09 Fernando Perez <fperez@colorado.edu>
2851
2854
2852 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
2855 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
2853 reporting exceptions (it's a bug in inspect.py, I just set a
2856 reporting exceptions (it's a bug in inspect.py, I just set a
2854 workaround).
2857 workaround).
2855
2858
2856 2002-07-08 Fernando Perez <fperez@colorado.edu>
2859 2002-07-08 Fernando Perez <fperez@colorado.edu>
2857
2860
2858 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
2861 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
2859 __IPYTHON__ in __builtins__ to show up in user_ns.
2862 __IPYTHON__ in __builtins__ to show up in user_ns.
2860
2863
2861 2002-07-03 Fernando Perez <fperez@colorado.edu>
2864 2002-07-03 Fernando Perez <fperez@colorado.edu>
2862
2865
2863 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
2866 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
2864 name from @gp_set_instance to @gp_set_default.
2867 name from @gp_set_instance to @gp_set_default.
2865
2868
2866 * IPython/ipmaker.py (make_IPython): default editor value set to
2869 * IPython/ipmaker.py (make_IPython): default editor value set to
2867 '0' (a string), to match the rc file. Otherwise will crash when
2870 '0' (a string), to match the rc file. Otherwise will crash when
2868 .strip() is called on it.
2871 .strip() is called on it.
2869
2872
2870
2873
2871 2002-06-28 Fernando Perez <fperez@colorado.edu>
2874 2002-06-28 Fernando Perez <fperez@colorado.edu>
2872
2875
2873 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
2876 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
2874 of files in current directory when a file is executed via
2877 of files in current directory when a file is executed via
2875 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
2878 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
2876
2879
2877 * setup.py (manfiles): fix for rpm builds, submitted by RA
2880 * setup.py (manfiles): fix for rpm builds, submitted by RA
2878 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
2881 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
2879
2882
2880 * IPython/ipmaker.py (make_IPython): fixed lookup of default
2883 * IPython/ipmaker.py (make_IPython): fixed lookup of default
2881 editor when set to '0'. Problem was, '0' evaluates to True (it's a
2884 editor when set to '0'. Problem was, '0' evaluates to True (it's a
2882 string!). A. Schmolck caught this one.
2885 string!). A. Schmolck caught this one.
2883
2886
2884 2002-06-27 Fernando Perez <fperez@colorado.edu>
2887 2002-06-27 Fernando Perez <fperez@colorado.edu>
2885
2888
2886 * IPython/ipmaker.py (make_IPython): fixed bug when running user
2889 * IPython/ipmaker.py (make_IPython): fixed bug when running user
2887 defined files at the cmd line. __name__ wasn't being set to
2890 defined files at the cmd line. __name__ wasn't being set to
2888 __main__.
2891 __main__.
2889
2892
2890 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
2893 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
2891 regular lists and tuples besides Numeric arrays.
2894 regular lists and tuples besides Numeric arrays.
2892
2895
2893 * IPython/Prompts.py (CachedOutput.__call__): Added output
2896 * IPython/Prompts.py (CachedOutput.__call__): Added output
2894 supression for input ending with ';'. Similar to Mathematica and
2897 supression for input ending with ';'. Similar to Mathematica and
2895 Matlab. The _* vars and Out[] list are still updated, just like
2898 Matlab. The _* vars and Out[] list are still updated, just like
2896 Mathematica behaves.
2899 Mathematica behaves.
2897
2900
2898 2002-06-25 Fernando Perez <fperez@colorado.edu>
2901 2002-06-25 Fernando Perez <fperez@colorado.edu>
2899
2902
2900 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
2903 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
2901 .ini extensions for profiels under Windows.
2904 .ini extensions for profiels under Windows.
2902
2905
2903 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
2906 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
2904 string form. Fix contributed by Alexander Schmolck
2907 string form. Fix contributed by Alexander Schmolck
2905 <a.schmolck-AT-gmx.net>
2908 <a.schmolck-AT-gmx.net>
2906
2909
2907 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
2910 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
2908 pre-configured Gnuplot instance.
2911 pre-configured Gnuplot instance.
2909
2912
2910 2002-06-21 Fernando Perez <fperez@colorado.edu>
2913 2002-06-21 Fernando Perez <fperez@colorado.edu>
2911
2914
2912 * IPython/numutils.py (exp_safe): new function, works around the
2915 * IPython/numutils.py (exp_safe): new function, works around the
2913 underflow problems in Numeric.
2916 underflow problems in Numeric.
2914 (log2): New fn. Safe log in base 2: returns exact integer answer
2917 (log2): New fn. Safe log in base 2: returns exact integer answer
2915 for exact integer powers of 2.
2918 for exact integer powers of 2.
2916
2919
2917 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
2920 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
2918 properly.
2921 properly.
2919
2922
2920 2002-06-20 Fernando Perez <fperez@colorado.edu>
2923 2002-06-20 Fernando Perez <fperez@colorado.edu>
2921
2924
2922 * IPython/genutils.py (timing): new function like
2925 * IPython/genutils.py (timing): new function like
2923 Mathematica's. Similar to time_test, but returns more info.
2926 Mathematica's. Similar to time_test, but returns more info.
2924
2927
2925 2002-06-18 Fernando Perez <fperez@colorado.edu>
2928 2002-06-18 Fernando Perez <fperez@colorado.edu>
2926
2929
2927 * IPython/Magic.py (Magic.magic_save): modified @save and @r
2930 * IPython/Magic.py (Magic.magic_save): modified @save and @r
2928 according to Mike Heeter's suggestions.
2931 according to Mike Heeter's suggestions.
2929
2932
2930 2002-06-16 Fernando Perez <fperez@colorado.edu>
2933 2002-06-16 Fernando Perez <fperez@colorado.edu>
2931
2934
2932 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
2935 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
2933 system. GnuplotMagic is gone as a user-directory option. New files
2936 system. GnuplotMagic is gone as a user-directory option. New files
2934 make it easier to use all the gnuplot stuff both from external
2937 make it easier to use all the gnuplot stuff both from external
2935 programs as well as from IPython. Had to rewrite part of
2938 programs as well as from IPython. Had to rewrite part of
2936 hardcopy() b/c of a strange bug: often the ps files simply don't
2939 hardcopy() b/c of a strange bug: often the ps files simply don't
2937 get created, and require a repeat of the command (often several
2940 get created, and require a repeat of the command (often several
2938 times).
2941 times).
2939
2942
2940 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
2943 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
2941 resolve output channel at call time, so that if sys.stderr has
2944 resolve output channel at call time, so that if sys.stderr has
2942 been redirected by user this gets honored.
2945 been redirected by user this gets honored.
2943
2946
2944 2002-06-13 Fernando Perez <fperez@colorado.edu>
2947 2002-06-13 Fernando Perez <fperez@colorado.edu>
2945
2948
2946 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
2949 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
2947 IPShell. Kept a copy with the old names to avoid breaking people's
2950 IPShell. Kept a copy with the old names to avoid breaking people's
2948 embedded code.
2951 embedded code.
2949
2952
2950 * IPython/ipython: simplified it to the bare minimum after
2953 * IPython/ipython: simplified it to the bare minimum after
2951 Holger's suggestions. Added info about how to use it in
2954 Holger's suggestions. Added info about how to use it in
2952 PYTHONSTARTUP.
2955 PYTHONSTARTUP.
2953
2956
2954 * IPython/Shell.py (IPythonShell): changed the options passing
2957 * IPython/Shell.py (IPythonShell): changed the options passing
2955 from a string with funky %s replacements to a straight list. Maybe
2958 from a string with funky %s replacements to a straight list. Maybe
2956 a bit more typing, but it follows sys.argv conventions, so there's
2959 a bit more typing, but it follows sys.argv conventions, so there's
2957 less special-casing to remember.
2960 less special-casing to remember.
2958
2961
2959 2002-06-12 Fernando Perez <fperez@colorado.edu>
2962 2002-06-12 Fernando Perez <fperez@colorado.edu>
2960
2963
2961 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
2964 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
2962 command. Thanks to a suggestion by Mike Heeter.
2965 command. Thanks to a suggestion by Mike Heeter.
2963 (Magic.magic_pfile): added behavior to look at filenames if given
2966 (Magic.magic_pfile): added behavior to look at filenames if given
2964 arg is not a defined object.
2967 arg is not a defined object.
2965 (Magic.magic_save): New @save function to save code snippets. Also
2968 (Magic.magic_save): New @save function to save code snippets. Also
2966 a Mike Heeter idea.
2969 a Mike Heeter idea.
2967
2970
2968 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
2971 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
2969 plot() and replot(). Much more convenient now, especially for
2972 plot() and replot(). Much more convenient now, especially for
2970 interactive use.
2973 interactive use.
2971
2974
2972 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
2975 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
2973 filenames.
2976 filenames.
2974
2977
2975 2002-06-02 Fernando Perez <fperez@colorado.edu>
2978 2002-06-02 Fernando Perez <fperez@colorado.edu>
2976
2979
2977 * IPython/Struct.py (Struct.__init__): modified to admit
2980 * IPython/Struct.py (Struct.__init__): modified to admit
2978 initialization via another struct.
2981 initialization via another struct.
2979
2982
2980 * IPython/genutils.py (SystemExec.__init__): New stateful
2983 * IPython/genutils.py (SystemExec.__init__): New stateful
2981 interface to xsys and bq. Useful for writing system scripts.
2984 interface to xsys and bq. Useful for writing system scripts.
2982
2985
2983 2002-05-30 Fernando Perez <fperez@colorado.edu>
2986 2002-05-30 Fernando Perez <fperez@colorado.edu>
2984
2987
2985 * MANIFEST.in: Changed docfile selection to exclude all the lyx
2988 * MANIFEST.in: Changed docfile selection to exclude all the lyx
2986 documents. This will make the user download smaller (it's getting
2989 documents. This will make the user download smaller (it's getting
2987 too big).
2990 too big).
2988
2991
2989 2002-05-29 Fernando Perez <fperez@colorado.edu>
2992 2002-05-29 Fernando Perez <fperez@colorado.edu>
2990
2993
2991 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
2994 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
2992 fix problems with shelve and pickle. Seems to work, but I don't
2995 fix problems with shelve and pickle. Seems to work, but I don't
2993 know if corner cases break it. Thanks to Mike Heeter
2996 know if corner cases break it. Thanks to Mike Heeter
2994 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
2997 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
2995
2998
2996 2002-05-24 Fernando Perez <fperez@colorado.edu>
2999 2002-05-24 Fernando Perez <fperez@colorado.edu>
2997
3000
2998 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3001 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
2999 macros having broken.
3002 macros having broken.
3000
3003
3001 2002-05-21 Fernando Perez <fperez@colorado.edu>
3004 2002-05-21 Fernando Perez <fperez@colorado.edu>
3002
3005
3003 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3006 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3004 introduced logging bug: all history before logging started was
3007 introduced logging bug: all history before logging started was
3005 being written one character per line! This came from the redesign
3008 being written one character per line! This came from the redesign
3006 of the input history as a special list which slices to strings,
3009 of the input history as a special list which slices to strings,
3007 not to lists.
3010 not to lists.
3008
3011
3009 2002-05-20 Fernando Perez <fperez@colorado.edu>
3012 2002-05-20 Fernando Perez <fperez@colorado.edu>
3010
3013
3011 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3014 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3012 be an attribute of all classes in this module. The design of these
3015 be an attribute of all classes in this module. The design of these
3013 classes needs some serious overhauling.
3016 classes needs some serious overhauling.
3014
3017
3015 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3018 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3016 which was ignoring '_' in option names.
3019 which was ignoring '_' in option names.
3017
3020
3018 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3021 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3019 'Verbose_novars' to 'Context' and made it the new default. It's a
3022 'Verbose_novars' to 'Context' and made it the new default. It's a
3020 bit more readable and also safer than verbose.
3023 bit more readable and also safer than verbose.
3021
3024
3022 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3025 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3023 triple-quoted strings.
3026 triple-quoted strings.
3024
3027
3025 * IPython/OInspect.py (__all__): new module exposing the object
3028 * IPython/OInspect.py (__all__): new module exposing the object
3026 introspection facilities. Now the corresponding magics are dummy
3029 introspection facilities. Now the corresponding magics are dummy
3027 wrappers around this. Having this module will make it much easier
3030 wrappers around this. Having this module will make it much easier
3028 to put these functions into our modified pdb.
3031 to put these functions into our modified pdb.
3029 This new object inspector system uses the new colorizing module,
3032 This new object inspector system uses the new colorizing module,
3030 so source code and other things are nicely syntax highlighted.
3033 so source code and other things are nicely syntax highlighted.
3031
3034
3032 2002-05-18 Fernando Perez <fperez@colorado.edu>
3035 2002-05-18 Fernando Perez <fperez@colorado.edu>
3033
3036
3034 * IPython/ColorANSI.py: Split the coloring tools into a separate
3037 * IPython/ColorANSI.py: Split the coloring tools into a separate
3035 module so I can use them in other code easier (they were part of
3038 module so I can use them in other code easier (they were part of
3036 ultraTB).
3039 ultraTB).
3037
3040
3038 2002-05-17 Fernando Perez <fperez@colorado.edu>
3041 2002-05-17 Fernando Perez <fperez@colorado.edu>
3039
3042
3040 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3043 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3041 fixed it to set the global 'g' also to the called instance, as
3044 fixed it to set the global 'g' also to the called instance, as
3042 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3045 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3043 user's 'g' variables).
3046 user's 'g' variables).
3044
3047
3045 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3048 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3046 global variables (aliases to _ih,_oh) so that users which expect
3049 global variables (aliases to _ih,_oh) so that users which expect
3047 In[5] or Out[7] to work aren't unpleasantly surprised.
3050 In[5] or Out[7] to work aren't unpleasantly surprised.
3048 (InputList.__getslice__): new class to allow executing slices of
3051 (InputList.__getslice__): new class to allow executing slices of
3049 input history directly. Very simple class, complements the use of
3052 input history directly. Very simple class, complements the use of
3050 macros.
3053 macros.
3051
3054
3052 2002-05-16 Fernando Perez <fperez@colorado.edu>
3055 2002-05-16 Fernando Perez <fperez@colorado.edu>
3053
3056
3054 * setup.py (docdirbase): make doc directory be just doc/IPython
3057 * setup.py (docdirbase): make doc directory be just doc/IPython
3055 without version numbers, it will reduce clutter for users.
3058 without version numbers, it will reduce clutter for users.
3056
3059
3057 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3060 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3058 execfile call to prevent possible memory leak. See for details:
3061 execfile call to prevent possible memory leak. See for details:
3059 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3062 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3060
3063
3061 2002-05-15 Fernando Perez <fperez@colorado.edu>
3064 2002-05-15 Fernando Perez <fperez@colorado.edu>
3062
3065
3063 * IPython/Magic.py (Magic.magic_psource): made the object
3066 * IPython/Magic.py (Magic.magic_psource): made the object
3064 introspection names be more standard: pdoc, pdef, pfile and
3067 introspection names be more standard: pdoc, pdef, pfile and
3065 psource. They all print/page their output, and it makes
3068 psource. They all print/page their output, and it makes
3066 remembering them easier. Kept old names for compatibility as
3069 remembering them easier. Kept old names for compatibility as
3067 aliases.
3070 aliases.
3068
3071
3069 2002-05-14 Fernando Perez <fperez@colorado.edu>
3072 2002-05-14 Fernando Perez <fperez@colorado.edu>
3070
3073
3071 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3074 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3072 what the mouse problem was. The trick is to use gnuplot with temp
3075 what the mouse problem was. The trick is to use gnuplot with temp
3073 files and NOT with pipes (for data communication), because having
3076 files and NOT with pipes (for data communication), because having
3074 both pipes and the mouse on is bad news.
3077 both pipes and the mouse on is bad news.
3075
3078
3076 2002-05-13 Fernando Perez <fperez@colorado.edu>
3079 2002-05-13 Fernando Perez <fperez@colorado.edu>
3077
3080
3078 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3081 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3079 bug. Information would be reported about builtins even when
3082 bug. Information would be reported about builtins even when
3080 user-defined functions overrode them.
3083 user-defined functions overrode them.
3081
3084
3082 2002-05-11 Fernando Perez <fperez@colorado.edu>
3085 2002-05-11 Fernando Perez <fperez@colorado.edu>
3083
3086
3084 * IPython/__init__.py (__all__): removed FlexCompleter from
3087 * IPython/__init__.py (__all__): removed FlexCompleter from
3085 __all__ so that things don't fail in platforms without readline.
3088 __all__ so that things don't fail in platforms without readline.
3086
3089
3087 2002-05-10 Fernando Perez <fperez@colorado.edu>
3090 2002-05-10 Fernando Perez <fperez@colorado.edu>
3088
3091
3089 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3092 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3090 it requires Numeric, effectively making Numeric a dependency for
3093 it requires Numeric, effectively making Numeric a dependency for
3091 IPython.
3094 IPython.
3092
3095
3093 * Released 0.2.13
3096 * Released 0.2.13
3094
3097
3095 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3098 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3096 profiler interface. Now all the major options from the profiler
3099 profiler interface. Now all the major options from the profiler
3097 module are directly supported in IPython, both for single
3100 module are directly supported in IPython, both for single
3098 expressions (@prun) and for full programs (@run -p).
3101 expressions (@prun) and for full programs (@run -p).
3099
3102
3100 2002-05-09 Fernando Perez <fperez@colorado.edu>
3103 2002-05-09 Fernando Perez <fperez@colorado.edu>
3101
3104
3102 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3105 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3103 magic properly formatted for screen.
3106 magic properly formatted for screen.
3104
3107
3105 * setup.py (make_shortcut): Changed things to put pdf version in
3108 * setup.py (make_shortcut): Changed things to put pdf version in
3106 doc/ instead of doc/manual (had to change lyxport a bit).
3109 doc/ instead of doc/manual (had to change lyxport a bit).
3107
3110
3108 * IPython/Magic.py (Profile.string_stats): made profile runs go
3111 * IPython/Magic.py (Profile.string_stats): made profile runs go
3109 through pager (they are long and a pager allows searching, saving,
3112 through pager (they are long and a pager allows searching, saving,
3110 etc.)
3113 etc.)
3111
3114
3112 2002-05-08 Fernando Perez <fperez@colorado.edu>
3115 2002-05-08 Fernando Perez <fperez@colorado.edu>
3113
3116
3114 * Released 0.2.12
3117 * Released 0.2.12
3115
3118
3116 2002-05-06 Fernando Perez <fperez@colorado.edu>
3119 2002-05-06 Fernando Perez <fperez@colorado.edu>
3117
3120
3118 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3121 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3119 introduced); 'hist n1 n2' was broken.
3122 introduced); 'hist n1 n2' was broken.
3120 (Magic.magic_pdb): added optional on/off arguments to @pdb
3123 (Magic.magic_pdb): added optional on/off arguments to @pdb
3121 (Magic.magic_run): added option -i to @run, which executes code in
3124 (Magic.magic_run): added option -i to @run, which executes code in
3122 the IPython namespace instead of a clean one. Also added @irun as
3125 the IPython namespace instead of a clean one. Also added @irun as
3123 an alias to @run -i.
3126 an alias to @run -i.
3124
3127
3125 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3128 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3126 fixed (it didn't really do anything, the namespaces were wrong).
3129 fixed (it didn't really do anything, the namespaces were wrong).
3127
3130
3128 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3131 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3129
3132
3130 * IPython/__init__.py (__all__): Fixed package namespace, now
3133 * IPython/__init__.py (__all__): Fixed package namespace, now
3131 'import IPython' does give access to IPython.<all> as
3134 'import IPython' does give access to IPython.<all> as
3132 expected. Also renamed __release__ to Release.
3135 expected. Also renamed __release__ to Release.
3133
3136
3134 * IPython/Debugger.py (__license__): created new Pdb class which
3137 * IPython/Debugger.py (__license__): created new Pdb class which
3135 functions like a drop-in for the normal pdb.Pdb but does NOT
3138 functions like a drop-in for the normal pdb.Pdb but does NOT
3136 import readline by default. This way it doesn't muck up IPython's
3139 import readline by default. This way it doesn't muck up IPython's
3137 readline handling, and now tab-completion finally works in the
3140 readline handling, and now tab-completion finally works in the
3138 debugger -- sort of. It completes things globally visible, but the
3141 debugger -- sort of. It completes things globally visible, but the
3139 completer doesn't track the stack as pdb walks it. That's a bit
3142 completer doesn't track the stack as pdb walks it. That's a bit
3140 tricky, and I'll have to implement it later.
3143 tricky, and I'll have to implement it later.
3141
3144
3142 2002-05-05 Fernando Perez <fperez@colorado.edu>
3145 2002-05-05 Fernando Perez <fperez@colorado.edu>
3143
3146
3144 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3147 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3145 magic docstrings when printed via ? (explicit \'s were being
3148 magic docstrings when printed via ? (explicit \'s were being
3146 printed).
3149 printed).
3147
3150
3148 * IPython/ipmaker.py (make_IPython): fixed namespace
3151 * IPython/ipmaker.py (make_IPython): fixed namespace
3149 identification bug. Now variables loaded via logs or command-line
3152 identification bug. Now variables loaded via logs or command-line
3150 files are recognized in the interactive namespace by @who.
3153 files are recognized in the interactive namespace by @who.
3151
3154
3152 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3155 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3153 log replay system stemming from the string form of Structs.
3156 log replay system stemming from the string form of Structs.
3154
3157
3155 * IPython/Magic.py (Macro.__init__): improved macros to properly
3158 * IPython/Magic.py (Macro.__init__): improved macros to properly
3156 handle magic commands in them.
3159 handle magic commands in them.
3157 (Magic.magic_logstart): usernames are now expanded so 'logstart
3160 (Magic.magic_logstart): usernames are now expanded so 'logstart
3158 ~/mylog' now works.
3161 ~/mylog' now works.
3159
3162
3160 * IPython/iplib.py (complete): fixed bug where paths starting with
3163 * IPython/iplib.py (complete): fixed bug where paths starting with
3161 '/' would be completed as magic names.
3164 '/' would be completed as magic names.
3162
3165
3163 2002-05-04 Fernando Perez <fperez@colorado.edu>
3166 2002-05-04 Fernando Perez <fperez@colorado.edu>
3164
3167
3165 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3168 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3166 allow running full programs under the profiler's control.
3169 allow running full programs under the profiler's control.
3167
3170
3168 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3171 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3169 mode to report exceptions verbosely but without formatting
3172 mode to report exceptions verbosely but without formatting
3170 variables. This addresses the issue of ipython 'freezing' (it's
3173 variables. This addresses the issue of ipython 'freezing' (it's
3171 not frozen, but caught in an expensive formatting loop) when huge
3174 not frozen, but caught in an expensive formatting loop) when huge
3172 variables are in the context of an exception.
3175 variables are in the context of an exception.
3173 (VerboseTB.text): Added '--->' markers at line where exception was
3176 (VerboseTB.text): Added '--->' markers at line where exception was
3174 triggered. Much clearer to read, especially in NoColor modes.
3177 triggered. Much clearer to read, especially in NoColor modes.
3175
3178
3176 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3179 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3177 implemented in reverse when changing to the new parse_options().
3180 implemented in reverse when changing to the new parse_options().
3178
3181
3179 2002-05-03 Fernando Perez <fperez@colorado.edu>
3182 2002-05-03 Fernando Perez <fperez@colorado.edu>
3180
3183
3181 * IPython/Magic.py (Magic.parse_options): new function so that
3184 * IPython/Magic.py (Magic.parse_options): new function so that
3182 magics can parse options easier.
3185 magics can parse options easier.
3183 (Magic.magic_prun): new function similar to profile.run(),
3186 (Magic.magic_prun): new function similar to profile.run(),
3184 suggested by Chris Hart.
3187 suggested by Chris Hart.
3185 (Magic.magic_cd): fixed behavior so that it only changes if
3188 (Magic.magic_cd): fixed behavior so that it only changes if
3186 directory actually is in history.
3189 directory actually is in history.
3187
3190
3188 * IPython/usage.py (__doc__): added information about potential
3191 * IPython/usage.py (__doc__): added information about potential
3189 slowness of Verbose exception mode when there are huge data
3192 slowness of Verbose exception mode when there are huge data
3190 structures to be formatted (thanks to Archie Paulson).
3193 structures to be formatted (thanks to Archie Paulson).
3191
3194
3192 * IPython/ipmaker.py (make_IPython): Changed default logging
3195 * IPython/ipmaker.py (make_IPython): Changed default logging
3193 (when simply called with -log) to use curr_dir/ipython.log in
3196 (when simply called with -log) to use curr_dir/ipython.log in
3194 rotate mode. Fixed crash which was occuring with -log before
3197 rotate mode. Fixed crash which was occuring with -log before
3195 (thanks to Jim Boyle).
3198 (thanks to Jim Boyle).
3196
3199
3197 2002-05-01 Fernando Perez <fperez@colorado.edu>
3200 2002-05-01 Fernando Perez <fperez@colorado.edu>
3198
3201
3199 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3202 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3200 was nasty -- though somewhat of a corner case).
3203 was nasty -- though somewhat of a corner case).
3201
3204
3202 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3205 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3203 text (was a bug).
3206 text (was a bug).
3204
3207
3205 2002-04-30 Fernando Perez <fperez@colorado.edu>
3208 2002-04-30 Fernando Perez <fperez@colorado.edu>
3206
3209
3207 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3210 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3208 a print after ^D or ^C from the user so that the In[] prompt
3211 a print after ^D or ^C from the user so that the In[] prompt
3209 doesn't over-run the gnuplot one.
3212 doesn't over-run the gnuplot one.
3210
3213
3211 2002-04-29 Fernando Perez <fperez@colorado.edu>
3214 2002-04-29 Fernando Perez <fperez@colorado.edu>
3212
3215
3213 * Released 0.2.10
3216 * Released 0.2.10
3214
3217
3215 * IPython/__release__.py (version): get date dynamically.
3218 * IPython/__release__.py (version): get date dynamically.
3216
3219
3217 * Misc. documentation updates thanks to Arnd's comments. Also ran
3220 * Misc. documentation updates thanks to Arnd's comments. Also ran
3218 a full spellcheck on the manual (hadn't been done in a while).
3221 a full spellcheck on the manual (hadn't been done in a while).
3219
3222
3220 2002-04-27 Fernando Perez <fperez@colorado.edu>
3223 2002-04-27 Fernando Perez <fperez@colorado.edu>
3221
3224
3222 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3225 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3223 starting a log in mid-session would reset the input history list.
3226 starting a log in mid-session would reset the input history list.
3224
3227
3225 2002-04-26 Fernando Perez <fperez@colorado.edu>
3228 2002-04-26 Fernando Perez <fperez@colorado.edu>
3226
3229
3227 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
3230 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
3228 all files were being included in an update. Now anything in
3231 all files were being included in an update. Now anything in
3229 UserConfig that matches [A-Za-z]*.py will go (this excludes
3232 UserConfig that matches [A-Za-z]*.py will go (this excludes
3230 __init__.py)
3233 __init__.py)
3231
3234
3232 2002-04-25 Fernando Perez <fperez@colorado.edu>
3235 2002-04-25 Fernando Perez <fperez@colorado.edu>
3233
3236
3234 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
3237 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
3235 to __builtins__ so that any form of embedded or imported code can
3238 to __builtins__ so that any form of embedded or imported code can
3236 test for being inside IPython.
3239 test for being inside IPython.
3237
3240
3238 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
3241 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
3239 changed to GnuplotMagic because it's now an importable module,
3242 changed to GnuplotMagic because it's now an importable module,
3240 this makes the name follow that of the standard Gnuplot module.
3243 this makes the name follow that of the standard Gnuplot module.
3241 GnuplotMagic can now be loaded at any time in mid-session.
3244 GnuplotMagic can now be loaded at any time in mid-session.
3242
3245
3243 2002-04-24 Fernando Perez <fperez@colorado.edu>
3246 2002-04-24 Fernando Perez <fperez@colorado.edu>
3244
3247
3245 * IPython/numutils.py: removed SIUnits. It doesn't properly set
3248 * IPython/numutils.py: removed SIUnits. It doesn't properly set
3246 the globals (IPython has its own namespace) and the
3249 the globals (IPython has its own namespace) and the
3247 PhysicalQuantity stuff is much better anyway.
3250 PhysicalQuantity stuff is much better anyway.
3248
3251
3249 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
3252 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
3250 embedding example to standard user directory for
3253 embedding example to standard user directory for
3251 distribution. Also put it in the manual.
3254 distribution. Also put it in the manual.
3252
3255
3253 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
3256 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
3254 instance as first argument (so it doesn't rely on some obscure
3257 instance as first argument (so it doesn't rely on some obscure
3255 hidden global).
3258 hidden global).
3256
3259
3257 * IPython/UserConfig/ipythonrc.py: put () back in accepted
3260 * IPython/UserConfig/ipythonrc.py: put () back in accepted
3258 delimiters. While it prevents ().TAB from working, it allows
3261 delimiters. While it prevents ().TAB from working, it allows
3259 completions in open (... expressions. This is by far a more common
3262 completions in open (... expressions. This is by far a more common
3260 case.
3263 case.
3261
3264
3262 2002-04-23 Fernando Perez <fperez@colorado.edu>
3265 2002-04-23 Fernando Perez <fperez@colorado.edu>
3263
3266
3264 * IPython/Extensions/InterpreterPasteInput.py: new
3267 * IPython/Extensions/InterpreterPasteInput.py: new
3265 syntax-processing module for pasting lines with >>> or ... at the
3268 syntax-processing module for pasting lines with >>> or ... at the
3266 start.
3269 start.
3267
3270
3268 * IPython/Extensions/PhysicalQ_Interactive.py
3271 * IPython/Extensions/PhysicalQ_Interactive.py
3269 (PhysicalQuantityInteractive.__int__): fixed to work with either
3272 (PhysicalQuantityInteractive.__int__): fixed to work with either
3270 Numeric or math.
3273 Numeric or math.
3271
3274
3272 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
3275 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
3273 provided profiles. Now we have:
3276 provided profiles. Now we have:
3274 -math -> math module as * and cmath with its own namespace.
3277 -math -> math module as * and cmath with its own namespace.
3275 -numeric -> Numeric as *, plus gnuplot & grace
3278 -numeric -> Numeric as *, plus gnuplot & grace
3276 -physics -> same as before
3279 -physics -> same as before
3277
3280
3278 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
3281 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
3279 user-defined magics wouldn't be found by @magic if they were
3282 user-defined magics wouldn't be found by @magic if they were
3280 defined as class methods. Also cleaned up the namespace search
3283 defined as class methods. Also cleaned up the namespace search
3281 logic and the string building (to use %s instead of many repeated
3284 logic and the string building (to use %s instead of many repeated
3282 string adds).
3285 string adds).
3283
3286
3284 * IPython/UserConfig/example-magic.py (magic_foo): updated example
3287 * IPython/UserConfig/example-magic.py (magic_foo): updated example
3285 of user-defined magics to operate with class methods (cleaner, in
3288 of user-defined magics to operate with class methods (cleaner, in
3286 line with the gnuplot code).
3289 line with the gnuplot code).
3287
3290
3288 2002-04-22 Fernando Perez <fperez@colorado.edu>
3291 2002-04-22 Fernando Perez <fperez@colorado.edu>
3289
3292
3290 * setup.py: updated dependency list so that manual is updated when
3293 * setup.py: updated dependency list so that manual is updated when
3291 all included files change.
3294 all included files change.
3292
3295
3293 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
3296 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
3294 the delimiter removal option (the fix is ugly right now).
3297 the delimiter removal option (the fix is ugly right now).
3295
3298
3296 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
3299 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
3297 all of the math profile (quicker loading, no conflict between
3300 all of the math profile (quicker loading, no conflict between
3298 g-9.8 and g-gnuplot).
3301 g-9.8 and g-gnuplot).
3299
3302
3300 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
3303 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
3301 name of post-mortem files to IPython_crash_report.txt.
3304 name of post-mortem files to IPython_crash_report.txt.
3302
3305
3303 * Cleanup/update of the docs. Added all the new readline info and
3306 * Cleanup/update of the docs. Added all the new readline info and
3304 formatted all lists as 'real lists'.
3307 formatted all lists as 'real lists'.
3305
3308
3306 * IPython/ipmaker.py (make_IPython): removed now-obsolete
3309 * IPython/ipmaker.py (make_IPython): removed now-obsolete
3307 tab-completion options, since the full readline parse_and_bind is
3310 tab-completion options, since the full readline parse_and_bind is
3308 now accessible.
3311 now accessible.
3309
3312
3310 * IPython/iplib.py (InteractiveShell.init_readline): Changed
3313 * IPython/iplib.py (InteractiveShell.init_readline): Changed
3311 handling of readline options. Now users can specify any string to
3314 handling of readline options. Now users can specify any string to
3312 be passed to parse_and_bind(), as well as the delimiters to be
3315 be passed to parse_and_bind(), as well as the delimiters to be
3313 removed.
3316 removed.
3314 (InteractiveShell.__init__): Added __name__ to the global
3317 (InteractiveShell.__init__): Added __name__ to the global
3315 namespace so that things like Itpl which rely on its existence
3318 namespace so that things like Itpl which rely on its existence
3316 don't crash.
3319 don't crash.
3317 (InteractiveShell._prefilter): Defined the default with a _ so
3320 (InteractiveShell._prefilter): Defined the default with a _ so
3318 that prefilter() is easier to override, while the default one
3321 that prefilter() is easier to override, while the default one
3319 remains available.
3322 remains available.
3320
3323
3321 2002-04-18 Fernando Perez <fperez@colorado.edu>
3324 2002-04-18 Fernando Perez <fperez@colorado.edu>
3322
3325
3323 * Added information about pdb in the docs.
3326 * Added information about pdb in the docs.
3324
3327
3325 2002-04-17 Fernando Perez <fperez@colorado.edu>
3328 2002-04-17 Fernando Perez <fperez@colorado.edu>
3326
3329
3327 * IPython/ipmaker.py (make_IPython): added rc_override option to
3330 * IPython/ipmaker.py (make_IPython): added rc_override option to
3328 allow passing config options at creation time which may override
3331 allow passing config options at creation time which may override
3329 anything set in the config files or command line. This is
3332 anything set in the config files or command line. This is
3330 particularly useful for configuring embedded instances.
3333 particularly useful for configuring embedded instances.
3331
3334
3332 2002-04-15 Fernando Perez <fperez@colorado.edu>
3335 2002-04-15 Fernando Perez <fperez@colorado.edu>
3333
3336
3334 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
3337 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
3335 crash embedded instances because of the input cache falling out of
3338 crash embedded instances because of the input cache falling out of
3336 sync with the output counter.
3339 sync with the output counter.
3337
3340
3338 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
3341 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
3339 mode which calls pdb after an uncaught exception in IPython itself.
3342 mode which calls pdb after an uncaught exception in IPython itself.
3340
3343
3341 2002-04-14 Fernando Perez <fperez@colorado.edu>
3344 2002-04-14 Fernando Perez <fperez@colorado.edu>
3342
3345
3343 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
3346 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
3344 readline, fix it back after each call.
3347 readline, fix it back after each call.
3345
3348
3346 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
3349 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
3347 method to force all access via __call__(), which guarantees that
3350 method to force all access via __call__(), which guarantees that
3348 traceback references are properly deleted.
3351 traceback references are properly deleted.
3349
3352
3350 * IPython/Prompts.py (CachedOutput._display): minor fixes to
3353 * IPython/Prompts.py (CachedOutput._display): minor fixes to
3351 improve printing when pprint is in use.
3354 improve printing when pprint is in use.
3352
3355
3353 2002-04-13 Fernando Perez <fperez@colorado.edu>
3356 2002-04-13 Fernando Perez <fperez@colorado.edu>
3354
3357
3355 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
3358 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
3356 exceptions aren't caught anymore. If the user triggers one, he
3359 exceptions aren't caught anymore. If the user triggers one, he
3357 should know why he's doing it and it should go all the way up,
3360 should know why he's doing it and it should go all the way up,
3358 just like any other exception. So now @abort will fully kill the
3361 just like any other exception. So now @abort will fully kill the
3359 embedded interpreter and the embedding code (unless that happens
3362 embedded interpreter and the embedding code (unless that happens
3360 to catch SystemExit).
3363 to catch SystemExit).
3361
3364
3362 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
3365 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
3363 and a debugger() method to invoke the interactive pdb debugger
3366 and a debugger() method to invoke the interactive pdb debugger
3364 after printing exception information. Also added the corresponding
3367 after printing exception information. Also added the corresponding
3365 -pdb option and @pdb magic to control this feature, and updated
3368 -pdb option and @pdb magic to control this feature, and updated
3366 the docs. After a suggestion from Christopher Hart
3369 the docs. After a suggestion from Christopher Hart
3367 (hart-AT-caltech.edu).
3370 (hart-AT-caltech.edu).
3368
3371
3369 2002-04-12 Fernando Perez <fperez@colorado.edu>
3372 2002-04-12 Fernando Perez <fperez@colorado.edu>
3370
3373
3371 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
3374 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
3372 the exception handlers defined by the user (not the CrashHandler)
3375 the exception handlers defined by the user (not the CrashHandler)
3373 so that user exceptions don't trigger an ipython bug report.
3376 so that user exceptions don't trigger an ipython bug report.
3374
3377
3375 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
3378 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
3376 configurable (it should have always been so).
3379 configurable (it should have always been so).
3377
3380
3378 2002-03-26 Fernando Perez <fperez@colorado.edu>
3381 2002-03-26 Fernando Perez <fperez@colorado.edu>
3379
3382
3380 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
3383 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
3381 and there to fix embedding namespace issues. This should all be
3384 and there to fix embedding namespace issues. This should all be
3382 done in a more elegant way.
3385 done in a more elegant way.
3383
3386
3384 2002-03-25 Fernando Perez <fperez@colorado.edu>
3387 2002-03-25 Fernando Perez <fperez@colorado.edu>
3385
3388
3386 * IPython/genutils.py (get_home_dir): Try to make it work under
3389 * IPython/genutils.py (get_home_dir): Try to make it work under
3387 win9x also.
3390 win9x also.
3388
3391
3389 2002-03-20 Fernando Perez <fperez@colorado.edu>
3392 2002-03-20 Fernando Perez <fperez@colorado.edu>
3390
3393
3391 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
3394 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
3392 sys.displayhook untouched upon __init__.
3395 sys.displayhook untouched upon __init__.
3393
3396
3394 2002-03-19 Fernando Perez <fperez@colorado.edu>
3397 2002-03-19 Fernando Perez <fperez@colorado.edu>
3395
3398
3396 * Released 0.2.9 (for embedding bug, basically).
3399 * Released 0.2.9 (for embedding bug, basically).
3397
3400
3398 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
3401 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
3399 exceptions so that enclosing shell's state can be restored.
3402 exceptions so that enclosing shell's state can be restored.
3400
3403
3401 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
3404 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
3402 naming conventions in the .ipython/ dir.
3405 naming conventions in the .ipython/ dir.
3403
3406
3404 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
3407 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
3405 from delimiters list so filenames with - in them get expanded.
3408 from delimiters list so filenames with - in them get expanded.
3406
3409
3407 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
3410 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
3408 sys.displayhook not being properly restored after an embedded call.
3411 sys.displayhook not being properly restored after an embedded call.
3409
3412
3410 2002-03-18 Fernando Perez <fperez@colorado.edu>
3413 2002-03-18 Fernando Perez <fperez@colorado.edu>
3411
3414
3412 * Released 0.2.8
3415 * Released 0.2.8
3413
3416
3414 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
3417 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
3415 some files weren't being included in a -upgrade.
3418 some files weren't being included in a -upgrade.
3416 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
3419 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
3417 on' so that the first tab completes.
3420 on' so that the first tab completes.
3418 (InteractiveShell.handle_magic): fixed bug with spaces around
3421 (InteractiveShell.handle_magic): fixed bug with spaces around
3419 quotes breaking many magic commands.
3422 quotes breaking many magic commands.
3420
3423
3421 * setup.py: added note about ignoring the syntax error messages at
3424 * setup.py: added note about ignoring the syntax error messages at
3422 installation.
3425 installation.
3423
3426
3424 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
3427 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
3425 streamlining the gnuplot interface, now there's only one magic @gp.
3428 streamlining the gnuplot interface, now there's only one magic @gp.
3426
3429
3427 2002-03-17 Fernando Perez <fperez@colorado.edu>
3430 2002-03-17 Fernando Perez <fperez@colorado.edu>
3428
3431
3429 * IPython/UserConfig/magic_gnuplot.py: new name for the
3432 * IPython/UserConfig/magic_gnuplot.py: new name for the
3430 example-magic_pm.py file. Much enhanced system, now with a shell
3433 example-magic_pm.py file. Much enhanced system, now with a shell
3431 for communicating directly with gnuplot, one command at a time.
3434 for communicating directly with gnuplot, one command at a time.
3432
3435
3433 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
3436 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
3434 setting __name__=='__main__'.
3437 setting __name__=='__main__'.
3435
3438
3436 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
3439 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
3437 mini-shell for accessing gnuplot from inside ipython. Should
3440 mini-shell for accessing gnuplot from inside ipython. Should
3438 extend it later for grace access too. Inspired by Arnd's
3441 extend it later for grace access too. Inspired by Arnd's
3439 suggestion.
3442 suggestion.
3440
3443
3441 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
3444 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
3442 calling magic functions with () in their arguments. Thanks to Arnd
3445 calling magic functions with () in their arguments. Thanks to Arnd
3443 Baecker for pointing this to me.
3446 Baecker for pointing this to me.
3444
3447
3445 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
3448 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
3446 infinitely for integer or complex arrays (only worked with floats).
3449 infinitely for integer or complex arrays (only worked with floats).
3447
3450
3448 2002-03-16 Fernando Perez <fperez@colorado.edu>
3451 2002-03-16 Fernando Perez <fperez@colorado.edu>
3449
3452
3450 * setup.py: Merged setup and setup_windows into a single script
3453 * setup.py: Merged setup and setup_windows into a single script
3451 which properly handles things for windows users.
3454 which properly handles things for windows users.
3452
3455
3453 2002-03-15 Fernando Perez <fperez@colorado.edu>
3456 2002-03-15 Fernando Perez <fperez@colorado.edu>
3454
3457
3455 * Big change to the manual: now the magics are all automatically
3458 * Big change to the manual: now the magics are all automatically
3456 documented. This information is generated from their docstrings
3459 documented. This information is generated from their docstrings
3457 and put in a latex file included by the manual lyx file. This way
3460 and put in a latex file included by the manual lyx file. This way
3458 we get always up to date information for the magics. The manual
3461 we get always up to date information for the magics. The manual
3459 now also has proper version information, also auto-synced.
3462 now also has proper version information, also auto-synced.
3460
3463
3461 For this to work, an undocumented --magic_docstrings option was added.
3464 For this to work, an undocumented --magic_docstrings option was added.
3462
3465
3463 2002-03-13 Fernando Perez <fperez@colorado.edu>
3466 2002-03-13 Fernando Perez <fperez@colorado.edu>
3464
3467
3465 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
3468 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
3466 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
3469 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
3467
3470
3468 2002-03-12 Fernando Perez <fperez@colorado.edu>
3471 2002-03-12 Fernando Perez <fperez@colorado.edu>
3469
3472
3470 * IPython/ultraTB.py (TermColors): changed color escapes again to
3473 * IPython/ultraTB.py (TermColors): changed color escapes again to
3471 fix the (old, reintroduced) line-wrapping bug. Basically, if
3474 fix the (old, reintroduced) line-wrapping bug. Basically, if
3472 \001..\002 aren't given in the color escapes, lines get wrapped
3475 \001..\002 aren't given in the color escapes, lines get wrapped
3473 weirdly. But giving those screws up old xterms and emacs terms. So
3476 weirdly. But giving those screws up old xterms and emacs terms. So
3474 I added some logic for emacs terms to be ok, but I can't identify old
3477 I added some logic for emacs terms to be ok, but I can't identify old
3475 xterms separately ($TERM=='xterm' for many terminals, like konsole).
3478 xterms separately ($TERM=='xterm' for many terminals, like konsole).
3476
3479
3477 2002-03-10 Fernando Perez <fperez@colorado.edu>
3480 2002-03-10 Fernando Perez <fperez@colorado.edu>
3478
3481
3479 * IPython/usage.py (__doc__): Various documentation cleanups and
3482 * IPython/usage.py (__doc__): Various documentation cleanups and
3480 updates, both in usage docstrings and in the manual.
3483 updates, both in usage docstrings and in the manual.
3481
3484
3482 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
3485 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
3483 handling of caching. Set minimum acceptabe value for having a
3486 handling of caching. Set minimum acceptabe value for having a
3484 cache at 20 values.
3487 cache at 20 values.
3485
3488
3486 * IPython/iplib.py (InteractiveShell.user_setup): moved the
3489 * IPython/iplib.py (InteractiveShell.user_setup): moved the
3487 install_first_time function to a method, renamed it and added an
3490 install_first_time function to a method, renamed it and added an
3488 'upgrade' mode. Now people can update their config directory with
3491 'upgrade' mode. Now people can update their config directory with
3489 a simple command line switch (-upgrade, also new).
3492 a simple command line switch (-upgrade, also new).
3490
3493
3491 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
3494 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
3492 @file (convenient for automagic users under Python >= 2.2).
3495 @file (convenient for automagic users under Python >= 2.2).
3493 Removed @files (it seemed more like a plural than an abbrev. of
3496 Removed @files (it seemed more like a plural than an abbrev. of
3494 'file show').
3497 'file show').
3495
3498
3496 * IPython/iplib.py (install_first_time): Fixed crash if there were
3499 * IPython/iplib.py (install_first_time): Fixed crash if there were
3497 backup files ('~') in .ipython/ install directory.
3500 backup files ('~') in .ipython/ install directory.
3498
3501
3499 * IPython/ipmaker.py (make_IPython): fixes for new prompt
3502 * IPython/ipmaker.py (make_IPython): fixes for new prompt
3500 system. Things look fine, but these changes are fairly
3503 system. Things look fine, but these changes are fairly
3501 intrusive. Test them for a few days.
3504 intrusive. Test them for a few days.
3502
3505
3503 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
3506 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
3504 the prompts system. Now all in/out prompt strings are user
3507 the prompts system. Now all in/out prompt strings are user
3505 controllable. This is particularly useful for embedding, as one
3508 controllable. This is particularly useful for embedding, as one
3506 can tag embedded instances with particular prompts.
3509 can tag embedded instances with particular prompts.
3507
3510
3508 Also removed global use of sys.ps1/2, which now allows nested
3511 Also removed global use of sys.ps1/2, which now allows nested
3509 embeddings without any problems. Added command-line options for
3512 embeddings without any problems. Added command-line options for
3510 the prompt strings.
3513 the prompt strings.
3511
3514
3512 2002-03-08 Fernando Perez <fperez@colorado.edu>
3515 2002-03-08 Fernando Perez <fperez@colorado.edu>
3513
3516
3514 * IPython/UserConfig/example-embed-short.py (ipshell): added
3517 * IPython/UserConfig/example-embed-short.py (ipshell): added
3515 example file with the bare minimum code for embedding.
3518 example file with the bare minimum code for embedding.
3516
3519
3517 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
3520 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
3518 functionality for the embeddable shell to be activated/deactivated
3521 functionality for the embeddable shell to be activated/deactivated
3519 either globally or at each call.
3522 either globally or at each call.
3520
3523
3521 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
3524 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
3522 rewriting the prompt with '--->' for auto-inputs with proper
3525 rewriting the prompt with '--->' for auto-inputs with proper
3523 coloring. Now the previous UGLY hack in handle_auto() is gone, and
3526 coloring. Now the previous UGLY hack in handle_auto() is gone, and
3524 this is handled by the prompts class itself, as it should.
3527 this is handled by the prompts class itself, as it should.
3525
3528
3526 2002-03-05 Fernando Perez <fperez@colorado.edu>
3529 2002-03-05 Fernando Perez <fperez@colorado.edu>
3527
3530
3528 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
3531 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
3529 @logstart to avoid name clashes with the math log function.
3532 @logstart to avoid name clashes with the math log function.
3530
3533
3531 * Big updates to X/Emacs section of the manual.
3534 * Big updates to X/Emacs section of the manual.
3532
3535
3533 * Removed ipython_emacs. Milan explained to me how to pass
3536 * Removed ipython_emacs. Milan explained to me how to pass
3534 arguments to ipython through Emacs. Some day I'm going to end up
3537 arguments to ipython through Emacs. Some day I'm going to end up
3535 learning some lisp...
3538 learning some lisp...
3536
3539
3537 2002-03-04 Fernando Perez <fperez@colorado.edu>
3540 2002-03-04 Fernando Perez <fperez@colorado.edu>
3538
3541
3539 * IPython/ipython_emacs: Created script to be used as the
3542 * IPython/ipython_emacs: Created script to be used as the
3540 py-python-command Emacs variable so we can pass IPython
3543 py-python-command Emacs variable so we can pass IPython
3541 parameters. I can't figure out how to tell Emacs directly to pass
3544 parameters. I can't figure out how to tell Emacs directly to pass
3542 parameters to IPython, so a dummy shell script will do it.
3545 parameters to IPython, so a dummy shell script will do it.
3543
3546
3544 Other enhancements made for things to work better under Emacs'
3547 Other enhancements made for things to work better under Emacs'
3545 various types of terminals. Many thanks to Milan Zamazal
3548 various types of terminals. Many thanks to Milan Zamazal
3546 <pdm-AT-zamazal.org> for all the suggestions and pointers.
3549 <pdm-AT-zamazal.org> for all the suggestions and pointers.
3547
3550
3548 2002-03-01 Fernando Perez <fperez@colorado.edu>
3551 2002-03-01 Fernando Perez <fperez@colorado.edu>
3549
3552
3550 * IPython/ipmaker.py (make_IPython): added a --readline! option so
3553 * IPython/ipmaker.py (make_IPython): added a --readline! option so
3551 that loading of readline is now optional. This gives better
3554 that loading of readline is now optional. This gives better
3552 control to emacs users.
3555 control to emacs users.
3553
3556
3554 * IPython/ultraTB.py (__date__): Modified color escape sequences
3557 * IPython/ultraTB.py (__date__): Modified color escape sequences
3555 and now things work fine under xterm and in Emacs' term buffers
3558 and now things work fine under xterm and in Emacs' term buffers
3556 (though not shell ones). Well, in emacs you get colors, but all
3559 (though not shell ones). Well, in emacs you get colors, but all
3557 seem to be 'light' colors (no difference between dark and light
3560 seem to be 'light' colors (no difference between dark and light
3558 ones). But the garbage chars are gone, and also in xterms. It
3561 ones). But the garbage chars are gone, and also in xterms. It
3559 seems that now I'm using 'cleaner' ansi sequences.
3562 seems that now I'm using 'cleaner' ansi sequences.
3560
3563
3561 2002-02-21 Fernando Perez <fperez@colorado.edu>
3564 2002-02-21 Fernando Perez <fperez@colorado.edu>
3562
3565
3563 * Released 0.2.7 (mainly to publish the scoping fix).
3566 * Released 0.2.7 (mainly to publish the scoping fix).
3564
3567
3565 * IPython/Logger.py (Logger.logstate): added. A corresponding
3568 * IPython/Logger.py (Logger.logstate): added. A corresponding
3566 @logstate magic was created.
3569 @logstate magic was created.
3567
3570
3568 * IPython/Magic.py: fixed nested scoping problem under Python
3571 * IPython/Magic.py: fixed nested scoping problem under Python
3569 2.1.x (automagic wasn't working).
3572 2.1.x (automagic wasn't working).
3570
3573
3571 2002-02-20 Fernando Perez <fperez@colorado.edu>
3574 2002-02-20 Fernando Perez <fperez@colorado.edu>
3572
3575
3573 * Released 0.2.6.
3576 * Released 0.2.6.
3574
3577
3575 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
3578 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
3576 option so that logs can come out without any headers at all.
3579 option so that logs can come out without any headers at all.
3577
3580
3578 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
3581 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
3579 SciPy.
3582 SciPy.
3580
3583
3581 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
3584 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
3582 that embedded IPython calls don't require vars() to be explicitly
3585 that embedded IPython calls don't require vars() to be explicitly
3583 passed. Now they are extracted from the caller's frame (code
3586 passed. Now they are extracted from the caller's frame (code
3584 snatched from Eric Jones' weave). Added better documentation to
3587 snatched from Eric Jones' weave). Added better documentation to
3585 the section on embedding and the example file.
3588 the section on embedding and the example file.
3586
3589
3587 * IPython/genutils.py (page): Changed so that under emacs, it just
3590 * IPython/genutils.py (page): Changed so that under emacs, it just
3588 prints the string. You can then page up and down in the emacs
3591 prints the string. You can then page up and down in the emacs
3589 buffer itself. This is how the builtin help() works.
3592 buffer itself. This is how the builtin help() works.
3590
3593
3591 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
3594 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
3592 macro scoping: macros need to be executed in the user's namespace
3595 macro scoping: macros need to be executed in the user's namespace
3593 to work as if they had been typed by the user.
3596 to work as if they had been typed by the user.
3594
3597
3595 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
3598 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
3596 execute automatically (no need to type 'exec...'). They then
3599 execute automatically (no need to type 'exec...'). They then
3597 behave like 'true macros'. The printing system was also modified
3600 behave like 'true macros'. The printing system was also modified
3598 for this to work.
3601 for this to work.
3599
3602
3600 2002-02-19 Fernando Perez <fperez@colorado.edu>
3603 2002-02-19 Fernando Perez <fperez@colorado.edu>
3601
3604
3602 * IPython/genutils.py (page_file): new function for paging files
3605 * IPython/genutils.py (page_file): new function for paging files
3603 in an OS-independent way. Also necessary for file viewing to work
3606 in an OS-independent way. Also necessary for file viewing to work
3604 well inside Emacs buffers.
3607 well inside Emacs buffers.
3605 (page): Added checks for being in an emacs buffer.
3608 (page): Added checks for being in an emacs buffer.
3606 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
3609 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
3607 same bug in iplib.
3610 same bug in iplib.
3608
3611
3609 2002-02-18 Fernando Perez <fperez@colorado.edu>
3612 2002-02-18 Fernando Perez <fperez@colorado.edu>
3610
3613
3611 * IPython/iplib.py (InteractiveShell.init_readline): modified use
3614 * IPython/iplib.py (InteractiveShell.init_readline): modified use
3612 of readline so that IPython can work inside an Emacs buffer.
3615 of readline so that IPython can work inside an Emacs buffer.
3613
3616
3614 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
3617 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
3615 method signatures (they weren't really bugs, but it looks cleaner
3618 method signatures (they weren't really bugs, but it looks cleaner
3616 and keeps PyChecker happy).
3619 and keeps PyChecker happy).
3617
3620
3618 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
3621 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
3619 for implementing various user-defined hooks. Currently only
3622 for implementing various user-defined hooks. Currently only
3620 display is done.
3623 display is done.
3621
3624
3622 * IPython/Prompts.py (CachedOutput._display): changed display
3625 * IPython/Prompts.py (CachedOutput._display): changed display
3623 functions so that they can be dynamically changed by users easily.
3626 functions so that they can be dynamically changed by users easily.
3624
3627
3625 * IPython/Extensions/numeric_formats.py (num_display): added an
3628 * IPython/Extensions/numeric_formats.py (num_display): added an
3626 extension for printing NumPy arrays in flexible manners. It
3629 extension for printing NumPy arrays in flexible manners. It
3627 doesn't do anything yet, but all the structure is in
3630 doesn't do anything yet, but all the structure is in
3628 place. Ultimately the plan is to implement output format control
3631 place. Ultimately the plan is to implement output format control
3629 like in Octave.
3632 like in Octave.
3630
3633
3631 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
3634 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
3632 methods are found at run-time by all the automatic machinery.
3635 methods are found at run-time by all the automatic machinery.
3633
3636
3634 2002-02-17 Fernando Perez <fperez@colorado.edu>
3637 2002-02-17 Fernando Perez <fperez@colorado.edu>
3635
3638
3636 * setup_Windows.py (make_shortcut): documented. Cleaned up the
3639 * setup_Windows.py (make_shortcut): documented. Cleaned up the
3637 whole file a little.
3640 whole file a little.
3638
3641
3639 * ToDo: closed this document. Now there's a new_design.lyx
3642 * ToDo: closed this document. Now there's a new_design.lyx
3640 document for all new ideas. Added making a pdf of it for the
3643 document for all new ideas. Added making a pdf of it for the
3641 end-user distro.
3644 end-user distro.
3642
3645
3643 * IPython/Logger.py (Logger.switch_log): Created this to replace
3646 * IPython/Logger.py (Logger.switch_log): Created this to replace
3644 logon() and logoff(). It also fixes a nasty crash reported by
3647 logon() and logoff(). It also fixes a nasty crash reported by
3645 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
3648 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
3646
3649
3647 * IPython/iplib.py (complete): got auto-completion to work with
3650 * IPython/iplib.py (complete): got auto-completion to work with
3648 automagic (I had wanted this for a long time).
3651 automagic (I had wanted this for a long time).
3649
3652
3650 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
3653 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
3651 to @file, since file() is now a builtin and clashes with automagic
3654 to @file, since file() is now a builtin and clashes with automagic
3652 for @file.
3655 for @file.
3653
3656
3654 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
3657 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
3655 of this was previously in iplib, which had grown to more than 2000
3658 of this was previously in iplib, which had grown to more than 2000
3656 lines, way too long. No new functionality, but it makes managing
3659 lines, way too long. No new functionality, but it makes managing
3657 the code a bit easier.
3660 the code a bit easier.
3658
3661
3659 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
3662 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
3660 information to crash reports.
3663 information to crash reports.
3661
3664
3662 2002-02-12 Fernando Perez <fperez@colorado.edu>
3665 2002-02-12 Fernando Perez <fperez@colorado.edu>
3663
3666
3664 * Released 0.2.5.
3667 * Released 0.2.5.
3665
3668
3666 2002-02-11 Fernando Perez <fperez@colorado.edu>
3669 2002-02-11 Fernando Perez <fperez@colorado.edu>
3667
3670
3668 * Wrote a relatively complete Windows installer. It puts
3671 * Wrote a relatively complete Windows installer. It puts
3669 everything in place, creates Start Menu entries and fixes the
3672 everything in place, creates Start Menu entries and fixes the
3670 color issues. Nothing fancy, but it works.
3673 color issues. Nothing fancy, but it works.
3671
3674
3672 2002-02-10 Fernando Perez <fperez@colorado.edu>
3675 2002-02-10 Fernando Perez <fperez@colorado.edu>
3673
3676
3674 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
3677 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
3675 os.path.expanduser() call so that we can type @run ~/myfile.py and
3678 os.path.expanduser() call so that we can type @run ~/myfile.py and
3676 have thigs work as expected.
3679 have thigs work as expected.
3677
3680
3678 * IPython/genutils.py (page): fixed exception handling so things
3681 * IPython/genutils.py (page): fixed exception handling so things
3679 work both in Unix and Windows correctly. Quitting a pager triggers
3682 work both in Unix and Windows correctly. Quitting a pager triggers
3680 an IOError/broken pipe in Unix, and in windows not finding a pager
3683 an IOError/broken pipe in Unix, and in windows not finding a pager
3681 is also an IOError, so I had to actually look at the return value
3684 is also an IOError, so I had to actually look at the return value
3682 of the exception, not just the exception itself. Should be ok now.
3685 of the exception, not just the exception itself. Should be ok now.
3683
3686
3684 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
3687 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
3685 modified to allow case-insensitive color scheme changes.
3688 modified to allow case-insensitive color scheme changes.
3686
3689
3687 2002-02-09 Fernando Perez <fperez@colorado.edu>
3690 2002-02-09 Fernando Perez <fperez@colorado.edu>
3688
3691
3689 * IPython/genutils.py (native_line_ends): new function to leave
3692 * IPython/genutils.py (native_line_ends): new function to leave
3690 user config files with os-native line-endings.
3693 user config files with os-native line-endings.
3691
3694
3692 * README and manual updates.
3695 * README and manual updates.
3693
3696
3694 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
3697 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
3695 instead of StringType to catch Unicode strings.
3698 instead of StringType to catch Unicode strings.
3696
3699
3697 * IPython/genutils.py (filefind): fixed bug for paths with
3700 * IPython/genutils.py (filefind): fixed bug for paths with
3698 embedded spaces (very common in Windows).
3701 embedded spaces (very common in Windows).
3699
3702
3700 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
3703 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
3701 files under Windows, so that they get automatically associated
3704 files under Windows, so that they get automatically associated
3702 with a text editor. Windows makes it a pain to handle
3705 with a text editor. Windows makes it a pain to handle
3703 extension-less files.
3706 extension-less files.
3704
3707
3705 * IPython/iplib.py (InteractiveShell.init_readline): Made the
3708 * IPython/iplib.py (InteractiveShell.init_readline): Made the
3706 warning about readline only occur for Posix. In Windows there's no
3709 warning about readline only occur for Posix. In Windows there's no
3707 way to get readline, so why bother with the warning.
3710 way to get readline, so why bother with the warning.
3708
3711
3709 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
3712 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
3710 for __str__ instead of dir(self), since dir() changed in 2.2.
3713 for __str__ instead of dir(self), since dir() changed in 2.2.
3711
3714
3712 * Ported to Windows! Tested on XP, I suspect it should work fine
3715 * Ported to Windows! Tested on XP, I suspect it should work fine
3713 on NT/2000, but I don't think it will work on 98 et al. That
3716 on NT/2000, but I don't think it will work on 98 et al. That
3714 series of Windows is such a piece of junk anyway that I won't try
3717 series of Windows is such a piece of junk anyway that I won't try
3715 porting it there. The XP port was straightforward, showed a few
3718 porting it there. The XP port was straightforward, showed a few
3716 bugs here and there (fixed all), in particular some string
3719 bugs here and there (fixed all), in particular some string
3717 handling stuff which required considering Unicode strings (which
3720 handling stuff which required considering Unicode strings (which
3718 Windows uses). This is good, but hasn't been too tested :) No
3721 Windows uses). This is good, but hasn't been too tested :) No
3719 fancy installer yet, I'll put a note in the manual so people at
3722 fancy installer yet, I'll put a note in the manual so people at
3720 least make manually a shortcut.
3723 least make manually a shortcut.
3721
3724
3722 * IPython/iplib.py (Magic.magic_colors): Unified the color options
3725 * IPython/iplib.py (Magic.magic_colors): Unified the color options
3723 into a single one, "colors". This now controls both prompt and
3726 into a single one, "colors". This now controls both prompt and
3724 exception color schemes, and can be changed both at startup
3727 exception color schemes, and can be changed both at startup
3725 (either via command-line switches or via ipythonrc files) and at
3728 (either via command-line switches or via ipythonrc files) and at
3726 runtime, with @colors.
3729 runtime, with @colors.
3727 (Magic.magic_run): renamed @prun to @run and removed the old
3730 (Magic.magic_run): renamed @prun to @run and removed the old
3728 @run. The two were too similar to warrant keeping both.
3731 @run. The two were too similar to warrant keeping both.
3729
3732
3730 2002-02-03 Fernando Perez <fperez@colorado.edu>
3733 2002-02-03 Fernando Perez <fperez@colorado.edu>
3731
3734
3732 * IPython/iplib.py (install_first_time): Added comment on how to
3735 * IPython/iplib.py (install_first_time): Added comment on how to
3733 configure the color options for first-time users. Put a <return>
3736 configure the color options for first-time users. Put a <return>
3734 request at the end so that small-terminal users get a chance to
3737 request at the end so that small-terminal users get a chance to
3735 read the startup info.
3738 read the startup info.
3736
3739
3737 2002-01-23 Fernando Perez <fperez@colorado.edu>
3740 2002-01-23 Fernando Perez <fperez@colorado.edu>
3738
3741
3739 * IPython/iplib.py (CachedOutput.update): Changed output memory
3742 * IPython/iplib.py (CachedOutput.update): Changed output memory
3740 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
3743 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
3741 input history we still use _i. Did this b/c these variable are
3744 input history we still use _i. Did this b/c these variable are
3742 very commonly used in interactive work, so the less we need to
3745 very commonly used in interactive work, so the less we need to
3743 type the better off we are.
3746 type the better off we are.
3744 (Magic.magic_prun): updated @prun to better handle the namespaces
3747 (Magic.magic_prun): updated @prun to better handle the namespaces
3745 the file will run in, including a fix for __name__ not being set
3748 the file will run in, including a fix for __name__ not being set
3746 before.
3749 before.
3747
3750
3748 2002-01-20 Fernando Perez <fperez@colorado.edu>
3751 2002-01-20 Fernando Perez <fperez@colorado.edu>
3749
3752
3750 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
3753 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
3751 extra garbage for Python 2.2. Need to look more carefully into
3754 extra garbage for Python 2.2. Need to look more carefully into
3752 this later.
3755 this later.
3753
3756
3754 2002-01-19 Fernando Perez <fperez@colorado.edu>
3757 2002-01-19 Fernando Perez <fperez@colorado.edu>
3755
3758
3756 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
3759 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
3757 display SyntaxError exceptions properly formatted when they occur
3760 display SyntaxError exceptions properly formatted when they occur
3758 (they can be triggered by imported code).
3761 (they can be triggered by imported code).
3759
3762
3760 2002-01-18 Fernando Perez <fperez@colorado.edu>
3763 2002-01-18 Fernando Perez <fperez@colorado.edu>
3761
3764
3762 * IPython/iplib.py (InteractiveShell.safe_execfile): now
3765 * IPython/iplib.py (InteractiveShell.safe_execfile): now
3763 SyntaxError exceptions are reported nicely formatted, instead of
3766 SyntaxError exceptions are reported nicely formatted, instead of
3764 spitting out only offset information as before.
3767 spitting out only offset information as before.
3765 (Magic.magic_prun): Added the @prun function for executing
3768 (Magic.magic_prun): Added the @prun function for executing
3766 programs with command line args inside IPython.
3769 programs with command line args inside IPython.
3767
3770
3768 2002-01-16 Fernando Perez <fperez@colorado.edu>
3771 2002-01-16 Fernando Perez <fperez@colorado.edu>
3769
3772
3770 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
3773 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
3771 to *not* include the last item given in a range. This brings their
3774 to *not* include the last item given in a range. This brings their
3772 behavior in line with Python's slicing:
3775 behavior in line with Python's slicing:
3773 a[n1:n2] -> a[n1]...a[n2-1]
3776 a[n1:n2] -> a[n1]...a[n2-1]
3774 It may be a bit less convenient, but I prefer to stick to Python's
3777 It may be a bit less convenient, but I prefer to stick to Python's
3775 conventions *everywhere*, so users never have to wonder.
3778 conventions *everywhere*, so users never have to wonder.
3776 (Magic.magic_macro): Added @macro function to ease the creation of
3779 (Magic.magic_macro): Added @macro function to ease the creation of
3777 macros.
3780 macros.
3778
3781
3779 2002-01-05 Fernando Perez <fperez@colorado.edu>
3782 2002-01-05 Fernando Perez <fperez@colorado.edu>
3780
3783
3781 * Released 0.2.4.
3784 * Released 0.2.4.
3782
3785
3783 * IPython/iplib.py (Magic.magic_pdef):
3786 * IPython/iplib.py (Magic.magic_pdef):
3784 (InteractiveShell.safe_execfile): report magic lines and error
3787 (InteractiveShell.safe_execfile): report magic lines and error
3785 lines without line numbers so one can easily copy/paste them for
3788 lines without line numbers so one can easily copy/paste them for
3786 re-execution.
3789 re-execution.
3787
3790
3788 * Updated manual with recent changes.
3791 * Updated manual with recent changes.
3789
3792
3790 * IPython/iplib.py (Magic.magic_oinfo): added constructor
3793 * IPython/iplib.py (Magic.magic_oinfo): added constructor
3791 docstring printing when class? is called. Very handy for knowing
3794 docstring printing when class? is called. Very handy for knowing
3792 how to create class instances (as long as __init__ is well
3795 how to create class instances (as long as __init__ is well
3793 documented, of course :)
3796 documented, of course :)
3794 (Magic.magic_doc): print both class and constructor docstrings.
3797 (Magic.magic_doc): print both class and constructor docstrings.
3795 (Magic.magic_pdef): give constructor info if passed a class and
3798 (Magic.magic_pdef): give constructor info if passed a class and
3796 __call__ info for callable object instances.
3799 __call__ info for callable object instances.
3797
3800
3798 2002-01-04 Fernando Perez <fperez@colorado.edu>
3801 2002-01-04 Fernando Perez <fperez@colorado.edu>
3799
3802
3800 * Made deep_reload() off by default. It doesn't always work
3803 * Made deep_reload() off by default. It doesn't always work
3801 exactly as intended, so it's probably safer to have it off. It's
3804 exactly as intended, so it's probably safer to have it off. It's
3802 still available as dreload() anyway, so nothing is lost.
3805 still available as dreload() anyway, so nothing is lost.
3803
3806
3804 2002-01-02 Fernando Perez <fperez@colorado.edu>
3807 2002-01-02 Fernando Perez <fperez@colorado.edu>
3805
3808
3806 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
3809 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
3807 so I wanted an updated release).
3810 so I wanted an updated release).
3808
3811
3809 2001-12-27 Fernando Perez <fperez@colorado.edu>
3812 2001-12-27 Fernando Perez <fperez@colorado.edu>
3810
3813
3811 * IPython/iplib.py (InteractiveShell.interact): Added the original
3814 * IPython/iplib.py (InteractiveShell.interact): Added the original
3812 code from 'code.py' for this module in order to change the
3815 code from 'code.py' for this module in order to change the
3813 handling of a KeyboardInterrupt. This was necessary b/c otherwise
3816 handling of a KeyboardInterrupt. This was necessary b/c otherwise
3814 the history cache would break when the user hit Ctrl-C, and
3817 the history cache would break when the user hit Ctrl-C, and
3815 interact() offers no way to add any hooks to it.
3818 interact() offers no way to add any hooks to it.
3816
3819
3817 2001-12-23 Fernando Perez <fperez@colorado.edu>
3820 2001-12-23 Fernando Perez <fperez@colorado.edu>
3818
3821
3819 * setup.py: added check for 'MANIFEST' before trying to remove
3822 * setup.py: added check for 'MANIFEST' before trying to remove
3820 it. Thanks to Sean Reifschneider.
3823 it. Thanks to Sean Reifschneider.
3821
3824
3822 2001-12-22 Fernando Perez <fperez@colorado.edu>
3825 2001-12-22 Fernando Perez <fperez@colorado.edu>
3823
3826
3824 * Released 0.2.2.
3827 * Released 0.2.2.
3825
3828
3826 * Finished (reasonably) writing the manual. Later will add the
3829 * Finished (reasonably) writing the manual. Later will add the
3827 python-standard navigation stylesheets, but for the time being
3830 python-standard navigation stylesheets, but for the time being
3828 it's fairly complete. Distribution will include html and pdf
3831 it's fairly complete. Distribution will include html and pdf
3829 versions.
3832 versions.
3830
3833
3831 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
3834 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
3832 (MayaVi author).
3835 (MayaVi author).
3833
3836
3834 2001-12-21 Fernando Perez <fperez@colorado.edu>
3837 2001-12-21 Fernando Perez <fperez@colorado.edu>
3835
3838
3836 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
3839 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
3837 good public release, I think (with the manual and the distutils
3840 good public release, I think (with the manual and the distutils
3838 installer). The manual can use some work, but that can go
3841 installer). The manual can use some work, but that can go
3839 slowly. Otherwise I think it's quite nice for end users. Next
3842 slowly. Otherwise I think it's quite nice for end users. Next
3840 summer, rewrite the guts of it...
3843 summer, rewrite the guts of it...
3841
3844
3842 * Changed format of ipythonrc files to use whitespace as the
3845 * Changed format of ipythonrc files to use whitespace as the
3843 separator instead of an explicit '='. Cleaner.
3846 separator instead of an explicit '='. Cleaner.
3844
3847
3845 2001-12-20 Fernando Perez <fperez@colorado.edu>
3848 2001-12-20 Fernando Perez <fperez@colorado.edu>
3846
3849
3847 * Started a manual in LyX. For now it's just a quick merge of the
3850 * Started a manual in LyX. For now it's just a quick merge of the
3848 various internal docstrings and READMEs. Later it may grow into a
3851 various internal docstrings and READMEs. Later it may grow into a
3849 nice, full-blown manual.
3852 nice, full-blown manual.
3850
3853
3851 * Set up a distutils based installer. Installation should now be
3854 * Set up a distutils based installer. Installation should now be
3852 trivially simple for end-users.
3855 trivially simple for end-users.
3853
3856
3854 2001-12-11 Fernando Perez <fperez@colorado.edu>
3857 2001-12-11 Fernando Perez <fperez@colorado.edu>
3855
3858
3856 * Released 0.2.0. First public release, announced it at
3859 * Released 0.2.0. First public release, announced it at
3857 comp.lang.python. From now on, just bugfixes...
3860 comp.lang.python. From now on, just bugfixes...
3858
3861
3859 * Went through all the files, set copyright/license notices and
3862 * Went through all the files, set copyright/license notices and
3860 cleaned up things. Ready for release.
3863 cleaned up things. Ready for release.
3861
3864
3862 2001-12-10 Fernando Perez <fperez@colorado.edu>
3865 2001-12-10 Fernando Perez <fperez@colorado.edu>
3863
3866
3864 * Changed the first-time installer not to use tarfiles. It's more
3867 * Changed the first-time installer not to use tarfiles. It's more
3865 robust now and less unix-dependent. Also makes it easier for
3868 robust now and less unix-dependent. Also makes it easier for
3866 people to later upgrade versions.
3869 people to later upgrade versions.
3867
3870
3868 * Changed @exit to @abort to reflect the fact that it's pretty
3871 * Changed @exit to @abort to reflect the fact that it's pretty
3869 brutal (a sys.exit()). The difference between @abort and Ctrl-D
3872 brutal (a sys.exit()). The difference between @abort and Ctrl-D
3870 becomes significant only when IPyhton is embedded: in that case,
3873 becomes significant only when IPyhton is embedded: in that case,
3871 C-D closes IPython only, but @abort kills the enclosing program
3874 C-D closes IPython only, but @abort kills the enclosing program
3872 too (unless it had called IPython inside a try catching
3875 too (unless it had called IPython inside a try catching
3873 SystemExit).
3876 SystemExit).
3874
3877
3875 * Created Shell module which exposes the actuall IPython Shell
3878 * Created Shell module which exposes the actuall IPython Shell
3876 classes, currently the normal and the embeddable one. This at
3879 classes, currently the normal and the embeddable one. This at
3877 least offers a stable interface we won't need to change when
3880 least offers a stable interface we won't need to change when
3878 (later) the internals are rewritten. That rewrite will be confined
3881 (later) the internals are rewritten. That rewrite will be confined
3879 to iplib and ipmaker, but the Shell interface should remain as is.
3882 to iplib and ipmaker, but the Shell interface should remain as is.
3880
3883
3881 * Added embed module which offers an embeddable IPShell object,
3884 * Added embed module which offers an embeddable IPShell object,
3882 useful to fire up IPython *inside* a running program. Great for
3885 useful to fire up IPython *inside* a running program. Great for
3883 debugging or dynamical data analysis.
3886 debugging or dynamical data analysis.
3884
3887
3885 2001-12-08 Fernando Perez <fperez@colorado.edu>
3888 2001-12-08 Fernando Perez <fperez@colorado.edu>
3886
3889
3887 * Fixed small bug preventing seeing info from methods of defined
3890 * Fixed small bug preventing seeing info from methods of defined
3888 objects (incorrect namespace in _ofind()).
3891 objects (incorrect namespace in _ofind()).
3889
3892
3890 * Documentation cleanup. Moved the main usage docstrings to a
3893 * Documentation cleanup. Moved the main usage docstrings to a
3891 separate file, usage.py (cleaner to maintain, and hopefully in the
3894 separate file, usage.py (cleaner to maintain, and hopefully in the
3892 future some perlpod-like way of producing interactive, man and
3895 future some perlpod-like way of producing interactive, man and
3893 html docs out of it will be found).
3896 html docs out of it will be found).
3894
3897
3895 * Added @profile to see your profile at any time.
3898 * Added @profile to see your profile at any time.
3896
3899
3897 * Added @p as an alias for 'print'. It's especially convenient if
3900 * Added @p as an alias for 'print'. It's especially convenient if
3898 using automagic ('p x' prints x).
3901 using automagic ('p x' prints x).
3899
3902
3900 * Small cleanups and fixes after a pychecker run.
3903 * Small cleanups and fixes after a pychecker run.
3901
3904
3902 * Changed the @cd command to handle @cd - and @cd -<n> for
3905 * Changed the @cd command to handle @cd - and @cd -<n> for
3903 visiting any directory in _dh.
3906 visiting any directory in _dh.
3904
3907
3905 * Introduced _dh, a history of visited directories. @dhist prints
3908 * Introduced _dh, a history of visited directories. @dhist prints
3906 it out with numbers.
3909 it out with numbers.
3907
3910
3908 2001-12-07 Fernando Perez <fperez@colorado.edu>
3911 2001-12-07 Fernando Perez <fperez@colorado.edu>
3909
3912
3910 * Released 0.1.22
3913 * Released 0.1.22
3911
3914
3912 * Made initialization a bit more robust against invalid color
3915 * Made initialization a bit more robust against invalid color
3913 options in user input (exit, not traceback-crash).
3916 options in user input (exit, not traceback-crash).
3914
3917
3915 * Changed the bug crash reporter to write the report only in the
3918 * Changed the bug crash reporter to write the report only in the
3916 user's .ipython directory. That way IPython won't litter people's
3919 user's .ipython directory. That way IPython won't litter people's
3917 hard disks with crash files all over the place. Also print on
3920 hard disks with crash files all over the place. Also print on
3918 screen the necessary mail command.
3921 screen the necessary mail command.
3919
3922
3920 * With the new ultraTB, implemented LightBG color scheme for light
3923 * With the new ultraTB, implemented LightBG color scheme for light
3921 background terminals. A lot of people like white backgrounds, so I
3924 background terminals. A lot of people like white backgrounds, so I
3922 guess we should at least give them something readable.
3925 guess we should at least give them something readable.
3923
3926
3924 2001-12-06 Fernando Perez <fperez@colorado.edu>
3927 2001-12-06 Fernando Perez <fperez@colorado.edu>
3925
3928
3926 * Modified the structure of ultraTB. Now there's a proper class
3929 * Modified the structure of ultraTB. Now there's a proper class
3927 for tables of color schemes which allow adding schemes easily and
3930 for tables of color schemes which allow adding schemes easily and
3928 switching the active scheme without creating a new instance every
3931 switching the active scheme without creating a new instance every
3929 time (which was ridiculous). The syntax for creating new schemes
3932 time (which was ridiculous). The syntax for creating new schemes
3930 is also cleaner. I think ultraTB is finally done, with a clean
3933 is also cleaner. I think ultraTB is finally done, with a clean
3931 class structure. Names are also much cleaner (now there's proper
3934 class structure. Names are also much cleaner (now there's proper
3932 color tables, no need for every variable to also have 'color' in
3935 color tables, no need for every variable to also have 'color' in
3933 its name).
3936 its name).
3934
3937
3935 * Broke down genutils into separate files. Now genutils only
3938 * Broke down genutils into separate files. Now genutils only
3936 contains utility functions, and classes have been moved to their
3939 contains utility functions, and classes have been moved to their
3937 own files (they had enough independent functionality to warrant
3940 own files (they had enough independent functionality to warrant
3938 it): ConfigLoader, OutputTrap, Struct.
3941 it): ConfigLoader, OutputTrap, Struct.
3939
3942
3940 2001-12-05 Fernando Perez <fperez@colorado.edu>
3943 2001-12-05 Fernando Perez <fperez@colorado.edu>
3941
3944
3942 * IPython turns 21! Released version 0.1.21, as a candidate for
3945 * IPython turns 21! Released version 0.1.21, as a candidate for
3943 public consumption. If all goes well, release in a few days.
3946 public consumption. If all goes well, release in a few days.
3944
3947
3945 * Fixed path bug (files in Extensions/ directory wouldn't be found
3948 * Fixed path bug (files in Extensions/ directory wouldn't be found
3946 unless IPython/ was explicitly in sys.path).
3949 unless IPython/ was explicitly in sys.path).
3947
3950
3948 * Extended the FlexCompleter class as MagicCompleter to allow
3951 * Extended the FlexCompleter class as MagicCompleter to allow
3949 completion of @-starting lines.
3952 completion of @-starting lines.
3950
3953
3951 * Created __release__.py file as a central repository for release
3954 * Created __release__.py file as a central repository for release
3952 info that other files can read from.
3955 info that other files can read from.
3953
3956
3954 * Fixed small bug in logging: when logging was turned on in
3957 * Fixed small bug in logging: when logging was turned on in
3955 mid-session, old lines with special meanings (!@?) were being
3958 mid-session, old lines with special meanings (!@?) were being
3956 logged without the prepended comment, which is necessary since
3959 logged without the prepended comment, which is necessary since
3957 they are not truly valid python syntax. This should make session
3960 they are not truly valid python syntax. This should make session
3958 restores produce less errors.
3961 restores produce less errors.
3959
3962
3960 * The namespace cleanup forced me to make a FlexCompleter class
3963 * The namespace cleanup forced me to make a FlexCompleter class
3961 which is nothing but a ripoff of rlcompleter, but with selectable
3964 which is nothing but a ripoff of rlcompleter, but with selectable
3962 namespace (rlcompleter only works in __main__.__dict__). I'll try
3965 namespace (rlcompleter only works in __main__.__dict__). I'll try
3963 to submit a note to the authors to see if this change can be
3966 to submit a note to the authors to see if this change can be
3964 incorporated in future rlcompleter releases (Dec.6: done)
3967 incorporated in future rlcompleter releases (Dec.6: done)
3965
3968
3966 * More fixes to namespace handling. It was a mess! Now all
3969 * More fixes to namespace handling. It was a mess! Now all
3967 explicit references to __main__.__dict__ are gone (except when
3970 explicit references to __main__.__dict__ are gone (except when
3968 really needed) and everything is handled through the namespace
3971 really needed) and everything is handled through the namespace
3969 dicts in the IPython instance. We seem to be getting somewhere
3972 dicts in the IPython instance. We seem to be getting somewhere
3970 with this, finally...
3973 with this, finally...
3971
3974
3972 * Small documentation updates.
3975 * Small documentation updates.
3973
3976
3974 * Created the Extensions directory under IPython (with an
3977 * Created the Extensions directory under IPython (with an
3975 __init__.py). Put the PhysicalQ stuff there. This directory should
3978 __init__.py). Put the PhysicalQ stuff there. This directory should
3976 be used for all special-purpose extensions.
3979 be used for all special-purpose extensions.
3977
3980
3978 * File renaming:
3981 * File renaming:
3979 ipythonlib --> ipmaker
3982 ipythonlib --> ipmaker
3980 ipplib --> iplib
3983 ipplib --> iplib
3981 This makes a bit more sense in terms of what these files actually do.
3984 This makes a bit more sense in terms of what these files actually do.
3982
3985
3983 * Moved all the classes and functions in ipythonlib to ipplib, so
3986 * Moved all the classes and functions in ipythonlib to ipplib, so
3984 now ipythonlib only has make_IPython(). This will ease up its
3987 now ipythonlib only has make_IPython(). This will ease up its
3985 splitting in smaller functional chunks later.
3988 splitting in smaller functional chunks later.
3986
3989
3987 * Cleaned up (done, I think) output of @whos. Better column
3990 * Cleaned up (done, I think) output of @whos. Better column
3988 formatting, and now shows str(var) for as much as it can, which is
3991 formatting, and now shows str(var) for as much as it can, which is
3989 typically what one gets with a 'print var'.
3992 typically what one gets with a 'print var'.
3990
3993
3991 2001-12-04 Fernando Perez <fperez@colorado.edu>
3994 2001-12-04 Fernando Perez <fperez@colorado.edu>
3992
3995
3993 * Fixed namespace problems. Now builtin/IPyhton/user names get
3996 * Fixed namespace problems. Now builtin/IPyhton/user names get
3994 properly reported in their namespace. Internal namespace handling
3997 properly reported in their namespace. Internal namespace handling
3995 is finally getting decent (not perfect yet, but much better than
3998 is finally getting decent (not perfect yet, but much better than
3996 the ad-hoc mess we had).
3999 the ad-hoc mess we had).
3997
4000
3998 * Removed -exit option. If people just want to run a python
4001 * Removed -exit option. If people just want to run a python
3999 script, that's what the normal interpreter is for. Less
4002 script, that's what the normal interpreter is for. Less
4000 unnecessary options, less chances for bugs.
4003 unnecessary options, less chances for bugs.
4001
4004
4002 * Added a crash handler which generates a complete post-mortem if
4005 * Added a crash handler which generates a complete post-mortem if
4003 IPython crashes. This will help a lot in tracking bugs down the
4006 IPython crashes. This will help a lot in tracking bugs down the
4004 road.
4007 road.
4005
4008
4006 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4009 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4007 which were boud to functions being reassigned would bypass the
4010 which were boud to functions being reassigned would bypass the
4008 logger, breaking the sync of _il with the prompt counter. This
4011 logger, breaking the sync of _il with the prompt counter. This
4009 would then crash IPython later when a new line was logged.
4012 would then crash IPython later when a new line was logged.
4010
4013
4011 2001-12-02 Fernando Perez <fperez@colorado.edu>
4014 2001-12-02 Fernando Perez <fperez@colorado.edu>
4012
4015
4013 * Made IPython a package. This means people don't have to clutter
4016 * Made IPython a package. This means people don't have to clutter
4014 their sys.path with yet another directory. Changed the INSTALL
4017 their sys.path with yet another directory. Changed the INSTALL
4015 file accordingly.
4018 file accordingly.
4016
4019
4017 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4020 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4018 sorts its output (so @who shows it sorted) and @whos formats the
4021 sorts its output (so @who shows it sorted) and @whos formats the
4019 table according to the width of the first column. Nicer, easier to
4022 table according to the width of the first column. Nicer, easier to
4020 read. Todo: write a generic table_format() which takes a list of
4023 read. Todo: write a generic table_format() which takes a list of
4021 lists and prints it nicely formatted, with optional row/column
4024 lists and prints it nicely formatted, with optional row/column
4022 separators and proper padding and justification.
4025 separators and proper padding and justification.
4023
4026
4024 * Released 0.1.20
4027 * Released 0.1.20
4025
4028
4026 * Fixed bug in @log which would reverse the inputcache list (a
4029 * Fixed bug in @log which would reverse the inputcache list (a
4027 copy operation was missing).
4030 copy operation was missing).
4028
4031
4029 * Code cleanup. @config was changed to use page(). Better, since
4032 * Code cleanup. @config was changed to use page(). Better, since
4030 its output is always quite long.
4033 its output is always quite long.
4031
4034
4032 * Itpl is back as a dependency. I was having too many problems
4035 * Itpl is back as a dependency. I was having too many problems
4033 getting the parametric aliases to work reliably, and it's just
4036 getting the parametric aliases to work reliably, and it's just
4034 easier to code weird string operations with it than playing %()s
4037 easier to code weird string operations with it than playing %()s
4035 games. It's only ~6k, so I don't think it's too big a deal.
4038 games. It's only ~6k, so I don't think it's too big a deal.
4036
4039
4037 * Found (and fixed) a very nasty bug with history. !lines weren't
4040 * Found (and fixed) a very nasty bug with history. !lines weren't
4038 getting cached, and the out of sync caches would crash
4041 getting cached, and the out of sync caches would crash
4039 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4042 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4040 division of labor a bit better. Bug fixed, cleaner structure.
4043 division of labor a bit better. Bug fixed, cleaner structure.
4041
4044
4042 2001-12-01 Fernando Perez <fperez@colorado.edu>
4045 2001-12-01 Fernando Perez <fperez@colorado.edu>
4043
4046
4044 * Released 0.1.19
4047 * Released 0.1.19
4045
4048
4046 * Added option -n to @hist to prevent line number printing. Much
4049 * Added option -n to @hist to prevent line number printing. Much
4047 easier to copy/paste code this way.
4050 easier to copy/paste code this way.
4048
4051
4049 * Created global _il to hold the input list. Allows easy
4052 * Created global _il to hold the input list. Allows easy
4050 re-execution of blocks of code by slicing it (inspired by Janko's
4053 re-execution of blocks of code by slicing it (inspired by Janko's
4051 comment on 'macros').
4054 comment on 'macros').
4052
4055
4053 * Small fixes and doc updates.
4056 * Small fixes and doc updates.
4054
4057
4055 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4058 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4056 much too fragile with automagic. Handles properly multi-line
4059 much too fragile with automagic. Handles properly multi-line
4057 statements and takes parameters.
4060 statements and takes parameters.
4058
4061
4059 2001-11-30 Fernando Perez <fperez@colorado.edu>
4062 2001-11-30 Fernando Perez <fperez@colorado.edu>
4060
4063
4061 * Version 0.1.18 released.
4064 * Version 0.1.18 released.
4062
4065
4063 * Fixed nasty namespace bug in initial module imports.
4066 * Fixed nasty namespace bug in initial module imports.
4064
4067
4065 * Added copyright/license notes to all code files (except
4068 * Added copyright/license notes to all code files (except
4066 DPyGetOpt). For the time being, LGPL. That could change.
4069 DPyGetOpt). For the time being, LGPL. That could change.
4067
4070
4068 * Rewrote a much nicer README, updated INSTALL, cleaned up
4071 * Rewrote a much nicer README, updated INSTALL, cleaned up
4069 ipythonrc-* samples.
4072 ipythonrc-* samples.
4070
4073
4071 * Overall code/documentation cleanup. Basically ready for
4074 * Overall code/documentation cleanup. Basically ready for
4072 release. Only remaining thing: licence decision (LGPL?).
4075 release. Only remaining thing: licence decision (LGPL?).
4073
4076
4074 * Converted load_config to a class, ConfigLoader. Now recursion
4077 * Converted load_config to a class, ConfigLoader. Now recursion
4075 control is better organized. Doesn't include the same file twice.
4078 control is better organized. Doesn't include the same file twice.
4076
4079
4077 2001-11-29 Fernando Perez <fperez@colorado.edu>
4080 2001-11-29 Fernando Perez <fperez@colorado.edu>
4078
4081
4079 * Got input history working. Changed output history variables from
4082 * Got input history working. Changed output history variables from
4080 _p to _o so that _i is for input and _o for output. Just cleaner
4083 _p to _o so that _i is for input and _o for output. Just cleaner
4081 convention.
4084 convention.
4082
4085
4083 * Implemented parametric aliases. This pretty much allows the
4086 * Implemented parametric aliases. This pretty much allows the
4084 alias system to offer full-blown shell convenience, I think.
4087 alias system to offer full-blown shell convenience, I think.
4085
4088
4086 * Version 0.1.17 released, 0.1.18 opened.
4089 * Version 0.1.17 released, 0.1.18 opened.
4087
4090
4088 * dot_ipython/ipythonrc (alias): added documentation.
4091 * dot_ipython/ipythonrc (alias): added documentation.
4089 (xcolor): Fixed small bug (xcolors -> xcolor)
4092 (xcolor): Fixed small bug (xcolors -> xcolor)
4090
4093
4091 * Changed the alias system. Now alias is a magic command to define
4094 * Changed the alias system. Now alias is a magic command to define
4092 aliases just like the shell. Rationale: the builtin magics should
4095 aliases just like the shell. Rationale: the builtin magics should
4093 be there for things deeply connected to IPython's
4096 be there for things deeply connected to IPython's
4094 architecture. And this is a much lighter system for what I think
4097 architecture. And this is a much lighter system for what I think
4095 is the really important feature: allowing users to define quickly
4098 is the really important feature: allowing users to define quickly
4096 magics that will do shell things for them, so they can customize
4099 magics that will do shell things for them, so they can customize
4097 IPython easily to match their work habits. If someone is really
4100 IPython easily to match their work habits. If someone is really
4098 desperate to have another name for a builtin alias, they can
4101 desperate to have another name for a builtin alias, they can
4099 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4102 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4100 works.
4103 works.
4101
4104
4102 2001-11-28 Fernando Perez <fperez@colorado.edu>
4105 2001-11-28 Fernando Perez <fperez@colorado.edu>
4103
4106
4104 * Changed @file so that it opens the source file at the proper
4107 * Changed @file so that it opens the source file at the proper
4105 line. Since it uses less, if your EDITOR environment is
4108 line. Since it uses less, if your EDITOR environment is
4106 configured, typing v will immediately open your editor of choice
4109 configured, typing v will immediately open your editor of choice
4107 right at the line where the object is defined. Not as quick as
4110 right at the line where the object is defined. Not as quick as
4108 having a direct @edit command, but for all intents and purposes it
4111 having a direct @edit command, but for all intents and purposes it
4109 works. And I don't have to worry about writing @edit to deal with
4112 works. And I don't have to worry about writing @edit to deal with
4110 all the editors, less does that.
4113 all the editors, less does that.
4111
4114
4112 * Version 0.1.16 released, 0.1.17 opened.
4115 * Version 0.1.16 released, 0.1.17 opened.
4113
4116
4114 * Fixed some nasty bugs in the page/page_dumb combo that could
4117 * Fixed some nasty bugs in the page/page_dumb combo that could
4115 crash IPython.
4118 crash IPython.
4116
4119
4117 2001-11-27 Fernando Perez <fperez@colorado.edu>
4120 2001-11-27 Fernando Perez <fperez@colorado.edu>
4118
4121
4119 * Version 0.1.15 released, 0.1.16 opened.
4122 * Version 0.1.15 released, 0.1.16 opened.
4120
4123
4121 * Finally got ? and ?? to work for undefined things: now it's
4124 * Finally got ? and ?? to work for undefined things: now it's
4122 possible to type {}.get? and get information about the get method
4125 possible to type {}.get? and get information about the get method
4123 of dicts, or os.path? even if only os is defined (so technically
4126 of dicts, or os.path? even if only os is defined (so technically
4124 os.path isn't). Works at any level. For example, after import os,
4127 os.path isn't). Works at any level. For example, after import os,
4125 os?, os.path?, os.path.abspath? all work. This is great, took some
4128 os?, os.path?, os.path.abspath? all work. This is great, took some
4126 work in _ofind.
4129 work in _ofind.
4127
4130
4128 * Fixed more bugs with logging. The sanest way to do it was to add
4131 * Fixed more bugs with logging. The sanest way to do it was to add
4129 to @log a 'mode' parameter. Killed two in one shot (this mode
4132 to @log a 'mode' parameter. Killed two in one shot (this mode
4130 option was a request of Janko's). I think it's finally clean
4133 option was a request of Janko's). I think it's finally clean
4131 (famous last words).
4134 (famous last words).
4132
4135
4133 * Added a page_dumb() pager which does a decent job of paging on
4136 * Added a page_dumb() pager which does a decent job of paging on
4134 screen, if better things (like less) aren't available. One less
4137 screen, if better things (like less) aren't available. One less
4135 unix dependency (someday maybe somebody will port this to
4138 unix dependency (someday maybe somebody will port this to
4136 windows).
4139 windows).
4137
4140
4138 * Fixed problem in magic_log: would lock of logging out if log
4141 * Fixed problem in magic_log: would lock of logging out if log
4139 creation failed (because it would still think it had succeeded).
4142 creation failed (because it would still think it had succeeded).
4140
4143
4141 * Improved the page() function using curses to auto-detect screen
4144 * Improved the page() function using curses to auto-detect screen
4142 size. Now it can make a much better decision on whether to print
4145 size. Now it can make a much better decision on whether to print
4143 or page a string. Option screen_length was modified: a value 0
4146 or page a string. Option screen_length was modified: a value 0
4144 means auto-detect, and that's the default now.
4147 means auto-detect, and that's the default now.
4145
4148
4146 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4149 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4147 go out. I'll test it for a few days, then talk to Janko about
4150 go out. I'll test it for a few days, then talk to Janko about
4148 licences and announce it.
4151 licences and announce it.
4149
4152
4150 * Fixed the length of the auto-generated ---> prompt which appears
4153 * Fixed the length of the auto-generated ---> prompt which appears
4151 for auto-parens and auto-quotes. Getting this right isn't trivial,
4154 for auto-parens and auto-quotes. Getting this right isn't trivial,
4152 with all the color escapes, different prompt types and optional
4155 with all the color escapes, different prompt types and optional
4153 separators. But it seems to be working in all the combinations.
4156 separators. But it seems to be working in all the combinations.
4154
4157
4155 2001-11-26 Fernando Perez <fperez@colorado.edu>
4158 2001-11-26 Fernando Perez <fperez@colorado.edu>
4156
4159
4157 * Wrote a regexp filter to get option types from the option names
4160 * Wrote a regexp filter to get option types from the option names
4158 string. This eliminates the need to manually keep two duplicate
4161 string. This eliminates the need to manually keep two duplicate
4159 lists.
4162 lists.
4160
4163
4161 * Removed the unneeded check_option_names. Now options are handled
4164 * Removed the unneeded check_option_names. Now options are handled
4162 in a much saner manner and it's easy to visually check that things
4165 in a much saner manner and it's easy to visually check that things
4163 are ok.
4166 are ok.
4164
4167
4165 * Updated version numbers on all files I modified to carry a
4168 * Updated version numbers on all files I modified to carry a
4166 notice so Janko and Nathan have clear version markers.
4169 notice so Janko and Nathan have clear version markers.
4167
4170
4168 * Updated docstring for ultraTB with my changes. I should send
4171 * Updated docstring for ultraTB with my changes. I should send
4169 this to Nathan.
4172 this to Nathan.
4170
4173
4171 * Lots of small fixes. Ran everything through pychecker again.
4174 * Lots of small fixes. Ran everything through pychecker again.
4172
4175
4173 * Made loading of deep_reload an cmd line option. If it's not too
4176 * Made loading of deep_reload an cmd line option. If it's not too
4174 kosher, now people can just disable it. With -nodeep_reload it's
4177 kosher, now people can just disable it. With -nodeep_reload it's
4175 still available as dreload(), it just won't overwrite reload().
4178 still available as dreload(), it just won't overwrite reload().
4176
4179
4177 * Moved many options to the no| form (-opt and -noopt
4180 * Moved many options to the no| form (-opt and -noopt
4178 accepted). Cleaner.
4181 accepted). Cleaner.
4179
4182
4180 * Changed magic_log so that if called with no parameters, it uses
4183 * Changed magic_log so that if called with no parameters, it uses
4181 'rotate' mode. That way auto-generated logs aren't automatically
4184 'rotate' mode. That way auto-generated logs aren't automatically
4182 over-written. For normal logs, now a backup is made if it exists
4185 over-written. For normal logs, now a backup is made if it exists
4183 (only 1 level of backups). A new 'backup' mode was added to the
4186 (only 1 level of backups). A new 'backup' mode was added to the
4184 Logger class to support this. This was a request by Janko.
4187 Logger class to support this. This was a request by Janko.
4185
4188
4186 * Added @logoff/@logon to stop/restart an active log.
4189 * Added @logoff/@logon to stop/restart an active log.
4187
4190
4188 * Fixed a lot of bugs in log saving/replay. It was pretty
4191 * Fixed a lot of bugs in log saving/replay. It was pretty
4189 broken. Now special lines (!@,/) appear properly in the command
4192 broken. Now special lines (!@,/) appear properly in the command
4190 history after a log replay.
4193 history after a log replay.
4191
4194
4192 * Tried and failed to implement full session saving via pickle. My
4195 * Tried and failed to implement full session saving via pickle. My
4193 idea was to pickle __main__.__dict__, but modules can't be
4196 idea was to pickle __main__.__dict__, but modules can't be
4194 pickled. This would be a better alternative to replaying logs, but
4197 pickled. This would be a better alternative to replaying logs, but
4195 seems quite tricky to get to work. Changed -session to be called
4198 seems quite tricky to get to work. Changed -session to be called
4196 -logplay, which more accurately reflects what it does. And if we
4199 -logplay, which more accurately reflects what it does. And if we
4197 ever get real session saving working, -session is now available.
4200 ever get real session saving working, -session is now available.
4198
4201
4199 * Implemented color schemes for prompts also. As for tracebacks,
4202 * Implemented color schemes for prompts also. As for tracebacks,
4200 currently only NoColor and Linux are supported. But now the
4203 currently only NoColor and Linux are supported. But now the
4201 infrastructure is in place, based on a generic ColorScheme
4204 infrastructure is in place, based on a generic ColorScheme
4202 class. So writing and activating new schemes both for the prompts
4205 class. So writing and activating new schemes both for the prompts
4203 and the tracebacks should be straightforward.
4206 and the tracebacks should be straightforward.
4204
4207
4205 * Version 0.1.13 released, 0.1.14 opened.
4208 * Version 0.1.13 released, 0.1.14 opened.
4206
4209
4207 * Changed handling of options for output cache. Now counter is
4210 * Changed handling of options for output cache. Now counter is
4208 hardwired starting at 1 and one specifies the maximum number of
4211 hardwired starting at 1 and one specifies the maximum number of
4209 entries *in the outcache* (not the max prompt counter). This is
4212 entries *in the outcache* (not the max prompt counter). This is
4210 much better, since many statements won't increase the cache
4213 much better, since many statements won't increase the cache
4211 count. It also eliminated some confusing options, now there's only
4214 count. It also eliminated some confusing options, now there's only
4212 one: cache_size.
4215 one: cache_size.
4213
4216
4214 * Added 'alias' magic function and magic_alias option in the
4217 * Added 'alias' magic function and magic_alias option in the
4215 ipythonrc file. Now the user can easily define whatever names he
4218 ipythonrc file. Now the user can easily define whatever names he
4216 wants for the magic functions without having to play weird
4219 wants for the magic functions without having to play weird
4217 namespace games. This gives IPython a real shell-like feel.
4220 namespace games. This gives IPython a real shell-like feel.
4218
4221
4219 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4222 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4220 @ or not).
4223 @ or not).
4221
4224
4222 This was one of the last remaining 'visible' bugs (that I know
4225 This was one of the last remaining 'visible' bugs (that I know
4223 of). I think if I can clean up the session loading so it works
4226 of). I think if I can clean up the session loading so it works
4224 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4227 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4225 about licensing).
4228 about licensing).
4226
4229
4227 2001-11-25 Fernando Perez <fperez@colorado.edu>
4230 2001-11-25 Fernando Perez <fperez@colorado.edu>
4228
4231
4229 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
4232 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
4230 there's a cleaner distinction between what ? and ?? show.
4233 there's a cleaner distinction between what ? and ?? show.
4231
4234
4232 * Added screen_length option. Now the user can define his own
4235 * Added screen_length option. Now the user can define his own
4233 screen size for page() operations.
4236 screen size for page() operations.
4234
4237
4235 * Implemented magic shell-like functions with automatic code
4238 * Implemented magic shell-like functions with automatic code
4236 generation. Now adding another function is just a matter of adding
4239 generation. Now adding another function is just a matter of adding
4237 an entry to a dict, and the function is dynamically generated at
4240 an entry to a dict, and the function is dynamically generated at
4238 run-time. Python has some really cool features!
4241 run-time. Python has some really cool features!
4239
4242
4240 * Renamed many options to cleanup conventions a little. Now all
4243 * Renamed many options to cleanup conventions a little. Now all
4241 are lowercase, and only underscores where needed. Also in the code
4244 are lowercase, and only underscores where needed. Also in the code
4242 option name tables are clearer.
4245 option name tables are clearer.
4243
4246
4244 * Changed prompts a little. Now input is 'In [n]:' instead of
4247 * Changed prompts a little. Now input is 'In [n]:' instead of
4245 'In[n]:='. This allows it the numbers to be aligned with the
4248 'In[n]:='. This allows it the numbers to be aligned with the
4246 Out[n] numbers, and removes usage of ':=' which doesn't exist in
4249 Out[n] numbers, and removes usage of ':=' which doesn't exist in
4247 Python (it was a Mathematica thing). The '...' continuation prompt
4250 Python (it was a Mathematica thing). The '...' continuation prompt
4248 was also changed a little to align better.
4251 was also changed a little to align better.
4249
4252
4250 * Fixed bug when flushing output cache. Not all _p<n> variables
4253 * Fixed bug when flushing output cache. Not all _p<n> variables
4251 exist, so their deletion needs to be wrapped in a try:
4254 exist, so their deletion needs to be wrapped in a try:
4252
4255
4253 * Figured out how to properly use inspect.formatargspec() (it
4256 * Figured out how to properly use inspect.formatargspec() (it
4254 requires the args preceded by *). So I removed all the code from
4257 requires the args preceded by *). So I removed all the code from
4255 _get_pdef in Magic, which was just replicating that.
4258 _get_pdef in Magic, which was just replicating that.
4256
4259
4257 * Added test to prefilter to allow redefining magic function names
4260 * Added test to prefilter to allow redefining magic function names
4258 as variables. This is ok, since the @ form is always available,
4261 as variables. This is ok, since the @ form is always available,
4259 but whe should allow the user to define a variable called 'ls' if
4262 but whe should allow the user to define a variable called 'ls' if
4260 he needs it.
4263 he needs it.
4261
4264
4262 * Moved the ToDo information from README into a separate ToDo.
4265 * Moved the ToDo information from README into a separate ToDo.
4263
4266
4264 * General code cleanup and small bugfixes. I think it's close to a
4267 * General code cleanup and small bugfixes. I think it's close to a
4265 state where it can be released, obviously with a big 'beta'
4268 state where it can be released, obviously with a big 'beta'
4266 warning on it.
4269 warning on it.
4267
4270
4268 * Got the magic function split to work. Now all magics are defined
4271 * Got the magic function split to work. Now all magics are defined
4269 in a separate class. It just organizes things a bit, and now
4272 in a separate class. It just organizes things a bit, and now
4270 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
4273 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
4271 was too long).
4274 was too long).
4272
4275
4273 * Changed @clear to @reset to avoid potential confusions with
4276 * Changed @clear to @reset to avoid potential confusions with
4274 the shell command clear. Also renamed @cl to @clear, which does
4277 the shell command clear. Also renamed @cl to @clear, which does
4275 exactly what people expect it to from their shell experience.
4278 exactly what people expect it to from their shell experience.
4276
4279
4277 Added a check to the @reset command (since it's so
4280 Added a check to the @reset command (since it's so
4278 destructive, it's probably a good idea to ask for confirmation).
4281 destructive, it's probably a good idea to ask for confirmation).
4279 But now reset only works for full namespace resetting. Since the
4282 But now reset only works for full namespace resetting. Since the
4280 del keyword is already there for deleting a few specific
4283 del keyword is already there for deleting a few specific
4281 variables, I don't see the point of having a redundant magic
4284 variables, I don't see the point of having a redundant magic
4282 function for the same task.
4285 function for the same task.
4283
4286
4284 2001-11-24 Fernando Perez <fperez@colorado.edu>
4287 2001-11-24 Fernando Perez <fperez@colorado.edu>
4285
4288
4286 * Updated the builtin docs (esp. the ? ones).
4289 * Updated the builtin docs (esp. the ? ones).
4287
4290
4288 * Ran all the code through pychecker. Not terribly impressed with
4291 * Ran all the code through pychecker. Not terribly impressed with
4289 it: lots of spurious warnings and didn't really find anything of
4292 it: lots of spurious warnings and didn't really find anything of
4290 substance (just a few modules being imported and not used).
4293 substance (just a few modules being imported and not used).
4291
4294
4292 * Implemented the new ultraTB functionality into IPython. New
4295 * Implemented the new ultraTB functionality into IPython. New
4293 option: xcolors. This chooses color scheme. xmode now only selects
4296 option: xcolors. This chooses color scheme. xmode now only selects
4294 between Plain and Verbose. Better orthogonality.
4297 between Plain and Verbose. Better orthogonality.
4295
4298
4296 * Large rewrite of ultraTB. Much cleaner now, with a separation of
4299 * Large rewrite of ultraTB. Much cleaner now, with a separation of
4297 mode and color scheme for the exception handlers. Now it's
4300 mode and color scheme for the exception handlers. Now it's
4298 possible to have the verbose traceback with no coloring.
4301 possible to have the verbose traceback with no coloring.
4299
4302
4300 2001-11-23 Fernando Perez <fperez@colorado.edu>
4303 2001-11-23 Fernando Perez <fperez@colorado.edu>
4301
4304
4302 * Version 0.1.12 released, 0.1.13 opened.
4305 * Version 0.1.12 released, 0.1.13 opened.
4303
4306
4304 * Removed option to set auto-quote and auto-paren escapes by
4307 * Removed option to set auto-quote and auto-paren escapes by
4305 user. The chances of breaking valid syntax are just too high. If
4308 user. The chances of breaking valid syntax are just too high. If
4306 someone *really* wants, they can always dig into the code.
4309 someone *really* wants, they can always dig into the code.
4307
4310
4308 * Made prompt separators configurable.
4311 * Made prompt separators configurable.
4309
4312
4310 2001-11-22 Fernando Perez <fperez@colorado.edu>
4313 2001-11-22 Fernando Perez <fperez@colorado.edu>
4311
4314
4312 * Small bugfixes in many places.
4315 * Small bugfixes in many places.
4313
4316
4314 * Removed the MyCompleter class from ipplib. It seemed redundant
4317 * Removed the MyCompleter class from ipplib. It seemed redundant
4315 with the C-p,C-n history search functionality. Less code to
4318 with the C-p,C-n history search functionality. Less code to
4316 maintain.
4319 maintain.
4317
4320
4318 * Moved all the original ipython.py code into ipythonlib.py. Right
4321 * Moved all the original ipython.py code into ipythonlib.py. Right
4319 now it's just one big dump into a function called make_IPython, so
4322 now it's just one big dump into a function called make_IPython, so
4320 no real modularity has been gained. But at least it makes the
4323 no real modularity has been gained. But at least it makes the
4321 wrapper script tiny, and since ipythonlib is a module, it gets
4324 wrapper script tiny, and since ipythonlib is a module, it gets
4322 compiled and startup is much faster.
4325 compiled and startup is much faster.
4323
4326
4324 This is a reasobably 'deep' change, so we should test it for a
4327 This is a reasobably 'deep' change, so we should test it for a
4325 while without messing too much more with the code.
4328 while without messing too much more with the code.
4326
4329
4327 2001-11-21 Fernando Perez <fperez@colorado.edu>
4330 2001-11-21 Fernando Perez <fperez@colorado.edu>
4328
4331
4329 * Version 0.1.11 released, 0.1.12 opened for further work.
4332 * Version 0.1.11 released, 0.1.12 opened for further work.
4330
4333
4331 * Removed dependency on Itpl. It was only needed in one place. It
4334 * Removed dependency on Itpl. It was only needed in one place. It
4332 would be nice if this became part of python, though. It makes life
4335 would be nice if this became part of python, though. It makes life
4333 *a lot* easier in some cases.
4336 *a lot* easier in some cases.
4334
4337
4335 * Simplified the prefilter code a bit. Now all handlers are
4338 * Simplified the prefilter code a bit. Now all handlers are
4336 expected to explicitly return a value (at least a blank string).
4339 expected to explicitly return a value (at least a blank string).
4337
4340
4338 * Heavy edits in ipplib. Removed the help system altogether. Now
4341 * Heavy edits in ipplib. Removed the help system altogether. Now
4339 obj?/?? is used for inspecting objects, a magic @doc prints
4342 obj?/?? is used for inspecting objects, a magic @doc prints
4340 docstrings, and full-blown Python help is accessed via the 'help'
4343 docstrings, and full-blown Python help is accessed via the 'help'
4341 keyword. This cleans up a lot of code (less to maintain) and does
4344 keyword. This cleans up a lot of code (less to maintain) and does
4342 the job. Since 'help' is now a standard Python component, might as
4345 the job. Since 'help' is now a standard Python component, might as
4343 well use it and remove duplicate functionality.
4346 well use it and remove duplicate functionality.
4344
4347
4345 Also removed the option to use ipplib as a standalone program. By
4348 Also removed the option to use ipplib as a standalone program. By
4346 now it's too dependent on other parts of IPython to function alone.
4349 now it's too dependent on other parts of IPython to function alone.
4347
4350
4348 * Fixed bug in genutils.pager. It would crash if the pager was
4351 * Fixed bug in genutils.pager. It would crash if the pager was
4349 exited immediately after opening (broken pipe).
4352 exited immediately after opening (broken pipe).
4350
4353
4351 * Trimmed down the VerboseTB reporting a little. The header is
4354 * Trimmed down the VerboseTB reporting a little. The header is
4352 much shorter now and the repeated exception arguments at the end
4355 much shorter now and the repeated exception arguments at the end
4353 have been removed. For interactive use the old header seemed a bit
4356 have been removed. For interactive use the old header seemed a bit
4354 excessive.
4357 excessive.
4355
4358
4356 * Fixed small bug in output of @whos for variables with multi-word
4359 * Fixed small bug in output of @whos for variables with multi-word
4357 types (only first word was displayed).
4360 types (only first word was displayed).
4358
4361
4359 2001-11-17 Fernando Perez <fperez@colorado.edu>
4362 2001-11-17 Fernando Perez <fperez@colorado.edu>
4360
4363
4361 * Version 0.1.10 released, 0.1.11 opened for further work.
4364 * Version 0.1.10 released, 0.1.11 opened for further work.
4362
4365
4363 * Modified dirs and friends. dirs now *returns* the stack (not
4366 * Modified dirs and friends. dirs now *returns* the stack (not
4364 prints), so one can manipulate it as a variable. Convenient to
4367 prints), so one can manipulate it as a variable. Convenient to
4365 travel along many directories.
4368 travel along many directories.
4366
4369
4367 * Fixed bug in magic_pdef: would only work with functions with
4370 * Fixed bug in magic_pdef: would only work with functions with
4368 arguments with default values.
4371 arguments with default values.
4369
4372
4370 2001-11-14 Fernando Perez <fperez@colorado.edu>
4373 2001-11-14 Fernando Perez <fperez@colorado.edu>
4371
4374
4372 * Added the PhysicsInput stuff to dot_ipython so it ships as an
4375 * Added the PhysicsInput stuff to dot_ipython so it ships as an
4373 example with IPython. Various other minor fixes and cleanups.
4376 example with IPython. Various other minor fixes and cleanups.
4374
4377
4375 * Version 0.1.9 released, 0.1.10 opened for further work.
4378 * Version 0.1.9 released, 0.1.10 opened for further work.
4376
4379
4377 * Added sys.path to the list of directories searched in the
4380 * Added sys.path to the list of directories searched in the
4378 execfile= option. It used to be the current directory and the
4381 execfile= option. It used to be the current directory and the
4379 user's IPYTHONDIR only.
4382 user's IPYTHONDIR only.
4380
4383
4381 2001-11-13 Fernando Perez <fperez@colorado.edu>
4384 2001-11-13 Fernando Perez <fperez@colorado.edu>
4382
4385
4383 * Reinstated the raw_input/prefilter separation that Janko had
4386 * Reinstated the raw_input/prefilter separation that Janko had
4384 initially. This gives a more convenient setup for extending the
4387 initially. This gives a more convenient setup for extending the
4385 pre-processor from the outside: raw_input always gets a string,
4388 pre-processor from the outside: raw_input always gets a string,
4386 and prefilter has to process it. We can then redefine prefilter
4389 and prefilter has to process it. We can then redefine prefilter
4387 from the outside and implement extensions for special
4390 from the outside and implement extensions for special
4388 purposes.
4391 purposes.
4389
4392
4390 Today I got one for inputting PhysicalQuantity objects
4393 Today I got one for inputting PhysicalQuantity objects
4391 (from Scientific) without needing any function calls at
4394 (from Scientific) without needing any function calls at
4392 all. Extremely convenient, and it's all done as a user-level
4395 all. Extremely convenient, and it's all done as a user-level
4393 extension (no IPython code was touched). Now instead of:
4396 extension (no IPython code was touched). Now instead of:
4394 a = PhysicalQuantity(4.2,'m/s**2')
4397 a = PhysicalQuantity(4.2,'m/s**2')
4395 one can simply say
4398 one can simply say
4396 a = 4.2 m/s**2
4399 a = 4.2 m/s**2
4397 or even
4400 or even
4398 a = 4.2 m/s^2
4401 a = 4.2 m/s^2
4399
4402
4400 I use this, but it's also a proof of concept: IPython really is
4403 I use this, but it's also a proof of concept: IPython really is
4401 fully user-extensible, even at the level of the parsing of the
4404 fully user-extensible, even at the level of the parsing of the
4402 command line. It's not trivial, but it's perfectly doable.
4405 command line. It's not trivial, but it's perfectly doable.
4403
4406
4404 * Added 'add_flip' method to inclusion conflict resolver. Fixes
4407 * Added 'add_flip' method to inclusion conflict resolver. Fixes
4405 the problem of modules being loaded in the inverse order in which
4408 the problem of modules being loaded in the inverse order in which
4406 they were defined in
4409 they were defined in
4407
4410
4408 * Version 0.1.8 released, 0.1.9 opened for further work.
4411 * Version 0.1.8 released, 0.1.9 opened for further work.
4409
4412
4410 * Added magics pdef, source and file. They respectively show the
4413 * Added magics pdef, source and file. They respectively show the
4411 definition line ('prototype' in C), source code and full python
4414 definition line ('prototype' in C), source code and full python
4412 file for any callable object. The object inspector oinfo uses
4415 file for any callable object. The object inspector oinfo uses
4413 these to show the same information.
4416 these to show the same information.
4414
4417
4415 * Version 0.1.7 released, 0.1.8 opened for further work.
4418 * Version 0.1.7 released, 0.1.8 opened for further work.
4416
4419
4417 * Separated all the magic functions into a class called Magic. The
4420 * Separated all the magic functions into a class called Magic. The
4418 InteractiveShell class was becoming too big for Xemacs to handle
4421 InteractiveShell class was becoming too big for Xemacs to handle
4419 (de-indenting a line would lock it up for 10 seconds while it
4422 (de-indenting a line would lock it up for 10 seconds while it
4420 backtracked on the whole class!)
4423 backtracked on the whole class!)
4421
4424
4422 FIXME: didn't work. It can be done, but right now namespaces are
4425 FIXME: didn't work. It can be done, but right now namespaces are
4423 all messed up. Do it later (reverted it for now, so at least
4426 all messed up. Do it later (reverted it for now, so at least
4424 everything works as before).
4427 everything works as before).
4425
4428
4426 * Got the object introspection system (magic_oinfo) working! I
4429 * Got the object introspection system (magic_oinfo) working! I
4427 think this is pretty much ready for release to Janko, so he can
4430 think this is pretty much ready for release to Janko, so he can
4428 test it for a while and then announce it. Pretty much 100% of what
4431 test it for a while and then announce it. Pretty much 100% of what
4429 I wanted for the 'phase 1' release is ready. Happy, tired.
4432 I wanted for the 'phase 1' release is ready. Happy, tired.
4430
4433
4431 2001-11-12 Fernando Perez <fperez@colorado.edu>
4434 2001-11-12 Fernando Perez <fperez@colorado.edu>
4432
4435
4433 * Version 0.1.6 released, 0.1.7 opened for further work.
4436 * Version 0.1.6 released, 0.1.7 opened for further work.
4434
4437
4435 * Fixed bug in printing: it used to test for truth before
4438 * Fixed bug in printing: it used to test for truth before
4436 printing, so 0 wouldn't print. Now checks for None.
4439 printing, so 0 wouldn't print. Now checks for None.
4437
4440
4438 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
4441 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
4439 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
4442 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
4440 reaches by hand into the outputcache. Think of a better way to do
4443 reaches by hand into the outputcache. Think of a better way to do
4441 this later.
4444 this later.
4442
4445
4443 * Various small fixes thanks to Nathan's comments.
4446 * Various small fixes thanks to Nathan's comments.
4444
4447
4445 * Changed magic_pprint to magic_Pprint. This way it doesn't
4448 * Changed magic_pprint to magic_Pprint. This way it doesn't
4446 collide with pprint() and the name is consistent with the command
4449 collide with pprint() and the name is consistent with the command
4447 line option.
4450 line option.
4448
4451
4449 * Changed prompt counter behavior to be fully like
4452 * Changed prompt counter behavior to be fully like
4450 Mathematica's. That is, even input that doesn't return a result
4453 Mathematica's. That is, even input that doesn't return a result
4451 raises the prompt counter. The old behavior was kind of confusing
4454 raises the prompt counter. The old behavior was kind of confusing
4452 (getting the same prompt number several times if the operation
4455 (getting the same prompt number several times if the operation
4453 didn't return a result).
4456 didn't return a result).
4454
4457
4455 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
4458 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
4456
4459
4457 * Fixed -Classic mode (wasn't working anymore).
4460 * Fixed -Classic mode (wasn't working anymore).
4458
4461
4459 * Added colored prompts using Nathan's new code. Colors are
4462 * Added colored prompts using Nathan's new code. Colors are
4460 currently hardwired, they can be user-configurable. For
4463 currently hardwired, they can be user-configurable. For
4461 developers, they can be chosen in file ipythonlib.py, at the
4464 developers, they can be chosen in file ipythonlib.py, at the
4462 beginning of the CachedOutput class def.
4465 beginning of the CachedOutput class def.
4463
4466
4464 2001-11-11 Fernando Perez <fperez@colorado.edu>
4467 2001-11-11 Fernando Perez <fperez@colorado.edu>
4465
4468
4466 * Version 0.1.5 released, 0.1.6 opened for further work.
4469 * Version 0.1.5 released, 0.1.6 opened for further work.
4467
4470
4468 * Changed magic_env to *return* the environment as a dict (not to
4471 * Changed magic_env to *return* the environment as a dict (not to
4469 print it). This way it prints, but it can also be processed.
4472 print it). This way it prints, but it can also be processed.
4470
4473
4471 * Added Verbose exception reporting to interactive
4474 * Added Verbose exception reporting to interactive
4472 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
4475 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
4473 traceback. Had to make some changes to the ultraTB file. This is
4476 traceback. Had to make some changes to the ultraTB file. This is
4474 probably the last 'big' thing in my mental todo list. This ties
4477 probably the last 'big' thing in my mental todo list. This ties
4475 in with the next entry:
4478 in with the next entry:
4476
4479
4477 * Changed -Xi and -Xf to a single -xmode option. Now all the user
4480 * Changed -Xi and -Xf to a single -xmode option. Now all the user
4478 has to specify is Plain, Color or Verbose for all exception
4481 has to specify is Plain, Color or Verbose for all exception
4479 handling.
4482 handling.
4480
4483
4481 * Removed ShellServices option. All this can really be done via
4484 * Removed ShellServices option. All this can really be done via
4482 the magic system. It's easier to extend, cleaner and has automatic
4485 the magic system. It's easier to extend, cleaner and has automatic
4483 namespace protection and documentation.
4486 namespace protection and documentation.
4484
4487
4485 2001-11-09 Fernando Perez <fperez@colorado.edu>
4488 2001-11-09 Fernando Perez <fperez@colorado.edu>
4486
4489
4487 * Fixed bug in output cache flushing (missing parameter to
4490 * Fixed bug in output cache flushing (missing parameter to
4488 __init__). Other small bugs fixed (found using pychecker).
4491 __init__). Other small bugs fixed (found using pychecker).
4489
4492
4490 * Version 0.1.4 opened for bugfixing.
4493 * Version 0.1.4 opened for bugfixing.
4491
4494
4492 2001-11-07 Fernando Perez <fperez@colorado.edu>
4495 2001-11-07 Fernando Perez <fperez@colorado.edu>
4493
4496
4494 * Version 0.1.3 released, mainly because of the raw_input bug.
4497 * Version 0.1.3 released, mainly because of the raw_input bug.
4495
4498
4496 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
4499 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
4497 and when testing for whether things were callable, a call could
4500 and when testing for whether things were callable, a call could
4498 actually be made to certain functions. They would get called again
4501 actually be made to certain functions. They would get called again
4499 once 'really' executed, with a resulting double call. A disaster
4502 once 'really' executed, with a resulting double call. A disaster
4500 in many cases (list.reverse() would never work!).
4503 in many cases (list.reverse() would never work!).
4501
4504
4502 * Removed prefilter() function, moved its code to raw_input (which
4505 * Removed prefilter() function, moved its code to raw_input (which
4503 after all was just a near-empty caller for prefilter). This saves
4506 after all was just a near-empty caller for prefilter). This saves
4504 a function call on every prompt, and simplifies the class a tiny bit.
4507 a function call on every prompt, and simplifies the class a tiny bit.
4505
4508
4506 * Fix _ip to __ip name in magic example file.
4509 * Fix _ip to __ip name in magic example file.
4507
4510
4508 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
4511 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
4509 work with non-gnu versions of tar.
4512 work with non-gnu versions of tar.
4510
4513
4511 2001-11-06 Fernando Perez <fperez@colorado.edu>
4514 2001-11-06 Fernando Perez <fperez@colorado.edu>
4512
4515
4513 * Version 0.1.2. Just to keep track of the recent changes.
4516 * Version 0.1.2. Just to keep track of the recent changes.
4514
4517
4515 * Fixed nasty bug in output prompt routine. It used to check 'if
4518 * Fixed nasty bug in output prompt routine. It used to check 'if
4516 arg != None...'. Problem is, this fails if arg implements a
4519 arg != None...'. Problem is, this fails if arg implements a
4517 special comparison (__cmp__) which disallows comparing to
4520 special comparison (__cmp__) which disallows comparing to
4518 None. Found it when trying to use the PhysicalQuantity module from
4521 None. Found it when trying to use the PhysicalQuantity module from
4519 ScientificPython.
4522 ScientificPython.
4520
4523
4521 2001-11-05 Fernando Perez <fperez@colorado.edu>
4524 2001-11-05 Fernando Perez <fperez@colorado.edu>
4522
4525
4523 * Also added dirs. Now the pushd/popd/dirs family functions
4526 * Also added dirs. Now the pushd/popd/dirs family functions
4524 basically like the shell, with the added convenience of going home
4527 basically like the shell, with the added convenience of going home
4525 when called with no args.
4528 when called with no args.
4526
4529
4527 * pushd/popd slightly modified to mimic shell behavior more
4530 * pushd/popd slightly modified to mimic shell behavior more
4528 closely.
4531 closely.
4529
4532
4530 * Added env,pushd,popd from ShellServices as magic functions. I
4533 * Added env,pushd,popd from ShellServices as magic functions. I
4531 think the cleanest will be to port all desired functions from
4534 think the cleanest will be to port all desired functions from
4532 ShellServices as magics and remove ShellServices altogether. This
4535 ShellServices as magics and remove ShellServices altogether. This
4533 will provide a single, clean way of adding functionality
4536 will provide a single, clean way of adding functionality
4534 (shell-type or otherwise) to IP.
4537 (shell-type or otherwise) to IP.
4535
4538
4536 2001-11-04 Fernando Perez <fperez@colorado.edu>
4539 2001-11-04 Fernando Perez <fperez@colorado.edu>
4537
4540
4538 * Added .ipython/ directory to sys.path. This way users can keep
4541 * Added .ipython/ directory to sys.path. This way users can keep
4539 customizations there and access them via import.
4542 customizations there and access them via import.
4540
4543
4541 2001-11-03 Fernando Perez <fperez@colorado.edu>
4544 2001-11-03 Fernando Perez <fperez@colorado.edu>
4542
4545
4543 * Opened version 0.1.1 for new changes.
4546 * Opened version 0.1.1 for new changes.
4544
4547
4545 * Changed version number to 0.1.0: first 'public' release, sent to
4548 * Changed version number to 0.1.0: first 'public' release, sent to
4546 Nathan and Janko.
4549 Nathan and Janko.
4547
4550
4548 * Lots of small fixes and tweaks.
4551 * Lots of small fixes and tweaks.
4549
4552
4550 * Minor changes to whos format. Now strings are shown, snipped if
4553 * Minor changes to whos format. Now strings are shown, snipped if
4551 too long.
4554 too long.
4552
4555
4553 * Changed ShellServices to work on __main__ so they show up in @who
4556 * Changed ShellServices to work on __main__ so they show up in @who
4554
4557
4555 * Help also works with ? at the end of a line:
4558 * Help also works with ? at the end of a line:
4556 ?sin and sin?
4559 ?sin and sin?
4557 both produce the same effect. This is nice, as often I use the
4560 both produce the same effect. This is nice, as often I use the
4558 tab-complete to find the name of a method, but I used to then have
4561 tab-complete to find the name of a method, but I used to then have
4559 to go to the beginning of the line to put a ? if I wanted more
4562 to go to the beginning of the line to put a ? if I wanted more
4560 info. Now I can just add the ? and hit return. Convenient.
4563 info. Now I can just add the ? and hit return. Convenient.
4561
4564
4562 2001-11-02 Fernando Perez <fperez@colorado.edu>
4565 2001-11-02 Fernando Perez <fperez@colorado.edu>
4563
4566
4564 * Python version check (>=2.1) added.
4567 * Python version check (>=2.1) added.
4565
4568
4566 * Added LazyPython documentation. At this point the docs are quite
4569 * Added LazyPython documentation. At this point the docs are quite
4567 a mess. A cleanup is in order.
4570 a mess. A cleanup is in order.
4568
4571
4569 * Auto-installer created. For some bizarre reason, the zipfiles
4572 * Auto-installer created. For some bizarre reason, the zipfiles
4570 module isn't working on my system. So I made a tar version
4573 module isn't working on my system. So I made a tar version
4571 (hopefully the command line options in various systems won't kill
4574 (hopefully the command line options in various systems won't kill
4572 me).
4575 me).
4573
4576
4574 * Fixes to Struct in genutils. Now all dictionary-like methods are
4577 * Fixes to Struct in genutils. Now all dictionary-like methods are
4575 protected (reasonably).
4578 protected (reasonably).
4576
4579
4577 * Added pager function to genutils and changed ? to print usage
4580 * Added pager function to genutils and changed ? to print usage
4578 note through it (it was too long).
4581 note through it (it was too long).
4579
4582
4580 * Added the LazyPython functionality. Works great! I changed the
4583 * Added the LazyPython functionality. Works great! I changed the
4581 auto-quote escape to ';', it's on home row and next to '. But
4584 auto-quote escape to ';', it's on home row and next to '. But
4582 both auto-quote and auto-paren (still /) escapes are command-line
4585 both auto-quote and auto-paren (still /) escapes are command-line
4583 parameters.
4586 parameters.
4584
4587
4585
4588
4586 2001-11-01 Fernando Perez <fperez@colorado.edu>
4589 2001-11-01 Fernando Perez <fperez@colorado.edu>
4587
4590
4588 * Version changed to 0.0.7. Fairly large change: configuration now
4591 * Version changed to 0.0.7. Fairly large change: configuration now
4589 is all stored in a directory, by default .ipython. There, all
4592 is all stored in a directory, by default .ipython. There, all
4590 config files have normal looking names (not .names)
4593 config files have normal looking names (not .names)
4591
4594
4592 * Version 0.0.6 Released first to Lucas and Archie as a test
4595 * Version 0.0.6 Released first to Lucas and Archie as a test
4593 run. Since it's the first 'semi-public' release, change version to
4596 run. Since it's the first 'semi-public' release, change version to
4594 > 0.0.6 for any changes now.
4597 > 0.0.6 for any changes now.
4595
4598
4596 * Stuff I had put in the ipplib.py changelog:
4599 * Stuff I had put in the ipplib.py changelog:
4597
4600
4598 Changes to InteractiveShell:
4601 Changes to InteractiveShell:
4599
4602
4600 - Made the usage message a parameter.
4603 - Made the usage message a parameter.
4601
4604
4602 - Require the name of the shell variable to be given. It's a bit
4605 - Require the name of the shell variable to be given. It's a bit
4603 of a hack, but allows the name 'shell' not to be hardwire in the
4606 of a hack, but allows the name 'shell' not to be hardwire in the
4604 magic (@) handler, which is problematic b/c it requires
4607 magic (@) handler, which is problematic b/c it requires
4605 polluting the global namespace with 'shell'. This in turn is
4608 polluting the global namespace with 'shell'. This in turn is
4606 fragile: if a user redefines a variable called shell, things
4609 fragile: if a user redefines a variable called shell, things
4607 break.
4610 break.
4608
4611
4609 - magic @: all functions available through @ need to be defined
4612 - magic @: all functions available through @ need to be defined
4610 as magic_<name>, even though they can be called simply as
4613 as magic_<name>, even though they can be called simply as
4611 @<name>. This allows the special command @magic to gather
4614 @<name>. This allows the special command @magic to gather
4612 information automatically about all existing magic functions,
4615 information automatically about all existing magic functions,
4613 even if they are run-time user extensions, by parsing the shell
4616 even if they are run-time user extensions, by parsing the shell
4614 instance __dict__ looking for special magic_ names.
4617 instance __dict__ looking for special magic_ names.
4615
4618
4616 - mainloop: added *two* local namespace parameters. This allows
4619 - mainloop: added *two* local namespace parameters. This allows
4617 the class to differentiate between parameters which were there
4620 the class to differentiate between parameters which were there
4618 before and after command line initialization was processed. This
4621 before and after command line initialization was processed. This
4619 way, later @who can show things loaded at startup by the
4622 way, later @who can show things loaded at startup by the
4620 user. This trick was necessary to make session saving/reloading
4623 user. This trick was necessary to make session saving/reloading
4621 really work: ideally after saving/exiting/reloading a session,
4624 really work: ideally after saving/exiting/reloading a session,
4622 *everythin* should look the same, including the output of @who. I
4625 *everythin* should look the same, including the output of @who. I
4623 was only able to make this work with this double namespace
4626 was only able to make this work with this double namespace
4624 trick.
4627 trick.
4625
4628
4626 - added a header to the logfile which allows (almost) full
4629 - added a header to the logfile which allows (almost) full
4627 session restoring.
4630 session restoring.
4628
4631
4629 - prepend lines beginning with @ or !, with a and log
4632 - prepend lines beginning with @ or !, with a and log
4630 them. Why? !lines: may be useful to know what you did @lines:
4633 them. Why? !lines: may be useful to know what you did @lines:
4631 they may affect session state. So when restoring a session, at
4634 they may affect session state. So when restoring a session, at
4632 least inform the user of their presence. I couldn't quite get
4635 least inform the user of their presence. I couldn't quite get
4633 them to properly re-execute, but at least the user is warned.
4636 them to properly re-execute, but at least the user is warned.
4634
4637
4635 * Started ChangeLog.
4638 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now