##// END OF EJS Templates
%time allows IPython syntax
vivainio -
Show More
@@ -1,3013 +1,3016 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Magic functions for InteractiveShell.
2 """Magic functions for InteractiveShell.
3
3
4 $Id: Magic.py 2675 2007-08-27 17:51:15Z vivainio $"""
4 $Id: Magic.py 2705 2007-09-04 15:10:37Z vivainio $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
8 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
8 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
9 #
9 #
10 # Distributed under the terms of the BSD License. The full license is in
10 # Distributed under the terms of the BSD License. The full license is in
11 # the file COPYING, distributed as part of this software.
11 # the file COPYING, distributed as part of this software.
12 #*****************************************************************************
12 #*****************************************************************************
13
13
14 #****************************************************************************
14 #****************************************************************************
15 # Modules and globals
15 # Modules and globals
16
16
17 from IPython import Release
17 from IPython import Release
18 __author__ = '%s <%s>\n%s <%s>' % \
18 __author__ = '%s <%s>\n%s <%s>' % \
19 ( Release.authors['Janko'] + Release.authors['Fernando'] )
19 ( Release.authors['Janko'] + Release.authors['Fernando'] )
20 __license__ = Release.license
20 __license__ = Release.license
21
21
22 # Python standard modules
22 # Python standard modules
23 import __builtin__
23 import __builtin__
24 import bdb
24 import bdb
25 import inspect
25 import inspect
26 import os
26 import os
27 import pdb
27 import pdb
28 import pydoc
28 import pydoc
29 import sys
29 import sys
30 import re
30 import re
31 import tempfile
31 import tempfile
32 import time
32 import time
33 import cPickle as pickle
33 import cPickle as pickle
34 import textwrap
34 import textwrap
35 from cStringIO import StringIO
35 from cStringIO import StringIO
36 from getopt import getopt,GetoptError
36 from getopt import getopt,GetoptError
37 from pprint import pprint, pformat
37 from pprint import pprint, pformat
38 from sets import Set
38 from sets import Set
39
39
40 # cProfile was added in Python2.5
40 # cProfile was added in Python2.5
41 try:
41 try:
42 import cProfile as profile
42 import cProfile as profile
43 import pstats
43 import pstats
44 except ImportError:
44 except ImportError:
45 # profile isn't bundled by default in Debian for license reasons
45 # profile isn't bundled by default in Debian for license reasons
46 try:
46 try:
47 import profile,pstats
47 import profile,pstats
48 except ImportError:
48 except ImportError:
49 profile = pstats = None
49 profile = pstats = None
50
50
51 # Homebrewed
51 # Homebrewed
52 import IPython
52 import IPython
53 from IPython import Debugger, OInspect, wildcard
53 from IPython import Debugger, OInspect, wildcard
54 from IPython.FakeModule import FakeModule
54 from IPython.FakeModule import FakeModule
55 from IPython.Itpl import Itpl, itpl, printpl,itplns
55 from IPython.Itpl import Itpl, itpl, printpl,itplns
56 from IPython.PyColorize import Parser
56 from IPython.PyColorize import Parser
57 from IPython.ipstruct import Struct
57 from IPython.ipstruct import Struct
58 from IPython.macro import Macro
58 from IPython.macro import Macro
59 from IPython.genutils import *
59 from IPython.genutils import *
60 from IPython import platutils
60 from IPython import platutils
61 import IPython.generics
61 import IPython.generics
62 import IPython.ipapi
62 import IPython.ipapi
63
63
64 #***************************************************************************
64 #***************************************************************************
65 # Utility functions
65 # Utility functions
66 def on_off(tag):
66 def on_off(tag):
67 """Return an ON/OFF string for a 1/0 input. Simple utility function."""
67 """Return an ON/OFF string for a 1/0 input. Simple utility function."""
68 return ['OFF','ON'][tag]
68 return ['OFF','ON'][tag]
69
69
70 class Bunch: pass
70 class Bunch: pass
71
71
72 def compress_dhist(dh):
72 def compress_dhist(dh):
73 head, tail = dh[:-10], dh[-10:]
73 head, tail = dh[:-10], dh[-10:]
74
74
75 newhead = []
75 newhead = []
76 done = Set()
76 done = Set()
77 for h in head:
77 for h in head:
78 if h in done:
78 if h in done:
79 continue
79 continue
80 newhead.append(h)
80 newhead.append(h)
81 done.add(h)
81 done.add(h)
82
82
83 return newhead + tail
83 return newhead + tail
84
84
85
85
86 #***************************************************************************
86 #***************************************************************************
87 # Main class implementing Magic functionality
87 # Main class implementing Magic functionality
88 class Magic:
88 class Magic:
89 """Magic functions for InteractiveShell.
89 """Magic functions for InteractiveShell.
90
90
91 Shell functions which can be reached as %function_name. All magic
91 Shell functions which can be reached as %function_name. All magic
92 functions should accept a string, which they can parse for their own
92 functions should accept a string, which they can parse for their own
93 needs. This can make some functions easier to type, eg `%cd ../`
93 needs. This can make some functions easier to type, eg `%cd ../`
94 vs. `%cd("../")`
94 vs. `%cd("../")`
95
95
96 ALL definitions MUST begin with the prefix magic_. The user won't need it
96 ALL definitions MUST begin with the prefix magic_. The user won't need it
97 at the command line, but it is is needed in the definition. """
97 at the command line, but it is is needed in the definition. """
98
98
99 # class globals
99 # class globals
100 auto_status = ['Automagic is OFF, % prefix IS needed for magic functions.',
100 auto_status = ['Automagic is OFF, % prefix IS needed for magic functions.',
101 'Automagic is ON, % prefix NOT needed for magic functions.']
101 'Automagic is ON, % prefix NOT needed for magic functions.']
102
102
103 #......................................................................
103 #......................................................................
104 # some utility functions
104 # some utility functions
105
105
106 def __init__(self,shell):
106 def __init__(self,shell):
107
107
108 self.options_table = {}
108 self.options_table = {}
109 if profile is None:
109 if profile is None:
110 self.magic_prun = self.profile_missing_notice
110 self.magic_prun = self.profile_missing_notice
111 self.shell = shell
111 self.shell = shell
112
112
113 # namespace for holding state we may need
113 # namespace for holding state we may need
114 self._magic_state = Bunch()
114 self._magic_state = Bunch()
115
115
116 def profile_missing_notice(self, *args, **kwargs):
116 def profile_missing_notice(self, *args, **kwargs):
117 error("""\
117 error("""\
118 The profile module could not be found. If you are a Debian user,
118 The profile module could not be found. If you are a Debian user,
119 it has been removed from the standard Debian package because of its non-free
119 it has been removed from the standard Debian package because of its non-free
120 license. To use profiling, please install"python2.3-profiler" from non-free.""")
120 license. To use profiling, please install"python2.3-profiler" from non-free.""")
121
121
122 def default_option(self,fn,optstr):
122 def default_option(self,fn,optstr):
123 """Make an entry in the options_table for fn, with value optstr"""
123 """Make an entry in the options_table for fn, with value optstr"""
124
124
125 if fn not in self.lsmagic():
125 if fn not in self.lsmagic():
126 error("%s is not a magic function" % fn)
126 error("%s is not a magic function" % fn)
127 self.options_table[fn] = optstr
127 self.options_table[fn] = optstr
128
128
129 def lsmagic(self):
129 def lsmagic(self):
130 """Return a list of currently available magic functions.
130 """Return a list of currently available magic functions.
131
131
132 Gives a list of the bare names after mangling (['ls','cd', ...], not
132 Gives a list of the bare names after mangling (['ls','cd', ...], not
133 ['magic_ls','magic_cd',...]"""
133 ['magic_ls','magic_cd',...]"""
134
134
135 # FIXME. This needs a cleanup, in the way the magics list is built.
135 # FIXME. This needs a cleanup, in the way the magics list is built.
136
136
137 # magics in class definition
137 # magics in class definition
138 class_magic = lambda fn: fn.startswith('magic_') and \
138 class_magic = lambda fn: fn.startswith('magic_') and \
139 callable(Magic.__dict__[fn])
139 callable(Magic.__dict__[fn])
140 # in instance namespace (run-time user additions)
140 # in instance namespace (run-time user additions)
141 inst_magic = lambda fn: fn.startswith('magic_') and \
141 inst_magic = lambda fn: fn.startswith('magic_') and \
142 callable(self.__dict__[fn])
142 callable(self.__dict__[fn])
143 # and bound magics by user (so they can access self):
143 # and bound magics by user (so they can access self):
144 inst_bound_magic = lambda fn: fn.startswith('magic_') and \
144 inst_bound_magic = lambda fn: fn.startswith('magic_') and \
145 callable(self.__class__.__dict__[fn])
145 callable(self.__class__.__dict__[fn])
146 magics = filter(class_magic,Magic.__dict__.keys()) + \
146 magics = filter(class_magic,Magic.__dict__.keys()) + \
147 filter(inst_magic,self.__dict__.keys()) + \
147 filter(inst_magic,self.__dict__.keys()) + \
148 filter(inst_bound_magic,self.__class__.__dict__.keys())
148 filter(inst_bound_magic,self.__class__.__dict__.keys())
149 out = []
149 out = []
150 for fn in magics:
150 for fn in magics:
151 out.append(fn.replace('magic_','',1))
151 out.append(fn.replace('magic_','',1))
152 out.sort()
152 out.sort()
153 return out
153 return out
154
154
155 def extract_input_slices(self,slices,raw=False):
155 def extract_input_slices(self,slices,raw=False):
156 """Return as a string a set of input history slices.
156 """Return as a string a set of input history slices.
157
157
158 Inputs:
158 Inputs:
159
159
160 - slices: the set of slices is given as a list of strings (like
160 - slices: the set of slices is given as a list of strings (like
161 ['1','4:8','9'], since this function is for use by magic functions
161 ['1','4:8','9'], since this function is for use by magic functions
162 which get their arguments as strings.
162 which get their arguments as strings.
163
163
164 Optional inputs:
164 Optional inputs:
165
165
166 - raw(False): by default, the processed input is used. If this is
166 - raw(False): by default, the processed input is used. If this is
167 true, the raw input history is used instead.
167 true, the raw input history is used instead.
168
168
169 Note that slices can be called with two notations:
169 Note that slices can be called with two notations:
170
170
171 N:M -> standard python form, means including items N...(M-1).
171 N:M -> standard python form, means including items N...(M-1).
172
172
173 N-M -> include items N..M (closed endpoint)."""
173 N-M -> include items N..M (closed endpoint)."""
174
174
175 if raw:
175 if raw:
176 hist = self.shell.input_hist_raw
176 hist = self.shell.input_hist_raw
177 else:
177 else:
178 hist = self.shell.input_hist
178 hist = self.shell.input_hist
179
179
180 cmds = []
180 cmds = []
181 for chunk in slices:
181 for chunk in slices:
182 if ':' in chunk:
182 if ':' in chunk:
183 ini,fin = map(int,chunk.split(':'))
183 ini,fin = map(int,chunk.split(':'))
184 elif '-' in chunk:
184 elif '-' in chunk:
185 ini,fin = map(int,chunk.split('-'))
185 ini,fin = map(int,chunk.split('-'))
186 fin += 1
186 fin += 1
187 else:
187 else:
188 ini = int(chunk)
188 ini = int(chunk)
189 fin = ini+1
189 fin = ini+1
190 cmds.append(hist[ini:fin])
190 cmds.append(hist[ini:fin])
191 return cmds
191 return cmds
192
192
193 def _ofind(self, oname, namespaces=None):
193 def _ofind(self, oname, namespaces=None):
194 """Find an object in the available namespaces.
194 """Find an object in the available namespaces.
195
195
196 self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic
196 self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic
197
197
198 Has special code to detect magic functions.
198 Has special code to detect magic functions.
199 """
199 """
200
200
201 oname = oname.strip()
201 oname = oname.strip()
202
202
203 alias_ns = None
203 alias_ns = None
204 if namespaces is None:
204 if namespaces is None:
205 # Namespaces to search in:
205 # Namespaces to search in:
206 # Put them in a list. The order is important so that we
206 # Put them in a list. The order is important so that we
207 # find things in the same order that Python finds them.
207 # find things in the same order that Python finds them.
208 namespaces = [ ('Interactive', self.shell.user_ns),
208 namespaces = [ ('Interactive', self.shell.user_ns),
209 ('IPython internal', self.shell.internal_ns),
209 ('IPython internal', self.shell.internal_ns),
210 ('Python builtin', __builtin__.__dict__),
210 ('Python builtin', __builtin__.__dict__),
211 ('Alias', self.shell.alias_table),
211 ('Alias', self.shell.alias_table),
212 ]
212 ]
213 alias_ns = self.shell.alias_table
213 alias_ns = self.shell.alias_table
214
214
215 # initialize results to 'null'
215 # initialize results to 'null'
216 found = 0; obj = None; ospace = None; ds = None;
216 found = 0; obj = None; ospace = None; ds = None;
217 ismagic = 0; isalias = 0; parent = None
217 ismagic = 0; isalias = 0; parent = None
218
218
219 # Look for the given name by splitting it in parts. If the head is
219 # Look for the given name by splitting it in parts. If the head is
220 # found, then we look for all the remaining parts as members, and only
220 # found, then we look for all the remaining parts as members, and only
221 # declare success if we can find them all.
221 # declare success if we can find them all.
222 oname_parts = oname.split('.')
222 oname_parts = oname.split('.')
223 oname_head, oname_rest = oname_parts[0],oname_parts[1:]
223 oname_head, oname_rest = oname_parts[0],oname_parts[1:]
224 for nsname,ns in namespaces:
224 for nsname,ns in namespaces:
225 try:
225 try:
226 obj = ns[oname_head]
226 obj = ns[oname_head]
227 except KeyError:
227 except KeyError:
228 continue
228 continue
229 else:
229 else:
230 #print 'oname_rest:', oname_rest # dbg
230 #print 'oname_rest:', oname_rest # dbg
231 for part in oname_rest:
231 for part in oname_rest:
232 try:
232 try:
233 parent = obj
233 parent = obj
234 obj = getattr(obj,part)
234 obj = getattr(obj,part)
235 except:
235 except:
236 # Blanket except b/c some badly implemented objects
236 # Blanket except b/c some badly implemented objects
237 # allow __getattr__ to raise exceptions other than
237 # allow __getattr__ to raise exceptions other than
238 # AttributeError, which then crashes IPython.
238 # AttributeError, which then crashes IPython.
239 break
239 break
240 else:
240 else:
241 # If we finish the for loop (no break), we got all members
241 # If we finish the for loop (no break), we got all members
242 found = 1
242 found = 1
243 ospace = nsname
243 ospace = nsname
244 if ns == alias_ns:
244 if ns == alias_ns:
245 isalias = 1
245 isalias = 1
246 break # namespace loop
246 break # namespace loop
247
247
248 # Try to see if it's magic
248 # Try to see if it's magic
249 if not found:
249 if not found:
250 if oname.startswith(self.shell.ESC_MAGIC):
250 if oname.startswith(self.shell.ESC_MAGIC):
251 oname = oname[1:]
251 oname = oname[1:]
252 obj = getattr(self,'magic_'+oname,None)
252 obj = getattr(self,'magic_'+oname,None)
253 if obj is not None:
253 if obj is not None:
254 found = 1
254 found = 1
255 ospace = 'IPython internal'
255 ospace = 'IPython internal'
256 ismagic = 1
256 ismagic = 1
257
257
258 # Last try: special-case some literals like '', [], {}, etc:
258 # Last try: special-case some literals like '', [], {}, etc:
259 if not found and oname_head in ["''",'""','[]','{}','()']:
259 if not found and oname_head in ["''",'""','[]','{}','()']:
260 obj = eval(oname_head)
260 obj = eval(oname_head)
261 found = 1
261 found = 1
262 ospace = 'Interactive'
262 ospace = 'Interactive'
263
263
264 return {'found':found, 'obj':obj, 'namespace':ospace,
264 return {'found':found, 'obj':obj, 'namespace':ospace,
265 'ismagic':ismagic, 'isalias':isalias, 'parent':parent}
265 'ismagic':ismagic, 'isalias':isalias, 'parent':parent}
266
266
267 def arg_err(self,func):
267 def arg_err(self,func):
268 """Print docstring if incorrect arguments were passed"""
268 """Print docstring if incorrect arguments were passed"""
269 print 'Error in arguments:'
269 print 'Error in arguments:'
270 print OInspect.getdoc(func)
270 print OInspect.getdoc(func)
271
271
272 def format_latex(self,strng):
272 def format_latex(self,strng):
273 """Format a string for latex inclusion."""
273 """Format a string for latex inclusion."""
274
274
275 # Characters that need to be escaped for latex:
275 # Characters that need to be escaped for latex:
276 escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE)
276 escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE)
277 # Magic command names as headers:
277 # Magic command names as headers:
278 cmd_name_re = re.compile(r'^(%s.*?):' % self.shell.ESC_MAGIC,
278 cmd_name_re = re.compile(r'^(%s.*?):' % self.shell.ESC_MAGIC,
279 re.MULTILINE)
279 re.MULTILINE)
280 # Magic commands
280 # Magic commands
281 cmd_re = re.compile(r'(?P<cmd>%s.+?\b)(?!\}\}:)' % self.shell.ESC_MAGIC,
281 cmd_re = re.compile(r'(?P<cmd>%s.+?\b)(?!\}\}:)' % self.shell.ESC_MAGIC,
282 re.MULTILINE)
282 re.MULTILINE)
283 # Paragraph continue
283 # Paragraph continue
284 par_re = re.compile(r'\\$',re.MULTILINE)
284 par_re = re.compile(r'\\$',re.MULTILINE)
285
285
286 # The "\n" symbol
286 # The "\n" symbol
287 newline_re = re.compile(r'\\n')
287 newline_re = re.compile(r'\\n')
288
288
289 # Now build the string for output:
289 # Now build the string for output:
290 #strng = cmd_name_re.sub(r'\n\\texttt{\\textsl{\\large \1}}:',strng)
290 #strng = cmd_name_re.sub(r'\n\\texttt{\\textsl{\\large \1}}:',strng)
291 strng = cmd_name_re.sub(r'\n\\bigskip\n\\texttt{\\textbf{ \1}}:',
291 strng = cmd_name_re.sub(r'\n\\bigskip\n\\texttt{\\textbf{ \1}}:',
292 strng)
292 strng)
293 strng = cmd_re.sub(r'\\texttt{\g<cmd>}',strng)
293 strng = cmd_re.sub(r'\\texttt{\g<cmd>}',strng)
294 strng = par_re.sub(r'\\\\',strng)
294 strng = par_re.sub(r'\\\\',strng)
295 strng = escape_re.sub(r'\\\1',strng)
295 strng = escape_re.sub(r'\\\1',strng)
296 strng = newline_re.sub(r'\\textbackslash{}n',strng)
296 strng = newline_re.sub(r'\\textbackslash{}n',strng)
297 return strng
297 return strng
298
298
299 def format_screen(self,strng):
299 def format_screen(self,strng):
300 """Format a string for screen printing.
300 """Format a string for screen printing.
301
301
302 This removes some latex-type format codes."""
302 This removes some latex-type format codes."""
303 # Paragraph continue
303 # Paragraph continue
304 par_re = re.compile(r'\\$',re.MULTILINE)
304 par_re = re.compile(r'\\$',re.MULTILINE)
305 strng = par_re.sub('',strng)
305 strng = par_re.sub('',strng)
306 return strng
306 return strng
307
307
308 def parse_options(self,arg_str,opt_str,*long_opts,**kw):
308 def parse_options(self,arg_str,opt_str,*long_opts,**kw):
309 """Parse options passed to an argument string.
309 """Parse options passed to an argument string.
310
310
311 The interface is similar to that of getopt(), but it returns back a
311 The interface is similar to that of getopt(), but it returns back a
312 Struct with the options as keys and the stripped argument string still
312 Struct with the options as keys and the stripped argument string still
313 as a string.
313 as a string.
314
314
315 arg_str is quoted as a true sys.argv vector by using shlex.split.
315 arg_str is quoted as a true sys.argv vector by using shlex.split.
316 This allows us to easily expand variables, glob files, quote
316 This allows us to easily expand variables, glob files, quote
317 arguments, etc.
317 arguments, etc.
318
318
319 Options:
319 Options:
320 -mode: default 'string'. If given as 'list', the argument string is
320 -mode: default 'string'. If given as 'list', the argument string is
321 returned as a list (split on whitespace) instead of a string.
321 returned as a list (split on whitespace) instead of a string.
322
322
323 -list_all: put all option values in lists. Normally only options
323 -list_all: put all option values in lists. Normally only options
324 appearing more than once are put in a list.
324 appearing more than once are put in a list.
325
325
326 -posix (True): whether to split the input line in POSIX mode or not,
326 -posix (True): whether to split the input line in POSIX mode or not,
327 as per the conventions outlined in the shlex module from the
327 as per the conventions outlined in the shlex module from the
328 standard library."""
328 standard library."""
329
329
330 # inject default options at the beginning of the input line
330 # inject default options at the beginning of the input line
331 caller = sys._getframe(1).f_code.co_name.replace('magic_','')
331 caller = sys._getframe(1).f_code.co_name.replace('magic_','')
332 arg_str = '%s %s' % (self.options_table.get(caller,''),arg_str)
332 arg_str = '%s %s' % (self.options_table.get(caller,''),arg_str)
333
333
334 mode = kw.get('mode','string')
334 mode = kw.get('mode','string')
335 if mode not in ['string','list']:
335 if mode not in ['string','list']:
336 raise ValueError,'incorrect mode given: %s' % mode
336 raise ValueError,'incorrect mode given: %s' % mode
337 # Get options
337 # Get options
338 list_all = kw.get('list_all',0)
338 list_all = kw.get('list_all',0)
339 posix = kw.get('posix',True)
339 posix = kw.get('posix',True)
340
340
341 # Check if we have more than one argument to warrant extra processing:
341 # Check if we have more than one argument to warrant extra processing:
342 odict = {} # Dictionary with options
342 odict = {} # Dictionary with options
343 args = arg_str.split()
343 args = arg_str.split()
344 if len(args) >= 1:
344 if len(args) >= 1:
345 # If the list of inputs only has 0 or 1 thing in it, there's no
345 # If the list of inputs only has 0 or 1 thing in it, there's no
346 # need to look for options
346 # need to look for options
347 argv = arg_split(arg_str,posix)
347 argv = arg_split(arg_str,posix)
348 # Do regular option processing
348 # Do regular option processing
349 try:
349 try:
350 opts,args = getopt(argv,opt_str,*long_opts)
350 opts,args = getopt(argv,opt_str,*long_opts)
351 except GetoptError,e:
351 except GetoptError,e:
352 raise GetoptError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
352 raise GetoptError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
353 " ".join(long_opts)))
353 " ".join(long_opts)))
354 for o,a in opts:
354 for o,a in opts:
355 if o.startswith('--'):
355 if o.startswith('--'):
356 o = o[2:]
356 o = o[2:]
357 else:
357 else:
358 o = o[1:]
358 o = o[1:]
359 try:
359 try:
360 odict[o].append(a)
360 odict[o].append(a)
361 except AttributeError:
361 except AttributeError:
362 odict[o] = [odict[o],a]
362 odict[o] = [odict[o],a]
363 except KeyError:
363 except KeyError:
364 if list_all:
364 if list_all:
365 odict[o] = [a]
365 odict[o] = [a]
366 else:
366 else:
367 odict[o] = a
367 odict[o] = a
368
368
369 # Prepare opts,args for return
369 # Prepare opts,args for return
370 opts = Struct(odict)
370 opts = Struct(odict)
371 if mode == 'string':
371 if mode == 'string':
372 args = ' '.join(args)
372 args = ' '.join(args)
373
373
374 return opts,args
374 return opts,args
375
375
376 #......................................................................
376 #......................................................................
377 # And now the actual magic functions
377 # And now the actual magic functions
378
378
379 # Functions for IPython shell work (vars,funcs, config, etc)
379 # Functions for IPython shell work (vars,funcs, config, etc)
380 def magic_lsmagic(self, parameter_s = ''):
380 def magic_lsmagic(self, parameter_s = ''):
381 """List currently available magic functions."""
381 """List currently available magic functions."""
382 mesc = self.shell.ESC_MAGIC
382 mesc = self.shell.ESC_MAGIC
383 print 'Available magic functions:\n'+mesc+\
383 print 'Available magic functions:\n'+mesc+\
384 (' '+mesc).join(self.lsmagic())
384 (' '+mesc).join(self.lsmagic())
385 print '\n' + Magic.auto_status[self.shell.rc.automagic]
385 print '\n' + Magic.auto_status[self.shell.rc.automagic]
386 return None
386 return None
387
387
388 def magic_magic(self, parameter_s = ''):
388 def magic_magic(self, parameter_s = ''):
389 """Print information about the magic function system."""
389 """Print information about the magic function system."""
390
390
391 mode = ''
391 mode = ''
392 try:
392 try:
393 if parameter_s.split()[0] == '-latex':
393 if parameter_s.split()[0] == '-latex':
394 mode = 'latex'
394 mode = 'latex'
395 if parameter_s.split()[0] == '-brief':
395 if parameter_s.split()[0] == '-brief':
396 mode = 'brief'
396 mode = 'brief'
397 except:
397 except:
398 pass
398 pass
399
399
400 magic_docs = []
400 magic_docs = []
401 for fname in self.lsmagic():
401 for fname in self.lsmagic():
402 mname = 'magic_' + fname
402 mname = 'magic_' + fname
403 for space in (Magic,self,self.__class__):
403 for space in (Magic,self,self.__class__):
404 try:
404 try:
405 fn = space.__dict__[mname]
405 fn = space.__dict__[mname]
406 except KeyError:
406 except KeyError:
407 pass
407 pass
408 else:
408 else:
409 break
409 break
410 if mode == 'brief':
410 if mode == 'brief':
411 # only first line
411 # only first line
412 fndoc = fn.__doc__.split('\n',1)[0]
412 fndoc = fn.__doc__.split('\n',1)[0]
413 else:
413 else:
414 fndoc = fn.__doc__
414 fndoc = fn.__doc__
415
415
416 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
416 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
417 fname,fndoc))
417 fname,fndoc))
418 magic_docs = ''.join(magic_docs)
418 magic_docs = ''.join(magic_docs)
419
419
420 if mode == 'latex':
420 if mode == 'latex':
421 print self.format_latex(magic_docs)
421 print self.format_latex(magic_docs)
422 return
422 return
423 else:
423 else:
424 magic_docs = self.format_screen(magic_docs)
424 magic_docs = self.format_screen(magic_docs)
425 if mode == 'brief':
425 if mode == 'brief':
426 return magic_docs
426 return magic_docs
427
427
428 outmsg = """
428 outmsg = """
429 IPython's 'magic' functions
429 IPython's 'magic' functions
430 ===========================
430 ===========================
431
431
432 The magic function system provides a series of functions which allow you to
432 The magic function system provides a series of functions which allow you to
433 control the behavior of IPython itself, plus a lot of system-type
433 control the behavior of IPython itself, plus a lot of system-type
434 features. All these functions are prefixed with a % character, but parameters
434 features. All these functions are prefixed with a % character, but parameters
435 are given without parentheses or quotes.
435 are given without parentheses or quotes.
436
436
437 NOTE: If you have 'automagic' enabled (via the command line option or with the
437 NOTE: If you have 'automagic' enabled (via the command line option or with the
438 %automagic function), you don't need to type in the % explicitly. By default,
438 %automagic function), you don't need to type in the % explicitly. By default,
439 IPython ships with automagic on, so you should only rarely need the % escape.
439 IPython ships with automagic on, so you should only rarely need the % escape.
440
440
441 Example: typing '%cd mydir' (without the quotes) changes you working directory
441 Example: typing '%cd mydir' (without the quotes) changes you working directory
442 to 'mydir', if it exists.
442 to 'mydir', if it exists.
443
443
444 You can define your own magic functions to extend the system. See the supplied
444 You can define your own magic functions to extend the system. See the supplied
445 ipythonrc and example-magic.py files for details (in your ipython
445 ipythonrc and example-magic.py files for details (in your ipython
446 configuration directory, typically $HOME/.ipython/).
446 configuration directory, typically $HOME/.ipython/).
447
447
448 You can also define your own aliased names for magic functions. In your
448 You can also define your own aliased names for magic functions. In your
449 ipythonrc file, placing a line like:
449 ipythonrc file, placing a line like:
450
450
451 execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
451 execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
452
452
453 will define %pf as a new name for %profile.
453 will define %pf as a new name for %profile.
454
454
455 You can also call magics in code using the ipmagic() function, which IPython
455 You can also call magics in code using the ipmagic() function, which IPython
456 automatically adds to the builtin namespace. Type 'ipmagic?' for details.
456 automatically adds to the builtin namespace. Type 'ipmagic?' for details.
457
457
458 For a list of the available magic functions, use %lsmagic. For a description
458 For a list of the available magic functions, use %lsmagic. For a description
459 of any of them, type %magic_name?, e.g. '%cd?'.
459 of any of them, type %magic_name?, e.g. '%cd?'.
460
460
461 Currently the magic system has the following functions:\n"""
461 Currently the magic system has the following functions:\n"""
462
462
463 mesc = self.shell.ESC_MAGIC
463 mesc = self.shell.ESC_MAGIC
464 outmsg = ("%s\n%s\n\nSummary of magic functions (from %slsmagic):"
464 outmsg = ("%s\n%s\n\nSummary of magic functions (from %slsmagic):"
465 "\n\n%s%s\n\n%s" % (outmsg,
465 "\n\n%s%s\n\n%s" % (outmsg,
466 magic_docs,mesc,mesc,
466 magic_docs,mesc,mesc,
467 (' '+mesc).join(self.lsmagic()),
467 (' '+mesc).join(self.lsmagic()),
468 Magic.auto_status[self.shell.rc.automagic] ) )
468 Magic.auto_status[self.shell.rc.automagic] ) )
469
469
470 page(outmsg,screen_lines=self.shell.rc.screen_length)
470 page(outmsg,screen_lines=self.shell.rc.screen_length)
471
471
472
472
473 def magic_autoindent(self, parameter_s = ''):
473 def magic_autoindent(self, parameter_s = ''):
474 """Toggle autoindent on/off (if available)."""
474 """Toggle autoindent on/off (if available)."""
475
475
476 self.shell.set_autoindent()
476 self.shell.set_autoindent()
477 print "Automatic indentation is:",['OFF','ON'][self.shell.autoindent]
477 print "Automatic indentation is:",['OFF','ON'][self.shell.autoindent]
478
478
479 def magic_system_verbose(self, parameter_s = ''):
479 def magic_system_verbose(self, parameter_s = ''):
480 """Set verbose printing of system calls.
480 """Set verbose printing of system calls.
481
481
482 If called without an argument, act as a toggle"""
482 If called without an argument, act as a toggle"""
483
483
484 if parameter_s:
484 if parameter_s:
485 val = bool(eval(parameter_s))
485 val = bool(eval(parameter_s))
486 else:
486 else:
487 val = None
487 val = None
488
488
489 self.shell.rc_set_toggle('system_verbose',val)
489 self.shell.rc_set_toggle('system_verbose',val)
490 print "System verbose printing is:",\
490 print "System verbose printing is:",\
491 ['OFF','ON'][self.shell.rc.system_verbose]
491 ['OFF','ON'][self.shell.rc.system_verbose]
492
492
493
493
494 def magic_page(self, parameter_s=''):
494 def magic_page(self, parameter_s=''):
495 """Pretty print the object and display it through a pager.
495 """Pretty print the object and display it through a pager.
496
496
497 %page [options] OBJECT
497 %page [options] OBJECT
498
498
499 If no object is given, use _ (last output).
499 If no object is given, use _ (last output).
500
500
501 Options:
501 Options:
502
502
503 -r: page str(object), don't pretty-print it."""
503 -r: page str(object), don't pretty-print it."""
504
504
505 # After a function contributed by Olivier Aubert, slightly modified.
505 # After a function contributed by Olivier Aubert, slightly modified.
506
506
507 # Process options/args
507 # Process options/args
508 opts,args = self.parse_options(parameter_s,'r')
508 opts,args = self.parse_options(parameter_s,'r')
509 raw = 'r' in opts
509 raw = 'r' in opts
510
510
511 oname = args and args or '_'
511 oname = args and args or '_'
512 info = self._ofind(oname)
512 info = self._ofind(oname)
513 if info['found']:
513 if info['found']:
514 txt = (raw and str or pformat)( info['obj'] )
514 txt = (raw and str or pformat)( info['obj'] )
515 page(txt)
515 page(txt)
516 else:
516 else:
517 print 'Object `%s` not found' % oname
517 print 'Object `%s` not found' % oname
518
518
519 def magic_profile(self, parameter_s=''):
519 def magic_profile(self, parameter_s=''):
520 """Print your currently active IPyhton profile."""
520 """Print your currently active IPyhton profile."""
521 if self.shell.rc.profile:
521 if self.shell.rc.profile:
522 printpl('Current IPython profile: $self.shell.rc.profile.')
522 printpl('Current IPython profile: $self.shell.rc.profile.')
523 else:
523 else:
524 print 'No profile active.'
524 print 'No profile active.'
525
525
526 def magic_pinfo(self, parameter_s='', namespaces=None):
526 def magic_pinfo(self, parameter_s='', namespaces=None):
527 """Provide detailed information about an object.
527 """Provide detailed information about an object.
528
528
529 '%pinfo object' is just a synonym for object? or ?object."""
529 '%pinfo object' is just a synonym for object? or ?object."""
530
530
531 #print 'pinfo par: <%s>' % parameter_s # dbg
531 #print 'pinfo par: <%s>' % parameter_s # dbg
532
532
533
533
534 # detail_level: 0 -> obj? , 1 -> obj??
534 # detail_level: 0 -> obj? , 1 -> obj??
535 detail_level = 0
535 detail_level = 0
536 # We need to detect if we got called as 'pinfo pinfo foo', which can
536 # We need to detect if we got called as 'pinfo pinfo foo', which can
537 # happen if the user types 'pinfo foo?' at the cmd line.
537 # happen if the user types 'pinfo foo?' at the cmd line.
538 pinfo,qmark1,oname,qmark2 = \
538 pinfo,qmark1,oname,qmark2 = \
539 re.match('(pinfo )?(\?*)(.*?)(\??$)',parameter_s).groups()
539 re.match('(pinfo )?(\?*)(.*?)(\??$)',parameter_s).groups()
540 if pinfo or qmark1 or qmark2:
540 if pinfo or qmark1 or qmark2:
541 detail_level = 1
541 detail_level = 1
542 if "*" in oname:
542 if "*" in oname:
543 self.magic_psearch(oname)
543 self.magic_psearch(oname)
544 else:
544 else:
545 self._inspect('pinfo', oname, detail_level=detail_level,
545 self._inspect('pinfo', oname, detail_level=detail_level,
546 namespaces=namespaces)
546 namespaces=namespaces)
547
547
548 def _inspect(self,meth,oname,namespaces=None,**kw):
548 def _inspect(self,meth,oname,namespaces=None,**kw):
549 """Generic interface to the inspector system.
549 """Generic interface to the inspector system.
550
550
551 This function is meant to be called by pdef, pdoc & friends."""
551 This function is meant to be called by pdef, pdoc & friends."""
552
552
553 #oname = oname.strip()
553 #oname = oname.strip()
554 #print '1- oname: <%r>' % oname # dbg
554 #print '1- oname: <%r>' % oname # dbg
555 try:
555 try:
556 oname = oname.strip().encode('ascii')
556 oname = oname.strip().encode('ascii')
557 #print '2- oname: <%r>' % oname # dbg
557 #print '2- oname: <%r>' % oname # dbg
558 except UnicodeEncodeError:
558 except UnicodeEncodeError:
559 print 'Python identifiers can only contain ascii characters.'
559 print 'Python identifiers can only contain ascii characters.'
560 return 'not found'
560 return 'not found'
561
561
562 info = Struct(self._ofind(oname, namespaces))
562 info = Struct(self._ofind(oname, namespaces))
563
563
564 if info.found:
564 if info.found:
565 try:
565 try:
566 IPython.generics.inspect_object(info.obj)
566 IPython.generics.inspect_object(info.obj)
567 return
567 return
568 except IPython.ipapi.TryNext:
568 except IPython.ipapi.TryNext:
569 pass
569 pass
570 # Get the docstring of the class property if it exists.
570 # Get the docstring of the class property if it exists.
571 path = oname.split('.')
571 path = oname.split('.')
572 root = '.'.join(path[:-1])
572 root = '.'.join(path[:-1])
573 if info.parent is not None:
573 if info.parent is not None:
574 try:
574 try:
575 target = getattr(info.parent, '__class__')
575 target = getattr(info.parent, '__class__')
576 # The object belongs to a class instance.
576 # The object belongs to a class instance.
577 try:
577 try:
578 target = getattr(target, path[-1])
578 target = getattr(target, path[-1])
579 # The class defines the object.
579 # The class defines the object.
580 if isinstance(target, property):
580 if isinstance(target, property):
581 oname = root + '.__class__.' + path[-1]
581 oname = root + '.__class__.' + path[-1]
582 info = Struct(self._ofind(oname))
582 info = Struct(self._ofind(oname))
583 except AttributeError: pass
583 except AttributeError: pass
584 except AttributeError: pass
584 except AttributeError: pass
585
585
586 pmethod = getattr(self.shell.inspector,meth)
586 pmethod = getattr(self.shell.inspector,meth)
587 formatter = info.ismagic and self.format_screen or None
587 formatter = info.ismagic and self.format_screen or None
588 if meth == 'pdoc':
588 if meth == 'pdoc':
589 pmethod(info.obj,oname,formatter)
589 pmethod(info.obj,oname,formatter)
590 elif meth == 'pinfo':
590 elif meth == 'pinfo':
591 pmethod(info.obj,oname,formatter,info,**kw)
591 pmethod(info.obj,oname,formatter,info,**kw)
592 else:
592 else:
593 pmethod(info.obj,oname)
593 pmethod(info.obj,oname)
594 else:
594 else:
595 print 'Object `%s` not found.' % oname
595 print 'Object `%s` not found.' % oname
596 return 'not found' # so callers can take other action
596 return 'not found' # so callers can take other action
597
597
598 def magic_psearch(self, parameter_s=''):
598 def magic_psearch(self, parameter_s=''):
599 """Search for object in namespaces by wildcard.
599 """Search for object in namespaces by wildcard.
600
600
601 %psearch [options] PATTERN [OBJECT TYPE]
601 %psearch [options] PATTERN [OBJECT TYPE]
602
602
603 Note: ? can be used as a synonym for %psearch, at the beginning or at
603 Note: ? can be used as a synonym for %psearch, at the beginning or at
604 the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the
604 the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the
605 rest of the command line must be unchanged (options come first), so
605 rest of the command line must be unchanged (options come first), so
606 for example the following forms are equivalent
606 for example the following forms are equivalent
607
607
608 %psearch -i a* function
608 %psearch -i a* function
609 -i a* function?
609 -i a* function?
610 ?-i a* function
610 ?-i a* function
611
611
612 Arguments:
612 Arguments:
613
613
614 PATTERN
614 PATTERN
615
615
616 where PATTERN is a string containing * as a wildcard similar to its
616 where PATTERN is a string containing * as a wildcard similar to its
617 use in a shell. The pattern is matched in all namespaces on the
617 use in a shell. The pattern is matched in all namespaces on the
618 search path. By default objects starting with a single _ are not
618 search path. By default objects starting with a single _ are not
619 matched, many IPython generated objects have a single
619 matched, many IPython generated objects have a single
620 underscore. The default is case insensitive matching. Matching is
620 underscore. The default is case insensitive matching. Matching is
621 also done on the attributes of objects and not only on the objects
621 also done on the attributes of objects and not only on the objects
622 in a module.
622 in a module.
623
623
624 [OBJECT TYPE]
624 [OBJECT TYPE]
625
625
626 Is the name of a python type from the types module. The name is
626 Is the name of a python type from the types module. The name is
627 given in lowercase without the ending type, ex. StringType is
627 given in lowercase without the ending type, ex. StringType is
628 written string. By adding a type here only objects matching the
628 written string. By adding a type here only objects matching the
629 given type are matched. Using all here makes the pattern match all
629 given type are matched. Using all here makes the pattern match all
630 types (this is the default).
630 types (this is the default).
631
631
632 Options:
632 Options:
633
633
634 -a: makes the pattern match even objects whose names start with a
634 -a: makes the pattern match even objects whose names start with a
635 single underscore. These names are normally ommitted from the
635 single underscore. These names are normally ommitted from the
636 search.
636 search.
637
637
638 -i/-c: make the pattern case insensitive/sensitive. If neither of
638 -i/-c: make the pattern case insensitive/sensitive. If neither of
639 these options is given, the default is read from your ipythonrc
639 these options is given, the default is read from your ipythonrc
640 file. The option name which sets this value is
640 file. The option name which sets this value is
641 'wildcards_case_sensitive'. If this option is not specified in your
641 'wildcards_case_sensitive'. If this option is not specified in your
642 ipythonrc file, IPython's internal default is to do a case sensitive
642 ipythonrc file, IPython's internal default is to do a case sensitive
643 search.
643 search.
644
644
645 -e/-s NAMESPACE: exclude/search a given namespace. The pattern you
645 -e/-s NAMESPACE: exclude/search a given namespace. The pattern you
646 specifiy can be searched in any of the following namespaces:
646 specifiy can be searched in any of the following namespaces:
647 'builtin', 'user', 'user_global','internal', 'alias', where
647 'builtin', 'user', 'user_global','internal', 'alias', where
648 'builtin' and 'user' are the search defaults. Note that you should
648 'builtin' and 'user' are the search defaults. Note that you should
649 not use quotes when specifying namespaces.
649 not use quotes when specifying namespaces.
650
650
651 'Builtin' contains the python module builtin, 'user' contains all
651 'Builtin' contains the python module builtin, 'user' contains all
652 user data, 'alias' only contain the shell aliases and no python
652 user data, 'alias' only contain the shell aliases and no python
653 objects, 'internal' contains objects used by IPython. The
653 objects, 'internal' contains objects used by IPython. The
654 'user_global' namespace is only used by embedded IPython instances,
654 'user_global' namespace is only used by embedded IPython instances,
655 and it contains module-level globals. You can add namespaces to the
655 and it contains module-level globals. You can add namespaces to the
656 search with -s or exclude them with -e (these options can be given
656 search with -s or exclude them with -e (these options can be given
657 more than once).
657 more than once).
658
658
659 Examples:
659 Examples:
660
660
661 %psearch a* -> objects beginning with an a
661 %psearch a* -> objects beginning with an a
662 %psearch -e builtin a* -> objects NOT in the builtin space starting in a
662 %psearch -e builtin a* -> objects NOT in the builtin space starting in a
663 %psearch a* function -> all functions beginning with an a
663 %psearch a* function -> all functions beginning with an a
664 %psearch re.e* -> objects beginning with an e in module re
664 %psearch re.e* -> objects beginning with an e in module re
665 %psearch r*.e* -> objects that start with e in modules starting in r
665 %psearch r*.e* -> objects that start with e in modules starting in r
666 %psearch r*.* string -> all strings in modules beginning with r
666 %psearch r*.* string -> all strings in modules beginning with r
667
667
668 Case sensitve search:
668 Case sensitve search:
669
669
670 %psearch -c a* list all object beginning with lower case a
670 %psearch -c a* list all object beginning with lower case a
671
671
672 Show objects beginning with a single _:
672 Show objects beginning with a single _:
673
673
674 %psearch -a _* list objects beginning with a single underscore"""
674 %psearch -a _* list objects beginning with a single underscore"""
675 try:
675 try:
676 parameter_s = parameter_s.encode('ascii')
676 parameter_s = parameter_s.encode('ascii')
677 except UnicodeEncodeError:
677 except UnicodeEncodeError:
678 print 'Python identifiers can only contain ascii characters.'
678 print 'Python identifiers can only contain ascii characters.'
679 return
679 return
680
680
681 # default namespaces to be searched
681 # default namespaces to be searched
682 def_search = ['user','builtin']
682 def_search = ['user','builtin']
683
683
684 # Process options/args
684 # Process options/args
685 opts,args = self.parse_options(parameter_s,'cias:e:',list_all=True)
685 opts,args = self.parse_options(parameter_s,'cias:e:',list_all=True)
686 opt = opts.get
686 opt = opts.get
687 shell = self.shell
687 shell = self.shell
688 psearch = shell.inspector.psearch
688 psearch = shell.inspector.psearch
689
689
690 # select case options
690 # select case options
691 if opts.has_key('i'):
691 if opts.has_key('i'):
692 ignore_case = True
692 ignore_case = True
693 elif opts.has_key('c'):
693 elif opts.has_key('c'):
694 ignore_case = False
694 ignore_case = False
695 else:
695 else:
696 ignore_case = not shell.rc.wildcards_case_sensitive
696 ignore_case = not shell.rc.wildcards_case_sensitive
697
697
698 # Build list of namespaces to search from user options
698 # Build list of namespaces to search from user options
699 def_search.extend(opt('s',[]))
699 def_search.extend(opt('s',[]))
700 ns_exclude = ns_exclude=opt('e',[])
700 ns_exclude = ns_exclude=opt('e',[])
701 ns_search = [nm for nm in def_search if nm not in ns_exclude]
701 ns_search = [nm for nm in def_search if nm not in ns_exclude]
702
702
703 # Call the actual search
703 # Call the actual search
704 try:
704 try:
705 psearch(args,shell.ns_table,ns_search,
705 psearch(args,shell.ns_table,ns_search,
706 show_all=opt('a'),ignore_case=ignore_case)
706 show_all=opt('a'),ignore_case=ignore_case)
707 except:
707 except:
708 shell.showtraceback()
708 shell.showtraceback()
709
709
710 def magic_who_ls(self, parameter_s=''):
710 def magic_who_ls(self, parameter_s=''):
711 """Return a sorted list of all interactive variables.
711 """Return a sorted list of all interactive variables.
712
712
713 If arguments are given, only variables of types matching these
713 If arguments are given, only variables of types matching these
714 arguments are returned."""
714 arguments are returned."""
715
715
716 user_ns = self.shell.user_ns
716 user_ns = self.shell.user_ns
717 internal_ns = self.shell.internal_ns
717 internal_ns = self.shell.internal_ns
718 user_config_ns = self.shell.user_config_ns
718 user_config_ns = self.shell.user_config_ns
719 out = []
719 out = []
720 typelist = parameter_s.split()
720 typelist = parameter_s.split()
721
721
722 for i in user_ns:
722 for i in user_ns:
723 if not (i.startswith('_') or i.startswith('_i')) \
723 if not (i.startswith('_') or i.startswith('_i')) \
724 and not (i in internal_ns or i in user_config_ns):
724 and not (i in internal_ns or i in user_config_ns):
725 if typelist:
725 if typelist:
726 if type(user_ns[i]).__name__ in typelist:
726 if type(user_ns[i]).__name__ in typelist:
727 out.append(i)
727 out.append(i)
728 else:
728 else:
729 out.append(i)
729 out.append(i)
730 out.sort()
730 out.sort()
731 return out
731 return out
732
732
733 def magic_who(self, parameter_s=''):
733 def magic_who(self, parameter_s=''):
734 """Print all interactive variables, with some minimal formatting.
734 """Print all interactive variables, with some minimal formatting.
735
735
736 If any arguments are given, only variables whose type matches one of
736 If any arguments are given, only variables whose type matches one of
737 these are printed. For example:
737 these are printed. For example:
738
738
739 %who function str
739 %who function str
740
740
741 will only list functions and strings, excluding all other types of
741 will only list functions and strings, excluding all other types of
742 variables. To find the proper type names, simply use type(var) at a
742 variables. To find the proper type names, simply use type(var) at a
743 command line to see how python prints type names. For example:
743 command line to see how python prints type names. For example:
744
744
745 In [1]: type('hello')\\
745 In [1]: type('hello')\\
746 Out[1]: <type 'str'>
746 Out[1]: <type 'str'>
747
747
748 indicates that the type name for strings is 'str'.
748 indicates that the type name for strings is 'str'.
749
749
750 %who always excludes executed names loaded through your configuration
750 %who always excludes executed names loaded through your configuration
751 file and things which are internal to IPython.
751 file and things which are internal to IPython.
752
752
753 This is deliberate, as typically you may load many modules and the
753 This is deliberate, as typically you may load many modules and the
754 purpose of %who is to show you only what you've manually defined."""
754 purpose of %who is to show you only what you've manually defined."""
755
755
756 varlist = self.magic_who_ls(parameter_s)
756 varlist = self.magic_who_ls(parameter_s)
757 if not varlist:
757 if not varlist:
758 if parameter_s:
758 if parameter_s:
759 print 'No variables match your requested type.'
759 print 'No variables match your requested type.'
760 else:
760 else:
761 print 'Interactive namespace is empty.'
761 print 'Interactive namespace is empty.'
762 return
762 return
763
763
764 # if we have variables, move on...
764 # if we have variables, move on...
765 count = 0
765 count = 0
766 for i in varlist:
766 for i in varlist:
767 print i+'\t',
767 print i+'\t',
768 count += 1
768 count += 1
769 if count > 8:
769 if count > 8:
770 count = 0
770 count = 0
771 print
771 print
772 print
772 print
773
773
774 def magic_whos(self, parameter_s=''):
774 def magic_whos(self, parameter_s=''):
775 """Like %who, but gives some extra information about each variable.
775 """Like %who, but gives some extra information about each variable.
776
776
777 The same type filtering of %who can be applied here.
777 The same type filtering of %who can be applied here.
778
778
779 For all variables, the type is printed. Additionally it prints:
779 For all variables, the type is printed. Additionally it prints:
780
780
781 - For {},[],(): their length.
781 - For {},[],(): their length.
782
782
783 - For numpy and Numeric arrays, a summary with shape, number of
783 - For numpy and Numeric arrays, a summary with shape, number of
784 elements, typecode and size in memory.
784 elements, typecode and size in memory.
785
785
786 - Everything else: a string representation, snipping their middle if
786 - Everything else: a string representation, snipping their middle if
787 too long."""
787 too long."""
788
788
789 varnames = self.magic_who_ls(parameter_s)
789 varnames = self.magic_who_ls(parameter_s)
790 if not varnames:
790 if not varnames:
791 if parameter_s:
791 if parameter_s:
792 print 'No variables match your requested type.'
792 print 'No variables match your requested type.'
793 else:
793 else:
794 print 'Interactive namespace is empty.'
794 print 'Interactive namespace is empty.'
795 return
795 return
796
796
797 # if we have variables, move on...
797 # if we have variables, move on...
798
798
799 # for these types, show len() instead of data:
799 # for these types, show len() instead of data:
800 seq_types = [types.DictType,types.ListType,types.TupleType]
800 seq_types = [types.DictType,types.ListType,types.TupleType]
801
801
802 # for numpy/Numeric arrays, display summary info
802 # for numpy/Numeric arrays, display summary info
803 try:
803 try:
804 import numpy
804 import numpy
805 except ImportError:
805 except ImportError:
806 ndarray_type = None
806 ndarray_type = None
807 else:
807 else:
808 ndarray_type = numpy.ndarray.__name__
808 ndarray_type = numpy.ndarray.__name__
809 try:
809 try:
810 import Numeric
810 import Numeric
811 except ImportError:
811 except ImportError:
812 array_type = None
812 array_type = None
813 else:
813 else:
814 array_type = Numeric.ArrayType.__name__
814 array_type = Numeric.ArrayType.__name__
815
815
816 # Find all variable names and types so we can figure out column sizes
816 # Find all variable names and types so we can figure out column sizes
817 def get_vars(i):
817 def get_vars(i):
818 return self.shell.user_ns[i]
818 return self.shell.user_ns[i]
819
819
820 # some types are well known and can be shorter
820 # some types are well known and can be shorter
821 abbrevs = {'IPython.macro.Macro' : 'Macro'}
821 abbrevs = {'IPython.macro.Macro' : 'Macro'}
822 def type_name(v):
822 def type_name(v):
823 tn = type(v).__name__
823 tn = type(v).__name__
824 return abbrevs.get(tn,tn)
824 return abbrevs.get(tn,tn)
825
825
826 varlist = map(get_vars,varnames)
826 varlist = map(get_vars,varnames)
827
827
828 typelist = []
828 typelist = []
829 for vv in varlist:
829 for vv in varlist:
830 tt = type_name(vv)
830 tt = type_name(vv)
831
831
832 if tt=='instance':
832 if tt=='instance':
833 typelist.append( abbrevs.get(str(vv.__class__),
833 typelist.append( abbrevs.get(str(vv.__class__),
834 str(vv.__class__)))
834 str(vv.__class__)))
835 else:
835 else:
836 typelist.append(tt)
836 typelist.append(tt)
837
837
838 # column labels and # of spaces as separator
838 # column labels and # of spaces as separator
839 varlabel = 'Variable'
839 varlabel = 'Variable'
840 typelabel = 'Type'
840 typelabel = 'Type'
841 datalabel = 'Data/Info'
841 datalabel = 'Data/Info'
842 colsep = 3
842 colsep = 3
843 # variable format strings
843 # variable format strings
844 vformat = "$vname.ljust(varwidth)$vtype.ljust(typewidth)"
844 vformat = "$vname.ljust(varwidth)$vtype.ljust(typewidth)"
845 vfmt_short = '$vstr[:25]<...>$vstr[-25:]'
845 vfmt_short = '$vstr[:25]<...>$vstr[-25:]'
846 aformat = "%s: %s elems, type `%s`, %s bytes"
846 aformat = "%s: %s elems, type `%s`, %s bytes"
847 # find the size of the columns to format the output nicely
847 # find the size of the columns to format the output nicely
848 varwidth = max(max(map(len,varnames)), len(varlabel)) + colsep
848 varwidth = max(max(map(len,varnames)), len(varlabel)) + colsep
849 typewidth = max(max(map(len,typelist)), len(typelabel)) + colsep
849 typewidth = max(max(map(len,typelist)), len(typelabel)) + colsep
850 # table header
850 # table header
851 print varlabel.ljust(varwidth) + typelabel.ljust(typewidth) + \
851 print varlabel.ljust(varwidth) + typelabel.ljust(typewidth) + \
852 ' '+datalabel+'\n' + '-'*(varwidth+typewidth+len(datalabel)+1)
852 ' '+datalabel+'\n' + '-'*(varwidth+typewidth+len(datalabel)+1)
853 # and the table itself
853 # and the table itself
854 kb = 1024
854 kb = 1024
855 Mb = 1048576 # kb**2
855 Mb = 1048576 # kb**2
856 for vname,var,vtype in zip(varnames,varlist,typelist):
856 for vname,var,vtype in zip(varnames,varlist,typelist):
857 print itpl(vformat),
857 print itpl(vformat),
858 if vtype in seq_types:
858 if vtype in seq_types:
859 print len(var)
859 print len(var)
860 elif vtype in [array_type,ndarray_type]:
860 elif vtype in [array_type,ndarray_type]:
861 vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1]
861 vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1]
862 if vtype==ndarray_type:
862 if vtype==ndarray_type:
863 # numpy
863 # numpy
864 vsize = var.size
864 vsize = var.size
865 vbytes = vsize*var.itemsize
865 vbytes = vsize*var.itemsize
866 vdtype = var.dtype
866 vdtype = var.dtype
867 else:
867 else:
868 # Numeric
868 # Numeric
869 vsize = Numeric.size(var)
869 vsize = Numeric.size(var)
870 vbytes = vsize*var.itemsize()
870 vbytes = vsize*var.itemsize()
871 vdtype = var.typecode()
871 vdtype = var.typecode()
872
872
873 if vbytes < 100000:
873 if vbytes < 100000:
874 print aformat % (vshape,vsize,vdtype,vbytes)
874 print aformat % (vshape,vsize,vdtype,vbytes)
875 else:
875 else:
876 print aformat % (vshape,vsize,vdtype,vbytes),
876 print aformat % (vshape,vsize,vdtype,vbytes),
877 if vbytes < Mb:
877 if vbytes < Mb:
878 print '(%s kb)' % (vbytes/kb,)
878 print '(%s kb)' % (vbytes/kb,)
879 else:
879 else:
880 print '(%s Mb)' % (vbytes/Mb,)
880 print '(%s Mb)' % (vbytes/Mb,)
881 else:
881 else:
882 try:
882 try:
883 vstr = str(var)
883 vstr = str(var)
884 except UnicodeEncodeError:
884 except UnicodeEncodeError:
885 vstr = unicode(var).encode(sys.getdefaultencoding(),
885 vstr = unicode(var).encode(sys.getdefaultencoding(),
886 'backslashreplace')
886 'backslashreplace')
887 vstr = vstr.replace('\n','\\n')
887 vstr = vstr.replace('\n','\\n')
888 if len(vstr) < 50:
888 if len(vstr) < 50:
889 print vstr
889 print vstr
890 else:
890 else:
891 printpl(vfmt_short)
891 printpl(vfmt_short)
892
892
893 def magic_reset(self, parameter_s=''):
893 def magic_reset(self, parameter_s=''):
894 """Resets the namespace by removing all names defined by the user.
894 """Resets the namespace by removing all names defined by the user.
895
895
896 Input/Output history are left around in case you need them."""
896 Input/Output history are left around in case you need them."""
897
897
898 ans = self.shell.ask_yes_no(
898 ans = self.shell.ask_yes_no(
899 "Once deleted, variables cannot be recovered. Proceed (y/[n])? ")
899 "Once deleted, variables cannot be recovered. Proceed (y/[n])? ")
900 if not ans:
900 if not ans:
901 print 'Nothing done.'
901 print 'Nothing done.'
902 return
902 return
903 user_ns = self.shell.user_ns
903 user_ns = self.shell.user_ns
904 for i in self.magic_who_ls():
904 for i in self.magic_who_ls():
905 del(user_ns[i])
905 del(user_ns[i])
906
906
907 def magic_logstart(self,parameter_s=''):
907 def magic_logstart(self,parameter_s=''):
908 """Start logging anywhere in a session.
908 """Start logging anywhere in a session.
909
909
910 %logstart [-o|-r|-t] [log_name [log_mode]]
910 %logstart [-o|-r|-t] [log_name [log_mode]]
911
911
912 If no name is given, it defaults to a file named 'ipython_log.py' in your
912 If no name is given, it defaults to a file named 'ipython_log.py' in your
913 current directory, in 'rotate' mode (see below).
913 current directory, in 'rotate' mode (see below).
914
914
915 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
915 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
916 history up to that point and then continues logging.
916 history up to that point and then continues logging.
917
917
918 %logstart takes a second optional parameter: logging mode. This can be one
918 %logstart takes a second optional parameter: logging mode. This can be one
919 of (note that the modes are given unquoted):\\
919 of (note that the modes are given unquoted):\\
920 append: well, that says it.\\
920 append: well, that says it.\\
921 backup: rename (if exists) to name~ and start name.\\
921 backup: rename (if exists) to name~ and start name.\\
922 global: single logfile in your home dir, appended to.\\
922 global: single logfile in your home dir, appended to.\\
923 over : overwrite existing log.\\
923 over : overwrite existing log.\\
924 rotate: create rotating logs name.1~, name.2~, etc.
924 rotate: create rotating logs name.1~, name.2~, etc.
925
925
926 Options:
926 Options:
927
927
928 -o: log also IPython's output. In this mode, all commands which
928 -o: log also IPython's output. In this mode, all commands which
929 generate an Out[NN] prompt are recorded to the logfile, right after
929 generate an Out[NN] prompt are recorded to the logfile, right after
930 their corresponding input line. The output lines are always
930 their corresponding input line. The output lines are always
931 prepended with a '#[Out]# ' marker, so that the log remains valid
931 prepended with a '#[Out]# ' marker, so that the log remains valid
932 Python code.
932 Python code.
933
933
934 Since this marker is always the same, filtering only the output from
934 Since this marker is always the same, filtering only the output from
935 a log is very easy, using for example a simple awk call:
935 a log is very easy, using for example a simple awk call:
936
936
937 awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py
937 awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py
938
938
939 -r: log 'raw' input. Normally, IPython's logs contain the processed
939 -r: log 'raw' input. Normally, IPython's logs contain the processed
940 input, so that user lines are logged in their final form, converted
940 input, so that user lines are logged in their final form, converted
941 into valid Python. For example, %Exit is logged as
941 into valid Python. For example, %Exit is logged as
942 '_ip.magic("Exit"). If the -r flag is given, all input is logged
942 '_ip.magic("Exit"). If the -r flag is given, all input is logged
943 exactly as typed, with no transformations applied.
943 exactly as typed, with no transformations applied.
944
944
945 -t: put timestamps before each input line logged (these are put in
945 -t: put timestamps before each input line logged (these are put in
946 comments)."""
946 comments)."""
947
947
948 opts,par = self.parse_options(parameter_s,'ort')
948 opts,par = self.parse_options(parameter_s,'ort')
949 log_output = 'o' in opts
949 log_output = 'o' in opts
950 log_raw_input = 'r' in opts
950 log_raw_input = 'r' in opts
951 timestamp = 't' in opts
951 timestamp = 't' in opts
952
952
953 rc = self.shell.rc
953 rc = self.shell.rc
954 logger = self.shell.logger
954 logger = self.shell.logger
955
955
956 # if no args are given, the defaults set in the logger constructor by
956 # if no args are given, the defaults set in the logger constructor by
957 # ipytohn remain valid
957 # ipytohn remain valid
958 if par:
958 if par:
959 try:
959 try:
960 logfname,logmode = par.split()
960 logfname,logmode = par.split()
961 except:
961 except:
962 logfname = par
962 logfname = par
963 logmode = 'backup'
963 logmode = 'backup'
964 else:
964 else:
965 logfname = logger.logfname
965 logfname = logger.logfname
966 logmode = logger.logmode
966 logmode = logger.logmode
967 # put logfname into rc struct as if it had been called on the command
967 # put logfname into rc struct as if it had been called on the command
968 # line, so it ends up saved in the log header Save it in case we need
968 # line, so it ends up saved in the log header Save it in case we need
969 # to restore it...
969 # to restore it...
970 old_logfile = rc.opts.get('logfile','')
970 old_logfile = rc.opts.get('logfile','')
971 if logfname:
971 if logfname:
972 logfname = os.path.expanduser(logfname)
972 logfname = os.path.expanduser(logfname)
973 rc.opts.logfile = logfname
973 rc.opts.logfile = logfname
974 loghead = self.shell.loghead_tpl % (rc.opts,rc.args)
974 loghead = self.shell.loghead_tpl % (rc.opts,rc.args)
975 try:
975 try:
976 started = logger.logstart(logfname,loghead,logmode,
976 started = logger.logstart(logfname,loghead,logmode,
977 log_output,timestamp,log_raw_input)
977 log_output,timestamp,log_raw_input)
978 except:
978 except:
979 rc.opts.logfile = old_logfile
979 rc.opts.logfile = old_logfile
980 warn("Couldn't start log: %s" % sys.exc_info()[1])
980 warn("Couldn't start log: %s" % sys.exc_info()[1])
981 else:
981 else:
982 # log input history up to this point, optionally interleaving
982 # log input history up to this point, optionally interleaving
983 # output if requested
983 # output if requested
984
984
985 if timestamp:
985 if timestamp:
986 # disable timestamping for the previous history, since we've
986 # disable timestamping for the previous history, since we've
987 # lost those already (no time machine here).
987 # lost those already (no time machine here).
988 logger.timestamp = False
988 logger.timestamp = False
989
989
990 if log_raw_input:
990 if log_raw_input:
991 input_hist = self.shell.input_hist_raw
991 input_hist = self.shell.input_hist_raw
992 else:
992 else:
993 input_hist = self.shell.input_hist
993 input_hist = self.shell.input_hist
994
994
995 if log_output:
995 if log_output:
996 log_write = logger.log_write
996 log_write = logger.log_write
997 output_hist = self.shell.output_hist
997 output_hist = self.shell.output_hist
998 for n in range(1,len(input_hist)-1):
998 for n in range(1,len(input_hist)-1):
999 log_write(input_hist[n].rstrip())
999 log_write(input_hist[n].rstrip())
1000 if n in output_hist:
1000 if n in output_hist:
1001 log_write(repr(output_hist[n]),'output')
1001 log_write(repr(output_hist[n]),'output')
1002 else:
1002 else:
1003 logger.log_write(input_hist[1:])
1003 logger.log_write(input_hist[1:])
1004 if timestamp:
1004 if timestamp:
1005 # re-enable timestamping
1005 # re-enable timestamping
1006 logger.timestamp = True
1006 logger.timestamp = True
1007
1007
1008 print ('Activating auto-logging. '
1008 print ('Activating auto-logging. '
1009 'Current session state plus future input saved.')
1009 'Current session state plus future input saved.')
1010 logger.logstate()
1010 logger.logstate()
1011
1011
1012 def magic_logoff(self,parameter_s=''):
1012 def magic_logoff(self,parameter_s=''):
1013 """Temporarily stop logging.
1013 """Temporarily stop logging.
1014
1014
1015 You must have previously started logging."""
1015 You must have previously started logging."""
1016 self.shell.logger.switch_log(0)
1016 self.shell.logger.switch_log(0)
1017
1017
1018 def magic_logon(self,parameter_s=''):
1018 def magic_logon(self,parameter_s=''):
1019 """Restart logging.
1019 """Restart logging.
1020
1020
1021 This function is for restarting logging which you've temporarily
1021 This function is for restarting logging which you've temporarily
1022 stopped with %logoff. For starting logging for the first time, you
1022 stopped with %logoff. For starting logging for the first time, you
1023 must use the %logstart function, which allows you to specify an
1023 must use the %logstart function, which allows you to specify an
1024 optional log filename."""
1024 optional log filename."""
1025
1025
1026 self.shell.logger.switch_log(1)
1026 self.shell.logger.switch_log(1)
1027
1027
1028 def magic_logstate(self,parameter_s=''):
1028 def magic_logstate(self,parameter_s=''):
1029 """Print the status of the logging system."""
1029 """Print the status of the logging system."""
1030
1030
1031 self.shell.logger.logstate()
1031 self.shell.logger.logstate()
1032
1032
1033 def magic_pdb(self, parameter_s=''):
1033 def magic_pdb(self, parameter_s=''):
1034 """Control the automatic calling of the pdb interactive debugger.
1034 """Control the automatic calling of the pdb interactive debugger.
1035
1035
1036 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
1036 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
1037 argument it works as a toggle.
1037 argument it works as a toggle.
1038
1038
1039 When an exception is triggered, IPython can optionally call the
1039 When an exception is triggered, IPython can optionally call the
1040 interactive pdb debugger after the traceback printout. %pdb toggles
1040 interactive pdb debugger after the traceback printout. %pdb toggles
1041 this feature on and off.
1041 this feature on and off.
1042
1042
1043 The initial state of this feature is set in your ipythonrc
1043 The initial state of this feature is set in your ipythonrc
1044 configuration file (the variable is called 'pdb').
1044 configuration file (the variable is called 'pdb').
1045
1045
1046 If you want to just activate the debugger AFTER an exception has fired,
1046 If you want to just activate the debugger AFTER an exception has fired,
1047 without having to type '%pdb on' and rerunning your code, you can use
1047 without having to type '%pdb on' and rerunning your code, you can use
1048 the %debug magic."""
1048 the %debug magic."""
1049
1049
1050 par = parameter_s.strip().lower()
1050 par = parameter_s.strip().lower()
1051
1051
1052 if par:
1052 if par:
1053 try:
1053 try:
1054 new_pdb = {'off':0,'0':0,'on':1,'1':1}[par]
1054 new_pdb = {'off':0,'0':0,'on':1,'1':1}[par]
1055 except KeyError:
1055 except KeyError:
1056 print ('Incorrect argument. Use on/1, off/0, '
1056 print ('Incorrect argument. Use on/1, off/0, '
1057 'or nothing for a toggle.')
1057 'or nothing for a toggle.')
1058 return
1058 return
1059 else:
1059 else:
1060 # toggle
1060 # toggle
1061 new_pdb = not self.shell.call_pdb
1061 new_pdb = not self.shell.call_pdb
1062
1062
1063 # set on the shell
1063 # set on the shell
1064 self.shell.call_pdb = new_pdb
1064 self.shell.call_pdb = new_pdb
1065 print 'Automatic pdb calling has been turned',on_off(new_pdb)
1065 print 'Automatic pdb calling has been turned',on_off(new_pdb)
1066
1066
1067 def magic_debug(self, parameter_s=''):
1067 def magic_debug(self, parameter_s=''):
1068 """Activate the interactive debugger in post-mortem mode.
1068 """Activate the interactive debugger in post-mortem mode.
1069
1069
1070 If an exception has just occurred, this lets you inspect its stack
1070 If an exception has just occurred, this lets you inspect its stack
1071 frames interactively. Note that this will always work only on the last
1071 frames interactively. Note that this will always work only on the last
1072 traceback that occurred, so you must call this quickly after an
1072 traceback that occurred, so you must call this quickly after an
1073 exception that you wish to inspect has fired, because if another one
1073 exception that you wish to inspect has fired, because if another one
1074 occurs, it clobbers the previous one.
1074 occurs, it clobbers the previous one.
1075
1075
1076 If you want IPython to automatically do this on every exception, see
1076 If you want IPython to automatically do this on every exception, see
1077 the %pdb magic for more details.
1077 the %pdb magic for more details.
1078 """
1078 """
1079
1079
1080 self.shell.debugger(force=True)
1080 self.shell.debugger(force=True)
1081
1081
1082 def magic_prun(self, parameter_s ='',user_mode=1,
1082 def magic_prun(self, parameter_s ='',user_mode=1,
1083 opts=None,arg_lst=None,prog_ns=None):
1083 opts=None,arg_lst=None,prog_ns=None):
1084
1084
1085 """Run a statement through the python code profiler.
1085 """Run a statement through the python code profiler.
1086
1086
1087 Usage:\\
1087 Usage:\\
1088 %prun [options] statement
1088 %prun [options] statement
1089
1089
1090 The given statement (which doesn't require quote marks) is run via the
1090 The given statement (which doesn't require quote marks) is run via the
1091 python profiler in a manner similar to the profile.run() function.
1091 python profiler in a manner similar to the profile.run() function.
1092 Namespaces are internally managed to work correctly; profile.run
1092 Namespaces are internally managed to work correctly; profile.run
1093 cannot be used in IPython because it makes certain assumptions about
1093 cannot be used in IPython because it makes certain assumptions about
1094 namespaces which do not hold under IPython.
1094 namespaces which do not hold under IPython.
1095
1095
1096 Options:
1096 Options:
1097
1097
1098 -l <limit>: you can place restrictions on what or how much of the
1098 -l <limit>: you can place restrictions on what or how much of the
1099 profile gets printed. The limit value can be:
1099 profile gets printed. The limit value can be:
1100
1100
1101 * A string: only information for function names containing this string
1101 * A string: only information for function names containing this string
1102 is printed.
1102 is printed.
1103
1103
1104 * An integer: only these many lines are printed.
1104 * An integer: only these many lines are printed.
1105
1105
1106 * A float (between 0 and 1): this fraction of the report is printed
1106 * A float (between 0 and 1): this fraction of the report is printed
1107 (for example, use a limit of 0.4 to see the topmost 40% only).
1107 (for example, use a limit of 0.4 to see the topmost 40% only).
1108
1108
1109 You can combine several limits with repeated use of the option. For
1109 You can combine several limits with repeated use of the option. For
1110 example, '-l __init__ -l 5' will print only the topmost 5 lines of
1110 example, '-l __init__ -l 5' will print only the topmost 5 lines of
1111 information about class constructors.
1111 information about class constructors.
1112
1112
1113 -r: return the pstats.Stats object generated by the profiling. This
1113 -r: return the pstats.Stats object generated by the profiling. This
1114 object has all the information about the profile in it, and you can
1114 object has all the information about the profile in it, and you can
1115 later use it for further analysis or in other functions.
1115 later use it for further analysis or in other functions.
1116
1116
1117 -s <key>: sort profile by given key. You can provide more than one key
1117 -s <key>: sort profile by given key. You can provide more than one key
1118 by using the option several times: '-s key1 -s key2 -s key3...'. The
1118 by using the option several times: '-s key1 -s key2 -s key3...'. The
1119 default sorting key is 'time'.
1119 default sorting key is 'time'.
1120
1120
1121 The following is copied verbatim from the profile documentation
1121 The following is copied verbatim from the profile documentation
1122 referenced below:
1122 referenced below:
1123
1123
1124 When more than one key is provided, additional keys are used as
1124 When more than one key is provided, additional keys are used as
1125 secondary criteria when the there is equality in all keys selected
1125 secondary criteria when the there is equality in all keys selected
1126 before them.
1126 before them.
1127
1127
1128 Abbreviations can be used for any key names, as long as the
1128 Abbreviations can be used for any key names, as long as the
1129 abbreviation is unambiguous. The following are the keys currently
1129 abbreviation is unambiguous. The following are the keys currently
1130 defined:
1130 defined:
1131
1131
1132 Valid Arg Meaning\\
1132 Valid Arg Meaning\\
1133 "calls" call count\\
1133 "calls" call count\\
1134 "cumulative" cumulative time\\
1134 "cumulative" cumulative time\\
1135 "file" file name\\
1135 "file" file name\\
1136 "module" file name\\
1136 "module" file name\\
1137 "pcalls" primitive call count\\
1137 "pcalls" primitive call count\\
1138 "line" line number\\
1138 "line" line number\\
1139 "name" function name\\
1139 "name" function name\\
1140 "nfl" name/file/line\\
1140 "nfl" name/file/line\\
1141 "stdname" standard name\\
1141 "stdname" standard name\\
1142 "time" internal time
1142 "time" internal time
1143
1143
1144 Note that all sorts on statistics are in descending order (placing
1144 Note that all sorts on statistics are in descending order (placing
1145 most time consuming items first), where as name, file, and line number
1145 most time consuming items first), where as name, file, and line number
1146 searches are in ascending order (i.e., alphabetical). The subtle
1146 searches are in ascending order (i.e., alphabetical). The subtle
1147 distinction between "nfl" and "stdname" is that the standard name is a
1147 distinction between "nfl" and "stdname" is that the standard name is a
1148 sort of the name as printed, which means that the embedded line
1148 sort of the name as printed, which means that the embedded line
1149 numbers get compared in an odd way. For example, lines 3, 20, and 40
1149 numbers get compared in an odd way. For example, lines 3, 20, and 40
1150 would (if the file names were the same) appear in the string order
1150 would (if the file names were the same) appear in the string order
1151 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
1151 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
1152 line numbers. In fact, sort_stats("nfl") is the same as
1152 line numbers. In fact, sort_stats("nfl") is the same as
1153 sort_stats("name", "file", "line").
1153 sort_stats("name", "file", "line").
1154
1154
1155 -T <filename>: save profile results as shown on screen to a text
1155 -T <filename>: save profile results as shown on screen to a text
1156 file. The profile is still shown on screen.
1156 file. The profile is still shown on screen.
1157
1157
1158 -D <filename>: save (via dump_stats) profile statistics to given
1158 -D <filename>: save (via dump_stats) profile statistics to given
1159 filename. This data is in a format understod by the pstats module, and
1159 filename. This data is in a format understod by the pstats module, and
1160 is generated by a call to the dump_stats() method of profile
1160 is generated by a call to the dump_stats() method of profile
1161 objects. The profile is still shown on screen.
1161 objects. The profile is still shown on screen.
1162
1162
1163 If you want to run complete programs under the profiler's control, use
1163 If you want to run complete programs under the profiler's control, use
1164 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
1164 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
1165 contains profiler specific options as described here.
1165 contains profiler specific options as described here.
1166
1166
1167 You can read the complete documentation for the profile module with:\\
1167 You can read the complete documentation for the profile module with:\\
1168 In [1]: import profile; profile.help() """
1168 In [1]: import profile; profile.help() """
1169
1169
1170 opts_def = Struct(D=[''],l=[],s=['time'],T=[''])
1170 opts_def = Struct(D=[''],l=[],s=['time'],T=[''])
1171 # protect user quote marks
1171 # protect user quote marks
1172 parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'")
1172 parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'")
1173
1173
1174 if user_mode: # regular user call
1174 if user_mode: # regular user call
1175 opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:',
1175 opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:',
1176 list_all=1)
1176 list_all=1)
1177 namespace = self.shell.user_ns
1177 namespace = self.shell.user_ns
1178 else: # called to run a program by %run -p
1178 else: # called to run a program by %run -p
1179 try:
1179 try:
1180 filename = get_py_filename(arg_lst[0])
1180 filename = get_py_filename(arg_lst[0])
1181 except IOError,msg:
1181 except IOError,msg:
1182 error(msg)
1182 error(msg)
1183 return
1183 return
1184
1184
1185 arg_str = 'execfile(filename,prog_ns)'
1185 arg_str = 'execfile(filename,prog_ns)'
1186 namespace = locals()
1186 namespace = locals()
1187
1187
1188 opts.merge(opts_def)
1188 opts.merge(opts_def)
1189
1189
1190 prof = profile.Profile()
1190 prof = profile.Profile()
1191 try:
1191 try:
1192 prof = prof.runctx(arg_str,namespace,namespace)
1192 prof = prof.runctx(arg_str,namespace,namespace)
1193 sys_exit = ''
1193 sys_exit = ''
1194 except SystemExit:
1194 except SystemExit:
1195 sys_exit = """*** SystemExit exception caught in code being profiled."""
1195 sys_exit = """*** SystemExit exception caught in code being profiled."""
1196
1196
1197 stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s)
1197 stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s)
1198
1198
1199 lims = opts.l
1199 lims = opts.l
1200 if lims:
1200 if lims:
1201 lims = [] # rebuild lims with ints/floats/strings
1201 lims = [] # rebuild lims with ints/floats/strings
1202 for lim in opts.l:
1202 for lim in opts.l:
1203 try:
1203 try:
1204 lims.append(int(lim))
1204 lims.append(int(lim))
1205 except ValueError:
1205 except ValueError:
1206 try:
1206 try:
1207 lims.append(float(lim))
1207 lims.append(float(lim))
1208 except ValueError:
1208 except ValueError:
1209 lims.append(lim)
1209 lims.append(lim)
1210
1210
1211 # Trap output.
1211 # Trap output.
1212 stdout_trap = StringIO()
1212 stdout_trap = StringIO()
1213
1213
1214 if hasattr(stats,'stream'):
1214 if hasattr(stats,'stream'):
1215 # In newer versions of python, the stats object has a 'stream'
1215 # In newer versions of python, the stats object has a 'stream'
1216 # attribute to write into.
1216 # attribute to write into.
1217 stats.stream = stdout_trap
1217 stats.stream = stdout_trap
1218 stats.print_stats(*lims)
1218 stats.print_stats(*lims)
1219 else:
1219 else:
1220 # For older versions, we manually redirect stdout during printing
1220 # For older versions, we manually redirect stdout during printing
1221 sys_stdout = sys.stdout
1221 sys_stdout = sys.stdout
1222 try:
1222 try:
1223 sys.stdout = stdout_trap
1223 sys.stdout = stdout_trap
1224 stats.print_stats(*lims)
1224 stats.print_stats(*lims)
1225 finally:
1225 finally:
1226 sys.stdout = sys_stdout
1226 sys.stdout = sys_stdout
1227
1227
1228 output = stdout_trap.getvalue()
1228 output = stdout_trap.getvalue()
1229 output = output.rstrip()
1229 output = output.rstrip()
1230
1230
1231 page(output,screen_lines=self.shell.rc.screen_length)
1231 page(output,screen_lines=self.shell.rc.screen_length)
1232 print sys_exit,
1232 print sys_exit,
1233
1233
1234 dump_file = opts.D[0]
1234 dump_file = opts.D[0]
1235 text_file = opts.T[0]
1235 text_file = opts.T[0]
1236 if dump_file:
1236 if dump_file:
1237 prof.dump_stats(dump_file)
1237 prof.dump_stats(dump_file)
1238 print '\n*** Profile stats marshalled to file',\
1238 print '\n*** Profile stats marshalled to file',\
1239 `dump_file`+'.',sys_exit
1239 `dump_file`+'.',sys_exit
1240 if text_file:
1240 if text_file:
1241 pfile = file(text_file,'w')
1241 pfile = file(text_file,'w')
1242 pfile.write(output)
1242 pfile.write(output)
1243 pfile.close()
1243 pfile.close()
1244 print '\n*** Profile printout saved to text file',\
1244 print '\n*** Profile printout saved to text file',\
1245 `text_file`+'.',sys_exit
1245 `text_file`+'.',sys_exit
1246
1246
1247 if opts.has_key('r'):
1247 if opts.has_key('r'):
1248 return stats
1248 return stats
1249 else:
1249 else:
1250 return None
1250 return None
1251
1251
1252 def magic_run(self, parameter_s ='',runner=None):
1252 def magic_run(self, parameter_s ='',runner=None):
1253 """Run the named file inside IPython as a program.
1253 """Run the named file inside IPython as a program.
1254
1254
1255 Usage:\\
1255 Usage:\\
1256 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
1256 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
1257
1257
1258 Parameters after the filename are passed as command-line arguments to
1258 Parameters after the filename are passed as command-line arguments to
1259 the program (put in sys.argv). Then, control returns to IPython's
1259 the program (put in sys.argv). Then, control returns to IPython's
1260 prompt.
1260 prompt.
1261
1261
1262 This is similar to running at a system prompt:\\
1262 This is similar to running at a system prompt:\\
1263 $ python file args\\
1263 $ python file args\\
1264 but with the advantage of giving you IPython's tracebacks, and of
1264 but with the advantage of giving you IPython's tracebacks, and of
1265 loading all variables into your interactive namespace for further use
1265 loading all variables into your interactive namespace for further use
1266 (unless -p is used, see below).
1266 (unless -p is used, see below).
1267
1267
1268 The file is executed in a namespace initially consisting only of
1268 The file is executed in a namespace initially consisting only of
1269 __name__=='__main__' and sys.argv constructed as indicated. It thus
1269 __name__=='__main__' and sys.argv constructed as indicated. It thus
1270 sees its environment as if it were being run as a stand-alone
1270 sees its environment as if it were being run as a stand-alone
1271 program. But after execution, the IPython interactive namespace gets
1271 program. But after execution, the IPython interactive namespace gets
1272 updated with all variables defined in the program (except for __name__
1272 updated with all variables defined in the program (except for __name__
1273 and sys.argv). This allows for very convenient loading of code for
1273 and sys.argv). This allows for very convenient loading of code for
1274 interactive work, while giving each program a 'clean sheet' to run in.
1274 interactive work, while giving each program a 'clean sheet' to run in.
1275
1275
1276 Options:
1276 Options:
1277
1277
1278 -n: __name__ is NOT set to '__main__', but to the running file's name
1278 -n: __name__ is NOT set to '__main__', but to the running file's name
1279 without extension (as python does under import). This allows running
1279 without extension (as python does under import). This allows running
1280 scripts and reloading the definitions in them without calling code
1280 scripts and reloading the definitions in them without calling code
1281 protected by an ' if __name__ == "__main__" ' clause.
1281 protected by an ' if __name__ == "__main__" ' clause.
1282
1282
1283 -i: run the file in IPython's namespace instead of an empty one. This
1283 -i: run the file in IPython's namespace instead of an empty one. This
1284 is useful if you are experimenting with code written in a text editor
1284 is useful if you are experimenting with code written in a text editor
1285 which depends on variables defined interactively.
1285 which depends on variables defined interactively.
1286
1286
1287 -e: ignore sys.exit() calls or SystemExit exceptions in the script
1287 -e: ignore sys.exit() calls or SystemExit exceptions in the script
1288 being run. This is particularly useful if IPython is being used to
1288 being run. This is particularly useful if IPython is being used to
1289 run unittests, which always exit with a sys.exit() call. In such
1289 run unittests, which always exit with a sys.exit() call. In such
1290 cases you are interested in the output of the test results, not in
1290 cases you are interested in the output of the test results, not in
1291 seeing a traceback of the unittest module.
1291 seeing a traceback of the unittest module.
1292
1292
1293 -t: print timing information at the end of the run. IPython will give
1293 -t: print timing information at the end of the run. IPython will give
1294 you an estimated CPU time consumption for your script, which under
1294 you an estimated CPU time consumption for your script, which under
1295 Unix uses the resource module to avoid the wraparound problems of
1295 Unix uses the resource module to avoid the wraparound problems of
1296 time.clock(). Under Unix, an estimate of time spent on system tasks
1296 time.clock(). Under Unix, an estimate of time spent on system tasks
1297 is also given (for Windows platforms this is reported as 0.0).
1297 is also given (for Windows platforms this is reported as 0.0).
1298
1298
1299 If -t is given, an additional -N<N> option can be given, where <N>
1299 If -t is given, an additional -N<N> option can be given, where <N>
1300 must be an integer indicating how many times you want the script to
1300 must be an integer indicating how many times you want the script to
1301 run. The final timing report will include total and per run results.
1301 run. The final timing report will include total and per run results.
1302
1302
1303 For example (testing the script uniq_stable.py):
1303 For example (testing the script uniq_stable.py):
1304
1304
1305 In [1]: run -t uniq_stable
1305 In [1]: run -t uniq_stable
1306
1306
1307 IPython CPU timings (estimated):\\
1307 IPython CPU timings (estimated):\\
1308 User : 0.19597 s.\\
1308 User : 0.19597 s.\\
1309 System: 0.0 s.\\
1309 System: 0.0 s.\\
1310
1310
1311 In [2]: run -t -N5 uniq_stable
1311 In [2]: run -t -N5 uniq_stable
1312
1312
1313 IPython CPU timings (estimated):\\
1313 IPython CPU timings (estimated):\\
1314 Total runs performed: 5\\
1314 Total runs performed: 5\\
1315 Times : Total Per run\\
1315 Times : Total Per run\\
1316 User : 0.910862 s, 0.1821724 s.\\
1316 User : 0.910862 s, 0.1821724 s.\\
1317 System: 0.0 s, 0.0 s.
1317 System: 0.0 s, 0.0 s.
1318
1318
1319 -d: run your program under the control of pdb, the Python debugger.
1319 -d: run your program under the control of pdb, the Python debugger.
1320 This allows you to execute your program step by step, watch variables,
1320 This allows you to execute your program step by step, watch variables,
1321 etc. Internally, what IPython does is similar to calling:
1321 etc. Internally, what IPython does is similar to calling:
1322
1322
1323 pdb.run('execfile("YOURFILENAME")')
1323 pdb.run('execfile("YOURFILENAME")')
1324
1324
1325 with a breakpoint set on line 1 of your file. You can change the line
1325 with a breakpoint set on line 1 of your file. You can change the line
1326 number for this automatic breakpoint to be <N> by using the -bN option
1326 number for this automatic breakpoint to be <N> by using the -bN option
1327 (where N must be an integer). For example:
1327 (where N must be an integer). For example:
1328
1328
1329 %run -d -b40 myscript
1329 %run -d -b40 myscript
1330
1330
1331 will set the first breakpoint at line 40 in myscript.py. Note that
1331 will set the first breakpoint at line 40 in myscript.py. Note that
1332 the first breakpoint must be set on a line which actually does
1332 the first breakpoint must be set on a line which actually does
1333 something (not a comment or docstring) for it to stop execution.
1333 something (not a comment or docstring) for it to stop execution.
1334
1334
1335 When the pdb debugger starts, you will see a (Pdb) prompt. You must
1335 When the pdb debugger starts, you will see a (Pdb) prompt. You must
1336 first enter 'c' (without qoutes) to start execution up to the first
1336 first enter 'c' (without qoutes) to start execution up to the first
1337 breakpoint.
1337 breakpoint.
1338
1338
1339 Entering 'help' gives information about the use of the debugger. You
1339 Entering 'help' gives information about the use of the debugger. You
1340 can easily see pdb's full documentation with "import pdb;pdb.help()"
1340 can easily see pdb's full documentation with "import pdb;pdb.help()"
1341 at a prompt.
1341 at a prompt.
1342
1342
1343 -p: run program under the control of the Python profiler module (which
1343 -p: run program under the control of the Python profiler module (which
1344 prints a detailed report of execution times, function calls, etc).
1344 prints a detailed report of execution times, function calls, etc).
1345
1345
1346 You can pass other options after -p which affect the behavior of the
1346 You can pass other options after -p which affect the behavior of the
1347 profiler itself. See the docs for %prun for details.
1347 profiler itself. See the docs for %prun for details.
1348
1348
1349 In this mode, the program's variables do NOT propagate back to the
1349 In this mode, the program's variables do NOT propagate back to the
1350 IPython interactive namespace (because they remain in the namespace
1350 IPython interactive namespace (because they remain in the namespace
1351 where the profiler executes them).
1351 where the profiler executes them).
1352
1352
1353 Internally this triggers a call to %prun, see its documentation for
1353 Internally this triggers a call to %prun, see its documentation for
1354 details on the options available specifically for profiling.
1354 details on the options available specifically for profiling.
1355
1355
1356 There is one special usage for which the text above doesn't apply:
1356 There is one special usage for which the text above doesn't apply:
1357 if the filename ends with .ipy, the file is run as ipython script,
1357 if the filename ends with .ipy, the file is run as ipython script,
1358 just as if the commands were written on IPython prompt.
1358 just as if the commands were written on IPython prompt.
1359 """
1359 """
1360
1360
1361 # get arguments and set sys.argv for program to be run.
1361 # get arguments and set sys.argv for program to be run.
1362 opts,arg_lst = self.parse_options(parameter_s,'nidtN:b:pD:l:rs:T:e',
1362 opts,arg_lst = self.parse_options(parameter_s,'nidtN:b:pD:l:rs:T:e',
1363 mode='list',list_all=1)
1363 mode='list',list_all=1)
1364
1364
1365 try:
1365 try:
1366 filename = get_py_filename(arg_lst[0])
1366 filename = get_py_filename(arg_lst[0])
1367 except IndexError:
1367 except IndexError:
1368 warn('you must provide at least a filename.')
1368 warn('you must provide at least a filename.')
1369 print '\n%run:\n',OInspect.getdoc(self.magic_run)
1369 print '\n%run:\n',OInspect.getdoc(self.magic_run)
1370 return
1370 return
1371 except IOError,msg:
1371 except IOError,msg:
1372 error(msg)
1372 error(msg)
1373 return
1373 return
1374
1374
1375 if filename.lower().endswith('.ipy'):
1375 if filename.lower().endswith('.ipy'):
1376 self.api.runlines(open(filename).read())
1376 self.api.runlines(open(filename).read())
1377 return
1377 return
1378
1378
1379 # Control the response to exit() calls made by the script being run
1379 # Control the response to exit() calls made by the script being run
1380 exit_ignore = opts.has_key('e')
1380 exit_ignore = opts.has_key('e')
1381
1381
1382 # Make sure that the running script gets a proper sys.argv as if it
1382 # Make sure that the running script gets a proper sys.argv as if it
1383 # were run from a system shell.
1383 # were run from a system shell.
1384 save_argv = sys.argv # save it for later restoring
1384 save_argv = sys.argv # save it for later restoring
1385 sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
1385 sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
1386
1386
1387 if opts.has_key('i'):
1387 if opts.has_key('i'):
1388 prog_ns = self.shell.user_ns
1388 prog_ns = self.shell.user_ns
1389 __name__save = self.shell.user_ns['__name__']
1389 __name__save = self.shell.user_ns['__name__']
1390 prog_ns['__name__'] = '__main__'
1390 prog_ns['__name__'] = '__main__'
1391 else:
1391 else:
1392 if opts.has_key('n'):
1392 if opts.has_key('n'):
1393 name = os.path.splitext(os.path.basename(filename))[0]
1393 name = os.path.splitext(os.path.basename(filename))[0]
1394 else:
1394 else:
1395 name = '__main__'
1395 name = '__main__'
1396 prog_ns = {'__name__':name}
1396 prog_ns = {'__name__':name}
1397
1397
1398 # Since '%run foo' emulates 'python foo.py' at the cmd line, we must
1398 # Since '%run foo' emulates 'python foo.py' at the cmd line, we must
1399 # set the __file__ global in the script's namespace
1399 # set the __file__ global in the script's namespace
1400 prog_ns['__file__'] = filename
1400 prog_ns['__file__'] = filename
1401
1401
1402 # pickle fix. See iplib for an explanation. But we need to make sure
1402 # pickle fix. See iplib for an explanation. But we need to make sure
1403 # that, if we overwrite __main__, we replace it at the end
1403 # that, if we overwrite __main__, we replace it at the end
1404 if prog_ns['__name__'] == '__main__':
1404 if prog_ns['__name__'] == '__main__':
1405 restore_main = sys.modules['__main__']
1405 restore_main = sys.modules['__main__']
1406 else:
1406 else:
1407 restore_main = False
1407 restore_main = False
1408
1408
1409 sys.modules[prog_ns['__name__']] = FakeModule(prog_ns)
1409 sys.modules[prog_ns['__name__']] = FakeModule(prog_ns)
1410
1410
1411 stats = None
1411 stats = None
1412 try:
1412 try:
1413 if self.shell.has_readline:
1413 if self.shell.has_readline:
1414 self.shell.savehist()
1414 self.shell.savehist()
1415
1415
1416 if opts.has_key('p'):
1416 if opts.has_key('p'):
1417 stats = self.magic_prun('',0,opts,arg_lst,prog_ns)
1417 stats = self.magic_prun('',0,opts,arg_lst,prog_ns)
1418 else:
1418 else:
1419 if opts.has_key('d'):
1419 if opts.has_key('d'):
1420 deb = Debugger.Pdb(self.shell.rc.colors)
1420 deb = Debugger.Pdb(self.shell.rc.colors)
1421 # reset Breakpoint state, which is moronically kept
1421 # reset Breakpoint state, which is moronically kept
1422 # in a class
1422 # in a class
1423 bdb.Breakpoint.next = 1
1423 bdb.Breakpoint.next = 1
1424 bdb.Breakpoint.bplist = {}
1424 bdb.Breakpoint.bplist = {}
1425 bdb.Breakpoint.bpbynumber = [None]
1425 bdb.Breakpoint.bpbynumber = [None]
1426 # Set an initial breakpoint to stop execution
1426 # Set an initial breakpoint to stop execution
1427 maxtries = 10
1427 maxtries = 10
1428 bp = int(opts.get('b',[1])[0])
1428 bp = int(opts.get('b',[1])[0])
1429 checkline = deb.checkline(filename,bp)
1429 checkline = deb.checkline(filename,bp)
1430 if not checkline:
1430 if not checkline:
1431 for bp in range(bp+1,bp+maxtries+1):
1431 for bp in range(bp+1,bp+maxtries+1):
1432 if deb.checkline(filename,bp):
1432 if deb.checkline(filename,bp):
1433 break
1433 break
1434 else:
1434 else:
1435 msg = ("\nI failed to find a valid line to set "
1435 msg = ("\nI failed to find a valid line to set "
1436 "a breakpoint\n"
1436 "a breakpoint\n"
1437 "after trying up to line: %s.\n"
1437 "after trying up to line: %s.\n"
1438 "Please set a valid breakpoint manually "
1438 "Please set a valid breakpoint manually "
1439 "with the -b option." % bp)
1439 "with the -b option." % bp)
1440 error(msg)
1440 error(msg)
1441 return
1441 return
1442 # if we find a good linenumber, set the breakpoint
1442 # if we find a good linenumber, set the breakpoint
1443 deb.do_break('%s:%s' % (filename,bp))
1443 deb.do_break('%s:%s' % (filename,bp))
1444 # Start file run
1444 # Start file run
1445 print "NOTE: Enter 'c' at the",
1445 print "NOTE: Enter 'c' at the",
1446 print "%s prompt to start your script." % deb.prompt
1446 print "%s prompt to start your script." % deb.prompt
1447 try:
1447 try:
1448 deb.run('execfile("%s")' % filename,prog_ns)
1448 deb.run('execfile("%s")' % filename,prog_ns)
1449
1449
1450 except:
1450 except:
1451 etype, value, tb = sys.exc_info()
1451 etype, value, tb = sys.exc_info()
1452 # Skip three frames in the traceback: the %run one,
1452 # Skip three frames in the traceback: the %run one,
1453 # one inside bdb.py, and the command-line typed by the
1453 # one inside bdb.py, and the command-line typed by the
1454 # user (run by exec in pdb itself).
1454 # user (run by exec in pdb itself).
1455 self.shell.InteractiveTB(etype,value,tb,tb_offset=3)
1455 self.shell.InteractiveTB(etype,value,tb,tb_offset=3)
1456 else:
1456 else:
1457 if runner is None:
1457 if runner is None:
1458 runner = self.shell.safe_execfile
1458 runner = self.shell.safe_execfile
1459 if opts.has_key('t'):
1459 if opts.has_key('t'):
1460 try:
1460 try:
1461 nruns = int(opts['N'][0])
1461 nruns = int(opts['N'][0])
1462 if nruns < 1:
1462 if nruns < 1:
1463 error('Number of runs must be >=1')
1463 error('Number of runs must be >=1')
1464 return
1464 return
1465 except (KeyError):
1465 except (KeyError):
1466 nruns = 1
1466 nruns = 1
1467 if nruns == 1:
1467 if nruns == 1:
1468 t0 = clock2()
1468 t0 = clock2()
1469 runner(filename,prog_ns,prog_ns,
1469 runner(filename,prog_ns,prog_ns,
1470 exit_ignore=exit_ignore)
1470 exit_ignore=exit_ignore)
1471 t1 = clock2()
1471 t1 = clock2()
1472 t_usr = t1[0]-t0[0]
1472 t_usr = t1[0]-t0[0]
1473 t_sys = t1[1]-t1[1]
1473 t_sys = t1[1]-t1[1]
1474 print "\nIPython CPU timings (estimated):"
1474 print "\nIPython CPU timings (estimated):"
1475 print " User : %10s s." % t_usr
1475 print " User : %10s s." % t_usr
1476 print " System: %10s s." % t_sys
1476 print " System: %10s s." % t_sys
1477 else:
1477 else:
1478 runs = range(nruns)
1478 runs = range(nruns)
1479 t0 = clock2()
1479 t0 = clock2()
1480 for nr in runs:
1480 for nr in runs:
1481 runner(filename,prog_ns,prog_ns,
1481 runner(filename,prog_ns,prog_ns,
1482 exit_ignore=exit_ignore)
1482 exit_ignore=exit_ignore)
1483 t1 = clock2()
1483 t1 = clock2()
1484 t_usr = t1[0]-t0[0]
1484 t_usr = t1[0]-t0[0]
1485 t_sys = t1[1]-t1[1]
1485 t_sys = t1[1]-t1[1]
1486 print "\nIPython CPU timings (estimated):"
1486 print "\nIPython CPU timings (estimated):"
1487 print "Total runs performed:",nruns
1487 print "Total runs performed:",nruns
1488 print " Times : %10s %10s" % ('Total','Per run')
1488 print " Times : %10s %10s" % ('Total','Per run')
1489 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1489 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1490 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1490 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1491
1491
1492 else:
1492 else:
1493 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
1493 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
1494 if opts.has_key('i'):
1494 if opts.has_key('i'):
1495 self.shell.user_ns['__name__'] = __name__save
1495 self.shell.user_ns['__name__'] = __name__save
1496 else:
1496 else:
1497 # update IPython interactive namespace
1497 # update IPython interactive namespace
1498 del prog_ns['__name__']
1498 del prog_ns['__name__']
1499 self.shell.user_ns.update(prog_ns)
1499 self.shell.user_ns.update(prog_ns)
1500 finally:
1500 finally:
1501 sys.argv = save_argv
1501 sys.argv = save_argv
1502 if restore_main:
1502 if restore_main:
1503 sys.modules['__main__'] = restore_main
1503 sys.modules['__main__'] = restore_main
1504 self.shell.reloadhist()
1504 self.shell.reloadhist()
1505
1505
1506 return stats
1506 return stats
1507
1507
1508 def magic_runlog(self, parameter_s =''):
1508 def magic_runlog(self, parameter_s =''):
1509 """Run files as logs.
1509 """Run files as logs.
1510
1510
1511 Usage:\\
1511 Usage:\\
1512 %runlog file1 file2 ...
1512 %runlog file1 file2 ...
1513
1513
1514 Run the named files (treating them as log files) in sequence inside
1514 Run the named files (treating them as log files) in sequence inside
1515 the interpreter, and return to the prompt. This is much slower than
1515 the interpreter, and return to the prompt. This is much slower than
1516 %run because each line is executed in a try/except block, but it
1516 %run because each line is executed in a try/except block, but it
1517 allows running files with syntax errors in them.
1517 allows running files with syntax errors in them.
1518
1518
1519 Normally IPython will guess when a file is one of its own logfiles, so
1519 Normally IPython will guess when a file is one of its own logfiles, so
1520 you can typically use %run even for logs. This shorthand allows you to
1520 you can typically use %run even for logs. This shorthand allows you to
1521 force any file to be treated as a log file."""
1521 force any file to be treated as a log file."""
1522
1522
1523 for f in parameter_s.split():
1523 for f in parameter_s.split():
1524 self.shell.safe_execfile(f,self.shell.user_ns,
1524 self.shell.safe_execfile(f,self.shell.user_ns,
1525 self.shell.user_ns,islog=1)
1525 self.shell.user_ns,islog=1)
1526
1526
1527 def magic_timeit(self, parameter_s =''):
1527 def magic_timeit(self, parameter_s =''):
1528 """Time execution of a Python statement or expression
1528 """Time execution of a Python statement or expression
1529
1529
1530 Usage:\\
1530 Usage:\\
1531 %timeit [-n<N> -r<R> [-t|-c]] statement
1531 %timeit [-n<N> -r<R> [-t|-c]] statement
1532
1532
1533 Time execution of a Python statement or expression using the timeit
1533 Time execution of a Python statement or expression using the timeit
1534 module.
1534 module.
1535
1535
1536 Options:
1536 Options:
1537 -n<N>: execute the given statement <N> times in a loop. If this value
1537 -n<N>: execute the given statement <N> times in a loop. If this value
1538 is not given, a fitting value is chosen.
1538 is not given, a fitting value is chosen.
1539
1539
1540 -r<R>: repeat the loop iteration <R> times and take the best result.
1540 -r<R>: repeat the loop iteration <R> times and take the best result.
1541 Default: 3
1541 Default: 3
1542
1542
1543 -t: use time.time to measure the time, which is the default on Unix.
1543 -t: use time.time to measure the time, which is the default on Unix.
1544 This function measures wall time.
1544 This function measures wall time.
1545
1545
1546 -c: use time.clock to measure the time, which is the default on
1546 -c: use time.clock to measure the time, which is the default on
1547 Windows and measures wall time. On Unix, resource.getrusage is used
1547 Windows and measures wall time. On Unix, resource.getrusage is used
1548 instead and returns the CPU user time.
1548 instead and returns the CPU user time.
1549
1549
1550 -p<P>: use a precision of <P> digits to display the timing result.
1550 -p<P>: use a precision of <P> digits to display the timing result.
1551 Default: 3
1551 Default: 3
1552
1552
1553
1553
1554 Examples:\\
1554 Examples:\\
1555 In [1]: %timeit pass
1555 In [1]: %timeit pass
1556 10000000 loops, best of 3: 53.3 ns per loop
1556 10000000 loops, best of 3: 53.3 ns per loop
1557
1557
1558 In [2]: u = None
1558 In [2]: u = None
1559
1559
1560 In [3]: %timeit u is None
1560 In [3]: %timeit u is None
1561 10000000 loops, best of 3: 184 ns per loop
1561 10000000 loops, best of 3: 184 ns per loop
1562
1562
1563 In [4]: %timeit -r 4 u == None
1563 In [4]: %timeit -r 4 u == None
1564 1000000 loops, best of 4: 242 ns per loop
1564 1000000 loops, best of 4: 242 ns per loop
1565
1565
1566 In [5]: import time
1566 In [5]: import time
1567
1567
1568 In [6]: %timeit -n1 time.sleep(2)
1568 In [6]: %timeit -n1 time.sleep(2)
1569 1 loops, best of 3: 2 s per loop
1569 1 loops, best of 3: 2 s per loop
1570
1570
1571
1571
1572 The times reported by %timeit will be slightly higher than those
1572 The times reported by %timeit will be slightly higher than those
1573 reported by the timeit.py script when variables are accessed. This is
1573 reported by the timeit.py script when variables are accessed. This is
1574 due to the fact that %timeit executes the statement in the namespace
1574 due to the fact that %timeit executes the statement in the namespace
1575 of the shell, compared with timeit.py, which uses a single setup
1575 of the shell, compared with timeit.py, which uses a single setup
1576 statement to import function or create variables. Generally, the bias
1576 statement to import function or create variables. Generally, the bias
1577 does not matter as long as results from timeit.py are not mixed with
1577 does not matter as long as results from timeit.py are not mixed with
1578 those from %timeit."""
1578 those from %timeit."""
1579
1579
1580 import timeit
1580 import timeit
1581 import math
1581 import math
1582
1582
1583 units = ["s", "ms", "\xc2\xb5s", "ns"]
1583 units = ["s", "ms", "\xc2\xb5s", "ns"]
1584 scaling = [1, 1e3, 1e6, 1e9]
1584 scaling = [1, 1e3, 1e6, 1e9]
1585
1585
1586 opts, stmt = self.parse_options(parameter_s,'n:r:tcp:',
1586 opts, stmt = self.parse_options(parameter_s,'n:r:tcp:',
1587 posix=False)
1587 posix=False)
1588 if stmt == "":
1588 if stmt == "":
1589 return
1589 return
1590 timefunc = timeit.default_timer
1590 timefunc = timeit.default_timer
1591 number = int(getattr(opts, "n", 0))
1591 number = int(getattr(opts, "n", 0))
1592 repeat = int(getattr(opts, "r", timeit.default_repeat))
1592 repeat = int(getattr(opts, "r", timeit.default_repeat))
1593 precision = int(getattr(opts, "p", 3))
1593 precision = int(getattr(opts, "p", 3))
1594 if hasattr(opts, "t"):
1594 if hasattr(opts, "t"):
1595 timefunc = time.time
1595 timefunc = time.time
1596 if hasattr(opts, "c"):
1596 if hasattr(opts, "c"):
1597 timefunc = clock
1597 timefunc = clock
1598
1598
1599 timer = timeit.Timer(timer=timefunc)
1599 timer = timeit.Timer(timer=timefunc)
1600 # this code has tight coupling to the inner workings of timeit.Timer,
1600 # this code has tight coupling to the inner workings of timeit.Timer,
1601 # but is there a better way to achieve that the code stmt has access
1601 # but is there a better way to achieve that the code stmt has access
1602 # to the shell namespace?
1602 # to the shell namespace?
1603
1603
1604 src = timeit.template % {'stmt': timeit.reindent(stmt, 8),
1604 src = timeit.template % {'stmt': timeit.reindent(stmt, 8),
1605 'setup': "pass"}
1605 'setup': "pass"}
1606 code = compile(src, "<magic-timeit>", "exec")
1606 code = compile(src, "<magic-timeit>", "exec")
1607 ns = {}
1607 ns = {}
1608 exec code in self.shell.user_ns, ns
1608 exec code in self.shell.user_ns, ns
1609 timer.inner = ns["inner"]
1609 timer.inner = ns["inner"]
1610
1610
1611 if number == 0:
1611 if number == 0:
1612 # determine number so that 0.2 <= total time < 2.0
1612 # determine number so that 0.2 <= total time < 2.0
1613 number = 1
1613 number = 1
1614 for i in range(1, 10):
1614 for i in range(1, 10):
1615 number *= 10
1615 number *= 10
1616 if timer.timeit(number) >= 0.2:
1616 if timer.timeit(number) >= 0.2:
1617 break
1617 break
1618
1618
1619 best = min(timer.repeat(repeat, number)) / number
1619 best = min(timer.repeat(repeat, number)) / number
1620
1620
1621 if best > 0.0:
1621 if best > 0.0:
1622 order = min(-int(math.floor(math.log10(best)) // 3), 3)
1622 order = min(-int(math.floor(math.log10(best)) // 3), 3)
1623 else:
1623 else:
1624 order = 3
1624 order = 3
1625 print "%d loops, best of %d: %.*g %s per loop" % (number, repeat,
1625 print "%d loops, best of %d: %.*g %s per loop" % (number, repeat,
1626 precision,
1626 precision,
1627 best * scaling[order],
1627 best * scaling[order],
1628 units[order])
1628 units[order])
1629
1629
1630 def magic_time(self,parameter_s = ''):
1630 def magic_time(self,parameter_s = ''):
1631 """Time execution of a Python statement or expression.
1631 """Time execution of a Python statement or expression.
1632
1632
1633 The CPU and wall clock times are printed, and the value of the
1633 The CPU and wall clock times are printed, and the value of the
1634 expression (if any) is returned. Note that under Win32, system time
1634 expression (if any) is returned. Note that under Win32, system time
1635 is always reported as 0, since it can not be measured.
1635 is always reported as 0, since it can not be measured.
1636
1636
1637 This function provides very basic timing functionality. In Python
1637 This function provides very basic timing functionality. In Python
1638 2.3, the timeit module offers more control and sophistication, so this
1638 2.3, the timeit module offers more control and sophistication, so this
1639 could be rewritten to use it (patches welcome).
1639 could be rewritten to use it (patches welcome).
1640
1640
1641 Some examples:
1641 Some examples:
1642
1642
1643 In [1]: time 2**128
1643 In [1]: time 2**128
1644 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1644 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1645 Wall time: 0.00
1645 Wall time: 0.00
1646 Out[1]: 340282366920938463463374607431768211456L
1646 Out[1]: 340282366920938463463374607431768211456L
1647
1647
1648 In [2]: n = 1000000
1648 In [2]: n = 1000000
1649
1649
1650 In [3]: time sum(range(n))
1650 In [3]: time sum(range(n))
1651 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
1651 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
1652 Wall time: 1.37
1652 Wall time: 1.37
1653 Out[3]: 499999500000L
1653 Out[3]: 499999500000L
1654
1654
1655 In [4]: time print 'hello world'
1655 In [4]: time print 'hello world'
1656 hello world
1656 hello world
1657 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1657 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1658 Wall time: 0.00
1658 Wall time: 0.00
1659 """
1659 """
1660
1660
1661 # fail immediately if the given expression can't be compiled
1661 # fail immediately if the given expression can't be compiled
1662
1663 expr = self.shell.prefilter(parameter_s,False)
1664
1662 try:
1665 try:
1663 mode = 'eval'
1666 mode = 'eval'
1664 code = compile(parameter_s,'<timed eval>',mode)
1667 code = compile(expr,'<timed eval>',mode)
1665 except SyntaxError:
1668 except SyntaxError:
1666 mode = 'exec'
1669 mode = 'exec'
1667 code = compile(parameter_s,'<timed exec>',mode)
1670 code = compile(expr,'<timed exec>',mode)
1668 # skew measurement as little as possible
1671 # skew measurement as little as possible
1669 glob = self.shell.user_ns
1672 glob = self.shell.user_ns
1670 clk = clock2
1673 clk = clock2
1671 wtime = time.time
1674 wtime = time.time
1672 # time execution
1675 # time execution
1673 wall_st = wtime()
1676 wall_st = wtime()
1674 if mode=='eval':
1677 if mode=='eval':
1675 st = clk()
1678 st = clk()
1676 out = eval(code,glob)
1679 out = eval(code,glob)
1677 end = clk()
1680 end = clk()
1678 else:
1681 else:
1679 st = clk()
1682 st = clk()
1680 exec code in glob
1683 exec code in glob
1681 end = clk()
1684 end = clk()
1682 out = None
1685 out = None
1683 wall_end = wtime()
1686 wall_end = wtime()
1684 # Compute actual times and report
1687 # Compute actual times and report
1685 wall_time = wall_end-wall_st
1688 wall_time = wall_end-wall_st
1686 cpu_user = end[0]-st[0]
1689 cpu_user = end[0]-st[0]
1687 cpu_sys = end[1]-st[1]
1690 cpu_sys = end[1]-st[1]
1688 cpu_tot = cpu_user+cpu_sys
1691 cpu_tot = cpu_user+cpu_sys
1689 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1692 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1690 (cpu_user,cpu_sys,cpu_tot)
1693 (cpu_user,cpu_sys,cpu_tot)
1691 print "Wall time: %.2f" % wall_time
1694 print "Wall time: %.2f" % wall_time
1692 return out
1695 return out
1693
1696
1694 def magic_macro(self,parameter_s = ''):
1697 def magic_macro(self,parameter_s = ''):
1695 """Define a set of input lines as a macro for future re-execution.
1698 """Define a set of input lines as a macro for future re-execution.
1696
1699
1697 Usage:\\
1700 Usage:\\
1698 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1701 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1699
1702
1700 Options:
1703 Options:
1701
1704
1702 -r: use 'raw' input. By default, the 'processed' history is used,
1705 -r: use 'raw' input. By default, the 'processed' history is used,
1703 so that magics are loaded in their transformed version to valid
1706 so that magics are loaded in their transformed version to valid
1704 Python. If this option is given, the raw input as typed as the
1707 Python. If this option is given, the raw input as typed as the
1705 command line is used instead.
1708 command line is used instead.
1706
1709
1707 This will define a global variable called `name` which is a string
1710 This will define a global variable called `name` which is a string
1708 made of joining the slices and lines you specify (n1,n2,... numbers
1711 made of joining the slices and lines you specify (n1,n2,... numbers
1709 above) from your input history into a single string. This variable
1712 above) from your input history into a single string. This variable
1710 acts like an automatic function which re-executes those lines as if
1713 acts like an automatic function which re-executes those lines as if
1711 you had typed them. You just type 'name' at the prompt and the code
1714 you had typed them. You just type 'name' at the prompt and the code
1712 executes.
1715 executes.
1713
1716
1714 The notation for indicating number ranges is: n1-n2 means 'use line
1717 The notation for indicating number ranges is: n1-n2 means 'use line
1715 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1718 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1716 using the lines numbered 5,6 and 7.
1719 using the lines numbered 5,6 and 7.
1717
1720
1718 Note: as a 'hidden' feature, you can also use traditional python slice
1721 Note: as a 'hidden' feature, you can also use traditional python slice
1719 notation, where N:M means numbers N through M-1.
1722 notation, where N:M means numbers N through M-1.
1720
1723
1721 For example, if your history contains (%hist prints it):
1724 For example, if your history contains (%hist prints it):
1722
1725
1723 44: x=1\\
1726 44: x=1\\
1724 45: y=3\\
1727 45: y=3\\
1725 46: z=x+y\\
1728 46: z=x+y\\
1726 47: print x\\
1729 47: print x\\
1727 48: a=5\\
1730 48: a=5\\
1728 49: print 'x',x,'y',y\\
1731 49: print 'x',x,'y',y\\
1729
1732
1730 you can create a macro with lines 44 through 47 (included) and line 49
1733 you can create a macro with lines 44 through 47 (included) and line 49
1731 called my_macro with:
1734 called my_macro with:
1732
1735
1733 In [51]: %macro my_macro 44-47 49
1736 In [51]: %macro my_macro 44-47 49
1734
1737
1735 Now, typing `my_macro` (without quotes) will re-execute all this code
1738 Now, typing `my_macro` (without quotes) will re-execute all this code
1736 in one pass.
1739 in one pass.
1737
1740
1738 You don't need to give the line-numbers in order, and any given line
1741 You don't need to give the line-numbers in order, and any given line
1739 number can appear multiple times. You can assemble macros with any
1742 number can appear multiple times. You can assemble macros with any
1740 lines from your input history in any order.
1743 lines from your input history in any order.
1741
1744
1742 The macro is a simple object which holds its value in an attribute,
1745 The macro is a simple object which holds its value in an attribute,
1743 but IPython's display system checks for macros and executes them as
1746 but IPython's display system checks for macros and executes them as
1744 code instead of printing them when you type their name.
1747 code instead of printing them when you type their name.
1745
1748
1746 You can view a macro's contents by explicitly printing it with:
1749 You can view a macro's contents by explicitly printing it with:
1747
1750
1748 'print macro_name'.
1751 'print macro_name'.
1749
1752
1750 For one-off cases which DON'T contain magic function calls in them you
1753 For one-off cases which DON'T contain magic function calls in them you
1751 can obtain similar results by explicitly executing slices from your
1754 can obtain similar results by explicitly executing slices from your
1752 input history with:
1755 input history with:
1753
1756
1754 In [60]: exec In[44:48]+In[49]"""
1757 In [60]: exec In[44:48]+In[49]"""
1755
1758
1756 opts,args = self.parse_options(parameter_s,'r',mode='list')
1759 opts,args = self.parse_options(parameter_s,'r',mode='list')
1757 if not args:
1760 if not args:
1758 macs = [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)]
1761 macs = [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)]
1759 macs.sort()
1762 macs.sort()
1760 return macs
1763 return macs
1761 name,ranges = args[0], args[1:]
1764 name,ranges = args[0], args[1:]
1762 #print 'rng',ranges # dbg
1765 #print 'rng',ranges # dbg
1763 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1766 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1764 macro = Macro(lines)
1767 macro = Macro(lines)
1765 self.shell.user_ns.update({name:macro})
1768 self.shell.user_ns.update({name:macro})
1766 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1769 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1767 print 'Macro contents:'
1770 print 'Macro contents:'
1768 print macro,
1771 print macro,
1769
1772
1770 def magic_save(self,parameter_s = ''):
1773 def magic_save(self,parameter_s = ''):
1771 """Save a set of lines to a given filename.
1774 """Save a set of lines to a given filename.
1772
1775
1773 Usage:\\
1776 Usage:\\
1774 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1777 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1775
1778
1776 Options:
1779 Options:
1777
1780
1778 -r: use 'raw' input. By default, the 'processed' history is used,
1781 -r: use 'raw' input. By default, the 'processed' history is used,
1779 so that magics are loaded in their transformed version to valid
1782 so that magics are loaded in their transformed version to valid
1780 Python. If this option is given, the raw input as typed as the
1783 Python. If this option is given, the raw input as typed as the
1781 command line is used instead.
1784 command line is used instead.
1782
1785
1783 This function uses the same syntax as %macro for line extraction, but
1786 This function uses the same syntax as %macro for line extraction, but
1784 instead of creating a macro it saves the resulting string to the
1787 instead of creating a macro it saves the resulting string to the
1785 filename you specify.
1788 filename you specify.
1786
1789
1787 It adds a '.py' extension to the file if you don't do so yourself, and
1790 It adds a '.py' extension to the file if you don't do so yourself, and
1788 it asks for confirmation before overwriting existing files."""
1791 it asks for confirmation before overwriting existing files."""
1789
1792
1790 opts,args = self.parse_options(parameter_s,'r',mode='list')
1793 opts,args = self.parse_options(parameter_s,'r',mode='list')
1791 fname,ranges = args[0], args[1:]
1794 fname,ranges = args[0], args[1:]
1792 if not fname.endswith('.py'):
1795 if not fname.endswith('.py'):
1793 fname += '.py'
1796 fname += '.py'
1794 if os.path.isfile(fname):
1797 if os.path.isfile(fname):
1795 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1798 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1796 if ans.lower() not in ['y','yes']:
1799 if ans.lower() not in ['y','yes']:
1797 print 'Operation cancelled.'
1800 print 'Operation cancelled.'
1798 return
1801 return
1799 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1802 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1800 f = file(fname,'w')
1803 f = file(fname,'w')
1801 f.write(cmds)
1804 f.write(cmds)
1802 f.close()
1805 f.close()
1803 print 'The following commands were written to file `%s`:' % fname
1806 print 'The following commands were written to file `%s`:' % fname
1804 print cmds
1807 print cmds
1805
1808
1806 def _edit_macro(self,mname,macro):
1809 def _edit_macro(self,mname,macro):
1807 """open an editor with the macro data in a file"""
1810 """open an editor with the macro data in a file"""
1808 filename = self.shell.mktempfile(macro.value)
1811 filename = self.shell.mktempfile(macro.value)
1809 self.shell.hooks.editor(filename)
1812 self.shell.hooks.editor(filename)
1810
1813
1811 # and make a new macro object, to replace the old one
1814 # and make a new macro object, to replace the old one
1812 mfile = open(filename)
1815 mfile = open(filename)
1813 mvalue = mfile.read()
1816 mvalue = mfile.read()
1814 mfile.close()
1817 mfile.close()
1815 self.shell.user_ns[mname] = Macro(mvalue)
1818 self.shell.user_ns[mname] = Macro(mvalue)
1816
1819
1817 def magic_ed(self,parameter_s=''):
1820 def magic_ed(self,parameter_s=''):
1818 """Alias to %edit."""
1821 """Alias to %edit."""
1819 return self.magic_edit(parameter_s)
1822 return self.magic_edit(parameter_s)
1820
1823
1821 def magic_edit(self,parameter_s='',last_call=['','']):
1824 def magic_edit(self,parameter_s='',last_call=['','']):
1822 """Bring up an editor and execute the resulting code.
1825 """Bring up an editor and execute the resulting code.
1823
1826
1824 Usage:
1827 Usage:
1825 %edit [options] [args]
1828 %edit [options] [args]
1826
1829
1827 %edit runs IPython's editor hook. The default version of this hook is
1830 %edit runs IPython's editor hook. The default version of this hook is
1828 set to call the __IPYTHON__.rc.editor command. This is read from your
1831 set to call the __IPYTHON__.rc.editor command. This is read from your
1829 environment variable $EDITOR. If this isn't found, it will default to
1832 environment variable $EDITOR. If this isn't found, it will default to
1830 vi under Linux/Unix and to notepad under Windows. See the end of this
1833 vi under Linux/Unix and to notepad under Windows. See the end of this
1831 docstring for how to change the editor hook.
1834 docstring for how to change the editor hook.
1832
1835
1833 You can also set the value of this editor via the command line option
1836 You can also set the value of this editor via the command line option
1834 '-editor' or in your ipythonrc file. This is useful if you wish to use
1837 '-editor' or in your ipythonrc file. This is useful if you wish to use
1835 specifically for IPython an editor different from your typical default
1838 specifically for IPython an editor different from your typical default
1836 (and for Windows users who typically don't set environment variables).
1839 (and for Windows users who typically don't set environment variables).
1837
1840
1838 This command allows you to conveniently edit multi-line code right in
1841 This command allows you to conveniently edit multi-line code right in
1839 your IPython session.
1842 your IPython session.
1840
1843
1841 If called without arguments, %edit opens up an empty editor with a
1844 If called without arguments, %edit opens up an empty editor with a
1842 temporary file and will execute the contents of this file when you
1845 temporary file and will execute the contents of this file when you
1843 close it (don't forget to save it!).
1846 close it (don't forget to save it!).
1844
1847
1845
1848
1846 Options:
1849 Options:
1847
1850
1848 -n <number>: open the editor at a specified line number. By default,
1851 -n <number>: open the editor at a specified line number. By default,
1849 the IPython editor hook uses the unix syntax 'editor +N filename', but
1852 the IPython editor hook uses the unix syntax 'editor +N filename', but
1850 you can configure this by providing your own modified hook if your
1853 you can configure this by providing your own modified hook if your
1851 favorite editor supports line-number specifications with a different
1854 favorite editor supports line-number specifications with a different
1852 syntax.
1855 syntax.
1853
1856
1854 -p: this will call the editor with the same data as the previous time
1857 -p: this will call the editor with the same data as the previous time
1855 it was used, regardless of how long ago (in your current session) it
1858 it was used, regardless of how long ago (in your current session) it
1856 was.
1859 was.
1857
1860
1858 -r: use 'raw' input. This option only applies to input taken from the
1861 -r: use 'raw' input. This option only applies to input taken from the
1859 user's history. By default, the 'processed' history is used, so that
1862 user's history. By default, the 'processed' history is used, so that
1860 magics are loaded in their transformed version to valid Python. If
1863 magics are loaded in their transformed version to valid Python. If
1861 this option is given, the raw input as typed as the command line is
1864 this option is given, the raw input as typed as the command line is
1862 used instead. When you exit the editor, it will be executed by
1865 used instead. When you exit the editor, it will be executed by
1863 IPython's own processor.
1866 IPython's own processor.
1864
1867
1865 -x: do not execute the edited code immediately upon exit. This is
1868 -x: do not execute the edited code immediately upon exit. This is
1866 mainly useful if you are editing programs which need to be called with
1869 mainly useful if you are editing programs which need to be called with
1867 command line arguments, which you can then do using %run.
1870 command line arguments, which you can then do using %run.
1868
1871
1869
1872
1870 Arguments:
1873 Arguments:
1871
1874
1872 If arguments are given, the following possibilites exist:
1875 If arguments are given, the following possibilites exist:
1873
1876
1874 - The arguments are numbers or pairs of colon-separated numbers (like
1877 - The arguments are numbers or pairs of colon-separated numbers (like
1875 1 4:8 9). These are interpreted as lines of previous input to be
1878 1 4:8 9). These are interpreted as lines of previous input to be
1876 loaded into the editor. The syntax is the same of the %macro command.
1879 loaded into the editor. The syntax is the same of the %macro command.
1877
1880
1878 - If the argument doesn't start with a number, it is evaluated as a
1881 - If the argument doesn't start with a number, it is evaluated as a
1879 variable and its contents loaded into the editor. You can thus edit
1882 variable and its contents loaded into the editor. You can thus edit
1880 any string which contains python code (including the result of
1883 any string which contains python code (including the result of
1881 previous edits).
1884 previous edits).
1882
1885
1883 - If the argument is the name of an object (other than a string),
1886 - If the argument is the name of an object (other than a string),
1884 IPython will try to locate the file where it was defined and open the
1887 IPython will try to locate the file where it was defined and open the
1885 editor at the point where it is defined. You can use `%edit function`
1888 editor at the point where it is defined. You can use `%edit function`
1886 to load an editor exactly at the point where 'function' is defined,
1889 to load an editor exactly at the point where 'function' is defined,
1887 edit it and have the file be executed automatically.
1890 edit it and have the file be executed automatically.
1888
1891
1889 If the object is a macro (see %macro for details), this opens up your
1892 If the object is a macro (see %macro for details), this opens up your
1890 specified editor with a temporary file containing the macro's data.
1893 specified editor with a temporary file containing the macro's data.
1891 Upon exit, the macro is reloaded with the contents of the file.
1894 Upon exit, the macro is reloaded with the contents of the file.
1892
1895
1893 Note: opening at an exact line is only supported under Unix, and some
1896 Note: opening at an exact line is only supported under Unix, and some
1894 editors (like kedit and gedit up to Gnome 2.8) do not understand the
1897 editors (like kedit and gedit up to Gnome 2.8) do not understand the
1895 '+NUMBER' parameter necessary for this feature. Good editors like
1898 '+NUMBER' parameter necessary for this feature. Good editors like
1896 (X)Emacs, vi, jed, pico and joe all do.
1899 (X)Emacs, vi, jed, pico and joe all do.
1897
1900
1898 - If the argument is not found as a variable, IPython will look for a
1901 - If the argument is not found as a variable, IPython will look for a
1899 file with that name (adding .py if necessary) and load it into the
1902 file with that name (adding .py if necessary) and load it into the
1900 editor. It will execute its contents with execfile() when you exit,
1903 editor. It will execute its contents with execfile() when you exit,
1901 loading any code in the file into your interactive namespace.
1904 loading any code in the file into your interactive namespace.
1902
1905
1903 After executing your code, %edit will return as output the code you
1906 After executing your code, %edit will return as output the code you
1904 typed in the editor (except when it was an existing file). This way
1907 typed in the editor (except when it was an existing file). This way
1905 you can reload the code in further invocations of %edit as a variable,
1908 you can reload the code in further invocations of %edit as a variable,
1906 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
1909 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
1907 the output.
1910 the output.
1908
1911
1909 Note that %edit is also available through the alias %ed.
1912 Note that %edit is also available through the alias %ed.
1910
1913
1911 This is an example of creating a simple function inside the editor and
1914 This is an example of creating a simple function inside the editor and
1912 then modifying it. First, start up the editor:
1915 then modifying it. First, start up the editor:
1913
1916
1914 In [1]: ed\\
1917 In [1]: ed\\
1915 Editing... done. Executing edited code...\\
1918 Editing... done. Executing edited code...\\
1916 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
1919 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
1917
1920
1918 We can then call the function foo():
1921 We can then call the function foo():
1919
1922
1920 In [2]: foo()\\
1923 In [2]: foo()\\
1921 foo() was defined in an editing session
1924 foo() was defined in an editing session
1922
1925
1923 Now we edit foo. IPython automatically loads the editor with the
1926 Now we edit foo. IPython automatically loads the editor with the
1924 (temporary) file where foo() was previously defined:
1927 (temporary) file where foo() was previously defined:
1925
1928
1926 In [3]: ed foo\\
1929 In [3]: ed foo\\
1927 Editing... done. Executing edited code...
1930 Editing... done. Executing edited code...
1928
1931
1929 And if we call foo() again we get the modified version:
1932 And if we call foo() again we get the modified version:
1930
1933
1931 In [4]: foo()\\
1934 In [4]: foo()\\
1932 foo() has now been changed!
1935 foo() has now been changed!
1933
1936
1934 Here is an example of how to edit a code snippet successive
1937 Here is an example of how to edit a code snippet successive
1935 times. First we call the editor:
1938 times. First we call the editor:
1936
1939
1937 In [8]: ed\\
1940 In [8]: ed\\
1938 Editing... done. Executing edited code...\\
1941 Editing... done. Executing edited code...\\
1939 hello\\
1942 hello\\
1940 Out[8]: "print 'hello'\\n"
1943 Out[8]: "print 'hello'\\n"
1941
1944
1942 Now we call it again with the previous output (stored in _):
1945 Now we call it again with the previous output (stored in _):
1943
1946
1944 In [9]: ed _\\
1947 In [9]: ed _\\
1945 Editing... done. Executing edited code...\\
1948 Editing... done. Executing edited code...\\
1946 hello world\\
1949 hello world\\
1947 Out[9]: "print 'hello world'\\n"
1950 Out[9]: "print 'hello world'\\n"
1948
1951
1949 Now we call it with the output #8 (stored in _8, also as Out[8]):
1952 Now we call it with the output #8 (stored in _8, also as Out[8]):
1950
1953
1951 In [10]: ed _8\\
1954 In [10]: ed _8\\
1952 Editing... done. Executing edited code...\\
1955 Editing... done. Executing edited code...\\
1953 hello again\\
1956 hello again\\
1954 Out[10]: "print 'hello again'\\n"
1957 Out[10]: "print 'hello again'\\n"
1955
1958
1956
1959
1957 Changing the default editor hook:
1960 Changing the default editor hook:
1958
1961
1959 If you wish to write your own editor hook, you can put it in a
1962 If you wish to write your own editor hook, you can put it in a
1960 configuration file which you load at startup time. The default hook
1963 configuration file which you load at startup time. The default hook
1961 is defined in the IPython.hooks module, and you can use that as a
1964 is defined in the IPython.hooks module, and you can use that as a
1962 starting example for further modifications. That file also has
1965 starting example for further modifications. That file also has
1963 general instructions on how to set a new hook for use once you've
1966 general instructions on how to set a new hook for use once you've
1964 defined it."""
1967 defined it."""
1965
1968
1966 # FIXME: This function has become a convoluted mess. It needs a
1969 # FIXME: This function has become a convoluted mess. It needs a
1967 # ground-up rewrite with clean, simple logic.
1970 # ground-up rewrite with clean, simple logic.
1968
1971
1969 def make_filename(arg):
1972 def make_filename(arg):
1970 "Make a filename from the given args"
1973 "Make a filename from the given args"
1971 try:
1974 try:
1972 filename = get_py_filename(arg)
1975 filename = get_py_filename(arg)
1973 except IOError:
1976 except IOError:
1974 if args.endswith('.py'):
1977 if args.endswith('.py'):
1975 filename = arg
1978 filename = arg
1976 else:
1979 else:
1977 filename = None
1980 filename = None
1978 return filename
1981 return filename
1979
1982
1980 # custom exceptions
1983 # custom exceptions
1981 class DataIsObject(Exception): pass
1984 class DataIsObject(Exception): pass
1982
1985
1983 opts,args = self.parse_options(parameter_s,'prxn:')
1986 opts,args = self.parse_options(parameter_s,'prxn:')
1984 # Set a few locals from the options for convenience:
1987 # Set a few locals from the options for convenience:
1985 opts_p = opts.has_key('p')
1988 opts_p = opts.has_key('p')
1986 opts_r = opts.has_key('r')
1989 opts_r = opts.has_key('r')
1987
1990
1988 # Default line number value
1991 # Default line number value
1989 lineno = opts.get('n',None)
1992 lineno = opts.get('n',None)
1990
1993
1991 if opts_p:
1994 if opts_p:
1992 args = '_%s' % last_call[0]
1995 args = '_%s' % last_call[0]
1993 if not self.shell.user_ns.has_key(args):
1996 if not self.shell.user_ns.has_key(args):
1994 args = last_call[1]
1997 args = last_call[1]
1995
1998
1996 # use last_call to remember the state of the previous call, but don't
1999 # use last_call to remember the state of the previous call, but don't
1997 # let it be clobbered by successive '-p' calls.
2000 # let it be clobbered by successive '-p' calls.
1998 try:
2001 try:
1999 last_call[0] = self.shell.outputcache.prompt_count
2002 last_call[0] = self.shell.outputcache.prompt_count
2000 if not opts_p:
2003 if not opts_p:
2001 last_call[1] = parameter_s
2004 last_call[1] = parameter_s
2002 except:
2005 except:
2003 pass
2006 pass
2004
2007
2005 # by default this is done with temp files, except when the given
2008 # by default this is done with temp files, except when the given
2006 # arg is a filename
2009 # arg is a filename
2007 use_temp = 1
2010 use_temp = 1
2008
2011
2009 if re.match(r'\d',args):
2012 if re.match(r'\d',args):
2010 # Mode where user specifies ranges of lines, like in %macro.
2013 # Mode where user specifies ranges of lines, like in %macro.
2011 # This means that you can't edit files whose names begin with
2014 # This means that you can't edit files whose names begin with
2012 # numbers this way. Tough.
2015 # numbers this way. Tough.
2013 ranges = args.split()
2016 ranges = args.split()
2014 data = ''.join(self.extract_input_slices(ranges,opts_r))
2017 data = ''.join(self.extract_input_slices(ranges,opts_r))
2015 elif args.endswith('.py'):
2018 elif args.endswith('.py'):
2016 filename = make_filename(args)
2019 filename = make_filename(args)
2017 data = ''
2020 data = ''
2018 use_temp = 0
2021 use_temp = 0
2019 elif args:
2022 elif args:
2020 try:
2023 try:
2021 # Load the parameter given as a variable. If not a string,
2024 # Load the parameter given as a variable. If not a string,
2022 # process it as an object instead (below)
2025 # process it as an object instead (below)
2023
2026
2024 #print '*** args',args,'type',type(args) # dbg
2027 #print '*** args',args,'type',type(args) # dbg
2025 data = eval(args,self.shell.user_ns)
2028 data = eval(args,self.shell.user_ns)
2026 if not type(data) in StringTypes:
2029 if not type(data) in StringTypes:
2027 raise DataIsObject
2030 raise DataIsObject
2028
2031
2029 except (NameError,SyntaxError):
2032 except (NameError,SyntaxError):
2030 # given argument is not a variable, try as a filename
2033 # given argument is not a variable, try as a filename
2031 filename = make_filename(args)
2034 filename = make_filename(args)
2032 if filename is None:
2035 if filename is None:
2033 warn("Argument given (%s) can't be found as a variable "
2036 warn("Argument given (%s) can't be found as a variable "
2034 "or as a filename." % args)
2037 "or as a filename." % args)
2035 return
2038 return
2036
2039
2037 data = ''
2040 data = ''
2038 use_temp = 0
2041 use_temp = 0
2039 except DataIsObject:
2042 except DataIsObject:
2040
2043
2041 # macros have a special edit function
2044 # macros have a special edit function
2042 if isinstance(data,Macro):
2045 if isinstance(data,Macro):
2043 self._edit_macro(args,data)
2046 self._edit_macro(args,data)
2044 return
2047 return
2045
2048
2046 # For objects, try to edit the file where they are defined
2049 # For objects, try to edit the file where they are defined
2047 try:
2050 try:
2048 filename = inspect.getabsfile(data)
2051 filename = inspect.getabsfile(data)
2049 datafile = 1
2052 datafile = 1
2050 except TypeError:
2053 except TypeError:
2051 filename = make_filename(args)
2054 filename = make_filename(args)
2052 datafile = 1
2055 datafile = 1
2053 warn('Could not find file where `%s` is defined.\n'
2056 warn('Could not find file where `%s` is defined.\n'
2054 'Opening a file named `%s`' % (args,filename))
2057 'Opening a file named `%s`' % (args,filename))
2055 # Now, make sure we can actually read the source (if it was in
2058 # Now, make sure we can actually read the source (if it was in
2056 # a temp file it's gone by now).
2059 # a temp file it's gone by now).
2057 if datafile:
2060 if datafile:
2058 try:
2061 try:
2059 if lineno is None:
2062 if lineno is None:
2060 lineno = inspect.getsourcelines(data)[1]
2063 lineno = inspect.getsourcelines(data)[1]
2061 except IOError:
2064 except IOError:
2062 filename = make_filename(args)
2065 filename = make_filename(args)
2063 if filename is None:
2066 if filename is None:
2064 warn('The file `%s` where `%s` was defined cannot '
2067 warn('The file `%s` where `%s` was defined cannot '
2065 'be read.' % (filename,data))
2068 'be read.' % (filename,data))
2066 return
2069 return
2067 use_temp = 0
2070 use_temp = 0
2068 else:
2071 else:
2069 data = ''
2072 data = ''
2070
2073
2071 if use_temp:
2074 if use_temp:
2072 filename = self.shell.mktempfile(data)
2075 filename = self.shell.mktempfile(data)
2073 print 'IPython will make a temporary file named:',filename
2076 print 'IPython will make a temporary file named:',filename
2074
2077
2075 # do actual editing here
2078 # do actual editing here
2076 print 'Editing...',
2079 print 'Editing...',
2077 sys.stdout.flush()
2080 sys.stdout.flush()
2078 self.shell.hooks.editor(filename,lineno)
2081 self.shell.hooks.editor(filename,lineno)
2079 if opts.has_key('x'): # -x prevents actual execution
2082 if opts.has_key('x'): # -x prevents actual execution
2080 print
2083 print
2081 else:
2084 else:
2082 print 'done. Executing edited code...'
2085 print 'done. Executing edited code...'
2083 if opts_r:
2086 if opts_r:
2084 self.shell.runlines(file_read(filename))
2087 self.shell.runlines(file_read(filename))
2085 else:
2088 else:
2086 self.shell.safe_execfile(filename,self.shell.user_ns,
2089 self.shell.safe_execfile(filename,self.shell.user_ns,
2087 self.shell.user_ns)
2090 self.shell.user_ns)
2088 if use_temp:
2091 if use_temp:
2089 try:
2092 try:
2090 return open(filename).read()
2093 return open(filename).read()
2091 except IOError,msg:
2094 except IOError,msg:
2092 if msg.filename == filename:
2095 if msg.filename == filename:
2093 warn('File not found. Did you forget to save?')
2096 warn('File not found. Did you forget to save?')
2094 return
2097 return
2095 else:
2098 else:
2096 self.shell.showtraceback()
2099 self.shell.showtraceback()
2097
2100
2098 def magic_xmode(self,parameter_s = ''):
2101 def magic_xmode(self,parameter_s = ''):
2099 """Switch modes for the exception handlers.
2102 """Switch modes for the exception handlers.
2100
2103
2101 Valid modes: Plain, Context and Verbose.
2104 Valid modes: Plain, Context and Verbose.
2102
2105
2103 If called without arguments, acts as a toggle."""
2106 If called without arguments, acts as a toggle."""
2104
2107
2105 def xmode_switch_err(name):
2108 def xmode_switch_err(name):
2106 warn('Error changing %s exception modes.\n%s' %
2109 warn('Error changing %s exception modes.\n%s' %
2107 (name,sys.exc_info()[1]))
2110 (name,sys.exc_info()[1]))
2108
2111
2109 shell = self.shell
2112 shell = self.shell
2110 new_mode = parameter_s.strip().capitalize()
2113 new_mode = parameter_s.strip().capitalize()
2111 try:
2114 try:
2112 shell.InteractiveTB.set_mode(mode=new_mode)
2115 shell.InteractiveTB.set_mode(mode=new_mode)
2113 print 'Exception reporting mode:',shell.InteractiveTB.mode
2116 print 'Exception reporting mode:',shell.InteractiveTB.mode
2114 except:
2117 except:
2115 xmode_switch_err('user')
2118 xmode_switch_err('user')
2116
2119
2117 # threaded shells use a special handler in sys.excepthook
2120 # threaded shells use a special handler in sys.excepthook
2118 if shell.isthreaded:
2121 if shell.isthreaded:
2119 try:
2122 try:
2120 shell.sys_excepthook.set_mode(mode=new_mode)
2123 shell.sys_excepthook.set_mode(mode=new_mode)
2121 except:
2124 except:
2122 xmode_switch_err('threaded')
2125 xmode_switch_err('threaded')
2123
2126
2124 def magic_colors(self,parameter_s = ''):
2127 def magic_colors(self,parameter_s = ''):
2125 """Switch color scheme for prompts, info system and exception handlers.
2128 """Switch color scheme for prompts, info system and exception handlers.
2126
2129
2127 Currently implemented schemes: NoColor, Linux, LightBG.
2130 Currently implemented schemes: NoColor, Linux, LightBG.
2128
2131
2129 Color scheme names are not case-sensitive."""
2132 Color scheme names are not case-sensitive."""
2130
2133
2131 def color_switch_err(name):
2134 def color_switch_err(name):
2132 warn('Error changing %s color schemes.\n%s' %
2135 warn('Error changing %s color schemes.\n%s' %
2133 (name,sys.exc_info()[1]))
2136 (name,sys.exc_info()[1]))
2134
2137
2135
2138
2136 new_scheme = parameter_s.strip()
2139 new_scheme = parameter_s.strip()
2137 if not new_scheme:
2140 if not new_scheme:
2138 print 'You must specify a color scheme.'
2141 print 'You must specify a color scheme.'
2139 return
2142 return
2140 # local shortcut
2143 # local shortcut
2141 shell = self.shell
2144 shell = self.shell
2142
2145
2143 import IPython.rlineimpl as readline
2146 import IPython.rlineimpl as readline
2144
2147
2145 if not readline.have_readline and sys.platform == "win32":
2148 if not readline.have_readline and sys.platform == "win32":
2146 msg = """\
2149 msg = """\
2147 Proper color support under MS Windows requires the pyreadline library.
2150 Proper color support under MS Windows requires the pyreadline library.
2148 You can find it at:
2151 You can find it at:
2149 http://ipython.scipy.org/moin/PyReadline/Intro
2152 http://ipython.scipy.org/moin/PyReadline/Intro
2150 Gary's readline needs the ctypes module, from:
2153 Gary's readline needs the ctypes module, from:
2151 http://starship.python.net/crew/theller/ctypes
2154 http://starship.python.net/crew/theller/ctypes
2152 (Note that ctypes is already part of Python versions 2.5 and newer).
2155 (Note that ctypes is already part of Python versions 2.5 and newer).
2153
2156
2154 Defaulting color scheme to 'NoColor'"""
2157 Defaulting color scheme to 'NoColor'"""
2155 new_scheme = 'NoColor'
2158 new_scheme = 'NoColor'
2156 warn(msg)
2159 warn(msg)
2157
2160
2158 # readline option is 0
2161 # readline option is 0
2159 if not shell.has_readline:
2162 if not shell.has_readline:
2160 new_scheme = 'NoColor'
2163 new_scheme = 'NoColor'
2161
2164
2162 # Set prompt colors
2165 # Set prompt colors
2163 try:
2166 try:
2164 shell.outputcache.set_colors(new_scheme)
2167 shell.outputcache.set_colors(new_scheme)
2165 except:
2168 except:
2166 color_switch_err('prompt')
2169 color_switch_err('prompt')
2167 else:
2170 else:
2168 shell.rc.colors = \
2171 shell.rc.colors = \
2169 shell.outputcache.color_table.active_scheme_name
2172 shell.outputcache.color_table.active_scheme_name
2170 # Set exception colors
2173 # Set exception colors
2171 try:
2174 try:
2172 shell.InteractiveTB.set_colors(scheme = new_scheme)
2175 shell.InteractiveTB.set_colors(scheme = new_scheme)
2173 shell.SyntaxTB.set_colors(scheme = new_scheme)
2176 shell.SyntaxTB.set_colors(scheme = new_scheme)
2174 except:
2177 except:
2175 color_switch_err('exception')
2178 color_switch_err('exception')
2176
2179
2177 # threaded shells use a verbose traceback in sys.excepthook
2180 # threaded shells use a verbose traceback in sys.excepthook
2178 if shell.isthreaded:
2181 if shell.isthreaded:
2179 try:
2182 try:
2180 shell.sys_excepthook.set_colors(scheme=new_scheme)
2183 shell.sys_excepthook.set_colors(scheme=new_scheme)
2181 except:
2184 except:
2182 color_switch_err('system exception handler')
2185 color_switch_err('system exception handler')
2183
2186
2184 # Set info (for 'object?') colors
2187 # Set info (for 'object?') colors
2185 if shell.rc.color_info:
2188 if shell.rc.color_info:
2186 try:
2189 try:
2187 shell.inspector.set_active_scheme(new_scheme)
2190 shell.inspector.set_active_scheme(new_scheme)
2188 except:
2191 except:
2189 color_switch_err('object inspector')
2192 color_switch_err('object inspector')
2190 else:
2193 else:
2191 shell.inspector.set_active_scheme('NoColor')
2194 shell.inspector.set_active_scheme('NoColor')
2192
2195
2193 def magic_color_info(self,parameter_s = ''):
2196 def magic_color_info(self,parameter_s = ''):
2194 """Toggle color_info.
2197 """Toggle color_info.
2195
2198
2196 The color_info configuration parameter controls whether colors are
2199 The color_info configuration parameter controls whether colors are
2197 used for displaying object details (by things like %psource, %pfile or
2200 used for displaying object details (by things like %psource, %pfile or
2198 the '?' system). This function toggles this value with each call.
2201 the '?' system). This function toggles this value with each call.
2199
2202
2200 Note that unless you have a fairly recent pager (less works better
2203 Note that unless you have a fairly recent pager (less works better
2201 than more) in your system, using colored object information displays
2204 than more) in your system, using colored object information displays
2202 will not work properly. Test it and see."""
2205 will not work properly. Test it and see."""
2203
2206
2204 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2207 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2205 self.magic_colors(self.shell.rc.colors)
2208 self.magic_colors(self.shell.rc.colors)
2206 print 'Object introspection functions have now coloring:',
2209 print 'Object introspection functions have now coloring:',
2207 print ['OFF','ON'][self.shell.rc.color_info]
2210 print ['OFF','ON'][self.shell.rc.color_info]
2208
2211
2209 def magic_Pprint(self, parameter_s=''):
2212 def magic_Pprint(self, parameter_s=''):
2210 """Toggle pretty printing on/off."""
2213 """Toggle pretty printing on/off."""
2211
2214
2212 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2215 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2213 print 'Pretty printing has been turned', \
2216 print 'Pretty printing has been turned', \
2214 ['OFF','ON'][self.shell.rc.pprint]
2217 ['OFF','ON'][self.shell.rc.pprint]
2215
2218
2216 def magic_exit(self, parameter_s=''):
2219 def magic_exit(self, parameter_s=''):
2217 """Exit IPython, confirming if configured to do so.
2220 """Exit IPython, confirming if configured to do so.
2218
2221
2219 You can configure whether IPython asks for confirmation upon exit by
2222 You can configure whether IPython asks for confirmation upon exit by
2220 setting the confirm_exit flag in the ipythonrc file."""
2223 setting the confirm_exit flag in the ipythonrc file."""
2221
2224
2222 self.shell.exit()
2225 self.shell.exit()
2223
2226
2224 def magic_quit(self, parameter_s=''):
2227 def magic_quit(self, parameter_s=''):
2225 """Exit IPython, confirming if configured to do so (like %exit)"""
2228 """Exit IPython, confirming if configured to do so (like %exit)"""
2226
2229
2227 self.shell.exit()
2230 self.shell.exit()
2228
2231
2229 def magic_Exit(self, parameter_s=''):
2232 def magic_Exit(self, parameter_s=''):
2230 """Exit IPython without confirmation."""
2233 """Exit IPython without confirmation."""
2231
2234
2232 self.shell.exit_now = True
2235 self.shell.exit_now = True
2233
2236
2234 #......................................................................
2237 #......................................................................
2235 # Functions to implement unix shell-type things
2238 # Functions to implement unix shell-type things
2236
2239
2237 def magic_alias(self, parameter_s = ''):
2240 def magic_alias(self, parameter_s = ''):
2238 """Define an alias for a system command.
2241 """Define an alias for a system command.
2239
2242
2240 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2243 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2241
2244
2242 Then, typing 'alias_name params' will execute the system command 'cmd
2245 Then, typing 'alias_name params' will execute the system command 'cmd
2243 params' (from your underlying operating system).
2246 params' (from your underlying operating system).
2244
2247
2245 Aliases have lower precedence than magic functions and Python normal
2248 Aliases have lower precedence than magic functions and Python normal
2246 variables, so if 'foo' is both a Python variable and an alias, the
2249 variables, so if 'foo' is both a Python variable and an alias, the
2247 alias can not be executed until 'del foo' removes the Python variable.
2250 alias can not be executed until 'del foo' removes the Python variable.
2248
2251
2249 You can use the %l specifier in an alias definition to represent the
2252 You can use the %l specifier in an alias definition to represent the
2250 whole line when the alias is called. For example:
2253 whole line when the alias is called. For example:
2251
2254
2252 In [2]: alias all echo "Input in brackets: <%l>"\\
2255 In [2]: alias all echo "Input in brackets: <%l>"\\
2253 In [3]: all hello world\\
2256 In [3]: all hello world\\
2254 Input in brackets: <hello world>
2257 Input in brackets: <hello world>
2255
2258
2256 You can also define aliases with parameters using %s specifiers (one
2259 You can also define aliases with parameters using %s specifiers (one
2257 per parameter):
2260 per parameter):
2258
2261
2259 In [1]: alias parts echo first %s second %s\\
2262 In [1]: alias parts echo first %s second %s\\
2260 In [2]: %parts A B\\
2263 In [2]: %parts A B\\
2261 first A second B\\
2264 first A second B\\
2262 In [3]: %parts A\\
2265 In [3]: %parts A\\
2263 Incorrect number of arguments: 2 expected.\\
2266 Incorrect number of arguments: 2 expected.\\
2264 parts is an alias to: 'echo first %s second %s'
2267 parts is an alias to: 'echo first %s second %s'
2265
2268
2266 Note that %l and %s are mutually exclusive. You can only use one or
2269 Note that %l and %s are mutually exclusive. You can only use one or
2267 the other in your aliases.
2270 the other in your aliases.
2268
2271
2269 Aliases expand Python variables just like system calls using ! or !!
2272 Aliases expand Python variables just like system calls using ! or !!
2270 do: all expressions prefixed with '$' get expanded. For details of
2273 do: all expressions prefixed with '$' get expanded. For details of
2271 the semantic rules, see PEP-215:
2274 the semantic rules, see PEP-215:
2272 http://www.python.org/peps/pep-0215.html. This is the library used by
2275 http://www.python.org/peps/pep-0215.html. This is the library used by
2273 IPython for variable expansion. If you want to access a true shell
2276 IPython for variable expansion. If you want to access a true shell
2274 variable, an extra $ is necessary to prevent its expansion by IPython:
2277 variable, an extra $ is necessary to prevent its expansion by IPython:
2275
2278
2276 In [6]: alias show echo\\
2279 In [6]: alias show echo\\
2277 In [7]: PATH='A Python string'\\
2280 In [7]: PATH='A Python string'\\
2278 In [8]: show $PATH\\
2281 In [8]: show $PATH\\
2279 A Python string\\
2282 A Python string\\
2280 In [9]: show $$PATH\\
2283 In [9]: show $$PATH\\
2281 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2284 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2282
2285
2283 You can use the alias facility to acess all of $PATH. See the %rehash
2286 You can use the alias facility to acess all of $PATH. See the %rehash
2284 and %rehashx functions, which automatically create aliases for the
2287 and %rehashx functions, which automatically create aliases for the
2285 contents of your $PATH.
2288 contents of your $PATH.
2286
2289
2287 If called with no parameters, %alias prints the current alias table."""
2290 If called with no parameters, %alias prints the current alias table."""
2288
2291
2289 par = parameter_s.strip()
2292 par = parameter_s.strip()
2290 if not par:
2293 if not par:
2291 stored = self.db.get('stored_aliases', {} )
2294 stored = self.db.get('stored_aliases', {} )
2292 atab = self.shell.alias_table
2295 atab = self.shell.alias_table
2293 aliases = atab.keys()
2296 aliases = atab.keys()
2294 aliases.sort()
2297 aliases.sort()
2295 res = []
2298 res = []
2296 showlast = []
2299 showlast = []
2297 for alias in aliases:
2300 for alias in aliases:
2298 special = False
2301 special = False
2299 try:
2302 try:
2300 tgt = atab[alias][1]
2303 tgt = atab[alias][1]
2301 except (TypeError, AttributeError):
2304 except (TypeError, AttributeError):
2302 # unsubscriptable? probably a callable
2305 # unsubscriptable? probably a callable
2303 tgt = atab[alias]
2306 tgt = atab[alias]
2304 special = True
2307 special = True
2305 # 'interesting' aliases
2308 # 'interesting' aliases
2306 if (alias in stored or
2309 if (alias in stored or
2307 special or
2310 special or
2308 alias.lower() != os.path.splitext(tgt)[0].lower() or
2311 alias.lower() != os.path.splitext(tgt)[0].lower() or
2309 ' ' in tgt):
2312 ' ' in tgt):
2310 showlast.append((alias, tgt))
2313 showlast.append((alias, tgt))
2311 else:
2314 else:
2312 res.append((alias, tgt ))
2315 res.append((alias, tgt ))
2313
2316
2314 # show most interesting aliases last
2317 # show most interesting aliases last
2315 res.extend(showlast)
2318 res.extend(showlast)
2316 print "Total number of aliases:",len(aliases)
2319 print "Total number of aliases:",len(aliases)
2317 return res
2320 return res
2318 try:
2321 try:
2319 alias,cmd = par.split(None,1)
2322 alias,cmd = par.split(None,1)
2320 except:
2323 except:
2321 print OInspect.getdoc(self.magic_alias)
2324 print OInspect.getdoc(self.magic_alias)
2322 else:
2325 else:
2323 nargs = cmd.count('%s')
2326 nargs = cmd.count('%s')
2324 if nargs>0 and cmd.find('%l')>=0:
2327 if nargs>0 and cmd.find('%l')>=0:
2325 error('The %s and %l specifiers are mutually exclusive '
2328 error('The %s and %l specifiers are mutually exclusive '
2326 'in alias definitions.')
2329 'in alias definitions.')
2327 else: # all looks OK
2330 else: # all looks OK
2328 self.shell.alias_table[alias] = (nargs,cmd)
2331 self.shell.alias_table[alias] = (nargs,cmd)
2329 self.shell.alias_table_validate(verbose=0)
2332 self.shell.alias_table_validate(verbose=0)
2330 # end magic_alias
2333 # end magic_alias
2331
2334
2332 def magic_unalias(self, parameter_s = ''):
2335 def magic_unalias(self, parameter_s = ''):
2333 """Remove an alias"""
2336 """Remove an alias"""
2334
2337
2335 aname = parameter_s.strip()
2338 aname = parameter_s.strip()
2336 if aname in self.shell.alias_table:
2339 if aname in self.shell.alias_table:
2337 del self.shell.alias_table[aname]
2340 del self.shell.alias_table[aname]
2338 stored = self.db.get('stored_aliases', {} )
2341 stored = self.db.get('stored_aliases', {} )
2339 if aname in stored:
2342 if aname in stored:
2340 print "Removing %stored alias",aname
2343 print "Removing %stored alias",aname
2341 del stored[aname]
2344 del stored[aname]
2342 self.db['stored_aliases'] = stored
2345 self.db['stored_aliases'] = stored
2343
2346
2344
2347
2345 def magic_rehashx(self, parameter_s = ''):
2348 def magic_rehashx(self, parameter_s = ''):
2346 """Update the alias table with all executable files in $PATH.
2349 """Update the alias table with all executable files in $PATH.
2347
2350
2348 This version explicitly checks that every entry in $PATH is a file
2351 This version explicitly checks that every entry in $PATH is a file
2349 with execute access (os.X_OK), so it is much slower than %rehash.
2352 with execute access (os.X_OK), so it is much slower than %rehash.
2350
2353
2351 Under Windows, it checks executability as a match agains a
2354 Under Windows, it checks executability as a match agains a
2352 '|'-separated string of extensions, stored in the IPython config
2355 '|'-separated string of extensions, stored in the IPython config
2353 variable win_exec_ext. This defaults to 'exe|com|bat'.
2356 variable win_exec_ext. This defaults to 'exe|com|bat'.
2354
2357
2355 This function also resets the root module cache of module completer,
2358 This function also resets the root module cache of module completer,
2356 used on slow filesystems.
2359 used on slow filesystems.
2357 """
2360 """
2358
2361
2359
2362
2360 ip = self.api
2363 ip = self.api
2361
2364
2362 # for the benefit of module completer in ipy_completers.py
2365 # for the benefit of module completer in ipy_completers.py
2363 del ip.db['rootmodules']
2366 del ip.db['rootmodules']
2364
2367
2365 path = [os.path.abspath(os.path.expanduser(p)) for p in
2368 path = [os.path.abspath(os.path.expanduser(p)) for p in
2366 os.environ.get('PATH','').split(os.pathsep)]
2369 os.environ.get('PATH','').split(os.pathsep)]
2367 path = filter(os.path.isdir,path)
2370 path = filter(os.path.isdir,path)
2368
2371
2369 alias_table = self.shell.alias_table
2372 alias_table = self.shell.alias_table
2370 syscmdlist = []
2373 syscmdlist = []
2371 if os.name == 'posix':
2374 if os.name == 'posix':
2372 isexec = lambda fname:os.path.isfile(fname) and \
2375 isexec = lambda fname:os.path.isfile(fname) and \
2373 os.access(fname,os.X_OK)
2376 os.access(fname,os.X_OK)
2374 else:
2377 else:
2375
2378
2376 try:
2379 try:
2377 winext = os.environ['pathext'].replace(';','|').replace('.','')
2380 winext = os.environ['pathext'].replace(';','|').replace('.','')
2378 except KeyError:
2381 except KeyError:
2379 winext = 'exe|com|bat|py'
2382 winext = 'exe|com|bat|py'
2380 if 'py' not in winext:
2383 if 'py' not in winext:
2381 winext += '|py'
2384 winext += '|py'
2382 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2385 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2383 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2386 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2384 savedir = os.getcwd()
2387 savedir = os.getcwd()
2385 try:
2388 try:
2386 # write the whole loop for posix/Windows so we don't have an if in
2389 # write the whole loop for posix/Windows so we don't have an if in
2387 # the innermost part
2390 # the innermost part
2388 if os.name == 'posix':
2391 if os.name == 'posix':
2389 for pdir in path:
2392 for pdir in path:
2390 os.chdir(pdir)
2393 os.chdir(pdir)
2391 for ff in os.listdir(pdir):
2394 for ff in os.listdir(pdir):
2392 if isexec(ff) and ff not in self.shell.no_alias:
2395 if isexec(ff) and ff not in self.shell.no_alias:
2393 # each entry in the alias table must be (N,name),
2396 # each entry in the alias table must be (N,name),
2394 # where N is the number of positional arguments of the
2397 # where N is the number of positional arguments of the
2395 # alias.
2398 # alias.
2396 alias_table[ff] = (0,ff)
2399 alias_table[ff] = (0,ff)
2397 syscmdlist.append(ff)
2400 syscmdlist.append(ff)
2398 else:
2401 else:
2399 for pdir in path:
2402 for pdir in path:
2400 os.chdir(pdir)
2403 os.chdir(pdir)
2401 for ff in os.listdir(pdir):
2404 for ff in os.listdir(pdir):
2402 base, ext = os.path.splitext(ff)
2405 base, ext = os.path.splitext(ff)
2403 if isexec(ff) and base not in self.shell.no_alias:
2406 if isexec(ff) and base not in self.shell.no_alias:
2404 if ext.lower() == '.exe':
2407 if ext.lower() == '.exe':
2405 ff = base
2408 ff = base
2406 alias_table[base.lower()] = (0,ff)
2409 alias_table[base.lower()] = (0,ff)
2407 syscmdlist.append(ff)
2410 syscmdlist.append(ff)
2408 # Make sure the alias table doesn't contain keywords or builtins
2411 # Make sure the alias table doesn't contain keywords or builtins
2409 self.shell.alias_table_validate()
2412 self.shell.alias_table_validate()
2410 # Call again init_auto_alias() so we get 'rm -i' and other
2413 # Call again init_auto_alias() so we get 'rm -i' and other
2411 # modified aliases since %rehashx will probably clobber them
2414 # modified aliases since %rehashx will probably clobber them
2412
2415
2413 # no, we don't want them. if %rehashx clobbers them, good,
2416 # no, we don't want them. if %rehashx clobbers them, good,
2414 # we'll probably get better versions
2417 # we'll probably get better versions
2415 # self.shell.init_auto_alias()
2418 # self.shell.init_auto_alias()
2416 db = ip.db
2419 db = ip.db
2417 db['syscmdlist'] = syscmdlist
2420 db['syscmdlist'] = syscmdlist
2418 finally:
2421 finally:
2419 os.chdir(savedir)
2422 os.chdir(savedir)
2420
2423
2421 def magic_pwd(self, parameter_s = ''):
2424 def magic_pwd(self, parameter_s = ''):
2422 """Return the current working directory path."""
2425 """Return the current working directory path."""
2423 return os.getcwd()
2426 return os.getcwd()
2424
2427
2425 def magic_cd(self, parameter_s=''):
2428 def magic_cd(self, parameter_s=''):
2426 """Change the current working directory.
2429 """Change the current working directory.
2427
2430
2428 This command automatically maintains an internal list of directories
2431 This command automatically maintains an internal list of directories
2429 you visit during your IPython session, in the variable _dh. The
2432 you visit during your IPython session, in the variable _dh. The
2430 command %dhist shows this history nicely formatted. You can also
2433 command %dhist shows this history nicely formatted. You can also
2431 do 'cd -<tab>' to see directory history conveniently.
2434 do 'cd -<tab>' to see directory history conveniently.
2432
2435
2433 Usage:
2436 Usage:
2434
2437
2435 cd 'dir': changes to directory 'dir'.
2438 cd 'dir': changes to directory 'dir'.
2436
2439
2437 cd -: changes to the last visited directory.
2440 cd -: changes to the last visited directory.
2438
2441
2439 cd -<n>: changes to the n-th directory in the directory history.
2442 cd -<n>: changes to the n-th directory in the directory history.
2440
2443
2441 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2444 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2442 (note: cd <bookmark_name> is enough if there is no
2445 (note: cd <bookmark_name> is enough if there is no
2443 directory <bookmark_name>, but a bookmark with the name exists.)
2446 directory <bookmark_name>, but a bookmark with the name exists.)
2444 'cd -b <tab>' allows you to tab-complete bookmark names.
2447 'cd -b <tab>' allows you to tab-complete bookmark names.
2445
2448
2446 Options:
2449 Options:
2447
2450
2448 -q: quiet. Do not print the working directory after the cd command is
2451 -q: quiet. Do not print the working directory after the cd command is
2449 executed. By default IPython's cd command does print this directory,
2452 executed. By default IPython's cd command does print this directory,
2450 since the default prompts do not display path information.
2453 since the default prompts do not display path information.
2451
2454
2452 Note that !cd doesn't work for this purpose because the shell where
2455 Note that !cd doesn't work for this purpose because the shell where
2453 !command runs is immediately discarded after executing 'command'."""
2456 !command runs is immediately discarded after executing 'command'."""
2454
2457
2455 parameter_s = parameter_s.strip()
2458 parameter_s = parameter_s.strip()
2456 #bkms = self.shell.persist.get("bookmarks",{})
2459 #bkms = self.shell.persist.get("bookmarks",{})
2457
2460
2458 numcd = re.match(r'(-)(\d+)$',parameter_s)
2461 numcd = re.match(r'(-)(\d+)$',parameter_s)
2459 # jump in directory history by number
2462 # jump in directory history by number
2460 if numcd:
2463 if numcd:
2461 nn = int(numcd.group(2))
2464 nn = int(numcd.group(2))
2462 try:
2465 try:
2463 ps = self.shell.user_ns['_dh'][nn]
2466 ps = self.shell.user_ns['_dh'][nn]
2464 except IndexError:
2467 except IndexError:
2465 print 'The requested directory does not exist in history.'
2468 print 'The requested directory does not exist in history.'
2466 return
2469 return
2467 else:
2470 else:
2468 opts = {}
2471 opts = {}
2469 else:
2472 else:
2470 #turn all non-space-escaping backslashes to slashes,
2473 #turn all non-space-escaping backslashes to slashes,
2471 # for c:\windows\directory\names\
2474 # for c:\windows\directory\names\
2472 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2475 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2473 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2476 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2474 # jump to previous
2477 # jump to previous
2475 if ps == '-':
2478 if ps == '-':
2476 try:
2479 try:
2477 ps = self.shell.user_ns['_dh'][-2]
2480 ps = self.shell.user_ns['_dh'][-2]
2478 except IndexError:
2481 except IndexError:
2479 print 'No previous directory to change to.'
2482 print 'No previous directory to change to.'
2480 return
2483 return
2481 # jump to bookmark if needed
2484 # jump to bookmark if needed
2482 else:
2485 else:
2483 if not os.path.isdir(ps) or opts.has_key('b'):
2486 if not os.path.isdir(ps) or opts.has_key('b'):
2484 bkms = self.db.get('bookmarks', {})
2487 bkms = self.db.get('bookmarks', {})
2485
2488
2486 if bkms.has_key(ps):
2489 if bkms.has_key(ps):
2487 target = bkms[ps]
2490 target = bkms[ps]
2488 print '(bookmark:%s) -> %s' % (ps,target)
2491 print '(bookmark:%s) -> %s' % (ps,target)
2489 ps = target
2492 ps = target
2490 else:
2493 else:
2491 if opts.has_key('b'):
2494 if opts.has_key('b'):
2492 error("Bookmark '%s' not found. "
2495 error("Bookmark '%s' not found. "
2493 "Use '%%bookmark -l' to see your bookmarks." % ps)
2496 "Use '%%bookmark -l' to see your bookmarks." % ps)
2494 return
2497 return
2495
2498
2496 # at this point ps should point to the target dir
2499 # at this point ps should point to the target dir
2497 if ps:
2500 if ps:
2498 try:
2501 try:
2499 os.chdir(os.path.expanduser(ps))
2502 os.chdir(os.path.expanduser(ps))
2500 if self.shell.rc.term_title:
2503 if self.shell.rc.term_title:
2501 #print 'set term title:',self.shell.rc.term_title # dbg
2504 #print 'set term title:',self.shell.rc.term_title # dbg
2502 ttitle = 'IPy ' + abbrev_cwd()
2505 ttitle = 'IPy ' + abbrev_cwd()
2503 platutils.set_term_title(ttitle)
2506 platutils.set_term_title(ttitle)
2504 except OSError:
2507 except OSError:
2505 print sys.exc_info()[1]
2508 print sys.exc_info()[1]
2506 else:
2509 else:
2507 cwd = os.getcwd()
2510 cwd = os.getcwd()
2508 dhist = self.shell.user_ns['_dh']
2511 dhist = self.shell.user_ns['_dh']
2509 dhist.append(cwd)
2512 dhist.append(cwd)
2510 self.db['dhist'] = compress_dhist(dhist)[-100:]
2513 self.db['dhist'] = compress_dhist(dhist)[-100:]
2511
2514
2512 else:
2515 else:
2513 os.chdir(self.shell.home_dir)
2516 os.chdir(self.shell.home_dir)
2514 if self.shell.rc.term_title:
2517 if self.shell.rc.term_title:
2515 platutils.set_term_title("IPy ~")
2518 platutils.set_term_title("IPy ~")
2516 cwd = os.getcwd()
2519 cwd = os.getcwd()
2517 dhist = self.shell.user_ns['_dh']
2520 dhist = self.shell.user_ns['_dh']
2518 dhist.append(cwd)
2521 dhist.append(cwd)
2519 self.db['dhist'] = compress_dhist(dhist)[-100:]
2522 self.db['dhist'] = compress_dhist(dhist)[-100:]
2520 if not 'q' in opts and self.shell.user_ns['_dh']:
2523 if not 'q' in opts and self.shell.user_ns['_dh']:
2521 print self.shell.user_ns['_dh'][-1]
2524 print self.shell.user_ns['_dh'][-1]
2522
2525
2523
2526
2524 def magic_env(self, parameter_s=''):
2527 def magic_env(self, parameter_s=''):
2525 """List environment variables."""
2528 """List environment variables."""
2526
2529
2527 return os.environ.data
2530 return os.environ.data
2528
2531
2529 def magic_pushd(self, parameter_s=''):
2532 def magic_pushd(self, parameter_s=''):
2530 """Place the current dir on stack and change directory.
2533 """Place the current dir on stack and change directory.
2531
2534
2532 Usage:\\
2535 Usage:\\
2533 %pushd ['dirname']
2536 %pushd ['dirname']
2534
2537
2535 %pushd with no arguments does a %pushd to your home directory.
2538 %pushd with no arguments does a %pushd to your home directory.
2536 """
2539 """
2537 if parameter_s == '': parameter_s = '~'
2540 if parameter_s == '': parameter_s = '~'
2538 dir_s = self.shell.dir_stack
2541 dir_s = self.shell.dir_stack
2539 if len(dir_s)>0 and os.path.expanduser(parameter_s) != \
2542 if len(dir_s)>0 and os.path.expanduser(parameter_s) != \
2540 os.path.expanduser(self.shell.dir_stack[0]):
2543 os.path.expanduser(self.shell.dir_stack[0]):
2541 try:
2544 try:
2542 self.magic_cd(parameter_s)
2545 self.magic_cd(parameter_s)
2543 dir_s.insert(0,os.getcwd().replace(self.home_dir,'~'))
2546 dir_s.insert(0,os.getcwd().replace(self.home_dir,'~'))
2544 self.magic_dirs()
2547 self.magic_dirs()
2545 except:
2548 except:
2546 print 'Invalid directory'
2549 print 'Invalid directory'
2547 else:
2550 else:
2548 print 'You are already there!'
2551 print 'You are already there!'
2549
2552
2550 def magic_popd(self, parameter_s=''):
2553 def magic_popd(self, parameter_s=''):
2551 """Change to directory popped off the top of the stack.
2554 """Change to directory popped off the top of the stack.
2552 """
2555 """
2553 if len (self.shell.dir_stack) > 1:
2556 if len (self.shell.dir_stack) > 1:
2554 self.shell.dir_stack.pop(0)
2557 self.shell.dir_stack.pop(0)
2555 self.magic_cd(self.shell.dir_stack[0])
2558 self.magic_cd(self.shell.dir_stack[0])
2556 print self.shell.dir_stack[0]
2559 print self.shell.dir_stack[0]
2557 else:
2560 else:
2558 print "You can't remove the starting directory from the stack:",\
2561 print "You can't remove the starting directory from the stack:",\
2559 self.shell.dir_stack
2562 self.shell.dir_stack
2560
2563
2561 def magic_dirs(self, parameter_s=''):
2564 def magic_dirs(self, parameter_s=''):
2562 """Return the current directory stack."""
2565 """Return the current directory stack."""
2563
2566
2564 return self.shell.dir_stack[:]
2567 return self.shell.dir_stack[:]
2565
2568
2566 def magic_sc(self, parameter_s=''):
2569 def magic_sc(self, parameter_s=''):
2567 """Shell capture - execute a shell command and capture its output.
2570 """Shell capture - execute a shell command and capture its output.
2568
2571
2569 DEPRECATED. Suboptimal, retained for backwards compatibility.
2572 DEPRECATED. Suboptimal, retained for backwards compatibility.
2570
2573
2571 You should use the form 'var = !command' instead. Example:
2574 You should use the form 'var = !command' instead. Example:
2572
2575
2573 "%sc -l myfiles = ls ~" should now be written as
2576 "%sc -l myfiles = ls ~" should now be written as
2574
2577
2575 "myfiles = !ls ~"
2578 "myfiles = !ls ~"
2576
2579
2577 myfiles.s, myfiles.l and myfiles.n still apply as documented
2580 myfiles.s, myfiles.l and myfiles.n still apply as documented
2578 below.
2581 below.
2579
2582
2580 --
2583 --
2581 %sc [options] varname=command
2584 %sc [options] varname=command
2582
2585
2583 IPython will run the given command using commands.getoutput(), and
2586 IPython will run the given command using commands.getoutput(), and
2584 will then update the user's interactive namespace with a variable
2587 will then update the user's interactive namespace with a variable
2585 called varname, containing the value of the call. Your command can
2588 called varname, containing the value of the call. Your command can
2586 contain shell wildcards, pipes, etc.
2589 contain shell wildcards, pipes, etc.
2587
2590
2588 The '=' sign in the syntax is mandatory, and the variable name you
2591 The '=' sign in the syntax is mandatory, and the variable name you
2589 supply must follow Python's standard conventions for valid names.
2592 supply must follow Python's standard conventions for valid names.
2590
2593
2591 (A special format without variable name exists for internal use)
2594 (A special format without variable name exists for internal use)
2592
2595
2593 Options:
2596 Options:
2594
2597
2595 -l: list output. Split the output on newlines into a list before
2598 -l: list output. Split the output on newlines into a list before
2596 assigning it to the given variable. By default the output is stored
2599 assigning it to the given variable. By default the output is stored
2597 as a single string.
2600 as a single string.
2598
2601
2599 -v: verbose. Print the contents of the variable.
2602 -v: verbose. Print the contents of the variable.
2600
2603
2601 In most cases you should not need to split as a list, because the
2604 In most cases you should not need to split as a list, because the
2602 returned value is a special type of string which can automatically
2605 returned value is a special type of string which can automatically
2603 provide its contents either as a list (split on newlines) or as a
2606 provide its contents either as a list (split on newlines) or as a
2604 space-separated string. These are convenient, respectively, either
2607 space-separated string. These are convenient, respectively, either
2605 for sequential processing or to be passed to a shell command.
2608 for sequential processing or to be passed to a shell command.
2606
2609
2607 For example:
2610 For example:
2608
2611
2609 # Capture into variable a
2612 # Capture into variable a
2610 In [9]: sc a=ls *py
2613 In [9]: sc a=ls *py
2611
2614
2612 # a is a string with embedded newlines
2615 # a is a string with embedded newlines
2613 In [10]: a
2616 In [10]: a
2614 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2617 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2615
2618
2616 # which can be seen as a list:
2619 # which can be seen as a list:
2617 In [11]: a.l
2620 In [11]: a.l
2618 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2621 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2619
2622
2620 # or as a whitespace-separated string:
2623 # or as a whitespace-separated string:
2621 In [12]: a.s
2624 In [12]: a.s
2622 Out[12]: 'setup.py win32_manual_post_install.py'
2625 Out[12]: 'setup.py win32_manual_post_install.py'
2623
2626
2624 # a.s is useful to pass as a single command line:
2627 # a.s is useful to pass as a single command line:
2625 In [13]: !wc -l $a.s
2628 In [13]: !wc -l $a.s
2626 146 setup.py
2629 146 setup.py
2627 130 win32_manual_post_install.py
2630 130 win32_manual_post_install.py
2628 276 total
2631 276 total
2629
2632
2630 # while the list form is useful to loop over:
2633 # while the list form is useful to loop over:
2631 In [14]: for f in a.l:
2634 In [14]: for f in a.l:
2632 ....: !wc -l $f
2635 ....: !wc -l $f
2633 ....:
2636 ....:
2634 146 setup.py
2637 146 setup.py
2635 130 win32_manual_post_install.py
2638 130 win32_manual_post_install.py
2636
2639
2637 Similiarly, the lists returned by the -l option are also special, in
2640 Similiarly, the lists returned by the -l option are also special, in
2638 the sense that you can equally invoke the .s attribute on them to
2641 the sense that you can equally invoke the .s attribute on them to
2639 automatically get a whitespace-separated string from their contents:
2642 automatically get a whitespace-separated string from their contents:
2640
2643
2641 In [1]: sc -l b=ls *py
2644 In [1]: sc -l b=ls *py
2642
2645
2643 In [2]: b
2646 In [2]: b
2644 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2647 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2645
2648
2646 In [3]: b.s
2649 In [3]: b.s
2647 Out[3]: 'setup.py win32_manual_post_install.py'
2650 Out[3]: 'setup.py win32_manual_post_install.py'
2648
2651
2649 In summary, both the lists and strings used for ouptut capture have
2652 In summary, both the lists and strings used for ouptut capture have
2650 the following special attributes:
2653 the following special attributes:
2651
2654
2652 .l (or .list) : value as list.
2655 .l (or .list) : value as list.
2653 .n (or .nlstr): value as newline-separated string.
2656 .n (or .nlstr): value as newline-separated string.
2654 .s (or .spstr): value as space-separated string.
2657 .s (or .spstr): value as space-separated string.
2655 """
2658 """
2656
2659
2657 opts,args = self.parse_options(parameter_s,'lv')
2660 opts,args = self.parse_options(parameter_s,'lv')
2658 # Try to get a variable name and command to run
2661 # Try to get a variable name and command to run
2659 try:
2662 try:
2660 # the variable name must be obtained from the parse_options
2663 # the variable name must be obtained from the parse_options
2661 # output, which uses shlex.split to strip options out.
2664 # output, which uses shlex.split to strip options out.
2662 var,_ = args.split('=',1)
2665 var,_ = args.split('=',1)
2663 var = var.strip()
2666 var = var.strip()
2664 # But the the command has to be extracted from the original input
2667 # But the the command has to be extracted from the original input
2665 # parameter_s, not on what parse_options returns, to avoid the
2668 # parameter_s, not on what parse_options returns, to avoid the
2666 # quote stripping which shlex.split performs on it.
2669 # quote stripping which shlex.split performs on it.
2667 _,cmd = parameter_s.split('=',1)
2670 _,cmd = parameter_s.split('=',1)
2668 except ValueError:
2671 except ValueError:
2669 var,cmd = '',''
2672 var,cmd = '',''
2670 # If all looks ok, proceed
2673 # If all looks ok, proceed
2671 out,err = self.shell.getoutputerror(cmd)
2674 out,err = self.shell.getoutputerror(cmd)
2672 if err:
2675 if err:
2673 print >> Term.cerr,err
2676 print >> Term.cerr,err
2674 if opts.has_key('l'):
2677 if opts.has_key('l'):
2675 out = SList(out.split('\n'))
2678 out = SList(out.split('\n'))
2676 else:
2679 else:
2677 out = LSString(out)
2680 out = LSString(out)
2678 if opts.has_key('v'):
2681 if opts.has_key('v'):
2679 print '%s ==\n%s' % (var,pformat(out))
2682 print '%s ==\n%s' % (var,pformat(out))
2680 if var:
2683 if var:
2681 self.shell.user_ns.update({var:out})
2684 self.shell.user_ns.update({var:out})
2682 else:
2685 else:
2683 return out
2686 return out
2684
2687
2685 def magic_sx(self, parameter_s=''):
2688 def magic_sx(self, parameter_s=''):
2686 """Shell execute - run a shell command and capture its output.
2689 """Shell execute - run a shell command and capture its output.
2687
2690
2688 %sx command
2691 %sx command
2689
2692
2690 IPython will run the given command using commands.getoutput(), and
2693 IPython will run the given command using commands.getoutput(), and
2691 return the result formatted as a list (split on '\\n'). Since the
2694 return the result formatted as a list (split on '\\n'). Since the
2692 output is _returned_, it will be stored in ipython's regular output
2695 output is _returned_, it will be stored in ipython's regular output
2693 cache Out[N] and in the '_N' automatic variables.
2696 cache Out[N] and in the '_N' automatic variables.
2694
2697
2695 Notes:
2698 Notes:
2696
2699
2697 1) If an input line begins with '!!', then %sx is automatically
2700 1) If an input line begins with '!!', then %sx is automatically
2698 invoked. That is, while:
2701 invoked. That is, while:
2699 !ls
2702 !ls
2700 causes ipython to simply issue system('ls'), typing
2703 causes ipython to simply issue system('ls'), typing
2701 !!ls
2704 !!ls
2702 is a shorthand equivalent to:
2705 is a shorthand equivalent to:
2703 %sx ls
2706 %sx ls
2704
2707
2705 2) %sx differs from %sc in that %sx automatically splits into a list,
2708 2) %sx differs from %sc in that %sx automatically splits into a list,
2706 like '%sc -l'. The reason for this is to make it as easy as possible
2709 like '%sc -l'. The reason for this is to make it as easy as possible
2707 to process line-oriented shell output via further python commands.
2710 to process line-oriented shell output via further python commands.
2708 %sc is meant to provide much finer control, but requires more
2711 %sc is meant to provide much finer control, but requires more
2709 typing.
2712 typing.
2710
2713
2711 3) Just like %sc -l, this is a list with special attributes:
2714 3) Just like %sc -l, this is a list with special attributes:
2712
2715
2713 .l (or .list) : value as list.
2716 .l (or .list) : value as list.
2714 .n (or .nlstr): value as newline-separated string.
2717 .n (or .nlstr): value as newline-separated string.
2715 .s (or .spstr): value as whitespace-separated string.
2718 .s (or .spstr): value as whitespace-separated string.
2716
2719
2717 This is very useful when trying to use such lists as arguments to
2720 This is very useful when trying to use such lists as arguments to
2718 system commands."""
2721 system commands."""
2719
2722
2720 if parameter_s:
2723 if parameter_s:
2721 out,err = self.shell.getoutputerror(parameter_s)
2724 out,err = self.shell.getoutputerror(parameter_s)
2722 if err:
2725 if err:
2723 print >> Term.cerr,err
2726 print >> Term.cerr,err
2724 return SList(out.split('\n'))
2727 return SList(out.split('\n'))
2725
2728
2726 def magic_bg(self, parameter_s=''):
2729 def magic_bg(self, parameter_s=''):
2727 """Run a job in the background, in a separate thread.
2730 """Run a job in the background, in a separate thread.
2728
2731
2729 For example,
2732 For example,
2730
2733
2731 %bg myfunc(x,y,z=1)
2734 %bg myfunc(x,y,z=1)
2732
2735
2733 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2736 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2734 execution starts, a message will be printed indicating the job
2737 execution starts, a message will be printed indicating the job
2735 number. If your job number is 5, you can use
2738 number. If your job number is 5, you can use
2736
2739
2737 myvar = jobs.result(5) or myvar = jobs[5].result
2740 myvar = jobs.result(5) or myvar = jobs[5].result
2738
2741
2739 to assign this result to variable 'myvar'.
2742 to assign this result to variable 'myvar'.
2740
2743
2741 IPython has a job manager, accessible via the 'jobs' object. You can
2744 IPython has a job manager, accessible via the 'jobs' object. You can
2742 type jobs? to get more information about it, and use jobs.<TAB> to see
2745 type jobs? to get more information about it, and use jobs.<TAB> to see
2743 its attributes. All attributes not starting with an underscore are
2746 its attributes. All attributes not starting with an underscore are
2744 meant for public use.
2747 meant for public use.
2745
2748
2746 In particular, look at the jobs.new() method, which is used to create
2749 In particular, look at the jobs.new() method, which is used to create
2747 new jobs. This magic %bg function is just a convenience wrapper
2750 new jobs. This magic %bg function is just a convenience wrapper
2748 around jobs.new(), for expression-based jobs. If you want to create a
2751 around jobs.new(), for expression-based jobs. If you want to create a
2749 new job with an explicit function object and arguments, you must call
2752 new job with an explicit function object and arguments, you must call
2750 jobs.new() directly.
2753 jobs.new() directly.
2751
2754
2752 The jobs.new docstring also describes in detail several important
2755 The jobs.new docstring also describes in detail several important
2753 caveats associated with a thread-based model for background job
2756 caveats associated with a thread-based model for background job
2754 execution. Type jobs.new? for details.
2757 execution. Type jobs.new? for details.
2755
2758
2756 You can check the status of all jobs with jobs.status().
2759 You can check the status of all jobs with jobs.status().
2757
2760
2758 The jobs variable is set by IPython into the Python builtin namespace.
2761 The jobs variable is set by IPython into the Python builtin namespace.
2759 If you ever declare a variable named 'jobs', you will shadow this
2762 If you ever declare a variable named 'jobs', you will shadow this
2760 name. You can either delete your global jobs variable to regain
2763 name. You can either delete your global jobs variable to regain
2761 access to the job manager, or make a new name and assign it manually
2764 access to the job manager, or make a new name and assign it manually
2762 to the manager (stored in IPython's namespace). For example, to
2765 to the manager (stored in IPython's namespace). For example, to
2763 assign the job manager to the Jobs name, use:
2766 assign the job manager to the Jobs name, use:
2764
2767
2765 Jobs = __builtins__.jobs"""
2768 Jobs = __builtins__.jobs"""
2766
2769
2767 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2770 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2768
2771
2769
2772
2770 def magic_bookmark(self, parameter_s=''):
2773 def magic_bookmark(self, parameter_s=''):
2771 """Manage IPython's bookmark system.
2774 """Manage IPython's bookmark system.
2772
2775
2773 %bookmark <name> - set bookmark to current dir
2776 %bookmark <name> - set bookmark to current dir
2774 %bookmark <name> <dir> - set bookmark to <dir>
2777 %bookmark <name> <dir> - set bookmark to <dir>
2775 %bookmark -l - list all bookmarks
2778 %bookmark -l - list all bookmarks
2776 %bookmark -d <name> - remove bookmark
2779 %bookmark -d <name> - remove bookmark
2777 %bookmark -r - remove all bookmarks
2780 %bookmark -r - remove all bookmarks
2778
2781
2779 You can later on access a bookmarked folder with:
2782 You can later on access a bookmarked folder with:
2780 %cd -b <name>
2783 %cd -b <name>
2781 or simply '%cd <name>' if there is no directory called <name> AND
2784 or simply '%cd <name>' if there is no directory called <name> AND
2782 there is such a bookmark defined.
2785 there is such a bookmark defined.
2783
2786
2784 Your bookmarks persist through IPython sessions, but they are
2787 Your bookmarks persist through IPython sessions, but they are
2785 associated with each profile."""
2788 associated with each profile."""
2786
2789
2787 opts,args = self.parse_options(parameter_s,'drl',mode='list')
2790 opts,args = self.parse_options(parameter_s,'drl',mode='list')
2788 if len(args) > 2:
2791 if len(args) > 2:
2789 error('You can only give at most two arguments')
2792 error('You can only give at most two arguments')
2790 return
2793 return
2791
2794
2792 bkms = self.db.get('bookmarks',{})
2795 bkms = self.db.get('bookmarks',{})
2793
2796
2794 if opts.has_key('d'):
2797 if opts.has_key('d'):
2795 try:
2798 try:
2796 todel = args[0]
2799 todel = args[0]
2797 except IndexError:
2800 except IndexError:
2798 error('You must provide a bookmark to delete')
2801 error('You must provide a bookmark to delete')
2799 else:
2802 else:
2800 try:
2803 try:
2801 del bkms[todel]
2804 del bkms[todel]
2802 except:
2805 except:
2803 error("Can't delete bookmark '%s'" % todel)
2806 error("Can't delete bookmark '%s'" % todel)
2804 elif opts.has_key('r'):
2807 elif opts.has_key('r'):
2805 bkms = {}
2808 bkms = {}
2806 elif opts.has_key('l'):
2809 elif opts.has_key('l'):
2807 bks = bkms.keys()
2810 bks = bkms.keys()
2808 bks.sort()
2811 bks.sort()
2809 if bks:
2812 if bks:
2810 size = max(map(len,bks))
2813 size = max(map(len,bks))
2811 else:
2814 else:
2812 size = 0
2815 size = 0
2813 fmt = '%-'+str(size)+'s -> %s'
2816 fmt = '%-'+str(size)+'s -> %s'
2814 print 'Current bookmarks:'
2817 print 'Current bookmarks:'
2815 for bk in bks:
2818 for bk in bks:
2816 print fmt % (bk,bkms[bk])
2819 print fmt % (bk,bkms[bk])
2817 else:
2820 else:
2818 if not args:
2821 if not args:
2819 error("You must specify the bookmark name")
2822 error("You must specify the bookmark name")
2820 elif len(args)==1:
2823 elif len(args)==1:
2821 bkms[args[0]] = os.getcwd()
2824 bkms[args[0]] = os.getcwd()
2822 elif len(args)==2:
2825 elif len(args)==2:
2823 bkms[args[0]] = args[1]
2826 bkms[args[0]] = args[1]
2824 self.db['bookmarks'] = bkms
2827 self.db['bookmarks'] = bkms
2825
2828
2826 def magic_pycat(self, parameter_s=''):
2829 def magic_pycat(self, parameter_s=''):
2827 """Show a syntax-highlighted file through a pager.
2830 """Show a syntax-highlighted file through a pager.
2828
2831
2829 This magic is similar to the cat utility, but it will assume the file
2832 This magic is similar to the cat utility, but it will assume the file
2830 to be Python source and will show it with syntax highlighting. """
2833 to be Python source and will show it with syntax highlighting. """
2831
2834
2832 try:
2835 try:
2833 filename = get_py_filename(parameter_s)
2836 filename = get_py_filename(parameter_s)
2834 cont = file_read(filename)
2837 cont = file_read(filename)
2835 except IOError:
2838 except IOError:
2836 try:
2839 try:
2837 cont = eval(parameter_s,self.user_ns)
2840 cont = eval(parameter_s,self.user_ns)
2838 except NameError:
2841 except NameError:
2839 cont = None
2842 cont = None
2840 if cont is None:
2843 if cont is None:
2841 print "Error: no such file or variable"
2844 print "Error: no such file or variable"
2842 return
2845 return
2843
2846
2844 page(self.shell.pycolorize(cont),
2847 page(self.shell.pycolorize(cont),
2845 screen_lines=self.shell.rc.screen_length)
2848 screen_lines=self.shell.rc.screen_length)
2846
2849
2847 def magic_cpaste(self, parameter_s=''):
2850 def magic_cpaste(self, parameter_s=''):
2848 """Allows you to paste & execute a pre-formatted code block from clipboard
2851 """Allows you to paste & execute a pre-formatted code block from clipboard
2849
2852
2850 You must terminate the block with '--' (two minus-signs) alone on the
2853 You must terminate the block with '--' (two minus-signs) alone on the
2851 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
2854 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
2852 is the new sentinel for this operation)
2855 is the new sentinel for this operation)
2853
2856
2854 The block is dedented prior to execution to enable execution of method
2857 The block is dedented prior to execution to enable execution of method
2855 definitions. '>' and '+' characters at the beginning of a line are
2858 definitions. '>' and '+' characters at the beginning of a line are
2856 ignored, to allow pasting directly from e-mails or diff files. The
2859 ignored, to allow pasting directly from e-mails or diff files. The
2857 executed block is also assigned to variable named 'pasted_block' for
2860 executed block is also assigned to variable named 'pasted_block' for
2858 later editing with '%edit pasted_block'.
2861 later editing with '%edit pasted_block'.
2859
2862
2860 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
2863 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
2861 This assigns the pasted block to variable 'foo' as string, without
2864 This assigns the pasted block to variable 'foo' as string, without
2862 dedenting or executing it.
2865 dedenting or executing it.
2863
2866
2864 Do not be alarmed by garbled output on Windows (it's a readline bug).
2867 Do not be alarmed by garbled output on Windows (it's a readline bug).
2865 Just press enter and type -- (and press enter again) and the block
2868 Just press enter and type -- (and press enter again) and the block
2866 will be what was just pasted.
2869 will be what was just pasted.
2867
2870
2868 IPython statements (magics, shell escapes) are not supported (yet).
2871 IPython statements (magics, shell escapes) are not supported (yet).
2869 """
2872 """
2870 opts,args = self.parse_options(parameter_s,'s:',mode='string')
2873 opts,args = self.parse_options(parameter_s,'s:',mode='string')
2871 par = args.strip()
2874 par = args.strip()
2872 sentinel = opts.get('s','--')
2875 sentinel = opts.get('s','--')
2873
2876
2874 from IPython import iplib
2877 from IPython import iplib
2875 lines = []
2878 lines = []
2876 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
2879 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
2877 while 1:
2880 while 1:
2878 l = iplib.raw_input_original(':')
2881 l = iplib.raw_input_original(':')
2879 if l ==sentinel:
2882 if l ==sentinel:
2880 break
2883 break
2881 lines.append(l.lstrip('>').lstrip('+'))
2884 lines.append(l.lstrip('>').lstrip('+'))
2882 block = "\n".join(lines) + '\n'
2885 block = "\n".join(lines) + '\n'
2883 #print "block:\n",block
2886 #print "block:\n",block
2884 if not par:
2887 if not par:
2885 b = textwrap.dedent(block)
2888 b = textwrap.dedent(block)
2886 exec b in self.user_ns
2889 exec b in self.user_ns
2887 self.user_ns['pasted_block'] = b
2890 self.user_ns['pasted_block'] = b
2888 else:
2891 else:
2889 self.user_ns[par] = block
2892 self.user_ns[par] = block
2890 print "Block assigned to '%s'" % par
2893 print "Block assigned to '%s'" % par
2891
2894
2892 def magic_quickref(self,arg):
2895 def magic_quickref(self,arg):
2893 """ Show a quick reference sheet """
2896 """ Show a quick reference sheet """
2894 import IPython.usage
2897 import IPython.usage
2895 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
2898 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
2896
2899
2897 page(qr)
2900 page(qr)
2898
2901
2899 def magic_upgrade(self,arg):
2902 def magic_upgrade(self,arg):
2900 """ Upgrade your IPython installation
2903 """ Upgrade your IPython installation
2901
2904
2902 This will copy the config files that don't yet exist in your
2905 This will copy the config files that don't yet exist in your
2903 ipython dir from the system config dir. Use this after upgrading
2906 ipython dir from the system config dir. Use this after upgrading
2904 IPython if you don't wish to delete your .ipython dir.
2907 IPython if you don't wish to delete your .ipython dir.
2905
2908
2906 Call with -nolegacy to get rid of ipythonrc* files (recommended for
2909 Call with -nolegacy to get rid of ipythonrc* files (recommended for
2907 new users)
2910 new users)
2908
2911
2909 """
2912 """
2910 ip = self.getapi()
2913 ip = self.getapi()
2911 ipinstallation = path(IPython.__file__).dirname()
2914 ipinstallation = path(IPython.__file__).dirname()
2912 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
2915 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
2913 src_config = ipinstallation / 'UserConfig'
2916 src_config = ipinstallation / 'UserConfig'
2914 userdir = path(ip.options.ipythondir)
2917 userdir = path(ip.options.ipythondir)
2915 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
2918 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
2916 print ">",cmd
2919 print ">",cmd
2917 shell(cmd)
2920 shell(cmd)
2918 if arg == '-nolegacy':
2921 if arg == '-nolegacy':
2919 legacy = userdir.files('ipythonrc*')
2922 legacy = userdir.files('ipythonrc*')
2920 print "Nuking legacy files:",legacy
2923 print "Nuking legacy files:",legacy
2921
2924
2922 [p.remove() for p in legacy]
2925 [p.remove() for p in legacy]
2923 suffix = (sys.platform == 'win32' and '.ini' or '')
2926 suffix = (sys.platform == 'win32' and '.ini' or '')
2924 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
2927 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
2925
2928
2926
2929
2927 def magic_doctest_mode(self,parameter_s=''):
2930 def magic_doctest_mode(self,parameter_s=''):
2928 """Toggle doctest mode on and off.
2931 """Toggle doctest mode on and off.
2929
2932
2930 This mode allows you to toggle the prompt behavior between normal
2933 This mode allows you to toggle the prompt behavior between normal
2931 IPython prompts and ones that are as similar to the default IPython
2934 IPython prompts and ones that are as similar to the default IPython
2932 interpreter as possible.
2935 interpreter as possible.
2933
2936
2934 It also supports the pasting of code snippets that have leading '>>>'
2937 It also supports the pasting of code snippets that have leading '>>>'
2935 and '...' prompts in them. This means that you can paste doctests from
2938 and '...' prompts in them. This means that you can paste doctests from
2936 files or docstrings (even if they have leading whitespace), and the
2939 files or docstrings (even if they have leading whitespace), and the
2937 code will execute correctly. You can then use '%history -tn' to see
2940 code will execute correctly. You can then use '%history -tn' to see
2938 the translated history without line numbers; this will give you the
2941 the translated history without line numbers; this will give you the
2939 input after removal of all the leading prompts and whitespace, which
2942 input after removal of all the leading prompts and whitespace, which
2940 can be pasted back into an editor.
2943 can be pasted back into an editor.
2941
2944
2942 With these features, you can switch into this mode easily whenever you
2945 With these features, you can switch into this mode easily whenever you
2943 need to do testing and changes to doctests, without having to leave
2946 need to do testing and changes to doctests, without having to leave
2944 your existing IPython session.
2947 your existing IPython session.
2945 """
2948 """
2946
2949
2947 # XXX - Fix this to have cleaner activate/deactivate calls.
2950 # XXX - Fix this to have cleaner activate/deactivate calls.
2948 from IPython.Extensions import InterpreterPasteInput as ipaste
2951 from IPython.Extensions import InterpreterPasteInput as ipaste
2949 from IPython.ipstruct import Struct
2952 from IPython.ipstruct import Struct
2950
2953
2951 # Shorthands
2954 # Shorthands
2952 shell = self.shell
2955 shell = self.shell
2953 oc = shell.outputcache
2956 oc = shell.outputcache
2954 rc = shell.rc
2957 rc = shell.rc
2955 meta = shell.meta
2958 meta = shell.meta
2956 # dstore is a data store kept in the instance metadata bag to track any
2959 # dstore is a data store kept in the instance metadata bag to track any
2957 # changes we make, so we can undo them later.
2960 # changes we make, so we can undo them later.
2958 dstore = meta.setdefault('doctest_mode',Struct())
2961 dstore = meta.setdefault('doctest_mode',Struct())
2959 save_dstore = dstore.setdefault
2962 save_dstore = dstore.setdefault
2960
2963
2961 # save a few values we'll need to recover later
2964 # save a few values we'll need to recover later
2962 mode = save_dstore('mode',False)
2965 mode = save_dstore('mode',False)
2963 save_dstore('rc_pprint',rc.pprint)
2966 save_dstore('rc_pprint',rc.pprint)
2964 save_dstore('xmode',shell.InteractiveTB.mode)
2967 save_dstore('xmode',shell.InteractiveTB.mode)
2965 save_dstore('rc_separate_in',rc.separate_in)
2968 save_dstore('rc_separate_in',rc.separate_in)
2966 save_dstore('rc_separate_out',rc.separate_out)
2969 save_dstore('rc_separate_out',rc.separate_out)
2967 save_dstore('rc_separate_out2',rc.separate_out2)
2970 save_dstore('rc_separate_out2',rc.separate_out2)
2968 save_dstore('rc_prompts_pad_left',rc.prompts_pad_left)
2971 save_dstore('rc_prompts_pad_left',rc.prompts_pad_left)
2969
2972
2970 if mode == False:
2973 if mode == False:
2971 # turn on
2974 # turn on
2972 ipaste.activate_prefilter()
2975 ipaste.activate_prefilter()
2973
2976
2974 oc.prompt1.p_template = '>>> '
2977 oc.prompt1.p_template = '>>> '
2975 oc.prompt2.p_template = '... '
2978 oc.prompt2.p_template = '... '
2976 oc.prompt_out.p_template = ''
2979 oc.prompt_out.p_template = ''
2977
2980
2978 oc.prompt1.sep = '\n'
2981 oc.prompt1.sep = '\n'
2979 oc.output_sep = ''
2982 oc.output_sep = ''
2980 oc.output_sep2 = ''
2983 oc.output_sep2 = ''
2981
2984
2982 oc.prompt1.pad_left = oc.prompt2.pad_left = \
2985 oc.prompt1.pad_left = oc.prompt2.pad_left = \
2983 oc.prompt_out.pad_left = False
2986 oc.prompt_out.pad_left = False
2984
2987
2985 rc.pprint = False
2988 rc.pprint = False
2986
2989
2987 shell.magic_xmode('Plain')
2990 shell.magic_xmode('Plain')
2988
2991
2989 else:
2992 else:
2990 # turn off
2993 # turn off
2991 ipaste.deactivate_prefilter()
2994 ipaste.deactivate_prefilter()
2992
2995
2993 oc.prompt1.p_template = rc.prompt_in1
2996 oc.prompt1.p_template = rc.prompt_in1
2994 oc.prompt2.p_template = rc.prompt_in2
2997 oc.prompt2.p_template = rc.prompt_in2
2995 oc.prompt_out.p_template = rc.prompt_out
2998 oc.prompt_out.p_template = rc.prompt_out
2996
2999
2997 oc.prompt1.sep = dstore.rc_separate_in
3000 oc.prompt1.sep = dstore.rc_separate_in
2998 oc.output_sep = dstore.rc_separate_out
3001 oc.output_sep = dstore.rc_separate_out
2999 oc.output_sep2 = dstore.rc_separate_out2
3002 oc.output_sep2 = dstore.rc_separate_out2
3000
3003
3001 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3004 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3002 oc.prompt_out.pad_left = dstore.rc_prompts_pad_left
3005 oc.prompt_out.pad_left = dstore.rc_prompts_pad_left
3003
3006
3004 rc.pprint = dstore.rc_pprint
3007 rc.pprint = dstore.rc_pprint
3005
3008
3006 shell.magic_xmode(dstore.xmode)
3009 shell.magic_xmode(dstore.xmode)
3007
3010
3008 # Store new mode and inform
3011 # Store new mode and inform
3009 dstore.mode = bool(1-int(mode))
3012 dstore.mode = bool(1-int(mode))
3010 print 'Doctest mode is:',
3013 print 'Doctest mode is:',
3011 print ['OFF','ON'][dstore.mode]
3014 print ['OFF','ON'][dstore.mode]
3012
3015
3013 # end Magic
3016 # end Magic
@@ -1,7068 +1,7073 b''
1 2007-09-03 Ville Vainio <vivainio@gmail.com>
2
3 * Magic.py: %time now passes expression through prefilter,
4 allowing IPython syntax.
5
1 2007-09-01 Ville Vainio <vivainio@gmail.com>
6 2007-09-01 Ville Vainio <vivainio@gmail.com>
2
7
3 * ipmaker.py: Always show full traceback when newstyle config fails
8 * ipmaker.py: Always show full traceback when newstyle config fails
4
9
5 2007-08-27 Ville Vainio <vivainio@gmail.com>
10 2007-08-27 Ville Vainio <vivainio@gmail.com>
6
11
7 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
12 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
8
13
9 2007-08-26 Ville Vainio <vivainio@gmail.com>
14 2007-08-26 Ville Vainio <vivainio@gmail.com>
10
15
11 * ipmaker.py: Command line args have the highest priority again
16 * ipmaker.py: Command line args have the highest priority again
12
17
13 * iplib.py, ipmaker.py: -i command line argument now behaves as in
18 * iplib.py, ipmaker.py: -i command line argument now behaves as in
14 normal python, i.e. leaves the IPython session running after -c
19 normal python, i.e. leaves the IPython session running after -c
15 command or running a batch file from command line.
20 command or running a batch file from command line.
16
21
17 2007-08-22 Ville Vainio <vivainio@gmail.com>
22 2007-08-22 Ville Vainio <vivainio@gmail.com>
18
23
19 * iplib.py: no extra empty (last) line in raw hist w/ multiline
24 * iplib.py: no extra empty (last) line in raw hist w/ multiline
20 statements
25 statements
21
26
22 * logger.py: Fix bug where blank lines in history were not
27 * logger.py: Fix bug where blank lines in history were not
23 added until AFTER adding the current line; translated and raw
28 added until AFTER adding the current line; translated and raw
24 history should finally be in sync with prompt now.
29 history should finally be in sync with prompt now.
25
30
26 * ipy_completers.py: quick_completer now makes it easy to create
31 * ipy_completers.py: quick_completer now makes it easy to create
27 trivial custom completers
32 trivial custom completers
28
33
29 * clearcmd.py: shadow history compression & erasing, fixed input hist
34 * clearcmd.py: shadow history compression & erasing, fixed input hist
30 clearing.
35 clearing.
31
36
32 * envpersist.py, history.py: %env (sh profile only), %hist completers
37 * envpersist.py, history.py: %env (sh profile only), %hist completers
33
38
34 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
39 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
35 term title now include the drive letter, and always use / instead of
40 term title now include the drive letter, and always use / instead of
36 os.sep (as per recommended approach for win32 ipython in general).
41 os.sep (as per recommended approach for win32 ipython in general).
37
42
38 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
43 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
39 plain python scripts from ipykit command line by running
44 plain python scripts from ipykit command line by running
40 "py myscript.py", even w/o installed python.
45 "py myscript.py", even w/o installed python.
41
46
42 2007-08-21 Ville Vainio <vivainio@gmail.com>
47 2007-08-21 Ville Vainio <vivainio@gmail.com>
43
48
44 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
49 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
45 (for backwards compatibility)
50 (for backwards compatibility)
46
51
47 * history.py: switch back to %hist -t from %hist -r as default.
52 * history.py: switch back to %hist -t from %hist -r as default.
48 At least until raw history is fixed for good.
53 At least until raw history is fixed for good.
49
54
50 2007-08-20 Ville Vainio <vivainio@gmail.com>
55 2007-08-20 Ville Vainio <vivainio@gmail.com>
51
56
52 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
57 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
53 locate alias redeclarations etc. Also, avoid handling
58 locate alias redeclarations etc. Also, avoid handling
54 _ip.IP.alias_table directly, prefer using _ip.defalias.
59 _ip.IP.alias_table directly, prefer using _ip.defalias.
55
60
56
61
57 2007-08-15 Ville Vainio <vivainio@gmail.com>
62 2007-08-15 Ville Vainio <vivainio@gmail.com>
58
63
59 * prefilter.py: ! is now always served first
64 * prefilter.py: ! is now always served first
60
65
61 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
66 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
62
67
63 * IPython/iplib.py (safe_execfile): fix the SystemExit
68 * IPython/iplib.py (safe_execfile): fix the SystemExit
64 auto-suppression code to work in Python2.4 (the internal structure
69 auto-suppression code to work in Python2.4 (the internal structure
65 of that exception changed and I'd only tested the code with 2.5).
70 of that exception changed and I'd only tested the code with 2.5).
66 Bug reported by a SciPy attendee.
71 Bug reported by a SciPy attendee.
67
72
68 2007-08-13 Ville Vainio <vivainio@gmail.com>
73 2007-08-13 Ville Vainio <vivainio@gmail.com>
69
74
70 * prefilter.py: reverted !c:/bin/foo fix, made % in
75 * prefilter.py: reverted !c:/bin/foo fix, made % in
71 multiline specials work again
76 multiline specials work again
72
77
73 2007-08-13 Ville Vainio <vivainio@gmail.com>
78 2007-08-13 Ville Vainio <vivainio@gmail.com>
74
79
75 * prefilter.py: Take more care to special-case !, so that
80 * prefilter.py: Take more care to special-case !, so that
76 !c:/bin/foo.exe works.
81 !c:/bin/foo.exe works.
77
82
78 * setup.py: if we are building eggs, strip all docs and
83 * setup.py: if we are building eggs, strip all docs and
79 examples (it doesn't make sense to bytecompile examples,
84 examples (it doesn't make sense to bytecompile examples,
80 and docs would be in an awkward place anyway).
85 and docs would be in an awkward place anyway).
81
86
82 * Ryan Krauss' patch fixes start menu shortcuts when IPython
87 * Ryan Krauss' patch fixes start menu shortcuts when IPython
83 is installed into a directory that has spaces in the name.
88 is installed into a directory that has spaces in the name.
84
89
85 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
90 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
86
91
87 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
92 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
88 doctest profile and %doctest_mode, so they actually generate the
93 doctest profile and %doctest_mode, so they actually generate the
89 blank lines needed by doctest to separate individual tests.
94 blank lines needed by doctest to separate individual tests.
90
95
91 * IPython/iplib.py (safe_execfile): modify so that running code
96 * IPython/iplib.py (safe_execfile): modify so that running code
92 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
97 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
93 doesn't get a printed traceback. Any other value in sys.exit(),
98 doesn't get a printed traceback. Any other value in sys.exit(),
94 including the empty call, still generates a traceback. This
99 including the empty call, still generates a traceback. This
95 enables use of %run without having to pass '-e' for codes that
100 enables use of %run without having to pass '-e' for codes that
96 correctly set the exit status flag.
101 correctly set the exit status flag.
97
102
98 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
103 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
99
104
100 * IPython/iplib.py (InteractiveShell.post_config_initialization):
105 * IPython/iplib.py (InteractiveShell.post_config_initialization):
101 fix problems with doctests failing when run inside IPython due to
106 fix problems with doctests failing when run inside IPython due to
102 IPython's modifications of sys.displayhook.
107 IPython's modifications of sys.displayhook.
103
108
104 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
109 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
105
110
106 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
111 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
107 a string with names.
112 a string with names.
108
113
109 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
114 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
110
115
111 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
116 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
112 magic to toggle on/off the doctest pasting support without having
117 magic to toggle on/off the doctest pasting support without having
113 to leave a session to switch to a separate profile.
118 to leave a session to switch to a separate profile.
114
119
115 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
120 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
116
121
117 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
122 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
118 introduce a blank line between inputs, to conform to doctest
123 introduce a blank line between inputs, to conform to doctest
119 requirements.
124 requirements.
120
125
121 * IPython/OInspect.py (Inspector.pinfo): fix another part where
126 * IPython/OInspect.py (Inspector.pinfo): fix another part where
122 auto-generated docstrings for new-style classes were showing up.
127 auto-generated docstrings for new-style classes were showing up.
123
128
124 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
129 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
125
130
126 * api_changes: Add new file to track backward-incompatible
131 * api_changes: Add new file to track backward-incompatible
127 user-visible changes.
132 user-visible changes.
128
133
129 2007-08-06 Ville Vainio <vivainio@gmail.com>
134 2007-08-06 Ville Vainio <vivainio@gmail.com>
130
135
131 * ipmaker.py: fix bug where user_config_ns didn't exist at all
136 * ipmaker.py: fix bug where user_config_ns didn't exist at all
132 before all the config files were handled.
137 before all the config files were handled.
133
138
134 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
139 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
135
140
136 * IPython/irunner.py (RunnerFactory): Add new factory class for
141 * IPython/irunner.py (RunnerFactory): Add new factory class for
137 creating reusable runners based on filenames.
142 creating reusable runners based on filenames.
138
143
139 * IPython/Extensions/ipy_profile_doctest.py: New profile for
144 * IPython/Extensions/ipy_profile_doctest.py: New profile for
140 doctest support. It sets prompts/exceptions as similar to
145 doctest support. It sets prompts/exceptions as similar to
141 standard Python as possible, so that ipython sessions in this
146 standard Python as possible, so that ipython sessions in this
142 profile can be easily pasted as doctests with minimal
147 profile can be easily pasted as doctests with minimal
143 modifications. It also enables pasting of doctests from external
148 modifications. It also enables pasting of doctests from external
144 sources (even if they have leading whitespace), so that you can
149 sources (even if they have leading whitespace), so that you can
145 rerun doctests from existing sources.
150 rerun doctests from existing sources.
146
151
147 * IPython/iplib.py (_prefilter): fix a buglet where after entering
152 * IPython/iplib.py (_prefilter): fix a buglet where after entering
148 some whitespace, the prompt would become a continuation prompt
153 some whitespace, the prompt would become a continuation prompt
149 with no way of exiting it other than Ctrl-C. This fix brings us
154 with no way of exiting it other than Ctrl-C. This fix brings us
150 into conformity with how the default python prompt works.
155 into conformity with how the default python prompt works.
151
156
152 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
157 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
153 Add support for pasting not only lines that start with '>>>', but
158 Add support for pasting not only lines that start with '>>>', but
154 also with ' >>>'. That is, arbitrary whitespace can now precede
159 also with ' >>>'. That is, arbitrary whitespace can now precede
155 the prompts. This makes the system useful for pasting doctests
160 the prompts. This makes the system useful for pasting doctests
156 from docstrings back into a normal session.
161 from docstrings back into a normal session.
157
162
158 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
163 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
159
164
160 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
165 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
161 r1357, which had killed multiple invocations of an embedded
166 r1357, which had killed multiple invocations of an embedded
162 ipython (this means that example-embed has been broken for over 1
167 ipython (this means that example-embed has been broken for over 1
163 year!!!). Rather than possibly breaking the batch stuff for which
168 year!!!). Rather than possibly breaking the batch stuff for which
164 the code in iplib.py/interact was introduced, I worked around the
169 the code in iplib.py/interact was introduced, I worked around the
165 problem in the embedding class in Shell.py. We really need a
170 problem in the embedding class in Shell.py. We really need a
166 bloody test suite for this code, I'm sick of finding stuff that
171 bloody test suite for this code, I'm sick of finding stuff that
167 used to work breaking left and right every time I use an old
172 used to work breaking left and right every time I use an old
168 feature I hadn't touched in a few months.
173 feature I hadn't touched in a few months.
169 (kill_embedded): Add a new magic that only shows up in embedded
174 (kill_embedded): Add a new magic that only shows up in embedded
170 mode, to allow users to permanently deactivate an embedded instance.
175 mode, to allow users to permanently deactivate an embedded instance.
171
176
172 2007-08-01 Ville Vainio <vivainio@gmail.com>
177 2007-08-01 Ville Vainio <vivainio@gmail.com>
173
178
174 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
179 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
175 history gets out of sync on runlines (e.g. when running macros).
180 history gets out of sync on runlines (e.g. when running macros).
176
181
177 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
182 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
178
183
179 * IPython/Magic.py (magic_colors): fix win32-related error message
184 * IPython/Magic.py (magic_colors): fix win32-related error message
180 that could appear under *nix when readline was missing. Patch by
185 that could appear under *nix when readline was missing. Patch by
181 Scott Jackson, closes #175.
186 Scott Jackson, closes #175.
182
187
183 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
188 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
184
189
185 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
190 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
186 completer that it traits-aware, so that traits objects don't show
191 completer that it traits-aware, so that traits objects don't show
187 all of their internal attributes all the time.
192 all of their internal attributes all the time.
188
193
189 * IPython/genutils.py (dir2): moved this code from inside
194 * IPython/genutils.py (dir2): moved this code from inside
190 completer.py to expose it publicly, so I could use it in the
195 completer.py to expose it publicly, so I could use it in the
191 wildcards bugfix.
196 wildcards bugfix.
192
197
193 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
198 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
194 Stefan with Traits.
199 Stefan with Traits.
195
200
196 * IPython/completer.py (Completer.attr_matches): change internal
201 * IPython/completer.py (Completer.attr_matches): change internal
197 var name from 'object' to 'obj', since 'object' is now a builtin
202 var name from 'object' to 'obj', since 'object' is now a builtin
198 and this can lead to weird bugs if reusing this code elsewhere.
203 and this can lead to weird bugs if reusing this code elsewhere.
199
204
200 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
205 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
201
206
202 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
207 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
203 'foo?' and update the code to prevent printing of default
208 'foo?' and update the code to prevent printing of default
204 docstrings that started appearing after I added support for
209 docstrings that started appearing after I added support for
205 new-style classes. The approach I'm using isn't ideal (I just
210 new-style classes. The approach I'm using isn't ideal (I just
206 special-case those strings) but I'm not sure how to more robustly
211 special-case those strings) but I'm not sure how to more robustly
207 differentiate between truly user-written strings and Python's
212 differentiate between truly user-written strings and Python's
208 automatic ones.
213 automatic ones.
209
214
210 2007-07-09 Ville Vainio <vivainio@gmail.com>
215 2007-07-09 Ville Vainio <vivainio@gmail.com>
211
216
212 * completer.py: Applied Matthew Neeley's patch:
217 * completer.py: Applied Matthew Neeley's patch:
213 Dynamic attributes from trait_names and _getAttributeNames are added
218 Dynamic attributes from trait_names and _getAttributeNames are added
214 to the list of tab completions, but when this happens, the attribute
219 to the list of tab completions, but when this happens, the attribute
215 list is turned into a set, so the attributes are unordered when
220 list is turned into a set, so the attributes are unordered when
216 printed, which makes it hard to find the right completion. This patch
221 printed, which makes it hard to find the right completion. This patch
217 turns this set back into a list and sort it.
222 turns this set back into a list and sort it.
218
223
219 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
224 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
220
225
221 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
226 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
222 classes in various inspector functions.
227 classes in various inspector functions.
223
228
224 2007-06-28 Ville Vainio <vivainio@gmail.com>
229 2007-06-28 Ville Vainio <vivainio@gmail.com>
225
230
226 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
231 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
227 Implement "shadow" namespace, and callable aliases that reside there.
232 Implement "shadow" namespace, and callable aliases that reside there.
228 Use them by:
233 Use them by:
229
234
230 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
235 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
231
236
232 foo hello world
237 foo hello world
233 (gets translated to:)
238 (gets translated to:)
234 _sh.foo(r"""hello world""")
239 _sh.foo(r"""hello world""")
235
240
236 In practice, this kind of alias can take the role of a magic function
241 In practice, this kind of alias can take the role of a magic function
237
242
238 * New generic inspect_object, called on obj? and obj??
243 * New generic inspect_object, called on obj? and obj??
239
244
240 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
245 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
241
246
242 * IPython/ultraTB.py (findsource): fix a problem with
247 * IPython/ultraTB.py (findsource): fix a problem with
243 inspect.getfile that can cause crashes during traceback construction.
248 inspect.getfile that can cause crashes during traceback construction.
244
249
245 2007-06-14 Ville Vainio <vivainio@gmail.com>
250 2007-06-14 Ville Vainio <vivainio@gmail.com>
246
251
247 * iplib.py (handle_auto): Try to use ascii for printing "--->"
252 * iplib.py (handle_auto): Try to use ascii for printing "--->"
248 autocall rewrite indication, becausesometimes unicode fails to print
253 autocall rewrite indication, becausesometimes unicode fails to print
249 properly (and you get ' - - - '). Use plain uncoloured ---> for
254 properly (and you get ' - - - '). Use plain uncoloured ---> for
250 unicode.
255 unicode.
251
256
252 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
257 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
253
258
254 . pickleshare 'hash' commands (hget, hset, hcompress,
259 . pickleshare 'hash' commands (hget, hset, hcompress,
255 hdict) for efficient shadow history storage.
260 hdict) for efficient shadow history storage.
256
261
257 2007-06-13 Ville Vainio <vivainio@gmail.com>
262 2007-06-13 Ville Vainio <vivainio@gmail.com>
258
263
259 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
264 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
260 Added kw arg 'interactive', tell whether vars should be visible
265 Added kw arg 'interactive', tell whether vars should be visible
261 with %whos.
266 with %whos.
262
267
263 2007-06-11 Ville Vainio <vivainio@gmail.com>
268 2007-06-11 Ville Vainio <vivainio@gmail.com>
264
269
265 * pspersistence.py, Magic.py, iplib.py: directory history now saved
270 * pspersistence.py, Magic.py, iplib.py: directory history now saved
266 to db
271 to db
267
272
268 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
273 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
269 Also, it exits IPython immediately after evaluating the command (just like
274 Also, it exits IPython immediately after evaluating the command (just like
270 std python)
275 std python)
271
276
272 2007-06-05 Walter Doerwald <walter@livinglogic.de>
277 2007-06-05 Walter Doerwald <walter@livinglogic.de>
273
278
274 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
279 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
275 Python string and captures the output. (Idea and original patch by
280 Python string and captures the output. (Idea and original patch by
276 StοΏ½fan van der Walt)
281 StοΏ½fan van der Walt)
277
282
278 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
283 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
279
284
280 * IPython/ultraTB.py (VerboseTB.text): update printing of
285 * IPython/ultraTB.py (VerboseTB.text): update printing of
281 exception types for Python 2.5 (now all exceptions in the stdlib
286 exception types for Python 2.5 (now all exceptions in the stdlib
282 are new-style classes).
287 are new-style classes).
283
288
284 2007-05-31 Walter Doerwald <walter@livinglogic.de>
289 2007-05-31 Walter Doerwald <walter@livinglogic.de>
285
290
286 * IPython/Extensions/igrid.py: Add new commands refresh and
291 * IPython/Extensions/igrid.py: Add new commands refresh and
287 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
292 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
288 the iterator once (refresh) or after every x seconds (refresh_timer).
293 the iterator once (refresh) or after every x seconds (refresh_timer).
289 Add a working implementation of "searchexpression", where the text
294 Add a working implementation of "searchexpression", where the text
290 entered is not the text to search for, but an expression that must
295 entered is not the text to search for, but an expression that must
291 be true. Added display of shortcuts to the menu. Added commands "pickinput"
296 be true. Added display of shortcuts to the menu. Added commands "pickinput"
292 and "pickinputattr" that put the object or attribute under the cursor
297 and "pickinputattr" that put the object or attribute under the cursor
293 in the input line. Split the statusbar to be able to display the currently
298 in the input line. Split the statusbar to be able to display the currently
294 active refresh interval. (Patch by Nik Tautenhahn)
299 active refresh interval. (Patch by Nik Tautenhahn)
295
300
296 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
301 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
297
302
298 * fixing set_term_title to use ctypes as default
303 * fixing set_term_title to use ctypes as default
299
304
300 * fixing set_term_title fallback to work when curent dir
305 * fixing set_term_title fallback to work when curent dir
301 is on a windows network share
306 is on a windows network share
302
307
303 2007-05-28 Ville Vainio <vivainio@gmail.com>
308 2007-05-28 Ville Vainio <vivainio@gmail.com>
304
309
305 * %cpaste: strip + with > from left (diffs).
310 * %cpaste: strip + with > from left (diffs).
306
311
307 * iplib.py: Fix crash when readline not installed
312 * iplib.py: Fix crash when readline not installed
308
313
309 2007-05-26 Ville Vainio <vivainio@gmail.com>
314 2007-05-26 Ville Vainio <vivainio@gmail.com>
310
315
311 * generics.py: intruduce easy to extend result_display generic
316 * generics.py: intruduce easy to extend result_display generic
312 function (using simplegeneric.py).
317 function (using simplegeneric.py).
313
318
314 * Fixed the append functionality of %set.
319 * Fixed the append functionality of %set.
315
320
316 2007-05-25 Ville Vainio <vivainio@gmail.com>
321 2007-05-25 Ville Vainio <vivainio@gmail.com>
317
322
318 * New magic: %rep (fetch / run old commands from history)
323 * New magic: %rep (fetch / run old commands from history)
319
324
320 * New extension: mglob (%mglob magic), for powerful glob / find /filter
325 * New extension: mglob (%mglob magic), for powerful glob / find /filter
321 like functionality
326 like functionality
322
327
323 % maghistory.py: %hist -g PATTERM greps the history for pattern
328 % maghistory.py: %hist -g PATTERM greps the history for pattern
324
329
325 2007-05-24 Walter Doerwald <walter@livinglogic.de>
330 2007-05-24 Walter Doerwald <walter@livinglogic.de>
326
331
327 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
332 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
328 browse the IPython input history
333 browse the IPython input history
329
334
330 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
335 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
331 (mapped to "i") can be used to put the object under the curser in the input
336 (mapped to "i") can be used to put the object under the curser in the input
332 line. pickinputattr (mapped to "I") does the same for the attribute under
337 line. pickinputattr (mapped to "I") does the same for the attribute under
333 the cursor.
338 the cursor.
334
339
335 2007-05-24 Ville Vainio <vivainio@gmail.com>
340 2007-05-24 Ville Vainio <vivainio@gmail.com>
336
341
337 * Grand magic cleansing (changeset [2380]):
342 * Grand magic cleansing (changeset [2380]):
338
343
339 * Introduce ipy_legacy.py where the following magics were
344 * Introduce ipy_legacy.py where the following magics were
340 moved:
345 moved:
341
346
342 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
347 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
343
348
344 If you need them, either use default profile or "import ipy_legacy"
349 If you need them, either use default profile or "import ipy_legacy"
345 in your ipy_user_conf.py
350 in your ipy_user_conf.py
346
351
347 * Move sh and scipy profile to Extensions from UserConfig. this implies
352 * Move sh and scipy profile to Extensions from UserConfig. this implies
348 you should not edit them, but you don't need to run %upgrade when
353 you should not edit them, but you don't need to run %upgrade when
349 upgrading IPython anymore.
354 upgrading IPython anymore.
350
355
351 * %hist/%history now operates in "raw" mode by default. To get the old
356 * %hist/%history now operates in "raw" mode by default. To get the old
352 behaviour, run '%hist -n' (native mode).
357 behaviour, run '%hist -n' (native mode).
353
358
354 * split ipy_stock_completers.py to ipy_stock_completers.py and
359 * split ipy_stock_completers.py to ipy_stock_completers.py and
355 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
360 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
356 installed as default.
361 installed as default.
357
362
358 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
363 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
359 handling.
364 handling.
360
365
361 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
366 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
362 input if readline is available.
367 input if readline is available.
363
368
364 2007-05-23 Ville Vainio <vivainio@gmail.com>
369 2007-05-23 Ville Vainio <vivainio@gmail.com>
365
370
366 * macro.py: %store uses __getstate__ properly
371 * macro.py: %store uses __getstate__ properly
367
372
368 * exesetup.py: added new setup script for creating
373 * exesetup.py: added new setup script for creating
369 standalone IPython executables with py2exe (i.e.
374 standalone IPython executables with py2exe (i.e.
370 no python installation required).
375 no python installation required).
371
376
372 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
377 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
373 its place.
378 its place.
374
379
375 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
380 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
376
381
377 2007-05-21 Ville Vainio <vivainio@gmail.com>
382 2007-05-21 Ville Vainio <vivainio@gmail.com>
378
383
379 * platutil_win32.py (set_term_title): handle
384 * platutil_win32.py (set_term_title): handle
380 failure of 'title' system call properly.
385 failure of 'title' system call properly.
381
386
382 2007-05-17 Walter Doerwald <walter@livinglogic.de>
387 2007-05-17 Walter Doerwald <walter@livinglogic.de>
383
388
384 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
389 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
385 (Bug detected by Paul Mueller).
390 (Bug detected by Paul Mueller).
386
391
387 2007-05-16 Ville Vainio <vivainio@gmail.com>
392 2007-05-16 Ville Vainio <vivainio@gmail.com>
388
393
389 * ipy_profile_sci.py, ipython_win_post_install.py: Create
394 * ipy_profile_sci.py, ipython_win_post_install.py: Create
390 new "sci" profile, effectively a modern version of the old
395 new "sci" profile, effectively a modern version of the old
391 "scipy" profile (which is now slated for deprecation).
396 "scipy" profile (which is now slated for deprecation).
392
397
393 2007-05-15 Ville Vainio <vivainio@gmail.com>
398 2007-05-15 Ville Vainio <vivainio@gmail.com>
394
399
395 * pycolorize.py, pycolor.1: Paul Mueller's patches that
400 * pycolorize.py, pycolor.1: Paul Mueller's patches that
396 make pycolorize read input from stdin when run without arguments.
401 make pycolorize read input from stdin when run without arguments.
397
402
398 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
403 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
399
404
400 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
405 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
401 it in sh profile (instead of ipy_system_conf.py).
406 it in sh profile (instead of ipy_system_conf.py).
402
407
403 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
408 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
404 aliases are now lower case on windows (MyCommand.exe => mycommand).
409 aliases are now lower case on windows (MyCommand.exe => mycommand).
405
410
406 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
411 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
407 Macros are now callable objects that inherit from ipapi.IPyAutocall,
412 Macros are now callable objects that inherit from ipapi.IPyAutocall,
408 i.e. get autocalled regardless of system autocall setting.
413 i.e. get autocalled regardless of system autocall setting.
409
414
410 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
415 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
411
416
412 * IPython/rlineimpl.py: check for clear_history in readline and
417 * IPython/rlineimpl.py: check for clear_history in readline and
413 make it a dummy no-op if not available. This function isn't
418 make it a dummy no-op if not available. This function isn't
414 guaranteed to be in the API and appeared in Python 2.4, so we need
419 guaranteed to be in the API and appeared in Python 2.4, so we need
415 to check it ourselves. Also, clean up this file quite a bit.
420 to check it ourselves. Also, clean up this file quite a bit.
416
421
417 * ipython.1: update man page and full manual with information
422 * ipython.1: update man page and full manual with information
418 about threads (remove outdated warning). Closes #151.
423 about threads (remove outdated warning). Closes #151.
419
424
420 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
425 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
421
426
422 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
427 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
423 in trunk (note that this made it into the 0.8.1 release already,
428 in trunk (note that this made it into the 0.8.1 release already,
424 but the changelogs didn't get coordinated). Many thanks to Gael
429 but the changelogs didn't get coordinated). Many thanks to Gael
425 Varoquaux <gael.varoquaux-AT-normalesup.org>
430 Varoquaux <gael.varoquaux-AT-normalesup.org>
426
431
427 2007-05-09 *** Released version 0.8.1
432 2007-05-09 *** Released version 0.8.1
428
433
429 2007-05-10 Walter Doerwald <walter@livinglogic.de>
434 2007-05-10 Walter Doerwald <walter@livinglogic.de>
430
435
431 * IPython/Extensions/igrid.py: Incorporate html help into
436 * IPython/Extensions/igrid.py: Incorporate html help into
432 the module, so we don't have to search for the file.
437 the module, so we don't have to search for the file.
433
438
434 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
439 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
435
440
436 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
441 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
437
442
438 2007-04-30 Ville Vainio <vivainio@gmail.com>
443 2007-04-30 Ville Vainio <vivainio@gmail.com>
439
444
440 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
445 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
441 user has illegal (non-ascii) home directory name
446 user has illegal (non-ascii) home directory name
442
447
443 2007-04-27 Ville Vainio <vivainio@gmail.com>
448 2007-04-27 Ville Vainio <vivainio@gmail.com>
444
449
445 * platutils_win32.py: implement set_term_title for windows
450 * platutils_win32.py: implement set_term_title for windows
446
451
447 * Update version number
452 * Update version number
448
453
449 * ipy_profile_sh.py: more informative prompt (2 dir levels)
454 * ipy_profile_sh.py: more informative prompt (2 dir levels)
450
455
451 2007-04-26 Walter Doerwald <walter@livinglogic.de>
456 2007-04-26 Walter Doerwald <walter@livinglogic.de>
452
457
453 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
458 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
454 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
459 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
455 bug discovered by Ville).
460 bug discovered by Ville).
456
461
457 2007-04-26 Ville Vainio <vivainio@gmail.com>
462 2007-04-26 Ville Vainio <vivainio@gmail.com>
458
463
459 * Extensions/ipy_completers.py: Olivier's module completer now
464 * Extensions/ipy_completers.py: Olivier's module completer now
460 saves the list of root modules if it takes > 4 secs on the first run.
465 saves the list of root modules if it takes > 4 secs on the first run.
461
466
462 * Magic.py (%rehashx): %rehashx now clears the completer cache
467 * Magic.py (%rehashx): %rehashx now clears the completer cache
463
468
464
469
465 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
470 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
466
471
467 * ipython.el: fix incorrect color scheme, reported by Stefan.
472 * ipython.el: fix incorrect color scheme, reported by Stefan.
468 Closes #149.
473 Closes #149.
469
474
470 * IPython/PyColorize.py (Parser.format2): fix state-handling
475 * IPython/PyColorize.py (Parser.format2): fix state-handling
471 logic. I still don't like how that code handles state, but at
476 logic. I still don't like how that code handles state, but at
472 least now it should be correct, if inelegant. Closes #146.
477 least now it should be correct, if inelegant. Closes #146.
473
478
474 2007-04-25 Ville Vainio <vivainio@gmail.com>
479 2007-04-25 Ville Vainio <vivainio@gmail.com>
475
480
476 * Extensions/ipy_which.py: added extension for %which magic, works
481 * Extensions/ipy_which.py: added extension for %which magic, works
477 a lot like unix 'which' but also finds and expands aliases, and
482 a lot like unix 'which' but also finds and expands aliases, and
478 allows wildcards.
483 allows wildcards.
479
484
480 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
485 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
481 as opposed to returning nothing.
486 as opposed to returning nothing.
482
487
483 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
488 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
484 ipy_stock_completers on default profile, do import on sh profile.
489 ipy_stock_completers on default profile, do import on sh profile.
485
490
486 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
491 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
487
492
488 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
493 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
489 like ipython.py foo.py which raised a IndexError.
494 like ipython.py foo.py which raised a IndexError.
490
495
491 2007-04-21 Ville Vainio <vivainio@gmail.com>
496 2007-04-21 Ville Vainio <vivainio@gmail.com>
492
497
493 * Extensions/ipy_extutil.py: added extension to manage other ipython
498 * Extensions/ipy_extutil.py: added extension to manage other ipython
494 extensions. Now only supports 'ls' == list extensions.
499 extensions. Now only supports 'ls' == list extensions.
495
500
496 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
501 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
497
502
498 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
503 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
499 would prevent use of the exception system outside of a running
504 would prevent use of the exception system outside of a running
500 IPython instance.
505 IPython instance.
501
506
502 2007-04-20 Ville Vainio <vivainio@gmail.com>
507 2007-04-20 Ville Vainio <vivainio@gmail.com>
503
508
504 * Extensions/ipy_render.py: added extension for easy
509 * Extensions/ipy_render.py: added extension for easy
505 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
510 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
506 'Iptl' template notation,
511 'Iptl' template notation,
507
512
508 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
513 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
509 safer & faster 'import' completer.
514 safer & faster 'import' completer.
510
515
511 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
516 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
512 and _ip.defalias(name, command).
517 and _ip.defalias(name, command).
513
518
514 * Extensions/ipy_exportdb.py: New extension for exporting all the
519 * Extensions/ipy_exportdb.py: New extension for exporting all the
515 %store'd data in a portable format (normal ipapi calls like
520 %store'd data in a portable format (normal ipapi calls like
516 defmacro() etc.)
521 defmacro() etc.)
517
522
518 2007-04-19 Ville Vainio <vivainio@gmail.com>
523 2007-04-19 Ville Vainio <vivainio@gmail.com>
519
524
520 * upgrade_dir.py: skip junk files like *.pyc
525 * upgrade_dir.py: skip junk files like *.pyc
521
526
522 * Release.py: version number to 0.8.1
527 * Release.py: version number to 0.8.1
523
528
524 2007-04-18 Ville Vainio <vivainio@gmail.com>
529 2007-04-18 Ville Vainio <vivainio@gmail.com>
525
530
526 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
531 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
527 and later on win32.
532 and later on win32.
528
533
529 2007-04-16 Ville Vainio <vivainio@gmail.com>
534 2007-04-16 Ville Vainio <vivainio@gmail.com>
530
535
531 * iplib.py (showtraceback): Do not crash when running w/o readline.
536 * iplib.py (showtraceback): Do not crash when running w/o readline.
532
537
533 2007-04-12 Walter Doerwald <walter@livinglogic.de>
538 2007-04-12 Walter Doerwald <walter@livinglogic.de>
534
539
535 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
540 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
536 sorted (case sensitive with files and dirs mixed).
541 sorted (case sensitive with files and dirs mixed).
537
542
538 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
543 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
539
544
540 * IPython/Release.py (version): Open trunk for 0.8.1 development.
545 * IPython/Release.py (version): Open trunk for 0.8.1 development.
541
546
542 2007-04-10 *** Released version 0.8.0
547 2007-04-10 *** Released version 0.8.0
543
548
544 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
549 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
545
550
546 * Tag 0.8.0 for release.
551 * Tag 0.8.0 for release.
547
552
548 * IPython/iplib.py (reloadhist): add API function to cleanly
553 * IPython/iplib.py (reloadhist): add API function to cleanly
549 reload the readline history, which was growing inappropriately on
554 reload the readline history, which was growing inappropriately on
550 every %run call.
555 every %run call.
551
556
552 * win32_manual_post_install.py (run): apply last part of Nicolas
557 * win32_manual_post_install.py (run): apply last part of Nicolas
553 Pernetty's patch (I'd accidentally applied it in a different
558 Pernetty's patch (I'd accidentally applied it in a different
554 directory and this particular file didn't get patched).
559 directory and this particular file didn't get patched).
555
560
556 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
561 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
557
562
558 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
563 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
559 find the main thread id and use the proper API call. Thanks to
564 find the main thread id and use the proper API call. Thanks to
560 Stefan for the fix.
565 Stefan for the fix.
561
566
562 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
567 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
563 unit tests to reflect fixed ticket #52, and add more tests sent by
568 unit tests to reflect fixed ticket #52, and add more tests sent by
564 him.
569 him.
565
570
566 * IPython/iplib.py (raw_input): restore the readline completer
571 * IPython/iplib.py (raw_input): restore the readline completer
567 state on every input, in case third-party code messed it up.
572 state on every input, in case third-party code messed it up.
568 (_prefilter): revert recent addition of early-escape checks which
573 (_prefilter): revert recent addition of early-escape checks which
569 prevent many valid alias calls from working.
574 prevent many valid alias calls from working.
570
575
571 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
576 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
572 flag for sigint handler so we don't run a full signal() call on
577 flag for sigint handler so we don't run a full signal() call on
573 each runcode access.
578 each runcode access.
574
579
575 * IPython/Magic.py (magic_whos): small improvement to diagnostic
580 * IPython/Magic.py (magic_whos): small improvement to diagnostic
576 message.
581 message.
577
582
578 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
583 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
579
584
580 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
585 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
581 asynchronous exceptions working, i.e., Ctrl-C can actually
586 asynchronous exceptions working, i.e., Ctrl-C can actually
582 interrupt long-running code in the multithreaded shells.
587 interrupt long-running code in the multithreaded shells.
583
588
584 This is using Tomer Filiba's great ctypes-based trick:
589 This is using Tomer Filiba's great ctypes-based trick:
585 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
590 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
586 this in the past, but hadn't been able to make it work before. So
591 this in the past, but hadn't been able to make it work before. So
587 far it looks like it's actually running, but this needs more
592 far it looks like it's actually running, but this needs more
588 testing. If it really works, I'll be *very* happy, and we'll owe
593 testing. If it really works, I'll be *very* happy, and we'll owe
589 a huge thank you to Tomer. My current implementation is ugly,
594 a huge thank you to Tomer. My current implementation is ugly,
590 hackish and uses nasty globals, but I don't want to try and clean
595 hackish and uses nasty globals, but I don't want to try and clean
591 anything up until we know if it actually works.
596 anything up until we know if it actually works.
592
597
593 NOTE: this feature needs ctypes to work. ctypes is included in
598 NOTE: this feature needs ctypes to work. ctypes is included in
594 Python2.5, but 2.4 users will need to manually install it. This
599 Python2.5, but 2.4 users will need to manually install it. This
595 feature makes multi-threaded shells so much more usable that it's
600 feature makes multi-threaded shells so much more usable that it's
596 a minor price to pay (ctypes is very easy to install, already a
601 a minor price to pay (ctypes is very easy to install, already a
597 requirement for win32 and available in major linux distros).
602 requirement for win32 and available in major linux distros).
598
603
599 2007-04-04 Ville Vainio <vivainio@gmail.com>
604 2007-04-04 Ville Vainio <vivainio@gmail.com>
600
605
601 * Extensions/ipy_completers.py, ipy_stock_completers.py:
606 * Extensions/ipy_completers.py, ipy_stock_completers.py:
602 Moved implementations of 'bundled' completers to ipy_completers.py,
607 Moved implementations of 'bundled' completers to ipy_completers.py,
603 they are only enabled in ipy_stock_completers.py.
608 they are only enabled in ipy_stock_completers.py.
604
609
605 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
610 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
606
611
607 * IPython/PyColorize.py (Parser.format2): Fix identation of
612 * IPython/PyColorize.py (Parser.format2): Fix identation of
608 colorzied output and return early if color scheme is NoColor, to
613 colorzied output and return early if color scheme is NoColor, to
609 avoid unnecessary and expensive tokenization. Closes #131.
614 avoid unnecessary and expensive tokenization. Closes #131.
610
615
611 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
616 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
612
617
613 * IPython/Debugger.py: disable the use of pydb version 1.17. It
618 * IPython/Debugger.py: disable the use of pydb version 1.17. It
614 has a critical bug (a missing import that makes post-mortem not
619 has a critical bug (a missing import that makes post-mortem not
615 work at all). Unfortunately as of this time, this is the version
620 work at all). Unfortunately as of this time, this is the version
616 shipped with Ubuntu Edgy, so quite a few people have this one. I
621 shipped with Ubuntu Edgy, so quite a few people have this one. I
617 hope Edgy will update to a more recent package.
622 hope Edgy will update to a more recent package.
618
623
619 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
624 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
620
625
621 * IPython/iplib.py (_prefilter): close #52, second part of a patch
626 * IPython/iplib.py (_prefilter): close #52, second part of a patch
622 set by Stefan (only the first part had been applied before).
627 set by Stefan (only the first part had been applied before).
623
628
624 * IPython/Extensions/ipy_stock_completers.py (module_completer):
629 * IPython/Extensions/ipy_stock_completers.py (module_completer):
625 remove usage of the dangerous pkgutil.walk_packages(). See
630 remove usage of the dangerous pkgutil.walk_packages(). See
626 details in comments left in the code.
631 details in comments left in the code.
627
632
628 * IPython/Magic.py (magic_whos): add support for numpy arrays
633 * IPython/Magic.py (magic_whos): add support for numpy arrays
629 similar to what we had for Numeric.
634 similar to what we had for Numeric.
630
635
631 * IPython/completer.py (IPCompleter.complete): extend the
636 * IPython/completer.py (IPCompleter.complete): extend the
632 complete() call API to support completions by other mechanisms
637 complete() call API to support completions by other mechanisms
633 than readline. Closes #109.
638 than readline. Closes #109.
634
639
635 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
640 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
636 protect against a bug in Python's execfile(). Closes #123.
641 protect against a bug in Python's execfile(). Closes #123.
637
642
638 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
643 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
639
644
640 * IPython/iplib.py (split_user_input): ensure that when splitting
645 * IPython/iplib.py (split_user_input): ensure that when splitting
641 user input, the part that can be treated as a python name is pure
646 user input, the part that can be treated as a python name is pure
642 ascii (Python identifiers MUST be pure ascii). Part of the
647 ascii (Python identifiers MUST be pure ascii). Part of the
643 ongoing Unicode support work.
648 ongoing Unicode support work.
644
649
645 * IPython/Prompts.py (prompt_specials_color): Add \N for the
650 * IPython/Prompts.py (prompt_specials_color): Add \N for the
646 actual prompt number, without any coloring. This allows users to
651 actual prompt number, without any coloring. This allows users to
647 produce numbered prompts with their own colors. Added after a
652 produce numbered prompts with their own colors. Added after a
648 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
653 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
649
654
650 2007-03-31 Walter Doerwald <walter@livinglogic.de>
655 2007-03-31 Walter Doerwald <walter@livinglogic.de>
651
656
652 * IPython/Extensions/igrid.py: Map the return key
657 * IPython/Extensions/igrid.py: Map the return key
653 to enter() and shift-return to enterattr().
658 to enter() and shift-return to enterattr().
654
659
655 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
660 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
656
661
657 * IPython/Magic.py (magic_psearch): add unicode support by
662 * IPython/Magic.py (magic_psearch): add unicode support by
658 encoding to ascii the input, since this routine also only deals
663 encoding to ascii the input, since this routine also only deals
659 with valid Python names. Fixes a bug reported by Stefan.
664 with valid Python names. Fixes a bug reported by Stefan.
660
665
661 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
666 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
662
667
663 * IPython/Magic.py (_inspect): convert unicode input into ascii
668 * IPython/Magic.py (_inspect): convert unicode input into ascii
664 before trying to evaluate it as a Python identifier. This fixes a
669 before trying to evaluate it as a Python identifier. This fixes a
665 problem that the new unicode support had introduced when analyzing
670 problem that the new unicode support had introduced when analyzing
666 long definition lines for functions.
671 long definition lines for functions.
667
672
668 2007-03-24 Walter Doerwald <walter@livinglogic.de>
673 2007-03-24 Walter Doerwald <walter@livinglogic.de>
669
674
670 * IPython/Extensions/igrid.py: Fix picking. Using
675 * IPython/Extensions/igrid.py: Fix picking. Using
671 igrid with wxPython 2.6 and -wthread should work now.
676 igrid with wxPython 2.6 and -wthread should work now.
672 igrid.display() simply tries to create a frame without
677 igrid.display() simply tries to create a frame without
673 an application. Only if this fails an application is created.
678 an application. Only if this fails an application is created.
674
679
675 2007-03-23 Walter Doerwald <walter@livinglogic.de>
680 2007-03-23 Walter Doerwald <walter@livinglogic.de>
676
681
677 * IPython/Extensions/path.py: Updated to version 2.2.
682 * IPython/Extensions/path.py: Updated to version 2.2.
678
683
679 2007-03-23 Ville Vainio <vivainio@gmail.com>
684 2007-03-23 Ville Vainio <vivainio@gmail.com>
680
685
681 * iplib.py: recursive alias expansion now works better, so that
686 * iplib.py: recursive alias expansion now works better, so that
682 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
687 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
683 doesn't trip up the process, if 'd' has been aliased to 'ls'.
688 doesn't trip up the process, if 'd' has been aliased to 'ls'.
684
689
685 * Extensions/ipy_gnuglobal.py added, provides %global magic
690 * Extensions/ipy_gnuglobal.py added, provides %global magic
686 for users of http://www.gnu.org/software/global
691 for users of http://www.gnu.org/software/global
687
692
688 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
693 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
689 Closes #52. Patch by Stefan van der Walt.
694 Closes #52. Patch by Stefan van der Walt.
690
695
691 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
696 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
692
697
693 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
698 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
694 respect the __file__ attribute when using %run. Thanks to a bug
699 respect the __file__ attribute when using %run. Thanks to a bug
695 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
700 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
696
701
697 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
702 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
698
703
699 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
704 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
700 input. Patch sent by Stefan.
705 input. Patch sent by Stefan.
701
706
702 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
707 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
703 * IPython/Extensions/ipy_stock_completer.py
708 * IPython/Extensions/ipy_stock_completer.py
704 shlex_split, fix bug in shlex_split. len function
709 shlex_split, fix bug in shlex_split. len function
705 call was missing an if statement. Caused shlex_split to
710 call was missing an if statement. Caused shlex_split to
706 sometimes return "" as last element.
711 sometimes return "" as last element.
707
712
708 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
713 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
709
714
710 * IPython/completer.py
715 * IPython/completer.py
711 (IPCompleter.file_matches.single_dir_expand): fix a problem
716 (IPCompleter.file_matches.single_dir_expand): fix a problem
712 reported by Stefan, where directories containign a single subdir
717 reported by Stefan, where directories containign a single subdir
713 would be completed too early.
718 would be completed too early.
714
719
715 * IPython/Shell.py (_load_pylab): Make the execution of 'from
720 * IPython/Shell.py (_load_pylab): Make the execution of 'from
716 pylab import *' when -pylab is given be optional. A new flag,
721 pylab import *' when -pylab is given be optional. A new flag,
717 pylab_import_all controls this behavior, the default is True for
722 pylab_import_all controls this behavior, the default is True for
718 backwards compatibility.
723 backwards compatibility.
719
724
720 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
725 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
721 modified) R. Bernstein's patch for fully syntax highlighted
726 modified) R. Bernstein's patch for fully syntax highlighted
722 tracebacks. The functionality is also available under ultraTB for
727 tracebacks. The functionality is also available under ultraTB for
723 non-ipython users (someone using ultraTB but outside an ipython
728 non-ipython users (someone using ultraTB but outside an ipython
724 session). They can select the color scheme by setting the
729 session). They can select the color scheme by setting the
725 module-level global DEFAULT_SCHEME. The highlight functionality
730 module-level global DEFAULT_SCHEME. The highlight functionality
726 also works when debugging.
731 also works when debugging.
727
732
728 * IPython/genutils.py (IOStream.close): small patch by
733 * IPython/genutils.py (IOStream.close): small patch by
729 R. Bernstein for improved pydb support.
734 R. Bernstein for improved pydb support.
730
735
731 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
736 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
732 DaveS <davls@telus.net> to improve support of debugging under
737 DaveS <davls@telus.net> to improve support of debugging under
733 NTEmacs, including improved pydb behavior.
738 NTEmacs, including improved pydb behavior.
734
739
735 * IPython/Magic.py (magic_prun): Fix saving of profile info for
740 * IPython/Magic.py (magic_prun): Fix saving of profile info for
736 Python 2.5, where the stats object API changed a little. Thanks
741 Python 2.5, where the stats object API changed a little. Thanks
737 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
742 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
738
743
739 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
744 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
740 Pernetty's patch to improve support for (X)Emacs under Win32.
745 Pernetty's patch to improve support for (X)Emacs under Win32.
741
746
742 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
747 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
743
748
744 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
749 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
745 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
750 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
746 a report by Nik Tautenhahn.
751 a report by Nik Tautenhahn.
747
752
748 2007-03-16 Walter Doerwald <walter@livinglogic.de>
753 2007-03-16 Walter Doerwald <walter@livinglogic.de>
749
754
750 * setup.py: Add the igrid help files to the list of data files
755 * setup.py: Add the igrid help files to the list of data files
751 to be installed alongside igrid.
756 to be installed alongside igrid.
752 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
757 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
753 Show the input object of the igrid browser as the window tile.
758 Show the input object of the igrid browser as the window tile.
754 Show the object the cursor is on in the statusbar.
759 Show the object the cursor is on in the statusbar.
755
760
756 2007-03-15 Ville Vainio <vivainio@gmail.com>
761 2007-03-15 Ville Vainio <vivainio@gmail.com>
757
762
758 * Extensions/ipy_stock_completers.py: Fixed exception
763 * Extensions/ipy_stock_completers.py: Fixed exception
759 on mismatching quotes in %run completer. Patch by
764 on mismatching quotes in %run completer. Patch by
760 JοΏ½rgen Stenarson. Closes #127.
765 JοΏ½rgen Stenarson. Closes #127.
761
766
762 2007-03-14 Ville Vainio <vivainio@gmail.com>
767 2007-03-14 Ville Vainio <vivainio@gmail.com>
763
768
764 * Extensions/ext_rehashdir.py: Do not do auto_alias
769 * Extensions/ext_rehashdir.py: Do not do auto_alias
765 in %rehashdir, it clobbers %store'd aliases.
770 in %rehashdir, it clobbers %store'd aliases.
766
771
767 * UserConfig/ipy_profile_sh.py: envpersist.py extension
772 * UserConfig/ipy_profile_sh.py: envpersist.py extension
768 (beefed up %env) imported for sh profile.
773 (beefed up %env) imported for sh profile.
769
774
770 2007-03-10 Walter Doerwald <walter@livinglogic.de>
775 2007-03-10 Walter Doerwald <walter@livinglogic.de>
771
776
772 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
777 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
773 as the default browser.
778 as the default browser.
774 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
779 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
775 As igrid displays all attributes it ever encounters, fetch() (which has
780 As igrid displays all attributes it ever encounters, fetch() (which has
776 been renamed to _fetch()) doesn't have to recalculate the display attributes
781 been renamed to _fetch()) doesn't have to recalculate the display attributes
777 every time a new item is fetched. This should speed up scrolling.
782 every time a new item is fetched. This should speed up scrolling.
778
783
779 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
784 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
780
785
781 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
786 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
782 Schmolck's recently reported tab-completion bug (my previous one
787 Schmolck's recently reported tab-completion bug (my previous one
783 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
788 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
784
789
785 2007-03-09 Walter Doerwald <walter@livinglogic.de>
790 2007-03-09 Walter Doerwald <walter@livinglogic.de>
786
791
787 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
792 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
788 Close help window if exiting igrid.
793 Close help window if exiting igrid.
789
794
790 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
795 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
791
796
792 * IPython/Extensions/ipy_defaults.py: Check if readline is available
797 * IPython/Extensions/ipy_defaults.py: Check if readline is available
793 before calling functions from readline.
798 before calling functions from readline.
794
799
795 2007-03-02 Walter Doerwald <walter@livinglogic.de>
800 2007-03-02 Walter Doerwald <walter@livinglogic.de>
796
801
797 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
802 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
798 igrid is a wxPython-based display object for ipipe. If your system has
803 igrid is a wxPython-based display object for ipipe. If your system has
799 wx installed igrid will be the default display. Without wx ipipe falls
804 wx installed igrid will be the default display. Without wx ipipe falls
800 back to ibrowse (which needs curses). If no curses is installed ipipe
805 back to ibrowse (which needs curses). If no curses is installed ipipe
801 falls back to idump.
806 falls back to idump.
802
807
803 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
808 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
804
809
805 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
810 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
806 my changes from yesterday, they introduced bugs. Will reactivate
811 my changes from yesterday, they introduced bugs. Will reactivate
807 once I get a correct solution, which will be much easier thanks to
812 once I get a correct solution, which will be much easier thanks to
808 Dan Milstein's new prefilter test suite.
813 Dan Milstein's new prefilter test suite.
809
814
810 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
815 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
811
816
812 * IPython/iplib.py (split_user_input): fix input splitting so we
817 * IPython/iplib.py (split_user_input): fix input splitting so we
813 don't attempt attribute accesses on things that can't possibly be
818 don't attempt attribute accesses on things that can't possibly be
814 valid Python attributes. After a bug report by Alex Schmolck.
819 valid Python attributes. After a bug report by Alex Schmolck.
815 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
820 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
816 %magic with explicit % prefix.
821 %magic with explicit % prefix.
817
822
818 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
823 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
819
824
820 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
825 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
821 avoid a DeprecationWarning from GTK.
826 avoid a DeprecationWarning from GTK.
822
827
823 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
828 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
824
829
825 * IPython/genutils.py (clock): I modified clock() to return total
830 * IPython/genutils.py (clock): I modified clock() to return total
826 time, user+system. This is a more commonly needed metric. I also
831 time, user+system. This is a more commonly needed metric. I also
827 introduced the new clocku/clocks to get only user/system time if
832 introduced the new clocku/clocks to get only user/system time if
828 one wants those instead.
833 one wants those instead.
829
834
830 ***WARNING: API CHANGE*** clock() used to return only user time,
835 ***WARNING: API CHANGE*** clock() used to return only user time,
831 so if you want exactly the same results as before, use clocku
836 so if you want exactly the same results as before, use clocku
832 instead.
837 instead.
833
838
834 2007-02-22 Ville Vainio <vivainio@gmail.com>
839 2007-02-22 Ville Vainio <vivainio@gmail.com>
835
840
836 * IPython/Extensions/ipy_p4.py: Extension for improved
841 * IPython/Extensions/ipy_p4.py: Extension for improved
837 p4 (perforce version control system) experience.
842 p4 (perforce version control system) experience.
838 Adds %p4 magic with p4 command completion and
843 Adds %p4 magic with p4 command completion and
839 automatic -G argument (marshall output as python dict)
844 automatic -G argument (marshall output as python dict)
840
845
841 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
846 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
842
847
843 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
848 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
844 stop marks.
849 stop marks.
845 (ClearingMixin): a simple mixin to easily make a Demo class clear
850 (ClearingMixin): a simple mixin to easily make a Demo class clear
846 the screen in between blocks and have empty marquees. The
851 the screen in between blocks and have empty marquees. The
847 ClearDemo and ClearIPDemo classes that use it are included.
852 ClearDemo and ClearIPDemo classes that use it are included.
848
853
849 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
854 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
850
855
851 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
856 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
852 protect against exceptions at Python shutdown time. Patch
857 protect against exceptions at Python shutdown time. Patch
853 sumbmitted to upstream.
858 sumbmitted to upstream.
854
859
855 2007-02-14 Walter Doerwald <walter@livinglogic.de>
860 2007-02-14 Walter Doerwald <walter@livinglogic.de>
856
861
857 * IPython/Extensions/ibrowse.py: If entering the first object level
862 * IPython/Extensions/ibrowse.py: If entering the first object level
858 (i.e. the object for which the browser has been started) fails,
863 (i.e. the object for which the browser has been started) fails,
859 now the error is raised directly (aborting the browser) instead of
864 now the error is raised directly (aborting the browser) instead of
860 running into an empty levels list later.
865 running into an empty levels list later.
861
866
862 2007-02-03 Walter Doerwald <walter@livinglogic.de>
867 2007-02-03 Walter Doerwald <walter@livinglogic.de>
863
868
864 * IPython/Extensions/ipipe.py: Add an xrepr implementation
869 * IPython/Extensions/ipipe.py: Add an xrepr implementation
865 for the noitem object.
870 for the noitem object.
866
871
867 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
872 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
868
873
869 * IPython/completer.py (Completer.attr_matches): Fix small
874 * IPython/completer.py (Completer.attr_matches): Fix small
870 tab-completion bug with Enthought Traits objects with units.
875 tab-completion bug with Enthought Traits objects with units.
871 Thanks to a bug report by Tom Denniston
876 Thanks to a bug report by Tom Denniston
872 <tom.denniston-AT-alum.dartmouth.org>.
877 <tom.denniston-AT-alum.dartmouth.org>.
873
878
874 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
879 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
875
880
876 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
881 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
877 bug where only .ipy or .py would be completed. Once the first
882 bug where only .ipy or .py would be completed. Once the first
878 argument to %run has been given, all completions are valid because
883 argument to %run has been given, all completions are valid because
879 they are the arguments to the script, which may well be non-python
884 they are the arguments to the script, which may well be non-python
880 filenames.
885 filenames.
881
886
882 * IPython/irunner.py (InteractiveRunner.run_source): major updates
887 * IPython/irunner.py (InteractiveRunner.run_source): major updates
883 to irunner to allow it to correctly support real doctesting of
888 to irunner to allow it to correctly support real doctesting of
884 out-of-process ipython code.
889 out-of-process ipython code.
885
890
886 * IPython/Magic.py (magic_cd): Make the setting of the terminal
891 * IPython/Magic.py (magic_cd): Make the setting of the terminal
887 title an option (-noterm_title) because it completely breaks
892 title an option (-noterm_title) because it completely breaks
888 doctesting.
893 doctesting.
889
894
890 * IPython/demo.py: fix IPythonDemo class that was not actually working.
895 * IPython/demo.py: fix IPythonDemo class that was not actually working.
891
896
892 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
897 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
893
898
894 * IPython/irunner.py (main): fix small bug where extensions were
899 * IPython/irunner.py (main): fix small bug where extensions were
895 not being correctly recognized.
900 not being correctly recognized.
896
901
897 2007-01-23 Walter Doerwald <walter@livinglogic.de>
902 2007-01-23 Walter Doerwald <walter@livinglogic.de>
898
903
899 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
904 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
900 a string containing a single line yields the string itself as the
905 a string containing a single line yields the string itself as the
901 only item.
906 only item.
902
907
903 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
908 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
904 object if it's the same as the one on the last level (This avoids
909 object if it's the same as the one on the last level (This avoids
905 infinite recursion for one line strings).
910 infinite recursion for one line strings).
906
911
907 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
912 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
908
913
909 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
914 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
910 all output streams before printing tracebacks. This ensures that
915 all output streams before printing tracebacks. This ensures that
911 user output doesn't end up interleaved with traceback output.
916 user output doesn't end up interleaved with traceback output.
912
917
913 2007-01-10 Ville Vainio <vivainio@gmail.com>
918 2007-01-10 Ville Vainio <vivainio@gmail.com>
914
919
915 * Extensions/envpersist.py: Turbocharged %env that remembers
920 * Extensions/envpersist.py: Turbocharged %env that remembers
916 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
921 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
917 "%env VISUAL=jed".
922 "%env VISUAL=jed".
918
923
919 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
924 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
920
925
921 * IPython/iplib.py (showtraceback): ensure that we correctly call
926 * IPython/iplib.py (showtraceback): ensure that we correctly call
922 custom handlers in all cases (some with pdb were slipping through,
927 custom handlers in all cases (some with pdb were slipping through,
923 but I'm not exactly sure why).
928 but I'm not exactly sure why).
924
929
925 * IPython/Debugger.py (Tracer.__init__): added new class to
930 * IPython/Debugger.py (Tracer.__init__): added new class to
926 support set_trace-like usage of IPython's enhanced debugger.
931 support set_trace-like usage of IPython's enhanced debugger.
927
932
928 2006-12-24 Ville Vainio <vivainio@gmail.com>
933 2006-12-24 Ville Vainio <vivainio@gmail.com>
929
934
930 * ipmaker.py: more informative message when ipy_user_conf
935 * ipmaker.py: more informative message when ipy_user_conf
931 import fails (suggest running %upgrade).
936 import fails (suggest running %upgrade).
932
937
933 * tools/run_ipy_in_profiler.py: Utility to see where
938 * tools/run_ipy_in_profiler.py: Utility to see where
934 the time during IPython startup is spent.
939 the time during IPython startup is spent.
935
940
936 2006-12-20 Ville Vainio <vivainio@gmail.com>
941 2006-12-20 Ville Vainio <vivainio@gmail.com>
937
942
938 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
943 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
939
944
940 * ipapi.py: Add new ipapi method, expand_alias.
945 * ipapi.py: Add new ipapi method, expand_alias.
941
946
942 * Release.py: Bump up version to 0.7.4.svn
947 * Release.py: Bump up version to 0.7.4.svn
943
948
944 2006-12-17 Ville Vainio <vivainio@gmail.com>
949 2006-12-17 Ville Vainio <vivainio@gmail.com>
945
950
946 * Extensions/jobctrl.py: Fixed &cmd arg arg...
951 * Extensions/jobctrl.py: Fixed &cmd arg arg...
947 to work properly on posix too
952 to work properly on posix too
948
953
949 * Release.py: Update revnum (version is still just 0.7.3).
954 * Release.py: Update revnum (version is still just 0.7.3).
950
955
951 2006-12-15 Ville Vainio <vivainio@gmail.com>
956 2006-12-15 Ville Vainio <vivainio@gmail.com>
952
957
953 * scripts/ipython_win_post_install: create ipython.py in
958 * scripts/ipython_win_post_install: create ipython.py in
954 prefix + "/scripts".
959 prefix + "/scripts".
955
960
956 * Release.py: Update version to 0.7.3.
961 * Release.py: Update version to 0.7.3.
957
962
958 2006-12-14 Ville Vainio <vivainio@gmail.com>
963 2006-12-14 Ville Vainio <vivainio@gmail.com>
959
964
960 * scripts/ipython_win_post_install: Overwrite old shortcuts
965 * scripts/ipython_win_post_install: Overwrite old shortcuts
961 if they already exist
966 if they already exist
962
967
963 * Release.py: release 0.7.3rc2
968 * Release.py: release 0.7.3rc2
964
969
965 2006-12-13 Ville Vainio <vivainio@gmail.com>
970 2006-12-13 Ville Vainio <vivainio@gmail.com>
966
971
967 * Branch and update Release.py for 0.7.3rc1
972 * Branch and update Release.py for 0.7.3rc1
968
973
969 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
974 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
970
975
971 * IPython/Shell.py (IPShellWX): update for current WX naming
976 * IPython/Shell.py (IPShellWX): update for current WX naming
972 conventions, to avoid a deprecation warning with current WX
977 conventions, to avoid a deprecation warning with current WX
973 versions. Thanks to a report by Danny Shevitz.
978 versions. Thanks to a report by Danny Shevitz.
974
979
975 2006-12-12 Ville Vainio <vivainio@gmail.com>
980 2006-12-12 Ville Vainio <vivainio@gmail.com>
976
981
977 * ipmaker.py: apply david cournapeau's patch to make
982 * ipmaker.py: apply david cournapeau's patch to make
978 import_some work properly even when ipythonrc does
983 import_some work properly even when ipythonrc does
979 import_some on empty list (it was an old bug!).
984 import_some on empty list (it was an old bug!).
980
985
981 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
986 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
982 Add deprecation note to ipythonrc and a url to wiki
987 Add deprecation note to ipythonrc and a url to wiki
983 in ipy_user_conf.py
988 in ipy_user_conf.py
984
989
985
990
986 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
991 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
987 as if it was typed on IPython command prompt, i.e.
992 as if it was typed on IPython command prompt, i.e.
988 as IPython script.
993 as IPython script.
989
994
990 * example-magic.py, magic_grepl.py: remove outdated examples
995 * example-magic.py, magic_grepl.py: remove outdated examples
991
996
992 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
997 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
993
998
994 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
999 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
995 is called before any exception has occurred.
1000 is called before any exception has occurred.
996
1001
997 2006-12-08 Ville Vainio <vivainio@gmail.com>
1002 2006-12-08 Ville Vainio <vivainio@gmail.com>
998
1003
999 * Extensions/ipy_stock_completers.py: fix cd completer
1004 * Extensions/ipy_stock_completers.py: fix cd completer
1000 to translate /'s to \'s again.
1005 to translate /'s to \'s again.
1001
1006
1002 * completer.py: prevent traceback on file completions w/
1007 * completer.py: prevent traceback on file completions w/
1003 backslash.
1008 backslash.
1004
1009
1005 * Release.py: Update release number to 0.7.3b3 for release
1010 * Release.py: Update release number to 0.7.3b3 for release
1006
1011
1007 2006-12-07 Ville Vainio <vivainio@gmail.com>
1012 2006-12-07 Ville Vainio <vivainio@gmail.com>
1008
1013
1009 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1014 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1010 while executing external code. Provides more shell-like behaviour
1015 while executing external code. Provides more shell-like behaviour
1011 and overall better response to ctrl + C / ctrl + break.
1016 and overall better response to ctrl + C / ctrl + break.
1012
1017
1013 * tools/make_tarball.py: new script to create tarball straight from svn
1018 * tools/make_tarball.py: new script to create tarball straight from svn
1014 (setup.py sdist doesn't work on win32).
1019 (setup.py sdist doesn't work on win32).
1015
1020
1016 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1021 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1017 on dirnames with spaces and use the default completer instead.
1022 on dirnames with spaces and use the default completer instead.
1018
1023
1019 * Revision.py: Change version to 0.7.3b2 for release.
1024 * Revision.py: Change version to 0.7.3b2 for release.
1020
1025
1021 2006-12-05 Ville Vainio <vivainio@gmail.com>
1026 2006-12-05 Ville Vainio <vivainio@gmail.com>
1022
1027
1023 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1028 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1024 pydb patch 4 (rm debug printing, py 2.5 checking)
1029 pydb patch 4 (rm debug printing, py 2.5 checking)
1025
1030
1026 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1031 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1027 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1032 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1028 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1033 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1029 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1034 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1030 object the cursor was on before the refresh. The command "markrange" is
1035 object the cursor was on before the refresh. The command "markrange" is
1031 mapped to "%" now.
1036 mapped to "%" now.
1032 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1037 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1033
1038
1034 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1039 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1035
1040
1036 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1041 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1037 interactive debugger on the last traceback, without having to call
1042 interactive debugger on the last traceback, without having to call
1038 %pdb and rerun your code. Made minor changes in various modules,
1043 %pdb and rerun your code. Made minor changes in various modules,
1039 should automatically recognize pydb if available.
1044 should automatically recognize pydb if available.
1040
1045
1041 2006-11-28 Ville Vainio <vivainio@gmail.com>
1046 2006-11-28 Ville Vainio <vivainio@gmail.com>
1042
1047
1043 * completer.py: If the text start with !, show file completions
1048 * completer.py: If the text start with !, show file completions
1044 properly. This helps when trying to complete command name
1049 properly. This helps when trying to complete command name
1045 for shell escapes.
1050 for shell escapes.
1046
1051
1047 2006-11-27 Ville Vainio <vivainio@gmail.com>
1052 2006-11-27 Ville Vainio <vivainio@gmail.com>
1048
1053
1049 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1054 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1050 der Walt. Clean up svn and hg completers by using a common
1055 der Walt. Clean up svn and hg completers by using a common
1051 vcs_completer.
1056 vcs_completer.
1052
1057
1053 2006-11-26 Ville Vainio <vivainio@gmail.com>
1058 2006-11-26 Ville Vainio <vivainio@gmail.com>
1054
1059
1055 * Remove ipconfig and %config; you should use _ip.options structure
1060 * Remove ipconfig and %config; you should use _ip.options structure
1056 directly instead!
1061 directly instead!
1057
1062
1058 * genutils.py: add wrap_deprecated function for deprecating callables
1063 * genutils.py: add wrap_deprecated function for deprecating callables
1059
1064
1060 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1065 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1061 _ip.system instead. ipalias is redundant.
1066 _ip.system instead. ipalias is redundant.
1062
1067
1063 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1068 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1064 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1069 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1065 explicit.
1070 explicit.
1066
1071
1067 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1072 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1068 completer. Try it by entering 'hg ' and pressing tab.
1073 completer. Try it by entering 'hg ' and pressing tab.
1069
1074
1070 * macro.py: Give Macro a useful __repr__ method
1075 * macro.py: Give Macro a useful __repr__ method
1071
1076
1072 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1077 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1073
1078
1074 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1079 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1075 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1080 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1076 we don't get a duplicate ipipe module, where registration of the xrepr
1081 we don't get a duplicate ipipe module, where registration of the xrepr
1077 implementation for Text is useless.
1082 implementation for Text is useless.
1078
1083
1079 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1084 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1080
1085
1081 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1086 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1082
1087
1083 2006-11-24 Ville Vainio <vivainio@gmail.com>
1088 2006-11-24 Ville Vainio <vivainio@gmail.com>
1084
1089
1085 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1090 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1086 try to use "cProfile" instead of the slower pure python
1091 try to use "cProfile" instead of the slower pure python
1087 "profile"
1092 "profile"
1088
1093
1089 2006-11-23 Ville Vainio <vivainio@gmail.com>
1094 2006-11-23 Ville Vainio <vivainio@gmail.com>
1090
1095
1091 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1096 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1092 Qt+IPython+Designer link in documentation.
1097 Qt+IPython+Designer link in documentation.
1093
1098
1094 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1099 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1095 correct Pdb object to %pydb.
1100 correct Pdb object to %pydb.
1096
1101
1097
1102
1098 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1103 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1099 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1104 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1100 generic xrepr(), otherwise the list implementation would kick in.
1105 generic xrepr(), otherwise the list implementation would kick in.
1101
1106
1102 2006-11-21 Ville Vainio <vivainio@gmail.com>
1107 2006-11-21 Ville Vainio <vivainio@gmail.com>
1103
1108
1104 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1109 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1105 with one from UserConfig.
1110 with one from UserConfig.
1106
1111
1107 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1112 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1108 it was missing which broke the sh profile.
1113 it was missing which broke the sh profile.
1109
1114
1110 * completer.py: file completer now uses explicit '/' instead
1115 * completer.py: file completer now uses explicit '/' instead
1111 of os.path.join, expansion of 'foo' was broken on win32
1116 of os.path.join, expansion of 'foo' was broken on win32
1112 if there was one directory with name 'foobar'.
1117 if there was one directory with name 'foobar'.
1113
1118
1114 * A bunch of patches from Kirill Smelkov:
1119 * A bunch of patches from Kirill Smelkov:
1115
1120
1116 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1121 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1117
1122
1118 * [patch 7/9] Implement %page -r (page in raw mode) -
1123 * [patch 7/9] Implement %page -r (page in raw mode) -
1119
1124
1120 * [patch 5/9] ScientificPython webpage has moved
1125 * [patch 5/9] ScientificPython webpage has moved
1121
1126
1122 * [patch 4/9] The manual mentions %ds, should be %dhist
1127 * [patch 4/9] The manual mentions %ds, should be %dhist
1123
1128
1124 * [patch 3/9] Kill old bits from %prun doc.
1129 * [patch 3/9] Kill old bits from %prun doc.
1125
1130
1126 * [patch 1/9] Fix typos here and there.
1131 * [patch 1/9] Fix typos here and there.
1127
1132
1128 2006-11-08 Ville Vainio <vivainio@gmail.com>
1133 2006-11-08 Ville Vainio <vivainio@gmail.com>
1129
1134
1130 * completer.py (attr_matches): catch all exceptions raised
1135 * completer.py (attr_matches): catch all exceptions raised
1131 by eval of expr with dots.
1136 by eval of expr with dots.
1132
1137
1133 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1138 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1134
1139
1135 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1140 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1136 input if it starts with whitespace. This allows you to paste
1141 input if it starts with whitespace. This allows you to paste
1137 indented input from any editor without manually having to type in
1142 indented input from any editor without manually having to type in
1138 the 'if 1:', which is convenient when working interactively.
1143 the 'if 1:', which is convenient when working interactively.
1139 Slightly modifed version of a patch by Bo Peng
1144 Slightly modifed version of a patch by Bo Peng
1140 <bpeng-AT-rice.edu>.
1145 <bpeng-AT-rice.edu>.
1141
1146
1142 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1147 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1143
1148
1144 * IPython/irunner.py (main): modified irunner so it automatically
1149 * IPython/irunner.py (main): modified irunner so it automatically
1145 recognizes the right runner to use based on the extension (.py for
1150 recognizes the right runner to use based on the extension (.py for
1146 python, .ipy for ipython and .sage for sage).
1151 python, .ipy for ipython and .sage for sage).
1147
1152
1148 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1153 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1149 visible in ipapi as ip.config(), to programatically control the
1154 visible in ipapi as ip.config(), to programatically control the
1150 internal rc object. There's an accompanying %config magic for
1155 internal rc object. There's an accompanying %config magic for
1151 interactive use, which has been enhanced to match the
1156 interactive use, which has been enhanced to match the
1152 funtionality in ipconfig.
1157 funtionality in ipconfig.
1153
1158
1154 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1159 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1155 so it's not just a toggle, it now takes an argument. Add support
1160 so it's not just a toggle, it now takes an argument. Add support
1156 for a customizable header when making system calls, as the new
1161 for a customizable header when making system calls, as the new
1157 system_header variable in the ipythonrc file.
1162 system_header variable in the ipythonrc file.
1158
1163
1159 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1164 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1160
1165
1161 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1166 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1162 generic functions (using Philip J. Eby's simplegeneric package).
1167 generic functions (using Philip J. Eby's simplegeneric package).
1163 This makes it possible to customize the display of third-party classes
1168 This makes it possible to customize the display of third-party classes
1164 without having to monkeypatch them. xiter() no longer supports a mode
1169 without having to monkeypatch them. xiter() no longer supports a mode
1165 argument and the XMode class has been removed. The same functionality can
1170 argument and the XMode class has been removed. The same functionality can
1166 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1171 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1167 One consequence of the switch to generic functions is that xrepr() and
1172 One consequence of the switch to generic functions is that xrepr() and
1168 xattrs() implementation must define the default value for the mode
1173 xattrs() implementation must define the default value for the mode
1169 argument themselves and xattrs() implementations must return real
1174 argument themselves and xattrs() implementations must return real
1170 descriptors.
1175 descriptors.
1171
1176
1172 * IPython/external: This new subpackage will contain all third-party
1177 * IPython/external: This new subpackage will contain all third-party
1173 packages that are bundled with IPython. (The first one is simplegeneric).
1178 packages that are bundled with IPython. (The first one is simplegeneric).
1174
1179
1175 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1180 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1176 directory which as been dropped in r1703.
1181 directory which as been dropped in r1703.
1177
1182
1178 * IPython/Extensions/ipipe.py (iless): Fixed.
1183 * IPython/Extensions/ipipe.py (iless): Fixed.
1179
1184
1180 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1185 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1181
1186
1182 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1187 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1183
1188
1184 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1189 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1185 handling in variable expansion so that shells and magics recognize
1190 handling in variable expansion so that shells and magics recognize
1186 function local scopes correctly. Bug reported by Brian.
1191 function local scopes correctly. Bug reported by Brian.
1187
1192
1188 * scripts/ipython: remove the very first entry in sys.path which
1193 * scripts/ipython: remove the very first entry in sys.path which
1189 Python auto-inserts for scripts, so that sys.path under IPython is
1194 Python auto-inserts for scripts, so that sys.path under IPython is
1190 as similar as possible to that under plain Python.
1195 as similar as possible to that under plain Python.
1191
1196
1192 * IPython/completer.py (IPCompleter.file_matches): Fix
1197 * IPython/completer.py (IPCompleter.file_matches): Fix
1193 tab-completion so that quotes are not closed unless the completion
1198 tab-completion so that quotes are not closed unless the completion
1194 is unambiguous. After a request by Stefan. Minor cleanups in
1199 is unambiguous. After a request by Stefan. Minor cleanups in
1195 ipy_stock_completers.
1200 ipy_stock_completers.
1196
1201
1197 2006-11-02 Ville Vainio <vivainio@gmail.com>
1202 2006-11-02 Ville Vainio <vivainio@gmail.com>
1198
1203
1199 * ipy_stock_completers.py: Add %run and %cd completers.
1204 * ipy_stock_completers.py: Add %run and %cd completers.
1200
1205
1201 * completer.py: Try running custom completer for both
1206 * completer.py: Try running custom completer for both
1202 "foo" and "%foo" if the command is just "foo". Ignore case
1207 "foo" and "%foo" if the command is just "foo". Ignore case
1203 when filtering possible completions.
1208 when filtering possible completions.
1204
1209
1205 * UserConfig/ipy_user_conf.py: install stock completers as default
1210 * UserConfig/ipy_user_conf.py: install stock completers as default
1206
1211
1207 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1212 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1208 simplified readline history save / restore through a wrapper
1213 simplified readline history save / restore through a wrapper
1209 function
1214 function
1210
1215
1211
1216
1212 2006-10-31 Ville Vainio <vivainio@gmail.com>
1217 2006-10-31 Ville Vainio <vivainio@gmail.com>
1213
1218
1214 * strdispatch.py, completer.py, ipy_stock_completers.py:
1219 * strdispatch.py, completer.py, ipy_stock_completers.py:
1215 Allow str_key ("command") in completer hooks. Implement
1220 Allow str_key ("command") in completer hooks. Implement
1216 trivial completer for 'import' (stdlib modules only). Rename
1221 trivial completer for 'import' (stdlib modules only). Rename
1217 ipy_linux_package_managers.py to ipy_stock_completers.py.
1222 ipy_linux_package_managers.py to ipy_stock_completers.py.
1218 SVN completer.
1223 SVN completer.
1219
1224
1220 * Extensions/ledit.py: %magic line editor for easily and
1225 * Extensions/ledit.py: %magic line editor for easily and
1221 incrementally manipulating lists of strings. The magic command
1226 incrementally manipulating lists of strings. The magic command
1222 name is %led.
1227 name is %led.
1223
1228
1224 2006-10-30 Ville Vainio <vivainio@gmail.com>
1229 2006-10-30 Ville Vainio <vivainio@gmail.com>
1225
1230
1226 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1231 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1227 Bernsteins's patches for pydb integration.
1232 Bernsteins's patches for pydb integration.
1228 http://bashdb.sourceforge.net/pydb/
1233 http://bashdb.sourceforge.net/pydb/
1229
1234
1230 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1235 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1231 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1236 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1232 custom completer hook to allow the users to implement their own
1237 custom completer hook to allow the users to implement their own
1233 completers. See ipy_linux_package_managers.py for example. The
1238 completers. See ipy_linux_package_managers.py for example. The
1234 hook name is 'complete_command'.
1239 hook name is 'complete_command'.
1235
1240
1236 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1241 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1237
1242
1238 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1243 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1239 Numeric leftovers.
1244 Numeric leftovers.
1240
1245
1241 * ipython.el (py-execute-region): apply Stefan's patch to fix
1246 * ipython.el (py-execute-region): apply Stefan's patch to fix
1242 garbled results if the python shell hasn't been previously started.
1247 garbled results if the python shell hasn't been previously started.
1243
1248
1244 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1249 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1245 pretty generic function and useful for other things.
1250 pretty generic function and useful for other things.
1246
1251
1247 * IPython/OInspect.py (getsource): Add customizable source
1252 * IPython/OInspect.py (getsource): Add customizable source
1248 extractor. After a request/patch form W. Stein (SAGE).
1253 extractor. After a request/patch form W. Stein (SAGE).
1249
1254
1250 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1255 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1251 window size to a more reasonable value from what pexpect does,
1256 window size to a more reasonable value from what pexpect does,
1252 since their choice causes wrapping bugs with long input lines.
1257 since their choice causes wrapping bugs with long input lines.
1253
1258
1254 2006-10-28 Ville Vainio <vivainio@gmail.com>
1259 2006-10-28 Ville Vainio <vivainio@gmail.com>
1255
1260
1256 * Magic.py (%run): Save and restore the readline history from
1261 * Magic.py (%run): Save and restore the readline history from
1257 file around %run commands to prevent side effects from
1262 file around %run commands to prevent side effects from
1258 %runned programs that might use readline (e.g. pydb).
1263 %runned programs that might use readline (e.g. pydb).
1259
1264
1260 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1265 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1261 invoking the pydb enhanced debugger.
1266 invoking the pydb enhanced debugger.
1262
1267
1263 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1268 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1264
1269
1265 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1270 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1266 call the base class method and propagate the return value to
1271 call the base class method and propagate the return value to
1267 ifile. This is now done by path itself.
1272 ifile. This is now done by path itself.
1268
1273
1269 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1274 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1270
1275
1271 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1276 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1272 api: set_crash_handler(), to expose the ability to change the
1277 api: set_crash_handler(), to expose the ability to change the
1273 internal crash handler.
1278 internal crash handler.
1274
1279
1275 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1280 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1276 the various parameters of the crash handler so that apps using
1281 the various parameters of the crash handler so that apps using
1277 IPython as their engine can customize crash handling. Ipmlemented
1282 IPython as their engine can customize crash handling. Ipmlemented
1278 at the request of SAGE.
1283 at the request of SAGE.
1279
1284
1280 2006-10-14 Ville Vainio <vivainio@gmail.com>
1285 2006-10-14 Ville Vainio <vivainio@gmail.com>
1281
1286
1282 * Magic.py, ipython.el: applied first "safe" part of Rocky
1287 * Magic.py, ipython.el: applied first "safe" part of Rocky
1283 Bernstein's patch set for pydb integration.
1288 Bernstein's patch set for pydb integration.
1284
1289
1285 * Magic.py (%unalias, %alias): %store'd aliases can now be
1290 * Magic.py (%unalias, %alias): %store'd aliases can now be
1286 removed with '%unalias'. %alias w/o args now shows most
1291 removed with '%unalias'. %alias w/o args now shows most
1287 interesting (stored / manually defined) aliases last
1292 interesting (stored / manually defined) aliases last
1288 where they catch the eye w/o scrolling.
1293 where they catch the eye w/o scrolling.
1289
1294
1290 * Magic.py (%rehashx), ext_rehashdir.py: files with
1295 * Magic.py (%rehashx), ext_rehashdir.py: files with
1291 'py' extension are always considered executable, even
1296 'py' extension are always considered executable, even
1292 when not in PATHEXT environment variable.
1297 when not in PATHEXT environment variable.
1293
1298
1294 2006-10-12 Ville Vainio <vivainio@gmail.com>
1299 2006-10-12 Ville Vainio <vivainio@gmail.com>
1295
1300
1296 * jobctrl.py: Add new "jobctrl" extension for spawning background
1301 * jobctrl.py: Add new "jobctrl" extension for spawning background
1297 processes with "&find /". 'import jobctrl' to try it out. Requires
1302 processes with "&find /". 'import jobctrl' to try it out. Requires
1298 'subprocess' module, standard in python 2.4+.
1303 'subprocess' module, standard in python 2.4+.
1299
1304
1300 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1305 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1301 so if foo -> bar and bar -> baz, then foo -> baz.
1306 so if foo -> bar and bar -> baz, then foo -> baz.
1302
1307
1303 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1308 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1304
1309
1305 * IPython/Magic.py (Magic.parse_options): add a new posix option
1310 * IPython/Magic.py (Magic.parse_options): add a new posix option
1306 to allow parsing of input args in magics that doesn't strip quotes
1311 to allow parsing of input args in magics that doesn't strip quotes
1307 (if posix=False). This also closes %timeit bug reported by
1312 (if posix=False). This also closes %timeit bug reported by
1308 Stefan.
1313 Stefan.
1309
1314
1310 2006-10-03 Ville Vainio <vivainio@gmail.com>
1315 2006-10-03 Ville Vainio <vivainio@gmail.com>
1311
1316
1312 * iplib.py (raw_input, interact): Return ValueError catching for
1317 * iplib.py (raw_input, interact): Return ValueError catching for
1313 raw_input. Fixes infinite loop for sys.stdin.close() or
1318 raw_input. Fixes infinite loop for sys.stdin.close() or
1314 sys.stdout.close().
1319 sys.stdout.close().
1315
1320
1316 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1321 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1317
1322
1318 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1323 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1319 to help in handling doctests. irunner is now pretty useful for
1324 to help in handling doctests. irunner is now pretty useful for
1320 running standalone scripts and simulate a full interactive session
1325 running standalone scripts and simulate a full interactive session
1321 in a format that can be then pasted as a doctest.
1326 in a format that can be then pasted as a doctest.
1322
1327
1323 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1328 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1324 on top of the default (useless) ones. This also fixes the nasty
1329 on top of the default (useless) ones. This also fixes the nasty
1325 way in which 2.5's Quitter() exits (reverted [1785]).
1330 way in which 2.5's Quitter() exits (reverted [1785]).
1326
1331
1327 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1332 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1328 2.5.
1333 2.5.
1329
1334
1330 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1335 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1331 color scheme is updated as well when color scheme is changed
1336 color scheme is updated as well when color scheme is changed
1332 interactively.
1337 interactively.
1333
1338
1334 2006-09-27 Ville Vainio <vivainio@gmail.com>
1339 2006-09-27 Ville Vainio <vivainio@gmail.com>
1335
1340
1336 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1341 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1337 infinite loop and just exit. It's a hack, but will do for a while.
1342 infinite loop and just exit. It's a hack, but will do for a while.
1338
1343
1339 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1344 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1340
1345
1341 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1346 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1342 the constructor, this makes it possible to get a list of only directories
1347 the constructor, this makes it possible to get a list of only directories
1343 or only files.
1348 or only files.
1344
1349
1345 2006-08-12 Ville Vainio <vivainio@gmail.com>
1350 2006-08-12 Ville Vainio <vivainio@gmail.com>
1346
1351
1347 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1352 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1348 they broke unittest
1353 they broke unittest
1349
1354
1350 2006-08-11 Ville Vainio <vivainio@gmail.com>
1355 2006-08-11 Ville Vainio <vivainio@gmail.com>
1351
1356
1352 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1357 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1353 by resolving issue properly, i.e. by inheriting FakeModule
1358 by resolving issue properly, i.e. by inheriting FakeModule
1354 from types.ModuleType. Pickling ipython interactive data
1359 from types.ModuleType. Pickling ipython interactive data
1355 should still work as usual (testing appreciated).
1360 should still work as usual (testing appreciated).
1356
1361
1357 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1362 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1358
1363
1359 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1364 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1360 running under python 2.3 with code from 2.4 to fix a bug with
1365 running under python 2.3 with code from 2.4 to fix a bug with
1361 help(). Reported by the Debian maintainers, Norbert Tretkowski
1366 help(). Reported by the Debian maintainers, Norbert Tretkowski
1362 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1367 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1363 <afayolle-AT-debian.org>.
1368 <afayolle-AT-debian.org>.
1364
1369
1365 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1370 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1366
1371
1367 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1372 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1368 (which was displaying "quit" twice).
1373 (which was displaying "quit" twice).
1369
1374
1370 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1375 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1371
1376
1372 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1377 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1373 the mode argument).
1378 the mode argument).
1374
1379
1375 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1380 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1376
1381
1377 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1382 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1378 not running under IPython.
1383 not running under IPython.
1379
1384
1380 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1385 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1381 and make it iterable (iterating over the attribute itself). Add two new
1386 and make it iterable (iterating over the attribute itself). Add two new
1382 magic strings for __xattrs__(): If the string starts with "-", the attribute
1387 magic strings for __xattrs__(): If the string starts with "-", the attribute
1383 will not be displayed in ibrowse's detail view (but it can still be
1388 will not be displayed in ibrowse's detail view (but it can still be
1384 iterated over). This makes it possible to add attributes that are large
1389 iterated over). This makes it possible to add attributes that are large
1385 lists or generator methods to the detail view. Replace magic attribute names
1390 lists or generator methods to the detail view. Replace magic attribute names
1386 and _attrname() and _getattr() with "descriptors": For each type of magic
1391 and _attrname() and _getattr() with "descriptors": For each type of magic
1387 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1392 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1388 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1393 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1389 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1394 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1390 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1395 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1391 are still supported.
1396 are still supported.
1392
1397
1393 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1398 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1394 fails in ibrowse.fetch(), the exception object is added as the last item
1399 fails in ibrowse.fetch(), the exception object is added as the last item
1395 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1400 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1396 a generator throws an exception midway through execution.
1401 a generator throws an exception midway through execution.
1397
1402
1398 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1403 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1399 encoding into methods.
1404 encoding into methods.
1400
1405
1401 2006-07-26 Ville Vainio <vivainio@gmail.com>
1406 2006-07-26 Ville Vainio <vivainio@gmail.com>
1402
1407
1403 * iplib.py: history now stores multiline input as single
1408 * iplib.py: history now stores multiline input as single
1404 history entries. Patch by Jorgen Cederlof.
1409 history entries. Patch by Jorgen Cederlof.
1405
1410
1406 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1411 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1407
1412
1408 * IPython/Extensions/ibrowse.py: Make cursor visible over
1413 * IPython/Extensions/ibrowse.py: Make cursor visible over
1409 non existing attributes.
1414 non existing attributes.
1410
1415
1411 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1416 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1412
1417
1413 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1418 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1414 error output of the running command doesn't mess up the screen.
1419 error output of the running command doesn't mess up the screen.
1415
1420
1416 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1421 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1417
1422
1418 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1423 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1419 argument. This sorts the items themselves.
1424 argument. This sorts the items themselves.
1420
1425
1421 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1426 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1422
1427
1423 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1428 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1424 Compile expression strings into code objects. This should speed
1429 Compile expression strings into code objects. This should speed
1425 up ifilter and friends somewhat.
1430 up ifilter and friends somewhat.
1426
1431
1427 2006-07-08 Ville Vainio <vivainio@gmail.com>
1432 2006-07-08 Ville Vainio <vivainio@gmail.com>
1428
1433
1429 * Magic.py: %cpaste now strips > from the beginning of lines
1434 * Magic.py: %cpaste now strips > from the beginning of lines
1430 to ease pasting quoted code from emails. Contributed by
1435 to ease pasting quoted code from emails. Contributed by
1431 Stefan van der Walt.
1436 Stefan van der Walt.
1432
1437
1433 2006-06-29 Ville Vainio <vivainio@gmail.com>
1438 2006-06-29 Ville Vainio <vivainio@gmail.com>
1434
1439
1435 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1440 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1436 mode, patch contributed by Darren Dale. NEEDS TESTING!
1441 mode, patch contributed by Darren Dale. NEEDS TESTING!
1437
1442
1438 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1443 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1439
1444
1440 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1445 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1441 a blue background. Fix fetching new display rows when the browser
1446 a blue background. Fix fetching new display rows when the browser
1442 scrolls more than a screenful (e.g. by using the goto command).
1447 scrolls more than a screenful (e.g. by using the goto command).
1443
1448
1444 2006-06-27 Ville Vainio <vivainio@gmail.com>
1449 2006-06-27 Ville Vainio <vivainio@gmail.com>
1445
1450
1446 * Magic.py (_inspect, _ofind) Apply David Huard's
1451 * Magic.py (_inspect, _ofind) Apply David Huard's
1447 patch for displaying the correct docstring for 'property'
1452 patch for displaying the correct docstring for 'property'
1448 attributes.
1453 attributes.
1449
1454
1450 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1455 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1451
1456
1452 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1457 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1453 commands into the methods implementing them.
1458 commands into the methods implementing them.
1454
1459
1455 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1460 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1456
1461
1457 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1462 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1458 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1463 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1459 autoindent support was authored by Jin Liu.
1464 autoindent support was authored by Jin Liu.
1460
1465
1461 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1466 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1462
1467
1463 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1468 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1464 for keymaps with a custom class that simplifies handling.
1469 for keymaps with a custom class that simplifies handling.
1465
1470
1466 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1471 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1467
1472
1468 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1473 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1469 resizing. This requires Python 2.5 to work.
1474 resizing. This requires Python 2.5 to work.
1470
1475
1471 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1476 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1472
1477
1473 * IPython/Extensions/ibrowse.py: Add two new commands to
1478 * IPython/Extensions/ibrowse.py: Add two new commands to
1474 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1479 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1475 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1480 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1476 attributes again. Remapped the help command to "?". Display
1481 attributes again. Remapped the help command to "?". Display
1477 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1482 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1478 as keys for the "home" and "end" commands. Add three new commands
1483 as keys for the "home" and "end" commands. Add three new commands
1479 to the input mode for "find" and friends: "delend" (CTRL-K)
1484 to the input mode for "find" and friends: "delend" (CTRL-K)
1480 deletes to the end of line. "incsearchup" searches upwards in the
1485 deletes to the end of line. "incsearchup" searches upwards in the
1481 command history for an input that starts with the text before the cursor.
1486 command history for an input that starts with the text before the cursor.
1482 "incsearchdown" does the same downwards. Removed a bogus mapping of
1487 "incsearchdown" does the same downwards. Removed a bogus mapping of
1483 the x key to "delete".
1488 the x key to "delete".
1484
1489
1485 2006-06-15 Ville Vainio <vivainio@gmail.com>
1490 2006-06-15 Ville Vainio <vivainio@gmail.com>
1486
1491
1487 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1492 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1488 used to create prompts dynamically, instead of the "old" way of
1493 used to create prompts dynamically, instead of the "old" way of
1489 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1494 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1490 way still works (it's invoked by the default hook), of course.
1495 way still works (it's invoked by the default hook), of course.
1491
1496
1492 * Prompts.py: added generate_output_prompt hook for altering output
1497 * Prompts.py: added generate_output_prompt hook for altering output
1493 prompt
1498 prompt
1494
1499
1495 * Release.py: Changed version string to 0.7.3.svn.
1500 * Release.py: Changed version string to 0.7.3.svn.
1496
1501
1497 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1502 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1498
1503
1499 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1504 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1500 the call to fetch() always tries to fetch enough data for at least one
1505 the call to fetch() always tries to fetch enough data for at least one
1501 full screen. This makes it possible to simply call moveto(0,0,True) in
1506 full screen. This makes it possible to simply call moveto(0,0,True) in
1502 the constructor. Fix typos and removed the obsolete goto attribute.
1507 the constructor. Fix typos and removed the obsolete goto attribute.
1503
1508
1504 2006-06-12 Ville Vainio <vivainio@gmail.com>
1509 2006-06-12 Ville Vainio <vivainio@gmail.com>
1505
1510
1506 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1511 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1507 allowing $variable interpolation within multiline statements,
1512 allowing $variable interpolation within multiline statements,
1508 though so far only with "sh" profile for a testing period.
1513 though so far only with "sh" profile for a testing period.
1509 The patch also enables splitting long commands with \ but it
1514 The patch also enables splitting long commands with \ but it
1510 doesn't work properly yet.
1515 doesn't work properly yet.
1511
1516
1512 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1517 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1513
1518
1514 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1519 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1515 input history and the position of the cursor in the input history for
1520 input history and the position of the cursor in the input history for
1516 the find, findbackwards and goto command.
1521 the find, findbackwards and goto command.
1517
1522
1518 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1523 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1519
1524
1520 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1525 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1521 implements the basic functionality of browser commands that require
1526 implements the basic functionality of browser commands that require
1522 input. Reimplement the goto, find and findbackwards commands as
1527 input. Reimplement the goto, find and findbackwards commands as
1523 subclasses of _CommandInput. Add an input history and keymaps to those
1528 subclasses of _CommandInput. Add an input history and keymaps to those
1524 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1529 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1525 execute commands.
1530 execute commands.
1526
1531
1527 2006-06-07 Ville Vainio <vivainio@gmail.com>
1532 2006-06-07 Ville Vainio <vivainio@gmail.com>
1528
1533
1529 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1534 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1530 running the batch files instead of leaving the session open.
1535 running the batch files instead of leaving the session open.
1531
1536
1532 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1537 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1533
1538
1534 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1539 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1535 the original fix was incomplete. Patch submitted by W. Maier.
1540 the original fix was incomplete. Patch submitted by W. Maier.
1536
1541
1537 2006-06-07 Ville Vainio <vivainio@gmail.com>
1542 2006-06-07 Ville Vainio <vivainio@gmail.com>
1538
1543
1539 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1544 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1540 Confirmation prompts can be supressed by 'quiet' option.
1545 Confirmation prompts can be supressed by 'quiet' option.
1541 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1546 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1542
1547
1543 2006-06-06 *** Released version 0.7.2
1548 2006-06-06 *** Released version 0.7.2
1544
1549
1545 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1550 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1546
1551
1547 * IPython/Release.py (version): Made 0.7.2 final for release.
1552 * IPython/Release.py (version): Made 0.7.2 final for release.
1548 Repo tagged and release cut.
1553 Repo tagged and release cut.
1549
1554
1550 2006-06-05 Ville Vainio <vivainio@gmail.com>
1555 2006-06-05 Ville Vainio <vivainio@gmail.com>
1551
1556
1552 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1557 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1553 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1558 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1554
1559
1555 * upgrade_dir.py: try import 'path' module a bit harder
1560 * upgrade_dir.py: try import 'path' module a bit harder
1556 (for %upgrade)
1561 (for %upgrade)
1557
1562
1558 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1563 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1559
1564
1560 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1565 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1561 instead of looping 20 times.
1566 instead of looping 20 times.
1562
1567
1563 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1568 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1564 correctly at initialization time. Bug reported by Krishna Mohan
1569 correctly at initialization time. Bug reported by Krishna Mohan
1565 Gundu <gkmohan-AT-gmail.com> on the user list.
1570 Gundu <gkmohan-AT-gmail.com> on the user list.
1566
1571
1567 * IPython/Release.py (version): Mark 0.7.2 version to start
1572 * IPython/Release.py (version): Mark 0.7.2 version to start
1568 testing for release on 06/06.
1573 testing for release on 06/06.
1569
1574
1570 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1575 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1571
1576
1572 * scripts/irunner: thin script interface so users don't have to
1577 * scripts/irunner: thin script interface so users don't have to
1573 find the module and call it as an executable, since modules rarely
1578 find the module and call it as an executable, since modules rarely
1574 live in people's PATH.
1579 live in people's PATH.
1575
1580
1576 * IPython/irunner.py (InteractiveRunner.__init__): added
1581 * IPython/irunner.py (InteractiveRunner.__init__): added
1577 delaybeforesend attribute to control delays with newer versions of
1582 delaybeforesend attribute to control delays with newer versions of
1578 pexpect. Thanks to detailed help from pexpect's author, Noah
1583 pexpect. Thanks to detailed help from pexpect's author, Noah
1579 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1584 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1580 correctly (it works in NoColor mode).
1585 correctly (it works in NoColor mode).
1581
1586
1582 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1587 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1583 SAGE list, from improper log() calls.
1588 SAGE list, from improper log() calls.
1584
1589
1585 2006-05-31 Ville Vainio <vivainio@gmail.com>
1590 2006-05-31 Ville Vainio <vivainio@gmail.com>
1586
1591
1587 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1592 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1588 with args in parens to work correctly with dirs that have spaces.
1593 with args in parens to work correctly with dirs that have spaces.
1589
1594
1590 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1595 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1591
1596
1592 * IPython/Logger.py (Logger.logstart): add option to log raw input
1597 * IPython/Logger.py (Logger.logstart): add option to log raw input
1593 instead of the processed one. A -r flag was added to the
1598 instead of the processed one. A -r flag was added to the
1594 %logstart magic used for controlling logging.
1599 %logstart magic used for controlling logging.
1595
1600
1596 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1601 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1597
1602
1598 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1603 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1599 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1604 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1600 recognize the option. After a bug report by Will Maier. This
1605 recognize the option. After a bug report by Will Maier. This
1601 closes #64 (will do it after confirmation from W. Maier).
1606 closes #64 (will do it after confirmation from W. Maier).
1602
1607
1603 * IPython/irunner.py: New module to run scripts as if manually
1608 * IPython/irunner.py: New module to run scripts as if manually
1604 typed into an interactive environment, based on pexpect. After a
1609 typed into an interactive environment, based on pexpect. After a
1605 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1610 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1606 ipython-user list. Simple unittests in the tests/ directory.
1611 ipython-user list. Simple unittests in the tests/ directory.
1607
1612
1608 * tools/release: add Will Maier, OpenBSD port maintainer, to
1613 * tools/release: add Will Maier, OpenBSD port maintainer, to
1609 recepients list. We are now officially part of the OpenBSD ports:
1614 recepients list. We are now officially part of the OpenBSD ports:
1610 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1615 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1611 work.
1616 work.
1612
1617
1613 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1618 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1614
1619
1615 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1620 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1616 so that it doesn't break tkinter apps.
1621 so that it doesn't break tkinter apps.
1617
1622
1618 * IPython/iplib.py (_prefilter): fix bug where aliases would
1623 * IPython/iplib.py (_prefilter): fix bug where aliases would
1619 shadow variables when autocall was fully off. Reported by SAGE
1624 shadow variables when autocall was fully off. Reported by SAGE
1620 author William Stein.
1625 author William Stein.
1621
1626
1622 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1627 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1623 at what detail level strings are computed when foo? is requested.
1628 at what detail level strings are computed when foo? is requested.
1624 This allows users to ask for example that the string form of an
1629 This allows users to ask for example that the string form of an
1625 object is only computed when foo?? is called, or even never, by
1630 object is only computed when foo?? is called, or even never, by
1626 setting the object_info_string_level >= 2 in the configuration
1631 setting the object_info_string_level >= 2 in the configuration
1627 file. This new option has been added and documented. After a
1632 file. This new option has been added and documented. After a
1628 request by SAGE to be able to control the printing of very large
1633 request by SAGE to be able to control the printing of very large
1629 objects more easily.
1634 objects more easily.
1630
1635
1631 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1636 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1632
1637
1633 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1638 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1634 from sys.argv, to be 100% consistent with how Python itself works
1639 from sys.argv, to be 100% consistent with how Python itself works
1635 (as seen for example with python -i file.py). After a bug report
1640 (as seen for example with python -i file.py). After a bug report
1636 by Jeffrey Collins.
1641 by Jeffrey Collins.
1637
1642
1638 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1643 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1639 nasty bug which was preventing custom namespaces with -pylab,
1644 nasty bug which was preventing custom namespaces with -pylab,
1640 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1645 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1641 compatibility (long gone from mpl).
1646 compatibility (long gone from mpl).
1642
1647
1643 * IPython/ipapi.py (make_session): name change: create->make. We
1648 * IPython/ipapi.py (make_session): name change: create->make. We
1644 use make in other places (ipmaker,...), it's shorter and easier to
1649 use make in other places (ipmaker,...), it's shorter and easier to
1645 type and say, etc. I'm trying to clean things before 0.7.2 so
1650 type and say, etc. I'm trying to clean things before 0.7.2 so
1646 that I can keep things stable wrt to ipapi in the chainsaw branch.
1651 that I can keep things stable wrt to ipapi in the chainsaw branch.
1647
1652
1648 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1653 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1649 python-mode recognizes our debugger mode. Add support for
1654 python-mode recognizes our debugger mode. Add support for
1650 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1655 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1651 <m.liu.jin-AT-gmail.com> originally written by
1656 <m.liu.jin-AT-gmail.com> originally written by
1652 doxgen-AT-newsmth.net (with minor modifications for xemacs
1657 doxgen-AT-newsmth.net (with minor modifications for xemacs
1653 compatibility)
1658 compatibility)
1654
1659
1655 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1660 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1656 tracebacks when walking the stack so that the stack tracking system
1661 tracebacks when walking the stack so that the stack tracking system
1657 in emacs' python-mode can identify the frames correctly.
1662 in emacs' python-mode can identify the frames correctly.
1658
1663
1659 * IPython/ipmaker.py (make_IPython): make the internal (and
1664 * IPython/ipmaker.py (make_IPython): make the internal (and
1660 default config) autoedit_syntax value false by default. Too many
1665 default config) autoedit_syntax value false by default. Too many
1661 users have complained to me (both on and off-list) about problems
1666 users have complained to me (both on and off-list) about problems
1662 with this option being on by default, so I'm making it default to
1667 with this option being on by default, so I'm making it default to
1663 off. It can still be enabled by anyone via the usual mechanisms.
1668 off. It can still be enabled by anyone via the usual mechanisms.
1664
1669
1665 * IPython/completer.py (Completer.attr_matches): add support for
1670 * IPython/completer.py (Completer.attr_matches): add support for
1666 PyCrust-style _getAttributeNames magic method. Patch contributed
1671 PyCrust-style _getAttributeNames magic method. Patch contributed
1667 by <mscott-AT-goldenspud.com>. Closes #50.
1672 by <mscott-AT-goldenspud.com>. Closes #50.
1668
1673
1669 * IPython/iplib.py (InteractiveShell.__init__): remove the
1674 * IPython/iplib.py (InteractiveShell.__init__): remove the
1670 deletion of exit/quit from __builtin__, which can break
1675 deletion of exit/quit from __builtin__, which can break
1671 third-party tools like the Zope debugging console. The
1676 third-party tools like the Zope debugging console. The
1672 %exit/%quit magics remain. In general, it's probably a good idea
1677 %exit/%quit magics remain. In general, it's probably a good idea
1673 not to delete anything from __builtin__, since we never know what
1678 not to delete anything from __builtin__, since we never know what
1674 that will break. In any case, python now (for 2.5) will support
1679 that will break. In any case, python now (for 2.5) will support
1675 'real' exit/quit, so this issue is moot. Closes #55.
1680 'real' exit/quit, so this issue is moot. Closes #55.
1676
1681
1677 * IPython/genutils.py (with_obj): rename the 'with' function to
1682 * IPython/genutils.py (with_obj): rename the 'with' function to
1678 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1683 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1679 becomes a language keyword. Closes #53.
1684 becomes a language keyword. Closes #53.
1680
1685
1681 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1686 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1682 __file__ attribute to this so it fools more things into thinking
1687 __file__ attribute to this so it fools more things into thinking
1683 it is a real module. Closes #59.
1688 it is a real module. Closes #59.
1684
1689
1685 * IPython/Magic.py (magic_edit): add -n option to open the editor
1690 * IPython/Magic.py (magic_edit): add -n option to open the editor
1686 at a specific line number. After a patch by Stefan van der Walt.
1691 at a specific line number. After a patch by Stefan van der Walt.
1687
1692
1688 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1693 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1689
1694
1690 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1695 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1691 reason the file could not be opened. After automatic crash
1696 reason the file could not be opened. After automatic crash
1692 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1697 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1693 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1698 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1694 (_should_recompile): Don't fire editor if using %bg, since there
1699 (_should_recompile): Don't fire editor if using %bg, since there
1695 is no file in the first place. From the same report as above.
1700 is no file in the first place. From the same report as above.
1696 (raw_input): protect against faulty third-party prefilters. After
1701 (raw_input): protect against faulty third-party prefilters. After
1697 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1702 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1698 while running under SAGE.
1703 while running under SAGE.
1699
1704
1700 2006-05-23 Ville Vainio <vivainio@gmail.com>
1705 2006-05-23 Ville Vainio <vivainio@gmail.com>
1701
1706
1702 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1707 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1703 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1708 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1704 now returns None (again), unless dummy is specifically allowed by
1709 now returns None (again), unless dummy is specifically allowed by
1705 ipapi.get(allow_dummy=True).
1710 ipapi.get(allow_dummy=True).
1706
1711
1707 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1712 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1708
1713
1709 * IPython: remove all 2.2-compatibility objects and hacks from
1714 * IPython: remove all 2.2-compatibility objects and hacks from
1710 everywhere, since we only support 2.3 at this point. Docs
1715 everywhere, since we only support 2.3 at this point. Docs
1711 updated.
1716 updated.
1712
1717
1713 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1718 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1714 Anything requiring extra validation can be turned into a Python
1719 Anything requiring extra validation can be turned into a Python
1715 property in the future. I used a property for the db one b/c
1720 property in the future. I used a property for the db one b/c
1716 there was a nasty circularity problem with the initialization
1721 there was a nasty circularity problem with the initialization
1717 order, which right now I don't have time to clean up.
1722 order, which right now I don't have time to clean up.
1718
1723
1719 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1724 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1720 another locking bug reported by Jorgen. I'm not 100% sure though,
1725 another locking bug reported by Jorgen. I'm not 100% sure though,
1721 so more testing is needed...
1726 so more testing is needed...
1722
1727
1723 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1728 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1724
1729
1725 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1730 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1726 local variables from any routine in user code (typically executed
1731 local variables from any routine in user code (typically executed
1727 with %run) directly into the interactive namespace. Very useful
1732 with %run) directly into the interactive namespace. Very useful
1728 when doing complex debugging.
1733 when doing complex debugging.
1729 (IPythonNotRunning): Changed the default None object to a dummy
1734 (IPythonNotRunning): Changed the default None object to a dummy
1730 whose attributes can be queried as well as called without
1735 whose attributes can be queried as well as called without
1731 exploding, to ease writing code which works transparently both in
1736 exploding, to ease writing code which works transparently both in
1732 and out of ipython and uses some of this API.
1737 and out of ipython and uses some of this API.
1733
1738
1734 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1739 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1735
1740
1736 * IPython/hooks.py (result_display): Fix the fact that our display
1741 * IPython/hooks.py (result_display): Fix the fact that our display
1737 hook was using str() instead of repr(), as the default python
1742 hook was using str() instead of repr(), as the default python
1738 console does. This had gone unnoticed b/c it only happened if
1743 console does. This had gone unnoticed b/c it only happened if
1739 %Pprint was off, but the inconsistency was there.
1744 %Pprint was off, but the inconsistency was there.
1740
1745
1741 2006-05-15 Ville Vainio <vivainio@gmail.com>
1746 2006-05-15 Ville Vainio <vivainio@gmail.com>
1742
1747
1743 * Oinspect.py: Only show docstring for nonexisting/binary files
1748 * Oinspect.py: Only show docstring for nonexisting/binary files
1744 when doing object??, closing ticket #62
1749 when doing object??, closing ticket #62
1745
1750
1746 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1751 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1747
1752
1748 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1753 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1749 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1754 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1750 was being released in a routine which hadn't checked if it had
1755 was being released in a routine which hadn't checked if it had
1751 been the one to acquire it.
1756 been the one to acquire it.
1752
1757
1753 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1758 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1754
1759
1755 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1760 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1756
1761
1757 2006-04-11 Ville Vainio <vivainio@gmail.com>
1762 2006-04-11 Ville Vainio <vivainio@gmail.com>
1758
1763
1759 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1764 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1760 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1765 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1761 prefilters, allowing stuff like magics and aliases in the file.
1766 prefilters, allowing stuff like magics and aliases in the file.
1762
1767
1763 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1768 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1764 added. Supported now are "%clear in" and "%clear out" (clear input and
1769 added. Supported now are "%clear in" and "%clear out" (clear input and
1765 output history, respectively). Also fixed CachedOutput.flush to
1770 output history, respectively). Also fixed CachedOutput.flush to
1766 properly flush the output cache.
1771 properly flush the output cache.
1767
1772
1768 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1773 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1769 half-success (and fail explicitly).
1774 half-success (and fail explicitly).
1770
1775
1771 2006-03-28 Ville Vainio <vivainio@gmail.com>
1776 2006-03-28 Ville Vainio <vivainio@gmail.com>
1772
1777
1773 * iplib.py: Fix quoting of aliases so that only argless ones
1778 * iplib.py: Fix quoting of aliases so that only argless ones
1774 are quoted
1779 are quoted
1775
1780
1776 2006-03-28 Ville Vainio <vivainio@gmail.com>
1781 2006-03-28 Ville Vainio <vivainio@gmail.com>
1777
1782
1778 * iplib.py: Quote aliases with spaces in the name.
1783 * iplib.py: Quote aliases with spaces in the name.
1779 "c:\program files\blah\bin" is now legal alias target.
1784 "c:\program files\blah\bin" is now legal alias target.
1780
1785
1781 * ext_rehashdir.py: Space no longer allowed as arg
1786 * ext_rehashdir.py: Space no longer allowed as arg
1782 separator, since space is legal in path names.
1787 separator, since space is legal in path names.
1783
1788
1784 2006-03-16 Ville Vainio <vivainio@gmail.com>
1789 2006-03-16 Ville Vainio <vivainio@gmail.com>
1785
1790
1786 * upgrade_dir.py: Take path.py from Extensions, correcting
1791 * upgrade_dir.py: Take path.py from Extensions, correcting
1787 %upgrade magic
1792 %upgrade magic
1788
1793
1789 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1794 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1790
1795
1791 * hooks.py: Only enclose editor binary in quotes if legal and
1796 * hooks.py: Only enclose editor binary in quotes if legal and
1792 necessary (space in the name, and is an existing file). Fixes a bug
1797 necessary (space in the name, and is an existing file). Fixes a bug
1793 reported by Zachary Pincus.
1798 reported by Zachary Pincus.
1794
1799
1795 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1800 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1796
1801
1797 * Manual: thanks to a tip on proper color handling for Emacs, by
1802 * Manual: thanks to a tip on proper color handling for Emacs, by
1798 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1803 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1799
1804
1800 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1805 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1801 by applying the provided patch. Thanks to Liu Jin
1806 by applying the provided patch. Thanks to Liu Jin
1802 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1807 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1803 XEmacs/Linux, I'm trusting the submitter that it actually helps
1808 XEmacs/Linux, I'm trusting the submitter that it actually helps
1804 under win32/GNU Emacs. Will revisit if any problems are reported.
1809 under win32/GNU Emacs. Will revisit if any problems are reported.
1805
1810
1806 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1811 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1807
1812
1808 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1813 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1809 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1814 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1810
1815
1811 2006-03-12 Ville Vainio <vivainio@gmail.com>
1816 2006-03-12 Ville Vainio <vivainio@gmail.com>
1812
1817
1813 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1818 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1814 Torsten Marek.
1819 Torsten Marek.
1815
1820
1816 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1821 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1817
1822
1818 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1823 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1819 line ranges works again.
1824 line ranges works again.
1820
1825
1821 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1826 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1822
1827
1823 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1828 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1824 and friends, after a discussion with Zach Pincus on ipython-user.
1829 and friends, after a discussion with Zach Pincus on ipython-user.
1825 I'm not 100% sure, but after thinking about it quite a bit, it may
1830 I'm not 100% sure, but after thinking about it quite a bit, it may
1826 be OK. Testing with the multithreaded shells didn't reveal any
1831 be OK. Testing with the multithreaded shells didn't reveal any
1827 problems, but let's keep an eye out.
1832 problems, but let's keep an eye out.
1828
1833
1829 In the process, I fixed a few things which were calling
1834 In the process, I fixed a few things which were calling
1830 self.InteractiveTB() directly (like safe_execfile), which is a
1835 self.InteractiveTB() directly (like safe_execfile), which is a
1831 mistake: ALL exception reporting should be done by calling
1836 mistake: ALL exception reporting should be done by calling
1832 self.showtraceback(), which handles state and tab-completion and
1837 self.showtraceback(), which handles state and tab-completion and
1833 more.
1838 more.
1834
1839
1835 2006-03-01 Ville Vainio <vivainio@gmail.com>
1840 2006-03-01 Ville Vainio <vivainio@gmail.com>
1836
1841
1837 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1842 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1838 To use, do "from ipipe import *".
1843 To use, do "from ipipe import *".
1839
1844
1840 2006-02-24 Ville Vainio <vivainio@gmail.com>
1845 2006-02-24 Ville Vainio <vivainio@gmail.com>
1841
1846
1842 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1847 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1843 "cleanly" and safely than the older upgrade mechanism.
1848 "cleanly" and safely than the older upgrade mechanism.
1844
1849
1845 2006-02-21 Ville Vainio <vivainio@gmail.com>
1850 2006-02-21 Ville Vainio <vivainio@gmail.com>
1846
1851
1847 * Magic.py: %save works again.
1852 * Magic.py: %save works again.
1848
1853
1849 2006-02-15 Ville Vainio <vivainio@gmail.com>
1854 2006-02-15 Ville Vainio <vivainio@gmail.com>
1850
1855
1851 * Magic.py: %Pprint works again
1856 * Magic.py: %Pprint works again
1852
1857
1853 * Extensions/ipy_sane_defaults.py: Provide everything provided
1858 * Extensions/ipy_sane_defaults.py: Provide everything provided
1854 in default ipythonrc, to make it possible to have a completely empty
1859 in default ipythonrc, to make it possible to have a completely empty
1855 ipythonrc (and thus completely rc-file free configuration)
1860 ipythonrc (and thus completely rc-file free configuration)
1856
1861
1857 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1862 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1858
1863
1859 * IPython/hooks.py (editor): quote the call to the editor command,
1864 * IPython/hooks.py (editor): quote the call to the editor command,
1860 to allow commands with spaces in them. Problem noted by watching
1865 to allow commands with spaces in them. Problem noted by watching
1861 Ian Oswald's video about textpad under win32 at
1866 Ian Oswald's video about textpad under win32 at
1862 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1867 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1863
1868
1864 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1869 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1865 describing magics (we haven't used @ for a loong time).
1870 describing magics (we haven't used @ for a loong time).
1866
1871
1867 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1872 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1868 contributed by marienz to close
1873 contributed by marienz to close
1869 http://www.scipy.net/roundup/ipython/issue53.
1874 http://www.scipy.net/roundup/ipython/issue53.
1870
1875
1871 2006-02-10 Ville Vainio <vivainio@gmail.com>
1876 2006-02-10 Ville Vainio <vivainio@gmail.com>
1872
1877
1873 * genutils.py: getoutput now works in win32 too
1878 * genutils.py: getoutput now works in win32 too
1874
1879
1875 * completer.py: alias and magic completion only invoked
1880 * completer.py: alias and magic completion only invoked
1876 at the first "item" in the line, to avoid "cd %store"
1881 at the first "item" in the line, to avoid "cd %store"
1877 nonsense.
1882 nonsense.
1878
1883
1879 2006-02-09 Ville Vainio <vivainio@gmail.com>
1884 2006-02-09 Ville Vainio <vivainio@gmail.com>
1880
1885
1881 * test/*: Added a unit testing framework (finally).
1886 * test/*: Added a unit testing framework (finally).
1882 '%run runtests.py' to run test_*.
1887 '%run runtests.py' to run test_*.
1883
1888
1884 * ipapi.py: Exposed runlines and set_custom_exc
1889 * ipapi.py: Exposed runlines and set_custom_exc
1885
1890
1886 2006-02-07 Ville Vainio <vivainio@gmail.com>
1891 2006-02-07 Ville Vainio <vivainio@gmail.com>
1887
1892
1888 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1893 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1889 instead use "f(1 2)" as before.
1894 instead use "f(1 2)" as before.
1890
1895
1891 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1896 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1892
1897
1893 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1898 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1894 facilities, for demos processed by the IPython input filter
1899 facilities, for demos processed by the IPython input filter
1895 (IPythonDemo), and for running a script one-line-at-a-time as a
1900 (IPythonDemo), and for running a script one-line-at-a-time as a
1896 demo, both for pure Python (LineDemo) and for IPython-processed
1901 demo, both for pure Python (LineDemo) and for IPython-processed
1897 input (IPythonLineDemo). After a request by Dave Kohel, from the
1902 input (IPythonLineDemo). After a request by Dave Kohel, from the
1898 SAGE team.
1903 SAGE team.
1899 (Demo.edit): added an edit() method to the demo objects, to edit
1904 (Demo.edit): added an edit() method to the demo objects, to edit
1900 the in-memory copy of the last executed block.
1905 the in-memory copy of the last executed block.
1901
1906
1902 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1907 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1903 processing to %edit, %macro and %save. These commands can now be
1908 processing to %edit, %macro and %save. These commands can now be
1904 invoked on the unprocessed input as it was typed by the user
1909 invoked on the unprocessed input as it was typed by the user
1905 (without any prefilters applied). After requests by the SAGE team
1910 (without any prefilters applied). After requests by the SAGE team
1906 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1911 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1907
1912
1908 2006-02-01 Ville Vainio <vivainio@gmail.com>
1913 2006-02-01 Ville Vainio <vivainio@gmail.com>
1909
1914
1910 * setup.py, eggsetup.py: easy_install ipython==dev works
1915 * setup.py, eggsetup.py: easy_install ipython==dev works
1911 correctly now (on Linux)
1916 correctly now (on Linux)
1912
1917
1913 * ipy_user_conf,ipmaker: user config changes, removed spurious
1918 * ipy_user_conf,ipmaker: user config changes, removed spurious
1914 warnings
1919 warnings
1915
1920
1916 * iplib: if rc.banner is string, use it as is.
1921 * iplib: if rc.banner is string, use it as is.
1917
1922
1918 * Magic: %pycat accepts a string argument and pages it's contents.
1923 * Magic: %pycat accepts a string argument and pages it's contents.
1919
1924
1920
1925
1921 2006-01-30 Ville Vainio <vivainio@gmail.com>
1926 2006-01-30 Ville Vainio <vivainio@gmail.com>
1922
1927
1923 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1928 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1924 Now %store and bookmarks work through PickleShare, meaning that
1929 Now %store and bookmarks work through PickleShare, meaning that
1925 concurrent access is possible and all ipython sessions see the
1930 concurrent access is possible and all ipython sessions see the
1926 same database situation all the time, instead of snapshot of
1931 same database situation all the time, instead of snapshot of
1927 the situation when the session was started. Hence, %bookmark
1932 the situation when the session was started. Hence, %bookmark
1928 results are immediately accessible from othes sessions. The database
1933 results are immediately accessible from othes sessions. The database
1929 is also available for use by user extensions. See:
1934 is also available for use by user extensions. See:
1930 http://www.python.org/pypi/pickleshare
1935 http://www.python.org/pypi/pickleshare
1931
1936
1932 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1937 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1933
1938
1934 * aliases can now be %store'd
1939 * aliases can now be %store'd
1935
1940
1936 * path.py moved to Extensions so that pickleshare does not need
1941 * path.py moved to Extensions so that pickleshare does not need
1937 IPython-specific import. Extensions added to pythonpath right
1942 IPython-specific import. Extensions added to pythonpath right
1938 at __init__.
1943 at __init__.
1939
1944
1940 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1945 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1941 called with _ip.system and the pre-transformed command string.
1946 called with _ip.system and the pre-transformed command string.
1942
1947
1943 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1948 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1944
1949
1945 * IPython/iplib.py (interact): Fix that we were not catching
1950 * IPython/iplib.py (interact): Fix that we were not catching
1946 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1951 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1947 logic here had to change, but it's fixed now.
1952 logic here had to change, but it's fixed now.
1948
1953
1949 2006-01-29 Ville Vainio <vivainio@gmail.com>
1954 2006-01-29 Ville Vainio <vivainio@gmail.com>
1950
1955
1951 * iplib.py: Try to import pyreadline on Windows.
1956 * iplib.py: Try to import pyreadline on Windows.
1952
1957
1953 2006-01-27 Ville Vainio <vivainio@gmail.com>
1958 2006-01-27 Ville Vainio <vivainio@gmail.com>
1954
1959
1955 * iplib.py: Expose ipapi as _ip in builtin namespace.
1960 * iplib.py: Expose ipapi as _ip in builtin namespace.
1956 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1961 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1957 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1962 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1958 syntax now produce _ip.* variant of the commands.
1963 syntax now produce _ip.* variant of the commands.
1959
1964
1960 * "_ip.options().autoedit_syntax = 2" automatically throws
1965 * "_ip.options().autoedit_syntax = 2" automatically throws
1961 user to editor for syntax error correction without prompting.
1966 user to editor for syntax error correction without prompting.
1962
1967
1963 2006-01-27 Ville Vainio <vivainio@gmail.com>
1968 2006-01-27 Ville Vainio <vivainio@gmail.com>
1964
1969
1965 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1970 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1966 'ipython' at argv[0]) executed through command line.
1971 'ipython' at argv[0]) executed through command line.
1967 NOTE: this DEPRECATES calling ipython with multiple scripts
1972 NOTE: this DEPRECATES calling ipython with multiple scripts
1968 ("ipython a.py b.py c.py")
1973 ("ipython a.py b.py c.py")
1969
1974
1970 * iplib.py, hooks.py: Added configurable input prefilter,
1975 * iplib.py, hooks.py: Added configurable input prefilter,
1971 named 'input_prefilter'. See ext_rescapture.py for example
1976 named 'input_prefilter'. See ext_rescapture.py for example
1972 usage.
1977 usage.
1973
1978
1974 * ext_rescapture.py, Magic.py: Better system command output capture
1979 * ext_rescapture.py, Magic.py: Better system command output capture
1975 through 'var = !ls' (deprecates user-visible %sc). Same notation
1980 through 'var = !ls' (deprecates user-visible %sc). Same notation
1976 applies for magics, 'var = %alias' assigns alias list to var.
1981 applies for magics, 'var = %alias' assigns alias list to var.
1977
1982
1978 * ipapi.py: added meta() for accessing extension-usable data store.
1983 * ipapi.py: added meta() for accessing extension-usable data store.
1979
1984
1980 * iplib.py: added InteractiveShell.getapi(). New magics should be
1985 * iplib.py: added InteractiveShell.getapi(). New magics should be
1981 written doing self.getapi() instead of using the shell directly.
1986 written doing self.getapi() instead of using the shell directly.
1982
1987
1983 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1988 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1984 %store foo >> ~/myfoo.txt to store variables to files (in clean
1989 %store foo >> ~/myfoo.txt to store variables to files (in clean
1985 textual form, not a restorable pickle).
1990 textual form, not a restorable pickle).
1986
1991
1987 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1992 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1988
1993
1989 * usage.py, Magic.py: added %quickref
1994 * usage.py, Magic.py: added %quickref
1990
1995
1991 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1996 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1992
1997
1993 * GetoptErrors when invoking magics etc. with wrong args
1998 * GetoptErrors when invoking magics etc. with wrong args
1994 are now more helpful:
1999 are now more helpful:
1995 GetoptError: option -l not recognized (allowed: "qb" )
2000 GetoptError: option -l not recognized (allowed: "qb" )
1996
2001
1997 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2002 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1998
2003
1999 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2004 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2000 computationally intensive blocks don't appear to stall the demo.
2005 computationally intensive blocks don't appear to stall the demo.
2001
2006
2002 2006-01-24 Ville Vainio <vivainio@gmail.com>
2007 2006-01-24 Ville Vainio <vivainio@gmail.com>
2003
2008
2004 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2009 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2005 value to manipulate resulting history entry.
2010 value to manipulate resulting history entry.
2006
2011
2007 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2012 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2008 to instance methods of IPApi class, to make extending an embedded
2013 to instance methods of IPApi class, to make extending an embedded
2009 IPython feasible. See ext_rehashdir.py for example usage.
2014 IPython feasible. See ext_rehashdir.py for example usage.
2010
2015
2011 * Merged 1071-1076 from branches/0.7.1
2016 * Merged 1071-1076 from branches/0.7.1
2012
2017
2013
2018
2014 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2019 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2015
2020
2016 * tools/release (daystamp): Fix build tools to use the new
2021 * tools/release (daystamp): Fix build tools to use the new
2017 eggsetup.py script to build lightweight eggs.
2022 eggsetup.py script to build lightweight eggs.
2018
2023
2019 * Applied changesets 1062 and 1064 before 0.7.1 release.
2024 * Applied changesets 1062 and 1064 before 0.7.1 release.
2020
2025
2021 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2026 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2022 see the raw input history (without conversions like %ls ->
2027 see the raw input history (without conversions like %ls ->
2023 ipmagic("ls")). After a request from W. Stein, SAGE
2028 ipmagic("ls")). After a request from W. Stein, SAGE
2024 (http://modular.ucsd.edu/sage) developer. This information is
2029 (http://modular.ucsd.edu/sage) developer. This information is
2025 stored in the input_hist_raw attribute of the IPython instance, so
2030 stored in the input_hist_raw attribute of the IPython instance, so
2026 developers can access it if needed (it's an InputList instance).
2031 developers can access it if needed (it's an InputList instance).
2027
2032
2028 * Versionstring = 0.7.2.svn
2033 * Versionstring = 0.7.2.svn
2029
2034
2030 * eggsetup.py: A separate script for constructing eggs, creates
2035 * eggsetup.py: A separate script for constructing eggs, creates
2031 proper launch scripts even on Windows (an .exe file in
2036 proper launch scripts even on Windows (an .exe file in
2032 \python24\scripts).
2037 \python24\scripts).
2033
2038
2034 * ipapi.py: launch_new_instance, launch entry point needed for the
2039 * ipapi.py: launch_new_instance, launch entry point needed for the
2035 egg.
2040 egg.
2036
2041
2037 2006-01-23 Ville Vainio <vivainio@gmail.com>
2042 2006-01-23 Ville Vainio <vivainio@gmail.com>
2038
2043
2039 * Added %cpaste magic for pasting python code
2044 * Added %cpaste magic for pasting python code
2040
2045
2041 2006-01-22 Ville Vainio <vivainio@gmail.com>
2046 2006-01-22 Ville Vainio <vivainio@gmail.com>
2042
2047
2043 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2048 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2044
2049
2045 * Versionstring = 0.7.2.svn
2050 * Versionstring = 0.7.2.svn
2046
2051
2047 * eggsetup.py: A separate script for constructing eggs, creates
2052 * eggsetup.py: A separate script for constructing eggs, creates
2048 proper launch scripts even on Windows (an .exe file in
2053 proper launch scripts even on Windows (an .exe file in
2049 \python24\scripts).
2054 \python24\scripts).
2050
2055
2051 * ipapi.py: launch_new_instance, launch entry point needed for the
2056 * ipapi.py: launch_new_instance, launch entry point needed for the
2052 egg.
2057 egg.
2053
2058
2054 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2059 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2055
2060
2056 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2061 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2057 %pfile foo would print the file for foo even if it was a binary.
2062 %pfile foo would print the file for foo even if it was a binary.
2058 Now, extensions '.so' and '.dll' are skipped.
2063 Now, extensions '.so' and '.dll' are skipped.
2059
2064
2060 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2065 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2061 bug, where macros would fail in all threaded modes. I'm not 100%
2066 bug, where macros would fail in all threaded modes. I'm not 100%
2062 sure, so I'm going to put out an rc instead of making a release
2067 sure, so I'm going to put out an rc instead of making a release
2063 today, and wait for feedback for at least a few days.
2068 today, and wait for feedback for at least a few days.
2064
2069
2065 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2070 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2066 it...) the handling of pasting external code with autoindent on.
2071 it...) the handling of pasting external code with autoindent on.
2067 To get out of a multiline input, the rule will appear for most
2072 To get out of a multiline input, the rule will appear for most
2068 users unchanged: two blank lines or change the indent level
2073 users unchanged: two blank lines or change the indent level
2069 proposed by IPython. But there is a twist now: you can
2074 proposed by IPython. But there is a twist now: you can
2070 add/subtract only *one or two spaces*. If you add/subtract three
2075 add/subtract only *one or two spaces*. If you add/subtract three
2071 or more (unless you completely delete the line), IPython will
2076 or more (unless you completely delete the line), IPython will
2072 accept that line, and you'll need to enter a second one of pure
2077 accept that line, and you'll need to enter a second one of pure
2073 whitespace. I know it sounds complicated, but I can't find a
2078 whitespace. I know it sounds complicated, but I can't find a
2074 different solution that covers all the cases, with the right
2079 different solution that covers all the cases, with the right
2075 heuristics. Hopefully in actual use, nobody will really notice
2080 heuristics. Hopefully in actual use, nobody will really notice
2076 all these strange rules and things will 'just work'.
2081 all these strange rules and things will 'just work'.
2077
2082
2078 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2083 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2079
2084
2080 * IPython/iplib.py (interact): catch exceptions which can be
2085 * IPython/iplib.py (interact): catch exceptions which can be
2081 triggered asynchronously by signal handlers. Thanks to an
2086 triggered asynchronously by signal handlers. Thanks to an
2082 automatic crash report, submitted by Colin Kingsley
2087 automatic crash report, submitted by Colin Kingsley
2083 <tercel-AT-gentoo.org>.
2088 <tercel-AT-gentoo.org>.
2084
2089
2085 2006-01-20 Ville Vainio <vivainio@gmail.com>
2090 2006-01-20 Ville Vainio <vivainio@gmail.com>
2086
2091
2087 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2092 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2088 (%rehashdir, very useful, try it out) of how to extend ipython
2093 (%rehashdir, very useful, try it out) of how to extend ipython
2089 with new magics. Also added Extensions dir to pythonpath to make
2094 with new magics. Also added Extensions dir to pythonpath to make
2090 importing extensions easy.
2095 importing extensions easy.
2091
2096
2092 * %store now complains when trying to store interactively declared
2097 * %store now complains when trying to store interactively declared
2093 classes / instances of those classes.
2098 classes / instances of those classes.
2094
2099
2095 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2100 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2096 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2101 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2097 if they exist, and ipy_user_conf.py with some defaults is created for
2102 if they exist, and ipy_user_conf.py with some defaults is created for
2098 the user.
2103 the user.
2099
2104
2100 * Startup rehashing done by the config file, not InterpreterExec.
2105 * Startup rehashing done by the config file, not InterpreterExec.
2101 This means system commands are available even without selecting the
2106 This means system commands are available even without selecting the
2102 pysh profile. It's the sensible default after all.
2107 pysh profile. It's the sensible default after all.
2103
2108
2104 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2109 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2105
2110
2106 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2111 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2107 multiline code with autoindent on working. But I am really not
2112 multiline code with autoindent on working. But I am really not
2108 sure, so this needs more testing. Will commit a debug-enabled
2113 sure, so this needs more testing. Will commit a debug-enabled
2109 version for now, while I test it some more, so that Ville and
2114 version for now, while I test it some more, so that Ville and
2110 others may also catch any problems. Also made
2115 others may also catch any problems. Also made
2111 self.indent_current_str() a method, to ensure that there's no
2116 self.indent_current_str() a method, to ensure that there's no
2112 chance of the indent space count and the corresponding string
2117 chance of the indent space count and the corresponding string
2113 falling out of sync. All code needing the string should just call
2118 falling out of sync. All code needing the string should just call
2114 the method.
2119 the method.
2115
2120
2116 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2121 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2117
2122
2118 * IPython/Magic.py (magic_edit): fix check for when users don't
2123 * IPython/Magic.py (magic_edit): fix check for when users don't
2119 save their output files, the try/except was in the wrong section.
2124 save their output files, the try/except was in the wrong section.
2120
2125
2121 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2126 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2122
2127
2123 * IPython/Magic.py (magic_run): fix __file__ global missing from
2128 * IPython/Magic.py (magic_run): fix __file__ global missing from
2124 script's namespace when executed via %run. After a report by
2129 script's namespace when executed via %run. After a report by
2125 Vivian.
2130 Vivian.
2126
2131
2127 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2132 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2128 when using python 2.4. The parent constructor changed in 2.4, and
2133 when using python 2.4. The parent constructor changed in 2.4, and
2129 we need to track it directly (we can't call it, as it messes up
2134 we need to track it directly (we can't call it, as it messes up
2130 readline and tab-completion inside our pdb would stop working).
2135 readline and tab-completion inside our pdb would stop working).
2131 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2136 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2132
2137
2133 2006-01-16 Ville Vainio <vivainio@gmail.com>
2138 2006-01-16 Ville Vainio <vivainio@gmail.com>
2134
2139
2135 * Ipython/magic.py: Reverted back to old %edit functionality
2140 * Ipython/magic.py: Reverted back to old %edit functionality
2136 that returns file contents on exit.
2141 that returns file contents on exit.
2137
2142
2138 * IPython/path.py: Added Jason Orendorff's "path" module to
2143 * IPython/path.py: Added Jason Orendorff's "path" module to
2139 IPython tree, http://www.jorendorff.com/articles/python/path/.
2144 IPython tree, http://www.jorendorff.com/articles/python/path/.
2140 You can get path objects conveniently through %sc, and !!, e.g.:
2145 You can get path objects conveniently through %sc, and !!, e.g.:
2141 sc files=ls
2146 sc files=ls
2142 for p in files.paths: # or files.p
2147 for p in files.paths: # or files.p
2143 print p,p.mtime
2148 print p,p.mtime
2144
2149
2145 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2150 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2146 now work again without considering the exclusion regexp -
2151 now work again without considering the exclusion regexp -
2147 hence, things like ',foo my/path' turn to 'foo("my/path")'
2152 hence, things like ',foo my/path' turn to 'foo("my/path")'
2148 instead of syntax error.
2153 instead of syntax error.
2149
2154
2150
2155
2151 2006-01-14 Ville Vainio <vivainio@gmail.com>
2156 2006-01-14 Ville Vainio <vivainio@gmail.com>
2152
2157
2153 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2158 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2154 ipapi decorators for python 2.4 users, options() provides access to rc
2159 ipapi decorators for python 2.4 users, options() provides access to rc
2155 data.
2160 data.
2156
2161
2157 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2162 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2158 as path separators (even on Linux ;-). Space character after
2163 as path separators (even on Linux ;-). Space character after
2159 backslash (as yielded by tab completer) is still space;
2164 backslash (as yielded by tab completer) is still space;
2160 "%cd long\ name" works as expected.
2165 "%cd long\ name" works as expected.
2161
2166
2162 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2167 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2163 as "chain of command", with priority. API stays the same,
2168 as "chain of command", with priority. API stays the same,
2164 TryNext exception raised by a hook function signals that
2169 TryNext exception raised by a hook function signals that
2165 current hook failed and next hook should try handling it, as
2170 current hook failed and next hook should try handling it, as
2166 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2171 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2167 requested configurable display hook, which is now implemented.
2172 requested configurable display hook, which is now implemented.
2168
2173
2169 2006-01-13 Ville Vainio <vivainio@gmail.com>
2174 2006-01-13 Ville Vainio <vivainio@gmail.com>
2170
2175
2171 * IPython/platutils*.py: platform specific utility functions,
2176 * IPython/platutils*.py: platform specific utility functions,
2172 so far only set_term_title is implemented (change terminal
2177 so far only set_term_title is implemented (change terminal
2173 label in windowing systems). %cd now changes the title to
2178 label in windowing systems). %cd now changes the title to
2174 current dir.
2179 current dir.
2175
2180
2176 * IPython/Release.py: Added myself to "authors" list,
2181 * IPython/Release.py: Added myself to "authors" list,
2177 had to create new files.
2182 had to create new files.
2178
2183
2179 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2184 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2180 shell escape; not a known bug but had potential to be one in the
2185 shell escape; not a known bug but had potential to be one in the
2181 future.
2186 future.
2182
2187
2183 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2188 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2184 extension API for IPython! See the module for usage example. Fix
2189 extension API for IPython! See the module for usage example. Fix
2185 OInspect for docstring-less magic functions.
2190 OInspect for docstring-less magic functions.
2186
2191
2187
2192
2188 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2193 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2189
2194
2190 * IPython/iplib.py (raw_input): temporarily deactivate all
2195 * IPython/iplib.py (raw_input): temporarily deactivate all
2191 attempts at allowing pasting of code with autoindent on. It
2196 attempts at allowing pasting of code with autoindent on. It
2192 introduced bugs (reported by Prabhu) and I can't seem to find a
2197 introduced bugs (reported by Prabhu) and I can't seem to find a
2193 robust combination which works in all cases. Will have to revisit
2198 robust combination which works in all cases. Will have to revisit
2194 later.
2199 later.
2195
2200
2196 * IPython/genutils.py: remove isspace() function. We've dropped
2201 * IPython/genutils.py: remove isspace() function. We've dropped
2197 2.2 compatibility, so it's OK to use the string method.
2202 2.2 compatibility, so it's OK to use the string method.
2198
2203
2199 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2204 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2200
2205
2201 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2206 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2202 matching what NOT to autocall on, to include all python binary
2207 matching what NOT to autocall on, to include all python binary
2203 operators (including things like 'and', 'or', 'is' and 'in').
2208 operators (including things like 'and', 'or', 'is' and 'in').
2204 Prompted by a bug report on 'foo & bar', but I realized we had
2209 Prompted by a bug report on 'foo & bar', but I realized we had
2205 many more potential bug cases with other operators. The regexp is
2210 many more potential bug cases with other operators. The regexp is
2206 self.re_exclude_auto, it's fairly commented.
2211 self.re_exclude_auto, it's fairly commented.
2207
2212
2208 2006-01-12 Ville Vainio <vivainio@gmail.com>
2213 2006-01-12 Ville Vainio <vivainio@gmail.com>
2209
2214
2210 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2215 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2211 Prettified and hardened string/backslash quoting with ipsystem(),
2216 Prettified and hardened string/backslash quoting with ipsystem(),
2212 ipalias() and ipmagic(). Now even \ characters are passed to
2217 ipalias() and ipmagic(). Now even \ characters are passed to
2213 %magics, !shell escapes and aliases exactly as they are in the
2218 %magics, !shell escapes and aliases exactly as they are in the
2214 ipython command line. Should improve backslash experience,
2219 ipython command line. Should improve backslash experience,
2215 particularly in Windows (path delimiter for some commands that
2220 particularly in Windows (path delimiter for some commands that
2216 won't understand '/'), but Unix benefits as well (regexps). %cd
2221 won't understand '/'), but Unix benefits as well (regexps). %cd
2217 magic still doesn't support backslash path delimiters, though. Also
2222 magic still doesn't support backslash path delimiters, though. Also
2218 deleted all pretense of supporting multiline command strings in
2223 deleted all pretense of supporting multiline command strings in
2219 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2224 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2220
2225
2221 * doc/build_doc_instructions.txt added. Documentation on how to
2226 * doc/build_doc_instructions.txt added. Documentation on how to
2222 use doc/update_manual.py, added yesterday. Both files contributed
2227 use doc/update_manual.py, added yesterday. Both files contributed
2223 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2228 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2224 doc/*.sh for deprecation at a later date.
2229 doc/*.sh for deprecation at a later date.
2225
2230
2226 * /ipython.py Added ipython.py to root directory for
2231 * /ipython.py Added ipython.py to root directory for
2227 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2232 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2228 ipython.py) and development convenience (no need to keep doing
2233 ipython.py) and development convenience (no need to keep doing
2229 "setup.py install" between changes).
2234 "setup.py install" between changes).
2230
2235
2231 * Made ! and !! shell escapes work (again) in multiline expressions:
2236 * Made ! and !! shell escapes work (again) in multiline expressions:
2232 if 1:
2237 if 1:
2233 !ls
2238 !ls
2234 !!ls
2239 !!ls
2235
2240
2236 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2241 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2237
2242
2238 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2243 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2239 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2244 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2240 module in case-insensitive installation. Was causing crashes
2245 module in case-insensitive installation. Was causing crashes
2241 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2246 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2242
2247
2243 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2248 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2244 <marienz-AT-gentoo.org>, closes
2249 <marienz-AT-gentoo.org>, closes
2245 http://www.scipy.net/roundup/ipython/issue51.
2250 http://www.scipy.net/roundup/ipython/issue51.
2246
2251
2247 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2252 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2248
2253
2249 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2254 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2250 problem of excessive CPU usage under *nix and keyboard lag under
2255 problem of excessive CPU usage under *nix and keyboard lag under
2251 win32.
2256 win32.
2252
2257
2253 2006-01-10 *** Released version 0.7.0
2258 2006-01-10 *** Released version 0.7.0
2254
2259
2255 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2260 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2256
2261
2257 * IPython/Release.py (revision): tag version number to 0.7.0,
2262 * IPython/Release.py (revision): tag version number to 0.7.0,
2258 ready for release.
2263 ready for release.
2259
2264
2260 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2265 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2261 it informs the user of the name of the temp. file used. This can
2266 it informs the user of the name of the temp. file used. This can
2262 help if you decide later to reuse that same file, so you know
2267 help if you decide later to reuse that same file, so you know
2263 where to copy the info from.
2268 where to copy the info from.
2264
2269
2265 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2270 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2266
2271
2267 * setup_bdist_egg.py: little script to build an egg. Added
2272 * setup_bdist_egg.py: little script to build an egg. Added
2268 support in the release tools as well.
2273 support in the release tools as well.
2269
2274
2270 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2275 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2271
2276
2272 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2277 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2273 version selection (new -wxversion command line and ipythonrc
2278 version selection (new -wxversion command line and ipythonrc
2274 parameter). Patch contributed by Arnd Baecker
2279 parameter). Patch contributed by Arnd Baecker
2275 <arnd.baecker-AT-web.de>.
2280 <arnd.baecker-AT-web.de>.
2276
2281
2277 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2282 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2278 embedded instances, for variables defined at the interactive
2283 embedded instances, for variables defined at the interactive
2279 prompt of the embedded ipython. Reported by Arnd.
2284 prompt of the embedded ipython. Reported by Arnd.
2280
2285
2281 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2286 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2282 it can be used as a (stateful) toggle, or with a direct parameter.
2287 it can be used as a (stateful) toggle, or with a direct parameter.
2283
2288
2284 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2289 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2285 could be triggered in certain cases and cause the traceback
2290 could be triggered in certain cases and cause the traceback
2286 printer not to work.
2291 printer not to work.
2287
2292
2288 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2293 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2289
2294
2290 * IPython/iplib.py (_should_recompile): Small fix, closes
2295 * IPython/iplib.py (_should_recompile): Small fix, closes
2291 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2296 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2292
2297
2293 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2298 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2294
2299
2295 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2300 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2296 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2301 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2297 Moad for help with tracking it down.
2302 Moad for help with tracking it down.
2298
2303
2299 * IPython/iplib.py (handle_auto): fix autocall handling for
2304 * IPython/iplib.py (handle_auto): fix autocall handling for
2300 objects which support BOTH __getitem__ and __call__ (so that f [x]
2305 objects which support BOTH __getitem__ and __call__ (so that f [x]
2301 is left alone, instead of becoming f([x]) automatically).
2306 is left alone, instead of becoming f([x]) automatically).
2302
2307
2303 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2308 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2304 Ville's patch.
2309 Ville's patch.
2305
2310
2306 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2311 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2307
2312
2308 * IPython/iplib.py (handle_auto): changed autocall semantics to
2313 * IPython/iplib.py (handle_auto): changed autocall semantics to
2309 include 'smart' mode, where the autocall transformation is NOT
2314 include 'smart' mode, where the autocall transformation is NOT
2310 applied if there are no arguments on the line. This allows you to
2315 applied if there are no arguments on the line. This allows you to
2311 just type 'foo' if foo is a callable to see its internal form,
2316 just type 'foo' if foo is a callable to see its internal form,
2312 instead of having it called with no arguments (typically a
2317 instead of having it called with no arguments (typically a
2313 mistake). The old 'full' autocall still exists: for that, you
2318 mistake). The old 'full' autocall still exists: for that, you
2314 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2319 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2315
2320
2316 * IPython/completer.py (Completer.attr_matches): add
2321 * IPython/completer.py (Completer.attr_matches): add
2317 tab-completion support for Enthoughts' traits. After a report by
2322 tab-completion support for Enthoughts' traits. After a report by
2318 Arnd and a patch by Prabhu.
2323 Arnd and a patch by Prabhu.
2319
2324
2320 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2325 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2321
2326
2322 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2327 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2323 Schmolck's patch to fix inspect.getinnerframes().
2328 Schmolck's patch to fix inspect.getinnerframes().
2324
2329
2325 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2330 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2326 for embedded instances, regarding handling of namespaces and items
2331 for embedded instances, regarding handling of namespaces and items
2327 added to the __builtin__ one. Multiple embedded instances and
2332 added to the __builtin__ one. Multiple embedded instances and
2328 recursive embeddings should work better now (though I'm not sure
2333 recursive embeddings should work better now (though I'm not sure
2329 I've got all the corner cases fixed, that code is a bit of a brain
2334 I've got all the corner cases fixed, that code is a bit of a brain
2330 twister).
2335 twister).
2331
2336
2332 * IPython/Magic.py (magic_edit): added support to edit in-memory
2337 * IPython/Magic.py (magic_edit): added support to edit in-memory
2333 macros (automatically creates the necessary temp files). %edit
2338 macros (automatically creates the necessary temp files). %edit
2334 also doesn't return the file contents anymore, it's just noise.
2339 also doesn't return the file contents anymore, it's just noise.
2335
2340
2336 * IPython/completer.py (Completer.attr_matches): revert change to
2341 * IPython/completer.py (Completer.attr_matches): revert change to
2337 complete only on attributes listed in __all__. I realized it
2342 complete only on attributes listed in __all__. I realized it
2338 cripples the tab-completion system as a tool for exploring the
2343 cripples the tab-completion system as a tool for exploring the
2339 internals of unknown libraries (it renders any non-__all__
2344 internals of unknown libraries (it renders any non-__all__
2340 attribute off-limits). I got bit by this when trying to see
2345 attribute off-limits). I got bit by this when trying to see
2341 something inside the dis module.
2346 something inside the dis module.
2342
2347
2343 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2348 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2344
2349
2345 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2350 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2346 namespace for users and extension writers to hold data in. This
2351 namespace for users and extension writers to hold data in. This
2347 follows the discussion in
2352 follows the discussion in
2348 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2353 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2349
2354
2350 * IPython/completer.py (IPCompleter.complete): small patch to help
2355 * IPython/completer.py (IPCompleter.complete): small patch to help
2351 tab-completion under Emacs, after a suggestion by John Barnard
2356 tab-completion under Emacs, after a suggestion by John Barnard
2352 <barnarj-AT-ccf.org>.
2357 <barnarj-AT-ccf.org>.
2353
2358
2354 * IPython/Magic.py (Magic.extract_input_slices): added support for
2359 * IPython/Magic.py (Magic.extract_input_slices): added support for
2355 the slice notation in magics to use N-M to represent numbers N...M
2360 the slice notation in magics to use N-M to represent numbers N...M
2356 (closed endpoints). This is used by %macro and %save.
2361 (closed endpoints). This is used by %macro and %save.
2357
2362
2358 * IPython/completer.py (Completer.attr_matches): for modules which
2363 * IPython/completer.py (Completer.attr_matches): for modules which
2359 define __all__, complete only on those. After a patch by Jeffrey
2364 define __all__, complete only on those. After a patch by Jeffrey
2360 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2365 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2361 speed up this routine.
2366 speed up this routine.
2362
2367
2363 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2368 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2364 don't know if this is the end of it, but the behavior now is
2369 don't know if this is the end of it, but the behavior now is
2365 certainly much more correct. Note that coupled with macros,
2370 certainly much more correct. Note that coupled with macros,
2366 slightly surprising (at first) behavior may occur: a macro will in
2371 slightly surprising (at first) behavior may occur: a macro will in
2367 general expand to multiple lines of input, so upon exiting, the
2372 general expand to multiple lines of input, so upon exiting, the
2368 in/out counters will both be bumped by the corresponding amount
2373 in/out counters will both be bumped by the corresponding amount
2369 (as if the macro's contents had been typed interactively). Typing
2374 (as if the macro's contents had been typed interactively). Typing
2370 %hist will reveal the intermediate (silently processed) lines.
2375 %hist will reveal the intermediate (silently processed) lines.
2371
2376
2372 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2377 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2373 pickle to fail (%run was overwriting __main__ and not restoring
2378 pickle to fail (%run was overwriting __main__ and not restoring
2374 it, but pickle relies on __main__ to operate).
2379 it, but pickle relies on __main__ to operate).
2375
2380
2376 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2381 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2377 using properties, but forgot to make the main InteractiveShell
2382 using properties, but forgot to make the main InteractiveShell
2378 class a new-style class. Properties fail silently, and
2383 class a new-style class. Properties fail silently, and
2379 mysteriously, with old-style class (getters work, but
2384 mysteriously, with old-style class (getters work, but
2380 setters don't do anything).
2385 setters don't do anything).
2381
2386
2382 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2387 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2383
2388
2384 * IPython/Magic.py (magic_history): fix history reporting bug (I
2389 * IPython/Magic.py (magic_history): fix history reporting bug (I
2385 know some nasties are still there, I just can't seem to find a
2390 know some nasties are still there, I just can't seem to find a
2386 reproducible test case to track them down; the input history is
2391 reproducible test case to track them down; the input history is
2387 falling out of sync...)
2392 falling out of sync...)
2388
2393
2389 * IPython/iplib.py (handle_shell_escape): fix bug where both
2394 * IPython/iplib.py (handle_shell_escape): fix bug where both
2390 aliases and system accesses where broken for indented code (such
2395 aliases and system accesses where broken for indented code (such
2391 as loops).
2396 as loops).
2392
2397
2393 * IPython/genutils.py (shell): fix small but critical bug for
2398 * IPython/genutils.py (shell): fix small but critical bug for
2394 win32 system access.
2399 win32 system access.
2395
2400
2396 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2401 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2397
2402
2398 * IPython/iplib.py (showtraceback): remove use of the
2403 * IPython/iplib.py (showtraceback): remove use of the
2399 sys.last_{type/value/traceback} structures, which are non
2404 sys.last_{type/value/traceback} structures, which are non
2400 thread-safe.
2405 thread-safe.
2401 (_prefilter): change control flow to ensure that we NEVER
2406 (_prefilter): change control flow to ensure that we NEVER
2402 introspect objects when autocall is off. This will guarantee that
2407 introspect objects when autocall is off. This will guarantee that
2403 having an input line of the form 'x.y', where access to attribute
2408 having an input line of the form 'x.y', where access to attribute
2404 'y' has side effects, doesn't trigger the side effect TWICE. It
2409 'y' has side effects, doesn't trigger the side effect TWICE. It
2405 is important to note that, with autocall on, these side effects
2410 is important to note that, with autocall on, these side effects
2406 can still happen.
2411 can still happen.
2407 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2412 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2408 trio. IPython offers these three kinds of special calls which are
2413 trio. IPython offers these three kinds of special calls which are
2409 not python code, and it's a good thing to have their call method
2414 not python code, and it's a good thing to have their call method
2410 be accessible as pure python functions (not just special syntax at
2415 be accessible as pure python functions (not just special syntax at
2411 the command line). It gives us a better internal implementation
2416 the command line). It gives us a better internal implementation
2412 structure, as well as exposing these for user scripting more
2417 structure, as well as exposing these for user scripting more
2413 cleanly.
2418 cleanly.
2414
2419
2415 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2420 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2416 file. Now that they'll be more likely to be used with the
2421 file. Now that they'll be more likely to be used with the
2417 persistance system (%store), I want to make sure their module path
2422 persistance system (%store), I want to make sure their module path
2418 doesn't change in the future, so that we don't break things for
2423 doesn't change in the future, so that we don't break things for
2419 users' persisted data.
2424 users' persisted data.
2420
2425
2421 * IPython/iplib.py (autoindent_update): move indentation
2426 * IPython/iplib.py (autoindent_update): move indentation
2422 management into the _text_ processing loop, not the keyboard
2427 management into the _text_ processing loop, not the keyboard
2423 interactive one. This is necessary to correctly process non-typed
2428 interactive one. This is necessary to correctly process non-typed
2424 multiline input (such as macros).
2429 multiline input (such as macros).
2425
2430
2426 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2431 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2427 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2432 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2428 which was producing problems in the resulting manual.
2433 which was producing problems in the resulting manual.
2429 (magic_whos): improve reporting of instances (show their class,
2434 (magic_whos): improve reporting of instances (show their class,
2430 instead of simply printing 'instance' which isn't terribly
2435 instead of simply printing 'instance' which isn't terribly
2431 informative).
2436 informative).
2432
2437
2433 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2438 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2434 (minor mods) to support network shares under win32.
2439 (minor mods) to support network shares under win32.
2435
2440
2436 * IPython/winconsole.py (get_console_size): add new winconsole
2441 * IPython/winconsole.py (get_console_size): add new winconsole
2437 module and fixes to page_dumb() to improve its behavior under
2442 module and fixes to page_dumb() to improve its behavior under
2438 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2443 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2439
2444
2440 * IPython/Magic.py (Macro): simplified Macro class to just
2445 * IPython/Magic.py (Macro): simplified Macro class to just
2441 subclass list. We've had only 2.2 compatibility for a very long
2446 subclass list. We've had only 2.2 compatibility for a very long
2442 time, yet I was still avoiding subclassing the builtin types. No
2447 time, yet I was still avoiding subclassing the builtin types. No
2443 more (I'm also starting to use properties, though I won't shift to
2448 more (I'm also starting to use properties, though I won't shift to
2444 2.3-specific features quite yet).
2449 2.3-specific features quite yet).
2445 (magic_store): added Ville's patch for lightweight variable
2450 (magic_store): added Ville's patch for lightweight variable
2446 persistence, after a request on the user list by Matt Wilkie
2451 persistence, after a request on the user list by Matt Wilkie
2447 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2452 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2448 details.
2453 details.
2449
2454
2450 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2455 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2451 changed the default logfile name from 'ipython.log' to
2456 changed the default logfile name from 'ipython.log' to
2452 'ipython_log.py'. These logs are real python files, and now that
2457 'ipython_log.py'. These logs are real python files, and now that
2453 we have much better multiline support, people are more likely to
2458 we have much better multiline support, people are more likely to
2454 want to use them as such. Might as well name them correctly.
2459 want to use them as such. Might as well name them correctly.
2455
2460
2456 * IPython/Magic.py: substantial cleanup. While we can't stop
2461 * IPython/Magic.py: substantial cleanup. While we can't stop
2457 using magics as mixins, due to the existing customizations 'out
2462 using magics as mixins, due to the existing customizations 'out
2458 there' which rely on the mixin naming conventions, at least I
2463 there' which rely on the mixin naming conventions, at least I
2459 cleaned out all cross-class name usage. So once we are OK with
2464 cleaned out all cross-class name usage. So once we are OK with
2460 breaking compatibility, the two systems can be separated.
2465 breaking compatibility, the two systems can be separated.
2461
2466
2462 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2467 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2463 anymore, and the class is a fair bit less hideous as well. New
2468 anymore, and the class is a fair bit less hideous as well. New
2464 features were also introduced: timestamping of input, and logging
2469 features were also introduced: timestamping of input, and logging
2465 of output results. These are user-visible with the -t and -o
2470 of output results. These are user-visible with the -t and -o
2466 options to %logstart. Closes
2471 options to %logstart. Closes
2467 http://www.scipy.net/roundup/ipython/issue11 and a request by
2472 http://www.scipy.net/roundup/ipython/issue11 and a request by
2468 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2473 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2469
2474
2470 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2475 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2471
2476
2472 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2477 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2473 better handle backslashes in paths. See the thread 'More Windows
2478 better handle backslashes in paths. See the thread 'More Windows
2474 questions part 2 - \/ characters revisited' on the iypthon user
2479 questions part 2 - \/ characters revisited' on the iypthon user
2475 list:
2480 list:
2476 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2481 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2477
2482
2478 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2483 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2479
2484
2480 (InteractiveShell.__init__): change threaded shells to not use the
2485 (InteractiveShell.__init__): change threaded shells to not use the
2481 ipython crash handler. This was causing more problems than not,
2486 ipython crash handler. This was causing more problems than not,
2482 as exceptions in the main thread (GUI code, typically) would
2487 as exceptions in the main thread (GUI code, typically) would
2483 always show up as a 'crash', when they really weren't.
2488 always show up as a 'crash', when they really weren't.
2484
2489
2485 The colors and exception mode commands (%colors/%xmode) have been
2490 The colors and exception mode commands (%colors/%xmode) have been
2486 synchronized to also take this into account, so users can get
2491 synchronized to also take this into account, so users can get
2487 verbose exceptions for their threaded code as well. I also added
2492 verbose exceptions for their threaded code as well. I also added
2488 support for activating pdb inside this exception handler as well,
2493 support for activating pdb inside this exception handler as well,
2489 so now GUI authors can use IPython's enhanced pdb at runtime.
2494 so now GUI authors can use IPython's enhanced pdb at runtime.
2490
2495
2491 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2496 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2492 true by default, and add it to the shipped ipythonrc file. Since
2497 true by default, and add it to the shipped ipythonrc file. Since
2493 this asks the user before proceeding, I think it's OK to make it
2498 this asks the user before proceeding, I think it's OK to make it
2494 true by default.
2499 true by default.
2495
2500
2496 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2501 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2497 of the previous special-casing of input in the eval loop. I think
2502 of the previous special-casing of input in the eval loop. I think
2498 this is cleaner, as they really are commands and shouldn't have
2503 this is cleaner, as they really are commands and shouldn't have
2499 a special role in the middle of the core code.
2504 a special role in the middle of the core code.
2500
2505
2501 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2506 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2502
2507
2503 * IPython/iplib.py (edit_syntax_error): added support for
2508 * IPython/iplib.py (edit_syntax_error): added support for
2504 automatically reopening the editor if the file had a syntax error
2509 automatically reopening the editor if the file had a syntax error
2505 in it. Thanks to scottt who provided the patch at:
2510 in it. Thanks to scottt who provided the patch at:
2506 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2511 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2507 version committed).
2512 version committed).
2508
2513
2509 * IPython/iplib.py (handle_normal): add suport for multi-line
2514 * IPython/iplib.py (handle_normal): add suport for multi-line
2510 input with emtpy lines. This fixes
2515 input with emtpy lines. This fixes
2511 http://www.scipy.net/roundup/ipython/issue43 and a similar
2516 http://www.scipy.net/roundup/ipython/issue43 and a similar
2512 discussion on the user list.
2517 discussion on the user list.
2513
2518
2514 WARNING: a behavior change is necessarily introduced to support
2519 WARNING: a behavior change is necessarily introduced to support
2515 blank lines: now a single blank line with whitespace does NOT
2520 blank lines: now a single blank line with whitespace does NOT
2516 break the input loop, which means that when autoindent is on, by
2521 break the input loop, which means that when autoindent is on, by
2517 default hitting return on the next (indented) line does NOT exit.
2522 default hitting return on the next (indented) line does NOT exit.
2518
2523
2519 Instead, to exit a multiline input you can either have:
2524 Instead, to exit a multiline input you can either have:
2520
2525
2521 - TWO whitespace lines (just hit return again), or
2526 - TWO whitespace lines (just hit return again), or
2522 - a single whitespace line of a different length than provided
2527 - a single whitespace line of a different length than provided
2523 by the autoindent (add or remove a space).
2528 by the autoindent (add or remove a space).
2524
2529
2525 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2530 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2526 module to better organize all readline-related functionality.
2531 module to better organize all readline-related functionality.
2527 I've deleted FlexCompleter and put all completion clases here.
2532 I've deleted FlexCompleter and put all completion clases here.
2528
2533
2529 * IPython/iplib.py (raw_input): improve indentation management.
2534 * IPython/iplib.py (raw_input): improve indentation management.
2530 It is now possible to paste indented code with autoindent on, and
2535 It is now possible to paste indented code with autoindent on, and
2531 the code is interpreted correctly (though it still looks bad on
2536 the code is interpreted correctly (though it still looks bad on
2532 screen, due to the line-oriented nature of ipython).
2537 screen, due to the line-oriented nature of ipython).
2533 (MagicCompleter.complete): change behavior so that a TAB key on an
2538 (MagicCompleter.complete): change behavior so that a TAB key on an
2534 otherwise empty line actually inserts a tab, instead of completing
2539 otherwise empty line actually inserts a tab, instead of completing
2535 on the entire global namespace. This makes it easier to use the
2540 on the entire global namespace. This makes it easier to use the
2536 TAB key for indentation. After a request by Hans Meine
2541 TAB key for indentation. After a request by Hans Meine
2537 <hans_meine-AT-gmx.net>
2542 <hans_meine-AT-gmx.net>
2538 (_prefilter): add support so that typing plain 'exit' or 'quit'
2543 (_prefilter): add support so that typing plain 'exit' or 'quit'
2539 does a sensible thing. Originally I tried to deviate as little as
2544 does a sensible thing. Originally I tried to deviate as little as
2540 possible from the default python behavior, but even that one may
2545 possible from the default python behavior, but even that one may
2541 change in this direction (thread on python-dev to that effect).
2546 change in this direction (thread on python-dev to that effect).
2542 Regardless, ipython should do the right thing even if CPython's
2547 Regardless, ipython should do the right thing even if CPython's
2543 '>>>' prompt doesn't.
2548 '>>>' prompt doesn't.
2544 (InteractiveShell): removed subclassing code.InteractiveConsole
2549 (InteractiveShell): removed subclassing code.InteractiveConsole
2545 class. By now we'd overridden just about all of its methods: I've
2550 class. By now we'd overridden just about all of its methods: I've
2546 copied the remaining two over, and now ipython is a standalone
2551 copied the remaining two over, and now ipython is a standalone
2547 class. This will provide a clearer picture for the chainsaw
2552 class. This will provide a clearer picture for the chainsaw
2548 branch refactoring.
2553 branch refactoring.
2549
2554
2550 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2555 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2551
2556
2552 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2557 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2553 failures for objects which break when dir() is called on them.
2558 failures for objects which break when dir() is called on them.
2554
2559
2555 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2560 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2556 distinct local and global namespaces in the completer API. This
2561 distinct local and global namespaces in the completer API. This
2557 change allows us to properly handle completion with distinct
2562 change allows us to properly handle completion with distinct
2558 scopes, including in embedded instances (this had never really
2563 scopes, including in embedded instances (this had never really
2559 worked correctly).
2564 worked correctly).
2560
2565
2561 Note: this introduces a change in the constructor for
2566 Note: this introduces a change in the constructor for
2562 MagicCompleter, as a new global_namespace parameter is now the
2567 MagicCompleter, as a new global_namespace parameter is now the
2563 second argument (the others were bumped one position).
2568 second argument (the others were bumped one position).
2564
2569
2565 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2570 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2566
2571
2567 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2572 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2568 embedded instances (which can be done now thanks to Vivian's
2573 embedded instances (which can be done now thanks to Vivian's
2569 frame-handling fixes for pdb).
2574 frame-handling fixes for pdb).
2570 (InteractiveShell.__init__): Fix namespace handling problem in
2575 (InteractiveShell.__init__): Fix namespace handling problem in
2571 embedded instances. We were overwriting __main__ unconditionally,
2576 embedded instances. We were overwriting __main__ unconditionally,
2572 and this should only be done for 'full' (non-embedded) IPython;
2577 and this should only be done for 'full' (non-embedded) IPython;
2573 embedded instances must respect the caller's __main__. Thanks to
2578 embedded instances must respect the caller's __main__. Thanks to
2574 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2579 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2575
2580
2576 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2581 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2577
2582
2578 * setup.py: added download_url to setup(). This registers the
2583 * setup.py: added download_url to setup(). This registers the
2579 download address at PyPI, which is not only useful to humans
2584 download address at PyPI, which is not only useful to humans
2580 browsing the site, but is also picked up by setuptools (the Eggs
2585 browsing the site, but is also picked up by setuptools (the Eggs
2581 machinery). Thanks to Ville and R. Kern for the info/discussion
2586 machinery). Thanks to Ville and R. Kern for the info/discussion
2582 on this.
2587 on this.
2583
2588
2584 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2589 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2585
2590
2586 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2591 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2587 This brings a lot of nice functionality to the pdb mode, which now
2592 This brings a lot of nice functionality to the pdb mode, which now
2588 has tab-completion, syntax highlighting, and better stack handling
2593 has tab-completion, syntax highlighting, and better stack handling
2589 than before. Many thanks to Vivian De Smedt
2594 than before. Many thanks to Vivian De Smedt
2590 <vivian-AT-vdesmedt.com> for the original patches.
2595 <vivian-AT-vdesmedt.com> for the original patches.
2591
2596
2592 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2597 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2593
2598
2594 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2599 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2595 sequence to consistently accept the banner argument. The
2600 sequence to consistently accept the banner argument. The
2596 inconsistency was tripping SAGE, thanks to Gary Zablackis
2601 inconsistency was tripping SAGE, thanks to Gary Zablackis
2597 <gzabl-AT-yahoo.com> for the report.
2602 <gzabl-AT-yahoo.com> for the report.
2598
2603
2599 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2604 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2600
2605
2601 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2606 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2602 Fix bug where a naked 'alias' call in the ipythonrc file would
2607 Fix bug where a naked 'alias' call in the ipythonrc file would
2603 cause a crash. Bug reported by Jorgen Stenarson.
2608 cause a crash. Bug reported by Jorgen Stenarson.
2604
2609
2605 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2610 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2606
2611
2607 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2612 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2608 startup time.
2613 startup time.
2609
2614
2610 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2615 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2611 instances had introduced a bug with globals in normal code. Now
2616 instances had introduced a bug with globals in normal code. Now
2612 it's working in all cases.
2617 it's working in all cases.
2613
2618
2614 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2619 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2615 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2620 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2616 has been introduced to set the default case sensitivity of the
2621 has been introduced to set the default case sensitivity of the
2617 searches. Users can still select either mode at runtime on a
2622 searches. Users can still select either mode at runtime on a
2618 per-search basis.
2623 per-search basis.
2619
2624
2620 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2625 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2621
2626
2622 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2627 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2623 attributes in wildcard searches for subclasses. Modified version
2628 attributes in wildcard searches for subclasses. Modified version
2624 of a patch by Jorgen.
2629 of a patch by Jorgen.
2625
2630
2626 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2631 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2627
2632
2628 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2633 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2629 embedded instances. I added a user_global_ns attribute to the
2634 embedded instances. I added a user_global_ns attribute to the
2630 InteractiveShell class to handle this.
2635 InteractiveShell class to handle this.
2631
2636
2632 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2637 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2633
2638
2634 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2639 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2635 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2640 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2636 (reported under win32, but may happen also in other platforms).
2641 (reported under win32, but may happen also in other platforms).
2637 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2642 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2638
2643
2639 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2644 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2640
2645
2641 * IPython/Magic.py (magic_psearch): new support for wildcard
2646 * IPython/Magic.py (magic_psearch): new support for wildcard
2642 patterns. Now, typing ?a*b will list all names which begin with a
2647 patterns. Now, typing ?a*b will list all names which begin with a
2643 and end in b, for example. The %psearch magic has full
2648 and end in b, for example. The %psearch magic has full
2644 docstrings. Many thanks to JΓΆrgen Stenarson
2649 docstrings. Many thanks to JΓΆrgen Stenarson
2645 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2650 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2646 implementing this functionality.
2651 implementing this functionality.
2647
2652
2648 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2653 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2649
2654
2650 * Manual: fixed long-standing annoyance of double-dashes (as in
2655 * Manual: fixed long-standing annoyance of double-dashes (as in
2651 --prefix=~, for example) being stripped in the HTML version. This
2656 --prefix=~, for example) being stripped in the HTML version. This
2652 is a latex2html bug, but a workaround was provided. Many thanks
2657 is a latex2html bug, but a workaround was provided. Many thanks
2653 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2658 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2654 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2659 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2655 rolling. This seemingly small issue had tripped a number of users
2660 rolling. This seemingly small issue had tripped a number of users
2656 when first installing, so I'm glad to see it gone.
2661 when first installing, so I'm glad to see it gone.
2657
2662
2658 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2663 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2659
2664
2660 * IPython/Extensions/numeric_formats.py: fix missing import,
2665 * IPython/Extensions/numeric_formats.py: fix missing import,
2661 reported by Stephen Walton.
2666 reported by Stephen Walton.
2662
2667
2663 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2668 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2664
2669
2665 * IPython/demo.py: finish demo module, fully documented now.
2670 * IPython/demo.py: finish demo module, fully documented now.
2666
2671
2667 * IPython/genutils.py (file_read): simple little utility to read a
2672 * IPython/genutils.py (file_read): simple little utility to read a
2668 file and ensure it's closed afterwards.
2673 file and ensure it's closed afterwards.
2669
2674
2670 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2675 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2671
2676
2672 * IPython/demo.py (Demo.__init__): added support for individually
2677 * IPython/demo.py (Demo.__init__): added support for individually
2673 tagging blocks for automatic execution.
2678 tagging blocks for automatic execution.
2674
2679
2675 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2680 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2676 syntax-highlighted python sources, requested by John.
2681 syntax-highlighted python sources, requested by John.
2677
2682
2678 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2683 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2679
2684
2680 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2685 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2681 finishing.
2686 finishing.
2682
2687
2683 * IPython/genutils.py (shlex_split): moved from Magic to here,
2688 * IPython/genutils.py (shlex_split): moved from Magic to here,
2684 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2689 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2685
2690
2686 * IPython/demo.py (Demo.__init__): added support for silent
2691 * IPython/demo.py (Demo.__init__): added support for silent
2687 blocks, improved marks as regexps, docstrings written.
2692 blocks, improved marks as regexps, docstrings written.
2688 (Demo.__init__): better docstring, added support for sys.argv.
2693 (Demo.__init__): better docstring, added support for sys.argv.
2689
2694
2690 * IPython/genutils.py (marquee): little utility used by the demo
2695 * IPython/genutils.py (marquee): little utility used by the demo
2691 code, handy in general.
2696 code, handy in general.
2692
2697
2693 * IPython/demo.py (Demo.__init__): new class for interactive
2698 * IPython/demo.py (Demo.__init__): new class for interactive
2694 demos. Not documented yet, I just wrote it in a hurry for
2699 demos. Not documented yet, I just wrote it in a hurry for
2695 scipy'05. Will docstring later.
2700 scipy'05. Will docstring later.
2696
2701
2697 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2702 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2698
2703
2699 * IPython/Shell.py (sigint_handler): Drastic simplification which
2704 * IPython/Shell.py (sigint_handler): Drastic simplification which
2700 also seems to make Ctrl-C work correctly across threads! This is
2705 also seems to make Ctrl-C work correctly across threads! This is
2701 so simple, that I can't beleive I'd missed it before. Needs more
2706 so simple, that I can't beleive I'd missed it before. Needs more
2702 testing, though.
2707 testing, though.
2703 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2708 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2704 like this before...
2709 like this before...
2705
2710
2706 * IPython/genutils.py (get_home_dir): add protection against
2711 * IPython/genutils.py (get_home_dir): add protection against
2707 non-dirs in win32 registry.
2712 non-dirs in win32 registry.
2708
2713
2709 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2714 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2710 bug where dict was mutated while iterating (pysh crash).
2715 bug where dict was mutated while iterating (pysh crash).
2711
2716
2712 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2717 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2713
2718
2714 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2719 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2715 spurious newlines added by this routine. After a report by
2720 spurious newlines added by this routine. After a report by
2716 F. Mantegazza.
2721 F. Mantegazza.
2717
2722
2718 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2723 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2719
2724
2720 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2725 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2721 calls. These were a leftover from the GTK 1.x days, and can cause
2726 calls. These were a leftover from the GTK 1.x days, and can cause
2722 problems in certain cases (after a report by John Hunter).
2727 problems in certain cases (after a report by John Hunter).
2723
2728
2724 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2729 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2725 os.getcwd() fails at init time. Thanks to patch from David Remahl
2730 os.getcwd() fails at init time. Thanks to patch from David Remahl
2726 <chmod007-AT-mac.com>.
2731 <chmod007-AT-mac.com>.
2727 (InteractiveShell.__init__): prevent certain special magics from
2732 (InteractiveShell.__init__): prevent certain special magics from
2728 being shadowed by aliases. Closes
2733 being shadowed by aliases. Closes
2729 http://www.scipy.net/roundup/ipython/issue41.
2734 http://www.scipy.net/roundup/ipython/issue41.
2730
2735
2731 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2736 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2732
2737
2733 * IPython/iplib.py (InteractiveShell.complete): Added new
2738 * IPython/iplib.py (InteractiveShell.complete): Added new
2734 top-level completion method to expose the completion mechanism
2739 top-level completion method to expose the completion mechanism
2735 beyond readline-based environments.
2740 beyond readline-based environments.
2736
2741
2737 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2742 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2738
2743
2739 * tools/ipsvnc (svnversion): fix svnversion capture.
2744 * tools/ipsvnc (svnversion): fix svnversion capture.
2740
2745
2741 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2746 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2742 attribute to self, which was missing. Before, it was set by a
2747 attribute to self, which was missing. Before, it was set by a
2743 routine which in certain cases wasn't being called, so the
2748 routine which in certain cases wasn't being called, so the
2744 instance could end up missing the attribute. This caused a crash.
2749 instance could end up missing the attribute. This caused a crash.
2745 Closes http://www.scipy.net/roundup/ipython/issue40.
2750 Closes http://www.scipy.net/roundup/ipython/issue40.
2746
2751
2747 2005-08-16 Fernando Perez <fperez@colorado.edu>
2752 2005-08-16 Fernando Perez <fperez@colorado.edu>
2748
2753
2749 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2754 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2750 contains non-string attribute. Closes
2755 contains non-string attribute. Closes
2751 http://www.scipy.net/roundup/ipython/issue38.
2756 http://www.scipy.net/roundup/ipython/issue38.
2752
2757
2753 2005-08-14 Fernando Perez <fperez@colorado.edu>
2758 2005-08-14 Fernando Perez <fperez@colorado.edu>
2754
2759
2755 * tools/ipsvnc: Minor improvements, to add changeset info.
2760 * tools/ipsvnc: Minor improvements, to add changeset info.
2756
2761
2757 2005-08-12 Fernando Perez <fperez@colorado.edu>
2762 2005-08-12 Fernando Perez <fperez@colorado.edu>
2758
2763
2759 * IPython/iplib.py (runsource): remove self.code_to_run_src
2764 * IPython/iplib.py (runsource): remove self.code_to_run_src
2760 attribute. I realized this is nothing more than
2765 attribute. I realized this is nothing more than
2761 '\n'.join(self.buffer), and having the same data in two different
2766 '\n'.join(self.buffer), and having the same data in two different
2762 places is just asking for synchronization bugs. This may impact
2767 places is just asking for synchronization bugs. This may impact
2763 people who have custom exception handlers, so I need to warn
2768 people who have custom exception handlers, so I need to warn
2764 ipython-dev about it (F. Mantegazza may use them).
2769 ipython-dev about it (F. Mantegazza may use them).
2765
2770
2766 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2771 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2767
2772
2768 * IPython/genutils.py: fix 2.2 compatibility (generators)
2773 * IPython/genutils.py: fix 2.2 compatibility (generators)
2769
2774
2770 2005-07-18 Fernando Perez <fperez@colorado.edu>
2775 2005-07-18 Fernando Perez <fperez@colorado.edu>
2771
2776
2772 * IPython/genutils.py (get_home_dir): fix to help users with
2777 * IPython/genutils.py (get_home_dir): fix to help users with
2773 invalid $HOME under win32.
2778 invalid $HOME under win32.
2774
2779
2775 2005-07-17 Fernando Perez <fperez@colorado.edu>
2780 2005-07-17 Fernando Perez <fperez@colorado.edu>
2776
2781
2777 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2782 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2778 some old hacks and clean up a bit other routines; code should be
2783 some old hacks and clean up a bit other routines; code should be
2779 simpler and a bit faster.
2784 simpler and a bit faster.
2780
2785
2781 * IPython/iplib.py (interact): removed some last-resort attempts
2786 * IPython/iplib.py (interact): removed some last-resort attempts
2782 to survive broken stdout/stderr. That code was only making it
2787 to survive broken stdout/stderr. That code was only making it
2783 harder to abstract out the i/o (necessary for gui integration),
2788 harder to abstract out the i/o (necessary for gui integration),
2784 and the crashes it could prevent were extremely rare in practice
2789 and the crashes it could prevent were extremely rare in practice
2785 (besides being fully user-induced in a pretty violent manner).
2790 (besides being fully user-induced in a pretty violent manner).
2786
2791
2787 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2792 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2788 Nothing major yet, but the code is simpler to read; this should
2793 Nothing major yet, but the code is simpler to read; this should
2789 make it easier to do more serious modifications in the future.
2794 make it easier to do more serious modifications in the future.
2790
2795
2791 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2796 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2792 which broke in .15 (thanks to a report by Ville).
2797 which broke in .15 (thanks to a report by Ville).
2793
2798
2794 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2799 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2795 be quite correct, I know next to nothing about unicode). This
2800 be quite correct, I know next to nothing about unicode). This
2796 will allow unicode strings to be used in prompts, amongst other
2801 will allow unicode strings to be used in prompts, amongst other
2797 cases. It also will prevent ipython from crashing when unicode
2802 cases. It also will prevent ipython from crashing when unicode
2798 shows up unexpectedly in many places. If ascii encoding fails, we
2803 shows up unexpectedly in many places. If ascii encoding fails, we
2799 assume utf_8. Currently the encoding is not a user-visible
2804 assume utf_8. Currently the encoding is not a user-visible
2800 setting, though it could be made so if there is demand for it.
2805 setting, though it could be made so if there is demand for it.
2801
2806
2802 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2807 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2803
2808
2804 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2809 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2805
2810
2806 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2811 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2807
2812
2808 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2813 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2809 code can work transparently for 2.2/2.3.
2814 code can work transparently for 2.2/2.3.
2810
2815
2811 2005-07-16 Fernando Perez <fperez@colorado.edu>
2816 2005-07-16 Fernando Perez <fperez@colorado.edu>
2812
2817
2813 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2818 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2814 out of the color scheme table used for coloring exception
2819 out of the color scheme table used for coloring exception
2815 tracebacks. This allows user code to add new schemes at runtime.
2820 tracebacks. This allows user code to add new schemes at runtime.
2816 This is a minimally modified version of the patch at
2821 This is a minimally modified version of the patch at
2817 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2822 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2818 for the contribution.
2823 for the contribution.
2819
2824
2820 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2825 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2821 slightly modified version of the patch in
2826 slightly modified version of the patch in
2822 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2827 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2823 to remove the previous try/except solution (which was costlier).
2828 to remove the previous try/except solution (which was costlier).
2824 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2829 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2825
2830
2826 2005-06-08 Fernando Perez <fperez@colorado.edu>
2831 2005-06-08 Fernando Perez <fperez@colorado.edu>
2827
2832
2828 * IPython/iplib.py (write/write_err): Add methods to abstract all
2833 * IPython/iplib.py (write/write_err): Add methods to abstract all
2829 I/O a bit more.
2834 I/O a bit more.
2830
2835
2831 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2836 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2832 warning, reported by Aric Hagberg, fix by JD Hunter.
2837 warning, reported by Aric Hagberg, fix by JD Hunter.
2833
2838
2834 2005-06-02 *** Released version 0.6.15
2839 2005-06-02 *** Released version 0.6.15
2835
2840
2836 2005-06-01 Fernando Perez <fperez@colorado.edu>
2841 2005-06-01 Fernando Perez <fperez@colorado.edu>
2837
2842
2838 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2843 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2839 tab-completion of filenames within open-quoted strings. Note that
2844 tab-completion of filenames within open-quoted strings. Note that
2840 this requires that in ~/.ipython/ipythonrc, users change the
2845 this requires that in ~/.ipython/ipythonrc, users change the
2841 readline delimiters configuration to read:
2846 readline delimiters configuration to read:
2842
2847
2843 readline_remove_delims -/~
2848 readline_remove_delims -/~
2844
2849
2845
2850
2846 2005-05-31 *** Released version 0.6.14
2851 2005-05-31 *** Released version 0.6.14
2847
2852
2848 2005-05-29 Fernando Perez <fperez@colorado.edu>
2853 2005-05-29 Fernando Perez <fperez@colorado.edu>
2849
2854
2850 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2855 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2851 with files not on the filesystem. Reported by Eliyahu Sandler
2856 with files not on the filesystem. Reported by Eliyahu Sandler
2852 <eli@gondolin.net>
2857 <eli@gondolin.net>
2853
2858
2854 2005-05-22 Fernando Perez <fperez@colorado.edu>
2859 2005-05-22 Fernando Perez <fperez@colorado.edu>
2855
2860
2856 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2861 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2857 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2862 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2858
2863
2859 2005-05-19 Fernando Perez <fperez@colorado.edu>
2864 2005-05-19 Fernando Perez <fperez@colorado.edu>
2860
2865
2861 * IPython/iplib.py (safe_execfile): close a file which could be
2866 * IPython/iplib.py (safe_execfile): close a file which could be
2862 left open (causing problems in win32, which locks open files).
2867 left open (causing problems in win32, which locks open files).
2863 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2868 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2864
2869
2865 2005-05-18 Fernando Perez <fperez@colorado.edu>
2870 2005-05-18 Fernando Perez <fperez@colorado.edu>
2866
2871
2867 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2872 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2868 keyword arguments correctly to safe_execfile().
2873 keyword arguments correctly to safe_execfile().
2869
2874
2870 2005-05-13 Fernando Perez <fperez@colorado.edu>
2875 2005-05-13 Fernando Perez <fperez@colorado.edu>
2871
2876
2872 * ipython.1: Added info about Qt to manpage, and threads warning
2877 * ipython.1: Added info about Qt to manpage, and threads warning
2873 to usage page (invoked with --help).
2878 to usage page (invoked with --help).
2874
2879
2875 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2880 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2876 new matcher (it goes at the end of the priority list) to do
2881 new matcher (it goes at the end of the priority list) to do
2877 tab-completion on named function arguments. Submitted by George
2882 tab-completion on named function arguments. Submitted by George
2878 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2883 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2879 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2884 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2880 for more details.
2885 for more details.
2881
2886
2882 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2887 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2883 SystemExit exceptions in the script being run. Thanks to a report
2888 SystemExit exceptions in the script being run. Thanks to a report
2884 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2889 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2885 producing very annoying behavior when running unit tests.
2890 producing very annoying behavior when running unit tests.
2886
2891
2887 2005-05-12 Fernando Perez <fperez@colorado.edu>
2892 2005-05-12 Fernando Perez <fperez@colorado.edu>
2888
2893
2889 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2894 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2890 which I'd broken (again) due to a changed regexp. In the process,
2895 which I'd broken (again) due to a changed regexp. In the process,
2891 added ';' as an escape to auto-quote the whole line without
2896 added ';' as an escape to auto-quote the whole line without
2892 splitting its arguments. Thanks to a report by Jerry McRae
2897 splitting its arguments. Thanks to a report by Jerry McRae
2893 <qrs0xyc02-AT-sneakemail.com>.
2898 <qrs0xyc02-AT-sneakemail.com>.
2894
2899
2895 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2900 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2896 possible crashes caused by a TokenError. Reported by Ed Schofield
2901 possible crashes caused by a TokenError. Reported by Ed Schofield
2897 <schofield-AT-ftw.at>.
2902 <schofield-AT-ftw.at>.
2898
2903
2899 2005-05-06 Fernando Perez <fperez@colorado.edu>
2904 2005-05-06 Fernando Perez <fperez@colorado.edu>
2900
2905
2901 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2906 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2902
2907
2903 2005-04-29 Fernando Perez <fperez@colorado.edu>
2908 2005-04-29 Fernando Perez <fperez@colorado.edu>
2904
2909
2905 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2910 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2906 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2911 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2907 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2912 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2908 which provides support for Qt interactive usage (similar to the
2913 which provides support for Qt interactive usage (similar to the
2909 existing one for WX and GTK). This had been often requested.
2914 existing one for WX and GTK). This had been often requested.
2910
2915
2911 2005-04-14 *** Released version 0.6.13
2916 2005-04-14 *** Released version 0.6.13
2912
2917
2913 2005-04-08 Fernando Perez <fperez@colorado.edu>
2918 2005-04-08 Fernando Perez <fperez@colorado.edu>
2914
2919
2915 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2920 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2916 from _ofind, which gets called on almost every input line. Now,
2921 from _ofind, which gets called on almost every input line. Now,
2917 we only try to get docstrings if they are actually going to be
2922 we only try to get docstrings if they are actually going to be
2918 used (the overhead of fetching unnecessary docstrings can be
2923 used (the overhead of fetching unnecessary docstrings can be
2919 noticeable for certain objects, such as Pyro proxies).
2924 noticeable for certain objects, such as Pyro proxies).
2920
2925
2921 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2926 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2922 for completers. For some reason I had been passing them the state
2927 for completers. For some reason I had been passing them the state
2923 variable, which completers never actually need, and was in
2928 variable, which completers never actually need, and was in
2924 conflict with the rlcompleter API. Custom completers ONLY need to
2929 conflict with the rlcompleter API. Custom completers ONLY need to
2925 take the text parameter.
2930 take the text parameter.
2926
2931
2927 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2932 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2928 work correctly in pysh. I've also moved all the logic which used
2933 work correctly in pysh. I've also moved all the logic which used
2929 to be in pysh.py here, which will prevent problems with future
2934 to be in pysh.py here, which will prevent problems with future
2930 upgrades. However, this time I must warn users to update their
2935 upgrades. However, this time I must warn users to update their
2931 pysh profile to include the line
2936 pysh profile to include the line
2932
2937
2933 import_all IPython.Extensions.InterpreterExec
2938 import_all IPython.Extensions.InterpreterExec
2934
2939
2935 because otherwise things won't work for them. They MUST also
2940 because otherwise things won't work for them. They MUST also
2936 delete pysh.py and the line
2941 delete pysh.py and the line
2937
2942
2938 execfile pysh.py
2943 execfile pysh.py
2939
2944
2940 from their ipythonrc-pysh.
2945 from their ipythonrc-pysh.
2941
2946
2942 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2947 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2943 robust in the face of objects whose dir() returns non-strings
2948 robust in the face of objects whose dir() returns non-strings
2944 (which it shouldn't, but some broken libs like ITK do). Thanks to
2949 (which it shouldn't, but some broken libs like ITK do). Thanks to
2945 a patch by John Hunter (implemented differently, though). Also
2950 a patch by John Hunter (implemented differently, though). Also
2946 minor improvements by using .extend instead of + on lists.
2951 minor improvements by using .extend instead of + on lists.
2947
2952
2948 * pysh.py:
2953 * pysh.py:
2949
2954
2950 2005-04-06 Fernando Perez <fperez@colorado.edu>
2955 2005-04-06 Fernando Perez <fperez@colorado.edu>
2951
2956
2952 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2957 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2953 by default, so that all users benefit from it. Those who don't
2958 by default, so that all users benefit from it. Those who don't
2954 want it can still turn it off.
2959 want it can still turn it off.
2955
2960
2956 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2961 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2957 config file, I'd forgotten about this, so users were getting it
2962 config file, I'd forgotten about this, so users were getting it
2958 off by default.
2963 off by default.
2959
2964
2960 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2965 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2961 consistency. Now magics can be called in multiline statements,
2966 consistency. Now magics can be called in multiline statements,
2962 and python variables can be expanded in magic calls via $var.
2967 and python variables can be expanded in magic calls via $var.
2963 This makes the magic system behave just like aliases or !system
2968 This makes the magic system behave just like aliases or !system
2964 calls.
2969 calls.
2965
2970
2966 2005-03-28 Fernando Perez <fperez@colorado.edu>
2971 2005-03-28 Fernando Perez <fperez@colorado.edu>
2967
2972
2968 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2973 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2969 expensive string additions for building command. Add support for
2974 expensive string additions for building command. Add support for
2970 trailing ';' when autocall is used.
2975 trailing ';' when autocall is used.
2971
2976
2972 2005-03-26 Fernando Perez <fperez@colorado.edu>
2977 2005-03-26 Fernando Perez <fperez@colorado.edu>
2973
2978
2974 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2979 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2975 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2980 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2976 ipython.el robust against prompts with any number of spaces
2981 ipython.el robust against prompts with any number of spaces
2977 (including 0) after the ':' character.
2982 (including 0) after the ':' character.
2978
2983
2979 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2984 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2980 continuation prompt, which misled users to think the line was
2985 continuation prompt, which misled users to think the line was
2981 already indented. Closes debian Bug#300847, reported to me by
2986 already indented. Closes debian Bug#300847, reported to me by
2982 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2987 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2983
2988
2984 2005-03-23 Fernando Perez <fperez@colorado.edu>
2989 2005-03-23 Fernando Perez <fperez@colorado.edu>
2985
2990
2986 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2991 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2987 properly aligned if they have embedded newlines.
2992 properly aligned if they have embedded newlines.
2988
2993
2989 * IPython/iplib.py (runlines): Add a public method to expose
2994 * IPython/iplib.py (runlines): Add a public method to expose
2990 IPython's code execution machinery, so that users can run strings
2995 IPython's code execution machinery, so that users can run strings
2991 as if they had been typed at the prompt interactively.
2996 as if they had been typed at the prompt interactively.
2992 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2997 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2993 methods which can call the system shell, but with python variable
2998 methods which can call the system shell, but with python variable
2994 expansion. The three such methods are: __IPYTHON__.system,
2999 expansion. The three such methods are: __IPYTHON__.system,
2995 .getoutput and .getoutputerror. These need to be documented in a
3000 .getoutput and .getoutputerror. These need to be documented in a
2996 'public API' section (to be written) of the manual.
3001 'public API' section (to be written) of the manual.
2997
3002
2998 2005-03-20 Fernando Perez <fperez@colorado.edu>
3003 2005-03-20 Fernando Perez <fperez@colorado.edu>
2999
3004
3000 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3005 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3001 for custom exception handling. This is quite powerful, and it
3006 for custom exception handling. This is quite powerful, and it
3002 allows for user-installable exception handlers which can trap
3007 allows for user-installable exception handlers which can trap
3003 custom exceptions at runtime and treat them separately from
3008 custom exceptions at runtime and treat them separately from
3004 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3009 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3005 Mantegazza <mantegazza-AT-ill.fr>.
3010 Mantegazza <mantegazza-AT-ill.fr>.
3006 (InteractiveShell.set_custom_completer): public API function to
3011 (InteractiveShell.set_custom_completer): public API function to
3007 add new completers at runtime.
3012 add new completers at runtime.
3008
3013
3009 2005-03-19 Fernando Perez <fperez@colorado.edu>
3014 2005-03-19 Fernando Perez <fperez@colorado.edu>
3010
3015
3011 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3016 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3012 allow objects which provide their docstrings via non-standard
3017 allow objects which provide their docstrings via non-standard
3013 mechanisms (like Pyro proxies) to still be inspected by ipython's
3018 mechanisms (like Pyro proxies) to still be inspected by ipython's
3014 ? system.
3019 ? system.
3015
3020
3016 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3021 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3017 automatic capture system. I tried quite hard to make it work
3022 automatic capture system. I tried quite hard to make it work
3018 reliably, and simply failed. I tried many combinations with the
3023 reliably, and simply failed. I tried many combinations with the
3019 subprocess module, but eventually nothing worked in all needed
3024 subprocess module, but eventually nothing worked in all needed
3020 cases (not blocking stdin for the child, duplicating stdout
3025 cases (not blocking stdin for the child, duplicating stdout
3021 without blocking, etc). The new %sc/%sx still do capture to these
3026 without blocking, etc). The new %sc/%sx still do capture to these
3022 magical list/string objects which make shell use much more
3027 magical list/string objects which make shell use much more
3023 conveninent, so not all is lost.
3028 conveninent, so not all is lost.
3024
3029
3025 XXX - FIX MANUAL for the change above!
3030 XXX - FIX MANUAL for the change above!
3026
3031
3027 (runsource): I copied code.py's runsource() into ipython to modify
3032 (runsource): I copied code.py's runsource() into ipython to modify
3028 it a bit. Now the code object and source to be executed are
3033 it a bit. Now the code object and source to be executed are
3029 stored in ipython. This makes this info accessible to third-party
3034 stored in ipython. This makes this info accessible to third-party
3030 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3035 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3031 Mantegazza <mantegazza-AT-ill.fr>.
3036 Mantegazza <mantegazza-AT-ill.fr>.
3032
3037
3033 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3038 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3034 history-search via readline (like C-p/C-n). I'd wanted this for a
3039 history-search via readline (like C-p/C-n). I'd wanted this for a
3035 long time, but only recently found out how to do it. For users
3040 long time, but only recently found out how to do it. For users
3036 who already have their ipythonrc files made and want this, just
3041 who already have their ipythonrc files made and want this, just
3037 add:
3042 add:
3038
3043
3039 readline_parse_and_bind "\e[A": history-search-backward
3044 readline_parse_and_bind "\e[A": history-search-backward
3040 readline_parse_and_bind "\e[B": history-search-forward
3045 readline_parse_and_bind "\e[B": history-search-forward
3041
3046
3042 2005-03-18 Fernando Perez <fperez@colorado.edu>
3047 2005-03-18 Fernando Perez <fperez@colorado.edu>
3043
3048
3044 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3049 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3045 LSString and SList classes which allow transparent conversions
3050 LSString and SList classes which allow transparent conversions
3046 between list mode and whitespace-separated string.
3051 between list mode and whitespace-separated string.
3047 (magic_r): Fix recursion problem in %r.
3052 (magic_r): Fix recursion problem in %r.
3048
3053
3049 * IPython/genutils.py (LSString): New class to be used for
3054 * IPython/genutils.py (LSString): New class to be used for
3050 automatic storage of the results of all alias/system calls in _o
3055 automatic storage of the results of all alias/system calls in _o
3051 and _e (stdout/err). These provide a .l/.list attribute which
3056 and _e (stdout/err). These provide a .l/.list attribute which
3052 does automatic splitting on newlines. This means that for most
3057 does automatic splitting on newlines. This means that for most
3053 uses, you'll never need to do capturing of output with %sc/%sx
3058 uses, you'll never need to do capturing of output with %sc/%sx
3054 anymore, since ipython keeps this always done for you. Note that
3059 anymore, since ipython keeps this always done for you. Note that
3055 only the LAST results are stored, the _o/e variables are
3060 only the LAST results are stored, the _o/e variables are
3056 overwritten on each call. If you need to save their contents
3061 overwritten on each call. If you need to save their contents
3057 further, simply bind them to any other name.
3062 further, simply bind them to any other name.
3058
3063
3059 2005-03-17 Fernando Perez <fperez@colorado.edu>
3064 2005-03-17 Fernando Perez <fperez@colorado.edu>
3060
3065
3061 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3066 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3062 prompt namespace handling.
3067 prompt namespace handling.
3063
3068
3064 2005-03-16 Fernando Perez <fperez@colorado.edu>
3069 2005-03-16 Fernando Perez <fperez@colorado.edu>
3065
3070
3066 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3071 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3067 classic prompts to be '>>> ' (final space was missing, and it
3072 classic prompts to be '>>> ' (final space was missing, and it
3068 trips the emacs python mode).
3073 trips the emacs python mode).
3069 (BasePrompt.__str__): Added safe support for dynamic prompt
3074 (BasePrompt.__str__): Added safe support for dynamic prompt
3070 strings. Now you can set your prompt string to be '$x', and the
3075 strings. Now you can set your prompt string to be '$x', and the
3071 value of x will be printed from your interactive namespace. The
3076 value of x will be printed from your interactive namespace. The
3072 interpolation syntax includes the full Itpl support, so
3077 interpolation syntax includes the full Itpl support, so
3073 ${foo()+x+bar()} is a valid prompt string now, and the function
3078 ${foo()+x+bar()} is a valid prompt string now, and the function
3074 calls will be made at runtime.
3079 calls will be made at runtime.
3075
3080
3076 2005-03-15 Fernando Perez <fperez@colorado.edu>
3081 2005-03-15 Fernando Perez <fperez@colorado.edu>
3077
3082
3078 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3083 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3079 avoid name clashes in pylab. %hist still works, it just forwards
3084 avoid name clashes in pylab. %hist still works, it just forwards
3080 the call to %history.
3085 the call to %history.
3081
3086
3082 2005-03-02 *** Released version 0.6.12
3087 2005-03-02 *** Released version 0.6.12
3083
3088
3084 2005-03-02 Fernando Perez <fperez@colorado.edu>
3089 2005-03-02 Fernando Perez <fperez@colorado.edu>
3085
3090
3086 * IPython/iplib.py (handle_magic): log magic calls properly as
3091 * IPython/iplib.py (handle_magic): log magic calls properly as
3087 ipmagic() function calls.
3092 ipmagic() function calls.
3088
3093
3089 * IPython/Magic.py (magic_time): Improved %time to support
3094 * IPython/Magic.py (magic_time): Improved %time to support
3090 statements and provide wall-clock as well as CPU time.
3095 statements and provide wall-clock as well as CPU time.
3091
3096
3092 2005-02-27 Fernando Perez <fperez@colorado.edu>
3097 2005-02-27 Fernando Perez <fperez@colorado.edu>
3093
3098
3094 * IPython/hooks.py: New hooks module, to expose user-modifiable
3099 * IPython/hooks.py: New hooks module, to expose user-modifiable
3095 IPython functionality in a clean manner. For now only the editor
3100 IPython functionality in a clean manner. For now only the editor
3096 hook is actually written, and other thigns which I intend to turn
3101 hook is actually written, and other thigns which I intend to turn
3097 into proper hooks aren't yet there. The display and prefilter
3102 into proper hooks aren't yet there. The display and prefilter
3098 stuff, for example, should be hooks. But at least now the
3103 stuff, for example, should be hooks. But at least now the
3099 framework is in place, and the rest can be moved here with more
3104 framework is in place, and the rest can be moved here with more
3100 time later. IPython had had a .hooks variable for a long time for
3105 time later. IPython had had a .hooks variable for a long time for
3101 this purpose, but I'd never actually used it for anything.
3106 this purpose, but I'd never actually used it for anything.
3102
3107
3103 2005-02-26 Fernando Perez <fperez@colorado.edu>
3108 2005-02-26 Fernando Perez <fperez@colorado.edu>
3104
3109
3105 * IPython/ipmaker.py (make_IPython): make the default ipython
3110 * IPython/ipmaker.py (make_IPython): make the default ipython
3106 directory be called _ipython under win32, to follow more the
3111 directory be called _ipython under win32, to follow more the
3107 naming peculiarities of that platform (where buggy software like
3112 naming peculiarities of that platform (where buggy software like
3108 Visual Sourcesafe breaks with .named directories). Reported by
3113 Visual Sourcesafe breaks with .named directories). Reported by
3109 Ville Vainio.
3114 Ville Vainio.
3110
3115
3111 2005-02-23 Fernando Perez <fperez@colorado.edu>
3116 2005-02-23 Fernando Perez <fperez@colorado.edu>
3112
3117
3113 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3118 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3114 auto_aliases for win32 which were causing problems. Users can
3119 auto_aliases for win32 which were causing problems. Users can
3115 define the ones they personally like.
3120 define the ones they personally like.
3116
3121
3117 2005-02-21 Fernando Perez <fperez@colorado.edu>
3122 2005-02-21 Fernando Perez <fperez@colorado.edu>
3118
3123
3119 * IPython/Magic.py (magic_time): new magic to time execution of
3124 * IPython/Magic.py (magic_time): new magic to time execution of
3120 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3125 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3121
3126
3122 2005-02-19 Fernando Perez <fperez@colorado.edu>
3127 2005-02-19 Fernando Perez <fperez@colorado.edu>
3123
3128
3124 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3129 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3125 into keys (for prompts, for example).
3130 into keys (for prompts, for example).
3126
3131
3127 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3132 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3128 prompts in case users want them. This introduces a small behavior
3133 prompts in case users want them. This introduces a small behavior
3129 change: ipython does not automatically add a space to all prompts
3134 change: ipython does not automatically add a space to all prompts
3130 anymore. To get the old prompts with a space, users should add it
3135 anymore. To get the old prompts with a space, users should add it
3131 manually to their ipythonrc file, so for example prompt_in1 should
3136 manually to their ipythonrc file, so for example prompt_in1 should
3132 now read 'In [\#]: ' instead of 'In [\#]:'.
3137 now read 'In [\#]: ' instead of 'In [\#]:'.
3133 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3138 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3134 file) to control left-padding of secondary prompts.
3139 file) to control left-padding of secondary prompts.
3135
3140
3136 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3141 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3137 the profiler can't be imported. Fix for Debian, which removed
3142 the profiler can't be imported. Fix for Debian, which removed
3138 profile.py because of License issues. I applied a slightly
3143 profile.py because of License issues. I applied a slightly
3139 modified version of the original Debian patch at
3144 modified version of the original Debian patch at
3140 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3145 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3141
3146
3142 2005-02-17 Fernando Perez <fperez@colorado.edu>
3147 2005-02-17 Fernando Perez <fperez@colorado.edu>
3143
3148
3144 * IPython/genutils.py (native_line_ends): Fix bug which would
3149 * IPython/genutils.py (native_line_ends): Fix bug which would
3145 cause improper line-ends under win32 b/c I was not opening files
3150 cause improper line-ends under win32 b/c I was not opening files
3146 in binary mode. Bug report and fix thanks to Ville.
3151 in binary mode. Bug report and fix thanks to Ville.
3147
3152
3148 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3153 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3149 trying to catch spurious foo[1] autocalls. My fix actually broke
3154 trying to catch spurious foo[1] autocalls. My fix actually broke
3150 ',/' autoquote/call with explicit escape (bad regexp).
3155 ',/' autoquote/call with explicit escape (bad regexp).
3151
3156
3152 2005-02-15 *** Released version 0.6.11
3157 2005-02-15 *** Released version 0.6.11
3153
3158
3154 2005-02-14 Fernando Perez <fperez@colorado.edu>
3159 2005-02-14 Fernando Perez <fperez@colorado.edu>
3155
3160
3156 * IPython/background_jobs.py: New background job management
3161 * IPython/background_jobs.py: New background job management
3157 subsystem. This is implemented via a new set of classes, and
3162 subsystem. This is implemented via a new set of classes, and
3158 IPython now provides a builtin 'jobs' object for background job
3163 IPython now provides a builtin 'jobs' object for background job
3159 execution. A convenience %bg magic serves as a lightweight
3164 execution. A convenience %bg magic serves as a lightweight
3160 frontend for starting the more common type of calls. This was
3165 frontend for starting the more common type of calls. This was
3161 inspired by discussions with B. Granger and the BackgroundCommand
3166 inspired by discussions with B. Granger and the BackgroundCommand
3162 class described in the book Python Scripting for Computational
3167 class described in the book Python Scripting for Computational
3163 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3168 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3164 (although ultimately no code from this text was used, as IPython's
3169 (although ultimately no code from this text was used, as IPython's
3165 system is a separate implementation).
3170 system is a separate implementation).
3166
3171
3167 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3172 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3168 to control the completion of single/double underscore names
3173 to control the completion of single/double underscore names
3169 separately. As documented in the example ipytonrc file, the
3174 separately. As documented in the example ipytonrc file, the
3170 readline_omit__names variable can now be set to 2, to omit even
3175 readline_omit__names variable can now be set to 2, to omit even
3171 single underscore names. Thanks to a patch by Brian Wong
3176 single underscore names. Thanks to a patch by Brian Wong
3172 <BrianWong-AT-AirgoNetworks.Com>.
3177 <BrianWong-AT-AirgoNetworks.Com>.
3173 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3178 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3174 be autocalled as foo([1]) if foo were callable. A problem for
3179 be autocalled as foo([1]) if foo were callable. A problem for
3175 things which are both callable and implement __getitem__.
3180 things which are both callable and implement __getitem__.
3176 (init_readline): Fix autoindentation for win32. Thanks to a patch
3181 (init_readline): Fix autoindentation for win32. Thanks to a patch
3177 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3182 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3178
3183
3179 2005-02-12 Fernando Perez <fperez@colorado.edu>
3184 2005-02-12 Fernando Perez <fperez@colorado.edu>
3180
3185
3181 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3186 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3182 which I had written long ago to sort out user error messages which
3187 which I had written long ago to sort out user error messages which
3183 may occur during startup. This seemed like a good idea initially,
3188 may occur during startup. This seemed like a good idea initially,
3184 but it has proven a disaster in retrospect. I don't want to
3189 but it has proven a disaster in retrospect. I don't want to
3185 change much code for now, so my fix is to set the internal 'debug'
3190 change much code for now, so my fix is to set the internal 'debug'
3186 flag to true everywhere, whose only job was precisely to control
3191 flag to true everywhere, whose only job was precisely to control
3187 this subsystem. This closes issue 28 (as well as avoiding all
3192 this subsystem. This closes issue 28 (as well as avoiding all
3188 sorts of strange hangups which occur from time to time).
3193 sorts of strange hangups which occur from time to time).
3189
3194
3190 2005-02-07 Fernando Perez <fperez@colorado.edu>
3195 2005-02-07 Fernando Perez <fperez@colorado.edu>
3191
3196
3192 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3197 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3193 previous call produced a syntax error.
3198 previous call produced a syntax error.
3194
3199
3195 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3200 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3196 classes without constructor.
3201 classes without constructor.
3197
3202
3198 2005-02-06 Fernando Perez <fperez@colorado.edu>
3203 2005-02-06 Fernando Perez <fperez@colorado.edu>
3199
3204
3200 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3205 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3201 completions with the results of each matcher, so we return results
3206 completions with the results of each matcher, so we return results
3202 to the user from all namespaces. This breaks with ipython
3207 to the user from all namespaces. This breaks with ipython
3203 tradition, but I think it's a nicer behavior. Now you get all
3208 tradition, but I think it's a nicer behavior. Now you get all
3204 possible completions listed, from all possible namespaces (python,
3209 possible completions listed, from all possible namespaces (python,
3205 filesystem, magics...) After a request by John Hunter
3210 filesystem, magics...) After a request by John Hunter
3206 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3211 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3207
3212
3208 2005-02-05 Fernando Perez <fperez@colorado.edu>
3213 2005-02-05 Fernando Perez <fperez@colorado.edu>
3209
3214
3210 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3215 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3211 the call had quote characters in it (the quotes were stripped).
3216 the call had quote characters in it (the quotes were stripped).
3212
3217
3213 2005-01-31 Fernando Perez <fperez@colorado.edu>
3218 2005-01-31 Fernando Perez <fperez@colorado.edu>
3214
3219
3215 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3220 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3216 Itpl.itpl() to make the code more robust against psyco
3221 Itpl.itpl() to make the code more robust against psyco
3217 optimizations.
3222 optimizations.
3218
3223
3219 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3224 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3220 of causing an exception. Quicker, cleaner.
3225 of causing an exception. Quicker, cleaner.
3221
3226
3222 2005-01-28 Fernando Perez <fperez@colorado.edu>
3227 2005-01-28 Fernando Perez <fperez@colorado.edu>
3223
3228
3224 * scripts/ipython_win_post_install.py (install): hardcode
3229 * scripts/ipython_win_post_install.py (install): hardcode
3225 sys.prefix+'python.exe' as the executable path. It turns out that
3230 sys.prefix+'python.exe' as the executable path. It turns out that
3226 during the post-installation run, sys.executable resolves to the
3231 during the post-installation run, sys.executable resolves to the
3227 name of the binary installer! I should report this as a distutils
3232 name of the binary installer! I should report this as a distutils
3228 bug, I think. I updated the .10 release with this tiny fix, to
3233 bug, I think. I updated the .10 release with this tiny fix, to
3229 avoid annoying the lists further.
3234 avoid annoying the lists further.
3230
3235
3231 2005-01-27 *** Released version 0.6.10
3236 2005-01-27 *** Released version 0.6.10
3232
3237
3233 2005-01-27 Fernando Perez <fperez@colorado.edu>
3238 2005-01-27 Fernando Perez <fperez@colorado.edu>
3234
3239
3235 * IPython/numutils.py (norm): Added 'inf' as optional name for
3240 * IPython/numutils.py (norm): Added 'inf' as optional name for
3236 L-infinity norm, included references to mathworld.com for vector
3241 L-infinity norm, included references to mathworld.com for vector
3237 norm definitions.
3242 norm definitions.
3238 (amin/amax): added amin/amax for array min/max. Similar to what
3243 (amin/amax): added amin/amax for array min/max. Similar to what
3239 pylab ships with after the recent reorganization of names.
3244 pylab ships with after the recent reorganization of names.
3240 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3245 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3241
3246
3242 * ipython.el: committed Alex's recent fixes and improvements.
3247 * ipython.el: committed Alex's recent fixes and improvements.
3243 Tested with python-mode from CVS, and it looks excellent. Since
3248 Tested with python-mode from CVS, and it looks excellent. Since
3244 python-mode hasn't released anything in a while, I'm temporarily
3249 python-mode hasn't released anything in a while, I'm temporarily
3245 putting a copy of today's CVS (v 4.70) of python-mode in:
3250 putting a copy of today's CVS (v 4.70) of python-mode in:
3246 http://ipython.scipy.org/tmp/python-mode.el
3251 http://ipython.scipy.org/tmp/python-mode.el
3247
3252
3248 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3253 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3249 sys.executable for the executable name, instead of assuming it's
3254 sys.executable for the executable name, instead of assuming it's
3250 called 'python.exe' (the post-installer would have produced broken
3255 called 'python.exe' (the post-installer would have produced broken
3251 setups on systems with a differently named python binary).
3256 setups on systems with a differently named python binary).
3252
3257
3253 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3258 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3254 references to os.linesep, to make the code more
3259 references to os.linesep, to make the code more
3255 platform-independent. This is also part of the win32 coloring
3260 platform-independent. This is also part of the win32 coloring
3256 fixes.
3261 fixes.
3257
3262
3258 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3263 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3259 lines, which actually cause coloring bugs because the length of
3264 lines, which actually cause coloring bugs because the length of
3260 the line is very difficult to correctly compute with embedded
3265 the line is very difficult to correctly compute with embedded
3261 escapes. This was the source of all the coloring problems under
3266 escapes. This was the source of all the coloring problems under
3262 Win32. I think that _finally_, Win32 users have a properly
3267 Win32. I think that _finally_, Win32 users have a properly
3263 working ipython in all respects. This would never have happened
3268 working ipython in all respects. This would never have happened
3264 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3269 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3265
3270
3266 2005-01-26 *** Released version 0.6.9
3271 2005-01-26 *** Released version 0.6.9
3267
3272
3268 2005-01-25 Fernando Perez <fperez@colorado.edu>
3273 2005-01-25 Fernando Perez <fperez@colorado.edu>
3269
3274
3270 * setup.py: finally, we have a true Windows installer, thanks to
3275 * setup.py: finally, we have a true Windows installer, thanks to
3271 the excellent work of Viktor Ransmayr
3276 the excellent work of Viktor Ransmayr
3272 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3277 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3273 Windows users. The setup routine is quite a bit cleaner thanks to
3278 Windows users. The setup routine is quite a bit cleaner thanks to
3274 this, and the post-install script uses the proper functions to
3279 this, and the post-install script uses the proper functions to
3275 allow a clean de-installation using the standard Windows Control
3280 allow a clean de-installation using the standard Windows Control
3276 Panel.
3281 Panel.
3277
3282
3278 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3283 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3279 environment variable under all OSes (including win32) if
3284 environment variable under all OSes (including win32) if
3280 available. This will give consistency to win32 users who have set
3285 available. This will give consistency to win32 users who have set
3281 this variable for any reason. If os.environ['HOME'] fails, the
3286 this variable for any reason. If os.environ['HOME'] fails, the
3282 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3287 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3283
3288
3284 2005-01-24 Fernando Perez <fperez@colorado.edu>
3289 2005-01-24 Fernando Perez <fperez@colorado.edu>
3285
3290
3286 * IPython/numutils.py (empty_like): add empty_like(), similar to
3291 * IPython/numutils.py (empty_like): add empty_like(), similar to
3287 zeros_like() but taking advantage of the new empty() Numeric routine.
3292 zeros_like() but taking advantage of the new empty() Numeric routine.
3288
3293
3289 2005-01-23 *** Released version 0.6.8
3294 2005-01-23 *** Released version 0.6.8
3290
3295
3291 2005-01-22 Fernando Perez <fperez@colorado.edu>
3296 2005-01-22 Fernando Perez <fperez@colorado.edu>
3292
3297
3293 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3298 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3294 automatic show() calls. After discussing things with JDH, it
3299 automatic show() calls. After discussing things with JDH, it
3295 turns out there are too many corner cases where this can go wrong.
3300 turns out there are too many corner cases where this can go wrong.
3296 It's best not to try to be 'too smart', and simply have ipython
3301 It's best not to try to be 'too smart', and simply have ipython
3297 reproduce as much as possible the default behavior of a normal
3302 reproduce as much as possible the default behavior of a normal
3298 python shell.
3303 python shell.
3299
3304
3300 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3305 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3301 line-splitting regexp and _prefilter() to avoid calling getattr()
3306 line-splitting regexp and _prefilter() to avoid calling getattr()
3302 on assignments. This closes
3307 on assignments. This closes
3303 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3308 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3304 readline uses getattr(), so a simple <TAB> keypress is still
3309 readline uses getattr(), so a simple <TAB> keypress is still
3305 enough to trigger getattr() calls on an object.
3310 enough to trigger getattr() calls on an object.
3306
3311
3307 2005-01-21 Fernando Perez <fperez@colorado.edu>
3312 2005-01-21 Fernando Perez <fperez@colorado.edu>
3308
3313
3309 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3314 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3310 docstring under pylab so it doesn't mask the original.
3315 docstring under pylab so it doesn't mask the original.
3311
3316
3312 2005-01-21 *** Released version 0.6.7
3317 2005-01-21 *** Released version 0.6.7
3313
3318
3314 2005-01-21 Fernando Perez <fperez@colorado.edu>
3319 2005-01-21 Fernando Perez <fperez@colorado.edu>
3315
3320
3316 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3321 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3317 signal handling for win32 users in multithreaded mode.
3322 signal handling for win32 users in multithreaded mode.
3318
3323
3319 2005-01-17 Fernando Perez <fperez@colorado.edu>
3324 2005-01-17 Fernando Perez <fperez@colorado.edu>
3320
3325
3321 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3326 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3322 instances with no __init__. After a crash report by Norbert Nemec
3327 instances with no __init__. After a crash report by Norbert Nemec
3323 <Norbert-AT-nemec-online.de>.
3328 <Norbert-AT-nemec-online.de>.
3324
3329
3325 2005-01-14 Fernando Perez <fperez@colorado.edu>
3330 2005-01-14 Fernando Perez <fperez@colorado.edu>
3326
3331
3327 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3332 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3328 names for verbose exceptions, when multiple dotted names and the
3333 names for verbose exceptions, when multiple dotted names and the
3329 'parent' object were present on the same line.
3334 'parent' object were present on the same line.
3330
3335
3331 2005-01-11 Fernando Perez <fperez@colorado.edu>
3336 2005-01-11 Fernando Perez <fperez@colorado.edu>
3332
3337
3333 * IPython/genutils.py (flag_calls): new utility to trap and flag
3338 * IPython/genutils.py (flag_calls): new utility to trap and flag
3334 calls in functions. I need it to clean up matplotlib support.
3339 calls in functions. I need it to clean up matplotlib support.
3335 Also removed some deprecated code in genutils.
3340 Also removed some deprecated code in genutils.
3336
3341
3337 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3342 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3338 that matplotlib scripts called with %run, which don't call show()
3343 that matplotlib scripts called with %run, which don't call show()
3339 themselves, still have their plotting windows open.
3344 themselves, still have their plotting windows open.
3340
3345
3341 2005-01-05 Fernando Perez <fperez@colorado.edu>
3346 2005-01-05 Fernando Perez <fperez@colorado.edu>
3342
3347
3343 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3348 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3344 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3349 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3345
3350
3346 2004-12-19 Fernando Perez <fperez@colorado.edu>
3351 2004-12-19 Fernando Perez <fperez@colorado.edu>
3347
3352
3348 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3353 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3349 parent_runcode, which was an eyesore. The same result can be
3354 parent_runcode, which was an eyesore. The same result can be
3350 obtained with Python's regular superclass mechanisms.
3355 obtained with Python's regular superclass mechanisms.
3351
3356
3352 2004-12-17 Fernando Perez <fperez@colorado.edu>
3357 2004-12-17 Fernando Perez <fperez@colorado.edu>
3353
3358
3354 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3359 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3355 reported by Prabhu.
3360 reported by Prabhu.
3356 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3361 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3357 sys.stderr) instead of explicitly calling sys.stderr. This helps
3362 sys.stderr) instead of explicitly calling sys.stderr. This helps
3358 maintain our I/O abstractions clean, for future GUI embeddings.
3363 maintain our I/O abstractions clean, for future GUI embeddings.
3359
3364
3360 * IPython/genutils.py (info): added new utility for sys.stderr
3365 * IPython/genutils.py (info): added new utility for sys.stderr
3361 unified info message handling (thin wrapper around warn()).
3366 unified info message handling (thin wrapper around warn()).
3362
3367
3363 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3368 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3364 composite (dotted) names on verbose exceptions.
3369 composite (dotted) names on verbose exceptions.
3365 (VerboseTB.nullrepr): harden against another kind of errors which
3370 (VerboseTB.nullrepr): harden against another kind of errors which
3366 Python's inspect module can trigger, and which were crashing
3371 Python's inspect module can trigger, and which were crashing
3367 IPython. Thanks to a report by Marco Lombardi
3372 IPython. Thanks to a report by Marco Lombardi
3368 <mlombard-AT-ma010192.hq.eso.org>.
3373 <mlombard-AT-ma010192.hq.eso.org>.
3369
3374
3370 2004-12-13 *** Released version 0.6.6
3375 2004-12-13 *** Released version 0.6.6
3371
3376
3372 2004-12-12 Fernando Perez <fperez@colorado.edu>
3377 2004-12-12 Fernando Perez <fperez@colorado.edu>
3373
3378
3374 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3379 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3375 generated by pygtk upon initialization if it was built without
3380 generated by pygtk upon initialization if it was built without
3376 threads (for matplotlib users). After a crash reported by
3381 threads (for matplotlib users). After a crash reported by
3377 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3382 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3378
3383
3379 * IPython/ipmaker.py (make_IPython): fix small bug in the
3384 * IPython/ipmaker.py (make_IPython): fix small bug in the
3380 import_some parameter for multiple imports.
3385 import_some parameter for multiple imports.
3381
3386
3382 * IPython/iplib.py (ipmagic): simplified the interface of
3387 * IPython/iplib.py (ipmagic): simplified the interface of
3383 ipmagic() to take a single string argument, just as it would be
3388 ipmagic() to take a single string argument, just as it would be
3384 typed at the IPython cmd line.
3389 typed at the IPython cmd line.
3385 (ipalias): Added new ipalias() with an interface identical to
3390 (ipalias): Added new ipalias() with an interface identical to
3386 ipmagic(). This completes exposing a pure python interface to the
3391 ipmagic(). This completes exposing a pure python interface to the
3387 alias and magic system, which can be used in loops or more complex
3392 alias and magic system, which can be used in loops or more complex
3388 code where IPython's automatic line mangling is not active.
3393 code where IPython's automatic line mangling is not active.
3389
3394
3390 * IPython/genutils.py (timing): changed interface of timing to
3395 * IPython/genutils.py (timing): changed interface of timing to
3391 simply run code once, which is the most common case. timings()
3396 simply run code once, which is the most common case. timings()
3392 remains unchanged, for the cases where you want multiple runs.
3397 remains unchanged, for the cases where you want multiple runs.
3393
3398
3394 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3399 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3395 bug where Python2.2 crashes with exec'ing code which does not end
3400 bug where Python2.2 crashes with exec'ing code which does not end
3396 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3401 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3397 before.
3402 before.
3398
3403
3399 2004-12-10 Fernando Perez <fperez@colorado.edu>
3404 2004-12-10 Fernando Perez <fperez@colorado.edu>
3400
3405
3401 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3406 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3402 -t to -T, to accomodate the new -t flag in %run (the %run and
3407 -t to -T, to accomodate the new -t flag in %run (the %run and
3403 %prun options are kind of intermixed, and it's not easy to change
3408 %prun options are kind of intermixed, and it's not easy to change
3404 this with the limitations of python's getopt).
3409 this with the limitations of python's getopt).
3405
3410
3406 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3411 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3407 the execution of scripts. It's not as fine-tuned as timeit.py,
3412 the execution of scripts. It's not as fine-tuned as timeit.py,
3408 but it works from inside ipython (and under 2.2, which lacks
3413 but it works from inside ipython (and under 2.2, which lacks
3409 timeit.py). Optionally a number of runs > 1 can be given for
3414 timeit.py). Optionally a number of runs > 1 can be given for
3410 timing very short-running code.
3415 timing very short-running code.
3411
3416
3412 * IPython/genutils.py (uniq_stable): new routine which returns a
3417 * IPython/genutils.py (uniq_stable): new routine which returns a
3413 list of unique elements in any iterable, but in stable order of
3418 list of unique elements in any iterable, but in stable order of
3414 appearance. I needed this for the ultraTB fixes, and it's a handy
3419 appearance. I needed this for the ultraTB fixes, and it's a handy
3415 utility.
3420 utility.
3416
3421
3417 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3422 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3418 dotted names in Verbose exceptions. This had been broken since
3423 dotted names in Verbose exceptions. This had been broken since
3419 the very start, now x.y will properly be printed in a Verbose
3424 the very start, now x.y will properly be printed in a Verbose
3420 traceback, instead of x being shown and y appearing always as an
3425 traceback, instead of x being shown and y appearing always as an
3421 'undefined global'. Getting this to work was a bit tricky,
3426 'undefined global'. Getting this to work was a bit tricky,
3422 because by default python tokenizers are stateless. Saved by
3427 because by default python tokenizers are stateless. Saved by
3423 python's ability to easily add a bit of state to an arbitrary
3428 python's ability to easily add a bit of state to an arbitrary
3424 function (without needing to build a full-blown callable object).
3429 function (without needing to build a full-blown callable object).
3425
3430
3426 Also big cleanup of this code, which had horrendous runtime
3431 Also big cleanup of this code, which had horrendous runtime
3427 lookups of zillions of attributes for colorization. Moved all
3432 lookups of zillions of attributes for colorization. Moved all
3428 this code into a few templates, which make it cleaner and quicker.
3433 this code into a few templates, which make it cleaner and quicker.
3429
3434
3430 Printout quality was also improved for Verbose exceptions: one
3435 Printout quality was also improved for Verbose exceptions: one
3431 variable per line, and memory addresses are printed (this can be
3436 variable per line, and memory addresses are printed (this can be
3432 quite handy in nasty debugging situations, which is what Verbose
3437 quite handy in nasty debugging situations, which is what Verbose
3433 is for).
3438 is for).
3434
3439
3435 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3440 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3436 the command line as scripts to be loaded by embedded instances.
3441 the command line as scripts to be loaded by embedded instances.
3437 Doing so has the potential for an infinite recursion if there are
3442 Doing so has the potential for an infinite recursion if there are
3438 exceptions thrown in the process. This fixes a strange crash
3443 exceptions thrown in the process. This fixes a strange crash
3439 reported by Philippe MULLER <muller-AT-irit.fr>.
3444 reported by Philippe MULLER <muller-AT-irit.fr>.
3440
3445
3441 2004-12-09 Fernando Perez <fperez@colorado.edu>
3446 2004-12-09 Fernando Perez <fperez@colorado.edu>
3442
3447
3443 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3448 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3444 to reflect new names in matplotlib, which now expose the
3449 to reflect new names in matplotlib, which now expose the
3445 matlab-compatible interface via a pylab module instead of the
3450 matlab-compatible interface via a pylab module instead of the
3446 'matlab' name. The new code is backwards compatible, so users of
3451 'matlab' name. The new code is backwards compatible, so users of
3447 all matplotlib versions are OK. Patch by J. Hunter.
3452 all matplotlib versions are OK. Patch by J. Hunter.
3448
3453
3449 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3454 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3450 of __init__ docstrings for instances (class docstrings are already
3455 of __init__ docstrings for instances (class docstrings are already
3451 automatically printed). Instances with customized docstrings
3456 automatically printed). Instances with customized docstrings
3452 (indep. of the class) are also recognized and all 3 separate
3457 (indep. of the class) are also recognized and all 3 separate
3453 docstrings are printed (instance, class, constructor). After some
3458 docstrings are printed (instance, class, constructor). After some
3454 comments/suggestions by J. Hunter.
3459 comments/suggestions by J. Hunter.
3455
3460
3456 2004-12-05 Fernando Perez <fperez@colorado.edu>
3461 2004-12-05 Fernando Perez <fperez@colorado.edu>
3457
3462
3458 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3463 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3459 warnings when tab-completion fails and triggers an exception.
3464 warnings when tab-completion fails and triggers an exception.
3460
3465
3461 2004-12-03 Fernando Perez <fperez@colorado.edu>
3466 2004-12-03 Fernando Perez <fperez@colorado.edu>
3462
3467
3463 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3468 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3464 be triggered when using 'run -p'. An incorrect option flag was
3469 be triggered when using 'run -p'. An incorrect option flag was
3465 being set ('d' instead of 'D').
3470 being set ('d' instead of 'D').
3466 (manpage): fix missing escaped \- sign.
3471 (manpage): fix missing escaped \- sign.
3467
3472
3468 2004-11-30 *** Released version 0.6.5
3473 2004-11-30 *** Released version 0.6.5
3469
3474
3470 2004-11-30 Fernando Perez <fperez@colorado.edu>
3475 2004-11-30 Fernando Perez <fperez@colorado.edu>
3471
3476
3472 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3477 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3473 setting with -d option.
3478 setting with -d option.
3474
3479
3475 * setup.py (docfiles): Fix problem where the doc glob I was using
3480 * setup.py (docfiles): Fix problem where the doc glob I was using
3476 was COMPLETELY BROKEN. It was giving the right files by pure
3481 was COMPLETELY BROKEN. It was giving the right files by pure
3477 accident, but failed once I tried to include ipython.el. Note:
3482 accident, but failed once I tried to include ipython.el. Note:
3478 glob() does NOT allow you to do exclusion on multiple endings!
3483 glob() does NOT allow you to do exclusion on multiple endings!
3479
3484
3480 2004-11-29 Fernando Perez <fperez@colorado.edu>
3485 2004-11-29 Fernando Perez <fperez@colorado.edu>
3481
3486
3482 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3487 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3483 the manpage as the source. Better formatting & consistency.
3488 the manpage as the source. Better formatting & consistency.
3484
3489
3485 * IPython/Magic.py (magic_run): Added new -d option, to run
3490 * IPython/Magic.py (magic_run): Added new -d option, to run
3486 scripts under the control of the python pdb debugger. Note that
3491 scripts under the control of the python pdb debugger. Note that
3487 this required changing the %prun option -d to -D, to avoid a clash
3492 this required changing the %prun option -d to -D, to avoid a clash
3488 (since %run must pass options to %prun, and getopt is too dumb to
3493 (since %run must pass options to %prun, and getopt is too dumb to
3489 handle options with string values with embedded spaces). Thanks
3494 handle options with string values with embedded spaces). Thanks
3490 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3495 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3491 (magic_who_ls): added type matching to %who and %whos, so that one
3496 (magic_who_ls): added type matching to %who and %whos, so that one
3492 can filter their output to only include variables of certain
3497 can filter their output to only include variables of certain
3493 types. Another suggestion by Matthew.
3498 types. Another suggestion by Matthew.
3494 (magic_whos): Added memory summaries in kb and Mb for arrays.
3499 (magic_whos): Added memory summaries in kb and Mb for arrays.
3495 (magic_who): Improve formatting (break lines every 9 vars).
3500 (magic_who): Improve formatting (break lines every 9 vars).
3496
3501
3497 2004-11-28 Fernando Perez <fperez@colorado.edu>
3502 2004-11-28 Fernando Perez <fperez@colorado.edu>
3498
3503
3499 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3504 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3500 cache when empty lines were present.
3505 cache when empty lines were present.
3501
3506
3502 2004-11-24 Fernando Perez <fperez@colorado.edu>
3507 2004-11-24 Fernando Perez <fperez@colorado.edu>
3503
3508
3504 * IPython/usage.py (__doc__): document the re-activated threading
3509 * IPython/usage.py (__doc__): document the re-activated threading
3505 options for WX and GTK.
3510 options for WX and GTK.
3506
3511
3507 2004-11-23 Fernando Perez <fperez@colorado.edu>
3512 2004-11-23 Fernando Perez <fperez@colorado.edu>
3508
3513
3509 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3514 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3510 the -wthread and -gthread options, along with a new -tk one to try
3515 the -wthread and -gthread options, along with a new -tk one to try
3511 and coordinate Tk threading with wx/gtk. The tk support is very
3516 and coordinate Tk threading with wx/gtk. The tk support is very
3512 platform dependent, since it seems to require Tcl and Tk to be
3517 platform dependent, since it seems to require Tcl and Tk to be
3513 built with threads (Fedora1/2 appears NOT to have it, but in
3518 built with threads (Fedora1/2 appears NOT to have it, but in
3514 Prabhu's Debian boxes it works OK). But even with some Tk
3519 Prabhu's Debian boxes it works OK). But even with some Tk
3515 limitations, this is a great improvement.
3520 limitations, this is a great improvement.
3516
3521
3517 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3522 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3518 info in user prompts. Patch by Prabhu.
3523 info in user prompts. Patch by Prabhu.
3519
3524
3520 2004-11-18 Fernando Perez <fperez@colorado.edu>
3525 2004-11-18 Fernando Perez <fperez@colorado.edu>
3521
3526
3522 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3527 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3523 EOFErrors and bail, to avoid infinite loops if a non-terminating
3528 EOFErrors and bail, to avoid infinite loops if a non-terminating
3524 file is fed into ipython. Patch submitted in issue 19 by user,
3529 file is fed into ipython. Patch submitted in issue 19 by user,
3525 many thanks.
3530 many thanks.
3526
3531
3527 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3532 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3528 autoquote/parens in continuation prompts, which can cause lots of
3533 autoquote/parens in continuation prompts, which can cause lots of
3529 problems. Closes roundup issue 20.
3534 problems. Closes roundup issue 20.
3530
3535
3531 2004-11-17 Fernando Perez <fperez@colorado.edu>
3536 2004-11-17 Fernando Perez <fperez@colorado.edu>
3532
3537
3533 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3538 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3534 reported as debian bug #280505. I'm not sure my local changelog
3539 reported as debian bug #280505. I'm not sure my local changelog
3535 entry has the proper debian format (Jack?).
3540 entry has the proper debian format (Jack?).
3536
3541
3537 2004-11-08 *** Released version 0.6.4
3542 2004-11-08 *** Released version 0.6.4
3538
3543
3539 2004-11-08 Fernando Perez <fperez@colorado.edu>
3544 2004-11-08 Fernando Perez <fperez@colorado.edu>
3540
3545
3541 * IPython/iplib.py (init_readline): Fix exit message for Windows
3546 * IPython/iplib.py (init_readline): Fix exit message for Windows
3542 when readline is active. Thanks to a report by Eric Jones
3547 when readline is active. Thanks to a report by Eric Jones
3543 <eric-AT-enthought.com>.
3548 <eric-AT-enthought.com>.
3544
3549
3545 2004-11-07 Fernando Perez <fperez@colorado.edu>
3550 2004-11-07 Fernando Perez <fperez@colorado.edu>
3546
3551
3547 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3552 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3548 sometimes seen by win2k/cygwin users.
3553 sometimes seen by win2k/cygwin users.
3549
3554
3550 2004-11-06 Fernando Perez <fperez@colorado.edu>
3555 2004-11-06 Fernando Perez <fperez@colorado.edu>
3551
3556
3552 * IPython/iplib.py (interact): Change the handling of %Exit from
3557 * IPython/iplib.py (interact): Change the handling of %Exit from
3553 trying to propagate a SystemExit to an internal ipython flag.
3558 trying to propagate a SystemExit to an internal ipython flag.
3554 This is less elegant than using Python's exception mechanism, but
3559 This is less elegant than using Python's exception mechanism, but
3555 I can't get that to work reliably with threads, so under -pylab
3560 I can't get that to work reliably with threads, so under -pylab
3556 %Exit was hanging IPython. Cross-thread exception handling is
3561 %Exit was hanging IPython. Cross-thread exception handling is
3557 really a bitch. Thaks to a bug report by Stephen Walton
3562 really a bitch. Thaks to a bug report by Stephen Walton
3558 <stephen.walton-AT-csun.edu>.
3563 <stephen.walton-AT-csun.edu>.
3559
3564
3560 2004-11-04 Fernando Perez <fperez@colorado.edu>
3565 2004-11-04 Fernando Perez <fperez@colorado.edu>
3561
3566
3562 * IPython/iplib.py (raw_input_original): store a pointer to the
3567 * IPython/iplib.py (raw_input_original): store a pointer to the
3563 true raw_input to harden against code which can modify it
3568 true raw_input to harden against code which can modify it
3564 (wx.py.PyShell does this and would otherwise crash ipython).
3569 (wx.py.PyShell does this and would otherwise crash ipython).
3565 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3570 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3566
3571
3567 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3572 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3568 Ctrl-C problem, which does not mess up the input line.
3573 Ctrl-C problem, which does not mess up the input line.
3569
3574
3570 2004-11-03 Fernando Perez <fperez@colorado.edu>
3575 2004-11-03 Fernando Perez <fperez@colorado.edu>
3571
3576
3572 * IPython/Release.py: Changed licensing to BSD, in all files.
3577 * IPython/Release.py: Changed licensing to BSD, in all files.
3573 (name): lowercase name for tarball/RPM release.
3578 (name): lowercase name for tarball/RPM release.
3574
3579
3575 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3580 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3576 use throughout ipython.
3581 use throughout ipython.
3577
3582
3578 * IPython/Magic.py (Magic._ofind): Switch to using the new
3583 * IPython/Magic.py (Magic._ofind): Switch to using the new
3579 OInspect.getdoc() function.
3584 OInspect.getdoc() function.
3580
3585
3581 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3586 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3582 of the line currently being canceled via Ctrl-C. It's extremely
3587 of the line currently being canceled via Ctrl-C. It's extremely
3583 ugly, but I don't know how to do it better (the problem is one of
3588 ugly, but I don't know how to do it better (the problem is one of
3584 handling cross-thread exceptions).
3589 handling cross-thread exceptions).
3585
3590
3586 2004-10-28 Fernando Perez <fperez@colorado.edu>
3591 2004-10-28 Fernando Perez <fperez@colorado.edu>
3587
3592
3588 * IPython/Shell.py (signal_handler): add signal handlers to trap
3593 * IPython/Shell.py (signal_handler): add signal handlers to trap
3589 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3594 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3590 report by Francesc Alted.
3595 report by Francesc Alted.
3591
3596
3592 2004-10-21 Fernando Perez <fperez@colorado.edu>
3597 2004-10-21 Fernando Perez <fperez@colorado.edu>
3593
3598
3594 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3599 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3595 to % for pysh syntax extensions.
3600 to % for pysh syntax extensions.
3596
3601
3597 2004-10-09 Fernando Perez <fperez@colorado.edu>
3602 2004-10-09 Fernando Perez <fperez@colorado.edu>
3598
3603
3599 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3604 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3600 arrays to print a more useful summary, without calling str(arr).
3605 arrays to print a more useful summary, without calling str(arr).
3601 This avoids the problem of extremely lengthy computations which
3606 This avoids the problem of extremely lengthy computations which
3602 occur if arr is large, and appear to the user as a system lockup
3607 occur if arr is large, and appear to the user as a system lockup
3603 with 100% cpu activity. After a suggestion by Kristian Sandberg
3608 with 100% cpu activity. After a suggestion by Kristian Sandberg
3604 <Kristian.Sandberg@colorado.edu>.
3609 <Kristian.Sandberg@colorado.edu>.
3605 (Magic.__init__): fix bug in global magic escapes not being
3610 (Magic.__init__): fix bug in global magic escapes not being
3606 correctly set.
3611 correctly set.
3607
3612
3608 2004-10-08 Fernando Perez <fperez@colorado.edu>
3613 2004-10-08 Fernando Perez <fperez@colorado.edu>
3609
3614
3610 * IPython/Magic.py (__license__): change to absolute imports of
3615 * IPython/Magic.py (__license__): change to absolute imports of
3611 ipython's own internal packages, to start adapting to the absolute
3616 ipython's own internal packages, to start adapting to the absolute
3612 import requirement of PEP-328.
3617 import requirement of PEP-328.
3613
3618
3614 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3619 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3615 files, and standardize author/license marks through the Release
3620 files, and standardize author/license marks through the Release
3616 module instead of having per/file stuff (except for files with
3621 module instead of having per/file stuff (except for files with
3617 particular licenses, like the MIT/PSF-licensed codes).
3622 particular licenses, like the MIT/PSF-licensed codes).
3618
3623
3619 * IPython/Debugger.py: remove dead code for python 2.1
3624 * IPython/Debugger.py: remove dead code for python 2.1
3620
3625
3621 2004-10-04 Fernando Perez <fperez@colorado.edu>
3626 2004-10-04 Fernando Perez <fperez@colorado.edu>
3622
3627
3623 * IPython/iplib.py (ipmagic): New function for accessing magics
3628 * IPython/iplib.py (ipmagic): New function for accessing magics
3624 via a normal python function call.
3629 via a normal python function call.
3625
3630
3626 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3631 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3627 from '@' to '%', to accomodate the new @decorator syntax of python
3632 from '@' to '%', to accomodate the new @decorator syntax of python
3628 2.4.
3633 2.4.
3629
3634
3630 2004-09-29 Fernando Perez <fperez@colorado.edu>
3635 2004-09-29 Fernando Perez <fperez@colorado.edu>
3631
3636
3632 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3637 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3633 matplotlib.use to prevent running scripts which try to switch
3638 matplotlib.use to prevent running scripts which try to switch
3634 interactive backends from within ipython. This will just crash
3639 interactive backends from within ipython. This will just crash
3635 the python interpreter, so we can't allow it (but a detailed error
3640 the python interpreter, so we can't allow it (but a detailed error
3636 is given to the user).
3641 is given to the user).
3637
3642
3638 2004-09-28 Fernando Perez <fperez@colorado.edu>
3643 2004-09-28 Fernando Perez <fperez@colorado.edu>
3639
3644
3640 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3645 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3641 matplotlib-related fixes so that using @run with non-matplotlib
3646 matplotlib-related fixes so that using @run with non-matplotlib
3642 scripts doesn't pop up spurious plot windows. This requires
3647 scripts doesn't pop up spurious plot windows. This requires
3643 matplotlib >= 0.63, where I had to make some changes as well.
3648 matplotlib >= 0.63, where I had to make some changes as well.
3644
3649
3645 * IPython/ipmaker.py (make_IPython): update version requirement to
3650 * IPython/ipmaker.py (make_IPython): update version requirement to
3646 python 2.2.
3651 python 2.2.
3647
3652
3648 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3653 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3649 banner arg for embedded customization.
3654 banner arg for embedded customization.
3650
3655
3651 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3656 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3652 explicit uses of __IP as the IPython's instance name. Now things
3657 explicit uses of __IP as the IPython's instance name. Now things
3653 are properly handled via the shell.name value. The actual code
3658 are properly handled via the shell.name value. The actual code
3654 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3659 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3655 is much better than before. I'll clean things completely when the
3660 is much better than before. I'll clean things completely when the
3656 magic stuff gets a real overhaul.
3661 magic stuff gets a real overhaul.
3657
3662
3658 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3663 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3659 minor changes to debian dir.
3664 minor changes to debian dir.
3660
3665
3661 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3666 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3662 pointer to the shell itself in the interactive namespace even when
3667 pointer to the shell itself in the interactive namespace even when
3663 a user-supplied dict is provided. This is needed for embedding
3668 a user-supplied dict is provided. This is needed for embedding
3664 purposes (found by tests with Michel Sanner).
3669 purposes (found by tests with Michel Sanner).
3665
3670
3666 2004-09-27 Fernando Perez <fperez@colorado.edu>
3671 2004-09-27 Fernando Perez <fperez@colorado.edu>
3667
3672
3668 * IPython/UserConfig/ipythonrc: remove []{} from
3673 * IPython/UserConfig/ipythonrc: remove []{} from
3669 readline_remove_delims, so that things like [modname.<TAB> do
3674 readline_remove_delims, so that things like [modname.<TAB> do
3670 proper completion. This disables [].TAB, but that's a less common
3675 proper completion. This disables [].TAB, but that's a less common
3671 case than module names in list comprehensions, for example.
3676 case than module names in list comprehensions, for example.
3672 Thanks to a report by Andrea Riciputi.
3677 Thanks to a report by Andrea Riciputi.
3673
3678
3674 2004-09-09 Fernando Perez <fperez@colorado.edu>
3679 2004-09-09 Fernando Perez <fperez@colorado.edu>
3675
3680
3676 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3681 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3677 blocking problems in win32 and osx. Fix by John.
3682 blocking problems in win32 and osx. Fix by John.
3678
3683
3679 2004-09-08 Fernando Perez <fperez@colorado.edu>
3684 2004-09-08 Fernando Perez <fperez@colorado.edu>
3680
3685
3681 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3686 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3682 for Win32 and OSX. Fix by John Hunter.
3687 for Win32 and OSX. Fix by John Hunter.
3683
3688
3684 2004-08-30 *** Released version 0.6.3
3689 2004-08-30 *** Released version 0.6.3
3685
3690
3686 2004-08-30 Fernando Perez <fperez@colorado.edu>
3691 2004-08-30 Fernando Perez <fperez@colorado.edu>
3687
3692
3688 * setup.py (isfile): Add manpages to list of dependent files to be
3693 * setup.py (isfile): Add manpages to list of dependent files to be
3689 updated.
3694 updated.
3690
3695
3691 2004-08-27 Fernando Perez <fperez@colorado.edu>
3696 2004-08-27 Fernando Perez <fperez@colorado.edu>
3692
3697
3693 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3698 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3694 for now. They don't really work with standalone WX/GTK code
3699 for now. They don't really work with standalone WX/GTK code
3695 (though matplotlib IS working fine with both of those backends).
3700 (though matplotlib IS working fine with both of those backends).
3696 This will neeed much more testing. I disabled most things with
3701 This will neeed much more testing. I disabled most things with
3697 comments, so turning it back on later should be pretty easy.
3702 comments, so turning it back on later should be pretty easy.
3698
3703
3699 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3704 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3700 autocalling of expressions like r'foo', by modifying the line
3705 autocalling of expressions like r'foo', by modifying the line
3701 split regexp. Closes
3706 split regexp. Closes
3702 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3707 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3703 Riley <ipythonbugs-AT-sabi.net>.
3708 Riley <ipythonbugs-AT-sabi.net>.
3704 (InteractiveShell.mainloop): honor --nobanner with banner
3709 (InteractiveShell.mainloop): honor --nobanner with banner
3705 extensions.
3710 extensions.
3706
3711
3707 * IPython/Shell.py: Significant refactoring of all classes, so
3712 * IPython/Shell.py: Significant refactoring of all classes, so
3708 that we can really support ALL matplotlib backends and threading
3713 that we can really support ALL matplotlib backends and threading
3709 models (John spotted a bug with Tk which required this). Now we
3714 models (John spotted a bug with Tk which required this). Now we
3710 should support single-threaded, WX-threads and GTK-threads, both
3715 should support single-threaded, WX-threads and GTK-threads, both
3711 for generic code and for matplotlib.
3716 for generic code and for matplotlib.
3712
3717
3713 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3718 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3714 -pylab, to simplify things for users. Will also remove the pylab
3719 -pylab, to simplify things for users. Will also remove the pylab
3715 profile, since now all of matplotlib configuration is directly
3720 profile, since now all of matplotlib configuration is directly
3716 handled here. This also reduces startup time.
3721 handled here. This also reduces startup time.
3717
3722
3718 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3723 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3719 shell wasn't being correctly called. Also in IPShellWX.
3724 shell wasn't being correctly called. Also in IPShellWX.
3720
3725
3721 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3726 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3722 fine-tune banner.
3727 fine-tune banner.
3723
3728
3724 * IPython/numutils.py (spike): Deprecate these spike functions,
3729 * IPython/numutils.py (spike): Deprecate these spike functions,
3725 delete (long deprecated) gnuplot_exec handler.
3730 delete (long deprecated) gnuplot_exec handler.
3726
3731
3727 2004-08-26 Fernando Perez <fperez@colorado.edu>
3732 2004-08-26 Fernando Perez <fperez@colorado.edu>
3728
3733
3729 * ipython.1: Update for threading options, plus some others which
3734 * ipython.1: Update for threading options, plus some others which
3730 were missing.
3735 were missing.
3731
3736
3732 * IPython/ipmaker.py (__call__): Added -wthread option for
3737 * IPython/ipmaker.py (__call__): Added -wthread option for
3733 wxpython thread handling. Make sure threading options are only
3738 wxpython thread handling. Make sure threading options are only
3734 valid at the command line.
3739 valid at the command line.
3735
3740
3736 * scripts/ipython: moved shell selection into a factory function
3741 * scripts/ipython: moved shell selection into a factory function
3737 in Shell.py, to keep the starter script to a minimum.
3742 in Shell.py, to keep the starter script to a minimum.
3738
3743
3739 2004-08-25 Fernando Perez <fperez@colorado.edu>
3744 2004-08-25 Fernando Perez <fperez@colorado.edu>
3740
3745
3741 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3746 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3742 John. Along with some recent changes he made to matplotlib, the
3747 John. Along with some recent changes he made to matplotlib, the
3743 next versions of both systems should work very well together.
3748 next versions of both systems should work very well together.
3744
3749
3745 2004-08-24 Fernando Perez <fperez@colorado.edu>
3750 2004-08-24 Fernando Perez <fperez@colorado.edu>
3746
3751
3747 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3752 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3748 tried to switch the profiling to using hotshot, but I'm getting
3753 tried to switch the profiling to using hotshot, but I'm getting
3749 strange errors from prof.runctx() there. I may be misreading the
3754 strange errors from prof.runctx() there. I may be misreading the
3750 docs, but it looks weird. For now the profiling code will
3755 docs, but it looks weird. For now the profiling code will
3751 continue to use the standard profiler.
3756 continue to use the standard profiler.
3752
3757
3753 2004-08-23 Fernando Perez <fperez@colorado.edu>
3758 2004-08-23 Fernando Perez <fperez@colorado.edu>
3754
3759
3755 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3760 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3756 threaded shell, by John Hunter. It's not quite ready yet, but
3761 threaded shell, by John Hunter. It's not quite ready yet, but
3757 close.
3762 close.
3758
3763
3759 2004-08-22 Fernando Perez <fperez@colorado.edu>
3764 2004-08-22 Fernando Perez <fperez@colorado.edu>
3760
3765
3761 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3766 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3762 in Magic and ultraTB.
3767 in Magic and ultraTB.
3763
3768
3764 * ipython.1: document threading options in manpage.
3769 * ipython.1: document threading options in manpage.
3765
3770
3766 * scripts/ipython: Changed name of -thread option to -gthread,
3771 * scripts/ipython: Changed name of -thread option to -gthread,
3767 since this is GTK specific. I want to leave the door open for a
3772 since this is GTK specific. I want to leave the door open for a
3768 -wthread option for WX, which will most likely be necessary. This
3773 -wthread option for WX, which will most likely be necessary. This
3769 change affects usage and ipmaker as well.
3774 change affects usage and ipmaker as well.
3770
3775
3771 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3776 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3772 handle the matplotlib shell issues. Code by John Hunter
3777 handle the matplotlib shell issues. Code by John Hunter
3773 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3778 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3774 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3779 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3775 broken (and disabled for end users) for now, but it puts the
3780 broken (and disabled for end users) for now, but it puts the
3776 infrastructure in place.
3781 infrastructure in place.
3777
3782
3778 2004-08-21 Fernando Perez <fperez@colorado.edu>
3783 2004-08-21 Fernando Perez <fperez@colorado.edu>
3779
3784
3780 * ipythonrc-pylab: Add matplotlib support.
3785 * ipythonrc-pylab: Add matplotlib support.
3781
3786
3782 * matplotlib_config.py: new files for matplotlib support, part of
3787 * matplotlib_config.py: new files for matplotlib support, part of
3783 the pylab profile.
3788 the pylab profile.
3784
3789
3785 * IPython/usage.py (__doc__): documented the threading options.
3790 * IPython/usage.py (__doc__): documented the threading options.
3786
3791
3787 2004-08-20 Fernando Perez <fperez@colorado.edu>
3792 2004-08-20 Fernando Perez <fperez@colorado.edu>
3788
3793
3789 * ipython: Modified the main calling routine to handle the -thread
3794 * ipython: Modified the main calling routine to handle the -thread
3790 and -mpthread options. This needs to be done as a top-level hack,
3795 and -mpthread options. This needs to be done as a top-level hack,
3791 because it determines which class to instantiate for IPython
3796 because it determines which class to instantiate for IPython
3792 itself.
3797 itself.
3793
3798
3794 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3799 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3795 classes to support multithreaded GTK operation without blocking,
3800 classes to support multithreaded GTK operation without blocking,
3796 and matplotlib with all backends. This is a lot of still very
3801 and matplotlib with all backends. This is a lot of still very
3797 experimental code, and threads are tricky. So it may still have a
3802 experimental code, and threads are tricky. So it may still have a
3798 few rough edges... This code owes a lot to
3803 few rough edges... This code owes a lot to
3799 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3804 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3800 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3805 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3801 to John Hunter for all the matplotlib work.
3806 to John Hunter for all the matplotlib work.
3802
3807
3803 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3808 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3804 options for gtk thread and matplotlib support.
3809 options for gtk thread and matplotlib support.
3805
3810
3806 2004-08-16 Fernando Perez <fperez@colorado.edu>
3811 2004-08-16 Fernando Perez <fperez@colorado.edu>
3807
3812
3808 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3813 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3809 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3814 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3810 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3815 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3811
3816
3812 2004-08-11 Fernando Perez <fperez@colorado.edu>
3817 2004-08-11 Fernando Perez <fperez@colorado.edu>
3813
3818
3814 * setup.py (isfile): Fix build so documentation gets updated for
3819 * setup.py (isfile): Fix build so documentation gets updated for
3815 rpms (it was only done for .tgz builds).
3820 rpms (it was only done for .tgz builds).
3816
3821
3817 2004-08-10 Fernando Perez <fperez@colorado.edu>
3822 2004-08-10 Fernando Perez <fperez@colorado.edu>
3818
3823
3819 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3824 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3820
3825
3821 * iplib.py : Silence syntax error exceptions in tab-completion.
3826 * iplib.py : Silence syntax error exceptions in tab-completion.
3822
3827
3823 2004-08-05 Fernando Perez <fperez@colorado.edu>
3828 2004-08-05 Fernando Perez <fperez@colorado.edu>
3824
3829
3825 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3830 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3826 'color off' mark for continuation prompts. This was causing long
3831 'color off' mark for continuation prompts. This was causing long
3827 continuation lines to mis-wrap.
3832 continuation lines to mis-wrap.
3828
3833
3829 2004-08-01 Fernando Perez <fperez@colorado.edu>
3834 2004-08-01 Fernando Perez <fperez@colorado.edu>
3830
3835
3831 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3836 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3832 for building ipython to be a parameter. All this is necessary
3837 for building ipython to be a parameter. All this is necessary
3833 right now to have a multithreaded version, but this insane
3838 right now to have a multithreaded version, but this insane
3834 non-design will be cleaned up soon. For now, it's a hack that
3839 non-design will be cleaned up soon. For now, it's a hack that
3835 works.
3840 works.
3836
3841
3837 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3842 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3838 args in various places. No bugs so far, but it's a dangerous
3843 args in various places. No bugs so far, but it's a dangerous
3839 practice.
3844 practice.
3840
3845
3841 2004-07-31 Fernando Perez <fperez@colorado.edu>
3846 2004-07-31 Fernando Perez <fperez@colorado.edu>
3842
3847
3843 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3848 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3844 fix completion of files with dots in their names under most
3849 fix completion of files with dots in their names under most
3845 profiles (pysh was OK because the completion order is different).
3850 profiles (pysh was OK because the completion order is different).
3846
3851
3847 2004-07-27 Fernando Perez <fperez@colorado.edu>
3852 2004-07-27 Fernando Perez <fperez@colorado.edu>
3848
3853
3849 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3854 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3850 keywords manually, b/c the one in keyword.py was removed in python
3855 keywords manually, b/c the one in keyword.py was removed in python
3851 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3856 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3852 This is NOT a bug under python 2.3 and earlier.
3857 This is NOT a bug under python 2.3 and earlier.
3853
3858
3854 2004-07-26 Fernando Perez <fperez@colorado.edu>
3859 2004-07-26 Fernando Perez <fperez@colorado.edu>
3855
3860
3856 * IPython/ultraTB.py (VerboseTB.text): Add another
3861 * IPython/ultraTB.py (VerboseTB.text): Add another
3857 linecache.checkcache() call to try to prevent inspect.py from
3862 linecache.checkcache() call to try to prevent inspect.py from
3858 crashing under python 2.3. I think this fixes
3863 crashing under python 2.3. I think this fixes
3859 http://www.scipy.net/roundup/ipython/issue17.
3864 http://www.scipy.net/roundup/ipython/issue17.
3860
3865
3861 2004-07-26 *** Released version 0.6.2
3866 2004-07-26 *** Released version 0.6.2
3862
3867
3863 2004-07-26 Fernando Perez <fperez@colorado.edu>
3868 2004-07-26 Fernando Perez <fperez@colorado.edu>
3864
3869
3865 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3870 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3866 fail for any number.
3871 fail for any number.
3867 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3872 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3868 empty bookmarks.
3873 empty bookmarks.
3869
3874
3870 2004-07-26 *** Released version 0.6.1
3875 2004-07-26 *** Released version 0.6.1
3871
3876
3872 2004-07-26 Fernando Perez <fperez@colorado.edu>
3877 2004-07-26 Fernando Perez <fperez@colorado.edu>
3873
3878
3874 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3879 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3875
3880
3876 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3881 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3877 escaping '()[]{}' in filenames.
3882 escaping '()[]{}' in filenames.
3878
3883
3879 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3884 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3880 Python 2.2 users who lack a proper shlex.split.
3885 Python 2.2 users who lack a proper shlex.split.
3881
3886
3882 2004-07-19 Fernando Perez <fperez@colorado.edu>
3887 2004-07-19 Fernando Perez <fperez@colorado.edu>
3883
3888
3884 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3889 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3885 for reading readline's init file. I follow the normal chain:
3890 for reading readline's init file. I follow the normal chain:
3886 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3891 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3887 report by Mike Heeter. This closes
3892 report by Mike Heeter. This closes
3888 http://www.scipy.net/roundup/ipython/issue16.
3893 http://www.scipy.net/roundup/ipython/issue16.
3889
3894
3890 2004-07-18 Fernando Perez <fperez@colorado.edu>
3895 2004-07-18 Fernando Perez <fperez@colorado.edu>
3891
3896
3892 * IPython/iplib.py (__init__): Add better handling of '\' under
3897 * IPython/iplib.py (__init__): Add better handling of '\' under
3893 Win32 for filenames. After a patch by Ville.
3898 Win32 for filenames. After a patch by Ville.
3894
3899
3895 2004-07-17 Fernando Perez <fperez@colorado.edu>
3900 2004-07-17 Fernando Perez <fperez@colorado.edu>
3896
3901
3897 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3902 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3898 autocalling would be triggered for 'foo is bar' if foo is
3903 autocalling would be triggered for 'foo is bar' if foo is
3899 callable. I also cleaned up the autocall detection code to use a
3904 callable. I also cleaned up the autocall detection code to use a
3900 regexp, which is faster. Bug reported by Alexander Schmolck.
3905 regexp, which is faster. Bug reported by Alexander Schmolck.
3901
3906
3902 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3907 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3903 '?' in them would confuse the help system. Reported by Alex
3908 '?' in them would confuse the help system. Reported by Alex
3904 Schmolck.
3909 Schmolck.
3905
3910
3906 2004-07-16 Fernando Perez <fperez@colorado.edu>
3911 2004-07-16 Fernando Perez <fperez@colorado.edu>
3907
3912
3908 * IPython/GnuplotInteractive.py (__all__): added plot2.
3913 * IPython/GnuplotInteractive.py (__all__): added plot2.
3909
3914
3910 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3915 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3911 plotting dictionaries, lists or tuples of 1d arrays.
3916 plotting dictionaries, lists or tuples of 1d arrays.
3912
3917
3913 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3918 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3914 optimizations.
3919 optimizations.
3915
3920
3916 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3921 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3917 the information which was there from Janko's original IPP code:
3922 the information which was there from Janko's original IPP code:
3918
3923
3919 03.05.99 20:53 porto.ifm.uni-kiel.de
3924 03.05.99 20:53 porto.ifm.uni-kiel.de
3920 --Started changelog.
3925 --Started changelog.
3921 --make clear do what it say it does
3926 --make clear do what it say it does
3922 --added pretty output of lines from inputcache
3927 --added pretty output of lines from inputcache
3923 --Made Logger a mixin class, simplifies handling of switches
3928 --Made Logger a mixin class, simplifies handling of switches
3924 --Added own completer class. .string<TAB> expands to last history
3929 --Added own completer class. .string<TAB> expands to last history
3925 line which starts with string. The new expansion is also present
3930 line which starts with string. The new expansion is also present
3926 with Ctrl-r from the readline library. But this shows, who this
3931 with Ctrl-r from the readline library. But this shows, who this
3927 can be done for other cases.
3932 can be done for other cases.
3928 --Added convention that all shell functions should accept a
3933 --Added convention that all shell functions should accept a
3929 parameter_string This opens the door for different behaviour for
3934 parameter_string This opens the door for different behaviour for
3930 each function. @cd is a good example of this.
3935 each function. @cd is a good example of this.
3931
3936
3932 04.05.99 12:12 porto.ifm.uni-kiel.de
3937 04.05.99 12:12 porto.ifm.uni-kiel.de
3933 --added logfile rotation
3938 --added logfile rotation
3934 --added new mainloop method which freezes first the namespace
3939 --added new mainloop method which freezes first the namespace
3935
3940
3936 07.05.99 21:24 porto.ifm.uni-kiel.de
3941 07.05.99 21:24 porto.ifm.uni-kiel.de
3937 --added the docreader classes. Now there is a help system.
3942 --added the docreader classes. Now there is a help system.
3938 -This is only a first try. Currently it's not easy to put new
3943 -This is only a first try. Currently it's not easy to put new
3939 stuff in the indices. But this is the way to go. Info would be
3944 stuff in the indices. But this is the way to go. Info would be
3940 better, but HTML is every where and not everybody has an info
3945 better, but HTML is every where and not everybody has an info
3941 system installed and it's not so easy to change html-docs to info.
3946 system installed and it's not so easy to change html-docs to info.
3942 --added global logfile option
3947 --added global logfile option
3943 --there is now a hook for object inspection method pinfo needs to
3948 --there is now a hook for object inspection method pinfo needs to
3944 be provided for this. Can be reached by two '??'.
3949 be provided for this. Can be reached by two '??'.
3945
3950
3946 08.05.99 20:51 porto.ifm.uni-kiel.de
3951 08.05.99 20:51 porto.ifm.uni-kiel.de
3947 --added a README
3952 --added a README
3948 --bug in rc file. Something has changed so functions in the rc
3953 --bug in rc file. Something has changed so functions in the rc
3949 file need to reference the shell and not self. Not clear if it's a
3954 file need to reference the shell and not self. Not clear if it's a
3950 bug or feature.
3955 bug or feature.
3951 --changed rc file for new behavior
3956 --changed rc file for new behavior
3952
3957
3953 2004-07-15 Fernando Perez <fperez@colorado.edu>
3958 2004-07-15 Fernando Perez <fperez@colorado.edu>
3954
3959
3955 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3960 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3956 cache was falling out of sync in bizarre manners when multi-line
3961 cache was falling out of sync in bizarre manners when multi-line
3957 input was present. Minor optimizations and cleanup.
3962 input was present. Minor optimizations and cleanup.
3958
3963
3959 (Logger): Remove old Changelog info for cleanup. This is the
3964 (Logger): Remove old Changelog info for cleanup. This is the
3960 information which was there from Janko's original code:
3965 information which was there from Janko's original code:
3961
3966
3962 Changes to Logger: - made the default log filename a parameter
3967 Changes to Logger: - made the default log filename a parameter
3963
3968
3964 - put a check for lines beginning with !@? in log(). Needed
3969 - put a check for lines beginning with !@? in log(). Needed
3965 (even if the handlers properly log their lines) for mid-session
3970 (even if the handlers properly log their lines) for mid-session
3966 logging activation to work properly. Without this, lines logged
3971 logging activation to work properly. Without this, lines logged
3967 in mid session, which get read from the cache, would end up
3972 in mid session, which get read from the cache, would end up
3968 'bare' (with !@? in the open) in the log. Now they are caught
3973 'bare' (with !@? in the open) in the log. Now they are caught
3969 and prepended with a #.
3974 and prepended with a #.
3970
3975
3971 * IPython/iplib.py (InteractiveShell.init_readline): added check
3976 * IPython/iplib.py (InteractiveShell.init_readline): added check
3972 in case MagicCompleter fails to be defined, so we don't crash.
3977 in case MagicCompleter fails to be defined, so we don't crash.
3973
3978
3974 2004-07-13 Fernando Perez <fperez@colorado.edu>
3979 2004-07-13 Fernando Perez <fperez@colorado.edu>
3975
3980
3976 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3981 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3977 of EPS if the requested filename ends in '.eps'.
3982 of EPS if the requested filename ends in '.eps'.
3978
3983
3979 2004-07-04 Fernando Perez <fperez@colorado.edu>
3984 2004-07-04 Fernando Perez <fperez@colorado.edu>
3980
3985
3981 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3986 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3982 escaping of quotes when calling the shell.
3987 escaping of quotes when calling the shell.
3983
3988
3984 2004-07-02 Fernando Perez <fperez@colorado.edu>
3989 2004-07-02 Fernando Perez <fperez@colorado.edu>
3985
3990
3986 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3991 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3987 gettext not working because we were clobbering '_'. Fixes
3992 gettext not working because we were clobbering '_'. Fixes
3988 http://www.scipy.net/roundup/ipython/issue6.
3993 http://www.scipy.net/roundup/ipython/issue6.
3989
3994
3990 2004-07-01 Fernando Perez <fperez@colorado.edu>
3995 2004-07-01 Fernando Perez <fperez@colorado.edu>
3991
3996
3992 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3997 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3993 into @cd. Patch by Ville.
3998 into @cd. Patch by Ville.
3994
3999
3995 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4000 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3996 new function to store things after ipmaker runs. Patch by Ville.
4001 new function to store things after ipmaker runs. Patch by Ville.
3997 Eventually this will go away once ipmaker is removed and the class
4002 Eventually this will go away once ipmaker is removed and the class
3998 gets cleaned up, but for now it's ok. Key functionality here is
4003 gets cleaned up, but for now it's ok. Key functionality here is
3999 the addition of the persistent storage mechanism, a dict for
4004 the addition of the persistent storage mechanism, a dict for
4000 keeping data across sessions (for now just bookmarks, but more can
4005 keeping data across sessions (for now just bookmarks, but more can
4001 be implemented later).
4006 be implemented later).
4002
4007
4003 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4008 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4004 persistent across sections. Patch by Ville, I modified it
4009 persistent across sections. Patch by Ville, I modified it
4005 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4010 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4006 added a '-l' option to list all bookmarks.
4011 added a '-l' option to list all bookmarks.
4007
4012
4008 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4013 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4009 center for cleanup. Registered with atexit.register(). I moved
4014 center for cleanup. Registered with atexit.register(). I moved
4010 here the old exit_cleanup(). After a patch by Ville.
4015 here the old exit_cleanup(). After a patch by Ville.
4011
4016
4012 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4017 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4013 characters in the hacked shlex_split for python 2.2.
4018 characters in the hacked shlex_split for python 2.2.
4014
4019
4015 * IPython/iplib.py (file_matches): more fixes to filenames with
4020 * IPython/iplib.py (file_matches): more fixes to filenames with
4016 whitespace in them. It's not perfect, but limitations in python's
4021 whitespace in them. It's not perfect, but limitations in python's
4017 readline make it impossible to go further.
4022 readline make it impossible to go further.
4018
4023
4019 2004-06-29 Fernando Perez <fperez@colorado.edu>
4024 2004-06-29 Fernando Perez <fperez@colorado.edu>
4020
4025
4021 * IPython/iplib.py (file_matches): escape whitespace correctly in
4026 * IPython/iplib.py (file_matches): escape whitespace correctly in
4022 filename completions. Bug reported by Ville.
4027 filename completions. Bug reported by Ville.
4023
4028
4024 2004-06-28 Fernando Perez <fperez@colorado.edu>
4029 2004-06-28 Fernando Perez <fperez@colorado.edu>
4025
4030
4026 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4031 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4027 the history file will be called 'history-PROFNAME' (or just
4032 the history file will be called 'history-PROFNAME' (or just
4028 'history' if no profile is loaded). I was getting annoyed at
4033 'history' if no profile is loaded). I was getting annoyed at
4029 getting my Numerical work history clobbered by pysh sessions.
4034 getting my Numerical work history clobbered by pysh sessions.
4030
4035
4031 * IPython/iplib.py (InteractiveShell.__init__): Internal
4036 * IPython/iplib.py (InteractiveShell.__init__): Internal
4032 getoutputerror() function so that we can honor the system_verbose
4037 getoutputerror() function so that we can honor the system_verbose
4033 flag for _all_ system calls. I also added escaping of #
4038 flag for _all_ system calls. I also added escaping of #
4034 characters here to avoid confusing Itpl.
4039 characters here to avoid confusing Itpl.
4035
4040
4036 * IPython/Magic.py (shlex_split): removed call to shell in
4041 * IPython/Magic.py (shlex_split): removed call to shell in
4037 parse_options and replaced it with shlex.split(). The annoying
4042 parse_options and replaced it with shlex.split(). The annoying
4038 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4043 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4039 to backport it from 2.3, with several frail hacks (the shlex
4044 to backport it from 2.3, with several frail hacks (the shlex
4040 module is rather limited in 2.2). Thanks to a suggestion by Ville
4045 module is rather limited in 2.2). Thanks to a suggestion by Ville
4041 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4046 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4042 problem.
4047 problem.
4043
4048
4044 (Magic.magic_system_verbose): new toggle to print the actual
4049 (Magic.magic_system_verbose): new toggle to print the actual
4045 system calls made by ipython. Mainly for debugging purposes.
4050 system calls made by ipython. Mainly for debugging purposes.
4046
4051
4047 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4052 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4048 doesn't support persistence. Reported (and fix suggested) by
4053 doesn't support persistence. Reported (and fix suggested) by
4049 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4054 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4050
4055
4051 2004-06-26 Fernando Perez <fperez@colorado.edu>
4056 2004-06-26 Fernando Perez <fperez@colorado.edu>
4052
4057
4053 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4058 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4054 continue prompts.
4059 continue prompts.
4055
4060
4056 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4061 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4057 function (basically a big docstring) and a few more things here to
4062 function (basically a big docstring) and a few more things here to
4058 speedup startup. pysh.py is now very lightweight. We want because
4063 speedup startup. pysh.py is now very lightweight. We want because
4059 it gets execfile'd, while InterpreterExec gets imported, so
4064 it gets execfile'd, while InterpreterExec gets imported, so
4060 byte-compilation saves time.
4065 byte-compilation saves time.
4061
4066
4062 2004-06-25 Fernando Perez <fperez@colorado.edu>
4067 2004-06-25 Fernando Perez <fperez@colorado.edu>
4063
4068
4064 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4069 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4065 -NUM', which was recently broken.
4070 -NUM', which was recently broken.
4066
4071
4067 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4072 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4068 in multi-line input (but not !!, which doesn't make sense there).
4073 in multi-line input (but not !!, which doesn't make sense there).
4069
4074
4070 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4075 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4071 It's just too useful, and people can turn it off in the less
4076 It's just too useful, and people can turn it off in the less
4072 common cases where it's a problem.
4077 common cases where it's a problem.
4073
4078
4074 2004-06-24 Fernando Perez <fperez@colorado.edu>
4079 2004-06-24 Fernando Perez <fperez@colorado.edu>
4075
4080
4076 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4081 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4077 special syntaxes (like alias calling) is now allied in multi-line
4082 special syntaxes (like alias calling) is now allied in multi-line
4078 input. This is still _very_ experimental, but it's necessary for
4083 input. This is still _very_ experimental, but it's necessary for
4079 efficient shell usage combining python looping syntax with system
4084 efficient shell usage combining python looping syntax with system
4080 calls. For now it's restricted to aliases, I don't think it
4085 calls. For now it's restricted to aliases, I don't think it
4081 really even makes sense to have this for magics.
4086 really even makes sense to have this for magics.
4082
4087
4083 2004-06-23 Fernando Perez <fperez@colorado.edu>
4088 2004-06-23 Fernando Perez <fperez@colorado.edu>
4084
4089
4085 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4090 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4086 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4091 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4087
4092
4088 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4093 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4089 extensions under Windows (after code sent by Gary Bishop). The
4094 extensions under Windows (after code sent by Gary Bishop). The
4090 extensions considered 'executable' are stored in IPython's rc
4095 extensions considered 'executable' are stored in IPython's rc
4091 structure as win_exec_ext.
4096 structure as win_exec_ext.
4092
4097
4093 * IPython/genutils.py (shell): new function, like system() but
4098 * IPython/genutils.py (shell): new function, like system() but
4094 without return value. Very useful for interactive shell work.
4099 without return value. Very useful for interactive shell work.
4095
4100
4096 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4101 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4097 delete aliases.
4102 delete aliases.
4098
4103
4099 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4104 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4100 sure that the alias table doesn't contain python keywords.
4105 sure that the alias table doesn't contain python keywords.
4101
4106
4102 2004-06-21 Fernando Perez <fperez@colorado.edu>
4107 2004-06-21 Fernando Perez <fperez@colorado.edu>
4103
4108
4104 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4109 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4105 non-existent items are found in $PATH. Reported by Thorsten.
4110 non-existent items are found in $PATH. Reported by Thorsten.
4106
4111
4107 2004-06-20 Fernando Perez <fperez@colorado.edu>
4112 2004-06-20 Fernando Perez <fperez@colorado.edu>
4108
4113
4109 * IPython/iplib.py (complete): modified the completer so that the
4114 * IPython/iplib.py (complete): modified the completer so that the
4110 order of priorities can be easily changed at runtime.
4115 order of priorities can be easily changed at runtime.
4111
4116
4112 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4117 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4113 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4118 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4114
4119
4115 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4120 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4116 expand Python variables prepended with $ in all system calls. The
4121 expand Python variables prepended with $ in all system calls. The
4117 same was done to InteractiveShell.handle_shell_escape. Now all
4122 same was done to InteractiveShell.handle_shell_escape. Now all
4118 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4123 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4119 expansion of python variables and expressions according to the
4124 expansion of python variables and expressions according to the
4120 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4125 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4121
4126
4122 Though PEP-215 has been rejected, a similar (but simpler) one
4127 Though PEP-215 has been rejected, a similar (but simpler) one
4123 seems like it will go into Python 2.4, PEP-292 -
4128 seems like it will go into Python 2.4, PEP-292 -
4124 http://www.python.org/peps/pep-0292.html.
4129 http://www.python.org/peps/pep-0292.html.
4125
4130
4126 I'll keep the full syntax of PEP-215, since IPython has since the
4131 I'll keep the full syntax of PEP-215, since IPython has since the
4127 start used Ka-Ping Yee's reference implementation discussed there
4132 start used Ka-Ping Yee's reference implementation discussed there
4128 (Itpl), and I actually like the powerful semantics it offers.
4133 (Itpl), and I actually like the powerful semantics it offers.
4129
4134
4130 In order to access normal shell variables, the $ has to be escaped
4135 In order to access normal shell variables, the $ has to be escaped
4131 via an extra $. For example:
4136 via an extra $. For example:
4132
4137
4133 In [7]: PATH='a python variable'
4138 In [7]: PATH='a python variable'
4134
4139
4135 In [8]: !echo $PATH
4140 In [8]: !echo $PATH
4136 a python variable
4141 a python variable
4137
4142
4138 In [9]: !echo $$PATH
4143 In [9]: !echo $$PATH
4139 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4144 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4140
4145
4141 (Magic.parse_options): escape $ so the shell doesn't evaluate
4146 (Magic.parse_options): escape $ so the shell doesn't evaluate
4142 things prematurely.
4147 things prematurely.
4143
4148
4144 * IPython/iplib.py (InteractiveShell.call_alias): added the
4149 * IPython/iplib.py (InteractiveShell.call_alias): added the
4145 ability for aliases to expand python variables via $.
4150 ability for aliases to expand python variables via $.
4146
4151
4147 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4152 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4148 system, now there's a @rehash/@rehashx pair of magics. These work
4153 system, now there's a @rehash/@rehashx pair of magics. These work
4149 like the csh rehash command, and can be invoked at any time. They
4154 like the csh rehash command, and can be invoked at any time. They
4150 build a table of aliases to everything in the user's $PATH
4155 build a table of aliases to everything in the user's $PATH
4151 (@rehash uses everything, @rehashx is slower but only adds
4156 (@rehash uses everything, @rehashx is slower but only adds
4152 executable files). With this, the pysh.py-based shell profile can
4157 executable files). With this, the pysh.py-based shell profile can
4153 now simply call rehash upon startup, and full access to all
4158 now simply call rehash upon startup, and full access to all
4154 programs in the user's path is obtained.
4159 programs in the user's path is obtained.
4155
4160
4156 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4161 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4157 functionality is now fully in place. I removed the old dynamic
4162 functionality is now fully in place. I removed the old dynamic
4158 code generation based approach, in favor of a much lighter one
4163 code generation based approach, in favor of a much lighter one
4159 based on a simple dict. The advantage is that this allows me to
4164 based on a simple dict. The advantage is that this allows me to
4160 now have thousands of aliases with negligible cost (unthinkable
4165 now have thousands of aliases with negligible cost (unthinkable
4161 with the old system).
4166 with the old system).
4162
4167
4163 2004-06-19 Fernando Perez <fperez@colorado.edu>
4168 2004-06-19 Fernando Perez <fperez@colorado.edu>
4164
4169
4165 * IPython/iplib.py (__init__): extended MagicCompleter class to
4170 * IPython/iplib.py (__init__): extended MagicCompleter class to
4166 also complete (last in priority) on user aliases.
4171 also complete (last in priority) on user aliases.
4167
4172
4168 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4173 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4169 call to eval.
4174 call to eval.
4170 (ItplNS.__init__): Added a new class which functions like Itpl,
4175 (ItplNS.__init__): Added a new class which functions like Itpl,
4171 but allows configuring the namespace for the evaluation to occur
4176 but allows configuring the namespace for the evaluation to occur
4172 in.
4177 in.
4173
4178
4174 2004-06-18 Fernando Perez <fperez@colorado.edu>
4179 2004-06-18 Fernando Perez <fperez@colorado.edu>
4175
4180
4176 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4181 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4177 better message when 'exit' or 'quit' are typed (a common newbie
4182 better message when 'exit' or 'quit' are typed (a common newbie
4178 confusion).
4183 confusion).
4179
4184
4180 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4185 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4181 check for Windows users.
4186 check for Windows users.
4182
4187
4183 * IPython/iplib.py (InteractiveShell.user_setup): removed
4188 * IPython/iplib.py (InteractiveShell.user_setup): removed
4184 disabling of colors for Windows. I'll test at runtime and issue a
4189 disabling of colors for Windows. I'll test at runtime and issue a
4185 warning if Gary's readline isn't found, as to nudge users to
4190 warning if Gary's readline isn't found, as to nudge users to
4186 download it.
4191 download it.
4187
4192
4188 2004-06-16 Fernando Perez <fperez@colorado.edu>
4193 2004-06-16 Fernando Perez <fperez@colorado.edu>
4189
4194
4190 * IPython/genutils.py (Stream.__init__): changed to print errors
4195 * IPython/genutils.py (Stream.__init__): changed to print errors
4191 to sys.stderr. I had a circular dependency here. Now it's
4196 to sys.stderr. I had a circular dependency here. Now it's
4192 possible to run ipython as IDLE's shell (consider this pre-alpha,
4197 possible to run ipython as IDLE's shell (consider this pre-alpha,
4193 since true stdout things end up in the starting terminal instead
4198 since true stdout things end up in the starting terminal instead
4194 of IDLE's out).
4199 of IDLE's out).
4195
4200
4196 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4201 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4197 users who haven't # updated their prompt_in2 definitions. Remove
4202 users who haven't # updated their prompt_in2 definitions. Remove
4198 eventually.
4203 eventually.
4199 (multiple_replace): added credit to original ASPN recipe.
4204 (multiple_replace): added credit to original ASPN recipe.
4200
4205
4201 2004-06-15 Fernando Perez <fperez@colorado.edu>
4206 2004-06-15 Fernando Perez <fperez@colorado.edu>
4202
4207
4203 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4208 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4204 list of auto-defined aliases.
4209 list of auto-defined aliases.
4205
4210
4206 2004-06-13 Fernando Perez <fperez@colorado.edu>
4211 2004-06-13 Fernando Perez <fperez@colorado.edu>
4207
4212
4208 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4213 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4209 install was really requested (so setup.py can be used for other
4214 install was really requested (so setup.py can be used for other
4210 things under Windows).
4215 things under Windows).
4211
4216
4212 2004-06-10 Fernando Perez <fperez@colorado.edu>
4217 2004-06-10 Fernando Perez <fperez@colorado.edu>
4213
4218
4214 * IPython/Logger.py (Logger.create_log): Manually remove any old
4219 * IPython/Logger.py (Logger.create_log): Manually remove any old
4215 backup, since os.remove may fail under Windows. Fixes bug
4220 backup, since os.remove may fail under Windows. Fixes bug
4216 reported by Thorsten.
4221 reported by Thorsten.
4217
4222
4218 2004-06-09 Fernando Perez <fperez@colorado.edu>
4223 2004-06-09 Fernando Perez <fperez@colorado.edu>
4219
4224
4220 * examples/example-embed.py: fixed all references to %n (replaced
4225 * examples/example-embed.py: fixed all references to %n (replaced
4221 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4226 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4222 for all examples and the manual as well.
4227 for all examples and the manual as well.
4223
4228
4224 2004-06-08 Fernando Perez <fperez@colorado.edu>
4229 2004-06-08 Fernando Perez <fperez@colorado.edu>
4225
4230
4226 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4231 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4227 alignment and color management. All 3 prompt subsystems now
4232 alignment and color management. All 3 prompt subsystems now
4228 inherit from BasePrompt.
4233 inherit from BasePrompt.
4229
4234
4230 * tools/release: updates for windows installer build and tag rpms
4235 * tools/release: updates for windows installer build and tag rpms
4231 with python version (since paths are fixed).
4236 with python version (since paths are fixed).
4232
4237
4233 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4238 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4234 which will become eventually obsolete. Also fixed the default
4239 which will become eventually obsolete. Also fixed the default
4235 prompt_in2 to use \D, so at least new users start with the correct
4240 prompt_in2 to use \D, so at least new users start with the correct
4236 defaults.
4241 defaults.
4237 WARNING: Users with existing ipythonrc files will need to apply
4242 WARNING: Users with existing ipythonrc files will need to apply
4238 this fix manually!
4243 this fix manually!
4239
4244
4240 * setup.py: make windows installer (.exe). This is finally the
4245 * setup.py: make windows installer (.exe). This is finally the
4241 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4246 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4242 which I hadn't included because it required Python 2.3 (or recent
4247 which I hadn't included because it required Python 2.3 (or recent
4243 distutils).
4248 distutils).
4244
4249
4245 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4250 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4246 usage of new '\D' escape.
4251 usage of new '\D' escape.
4247
4252
4248 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4253 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4249 lacks os.getuid())
4254 lacks os.getuid())
4250 (CachedOutput.set_colors): Added the ability to turn coloring
4255 (CachedOutput.set_colors): Added the ability to turn coloring
4251 on/off with @colors even for manually defined prompt colors. It
4256 on/off with @colors even for manually defined prompt colors. It
4252 uses a nasty global, but it works safely and via the generic color
4257 uses a nasty global, but it works safely and via the generic color
4253 handling mechanism.
4258 handling mechanism.
4254 (Prompt2.__init__): Introduced new escape '\D' for continuation
4259 (Prompt2.__init__): Introduced new escape '\D' for continuation
4255 prompts. It represents the counter ('\#') as dots.
4260 prompts. It represents the counter ('\#') as dots.
4256 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4261 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4257 need to update their ipythonrc files and replace '%n' with '\D' in
4262 need to update their ipythonrc files and replace '%n' with '\D' in
4258 their prompt_in2 settings everywhere. Sorry, but there's
4263 their prompt_in2 settings everywhere. Sorry, but there's
4259 otherwise no clean way to get all prompts to properly align. The
4264 otherwise no clean way to get all prompts to properly align. The
4260 ipythonrc shipped with IPython has been updated.
4265 ipythonrc shipped with IPython has been updated.
4261
4266
4262 2004-06-07 Fernando Perez <fperez@colorado.edu>
4267 2004-06-07 Fernando Perez <fperez@colorado.edu>
4263
4268
4264 * setup.py (isfile): Pass local_icons option to latex2html, so the
4269 * setup.py (isfile): Pass local_icons option to latex2html, so the
4265 resulting HTML file is self-contained. Thanks to
4270 resulting HTML file is self-contained. Thanks to
4266 dryice-AT-liu.com.cn for the tip.
4271 dryice-AT-liu.com.cn for the tip.
4267
4272
4268 * pysh.py: I created a new profile 'shell', which implements a
4273 * pysh.py: I created a new profile 'shell', which implements a
4269 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4274 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4270 system shell, nor will it become one anytime soon. It's mainly
4275 system shell, nor will it become one anytime soon. It's mainly
4271 meant to illustrate the use of the new flexible bash-like prompts.
4276 meant to illustrate the use of the new flexible bash-like prompts.
4272 I guess it could be used by hardy souls for true shell management,
4277 I guess it could be used by hardy souls for true shell management,
4273 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4278 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4274 profile. This uses the InterpreterExec extension provided by
4279 profile. This uses the InterpreterExec extension provided by
4275 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4280 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4276
4281
4277 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4282 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4278 auto-align itself with the length of the previous input prompt
4283 auto-align itself with the length of the previous input prompt
4279 (taking into account the invisible color escapes).
4284 (taking into account the invisible color escapes).
4280 (CachedOutput.__init__): Large restructuring of this class. Now
4285 (CachedOutput.__init__): Large restructuring of this class. Now
4281 all three prompts (primary1, primary2, output) are proper objects,
4286 all three prompts (primary1, primary2, output) are proper objects,
4282 managed by the 'parent' CachedOutput class. The code is still a
4287 managed by the 'parent' CachedOutput class. The code is still a
4283 bit hackish (all prompts share state via a pointer to the cache),
4288 bit hackish (all prompts share state via a pointer to the cache),
4284 but it's overall far cleaner than before.
4289 but it's overall far cleaner than before.
4285
4290
4286 * IPython/genutils.py (getoutputerror): modified to add verbose,
4291 * IPython/genutils.py (getoutputerror): modified to add verbose,
4287 debug and header options. This makes the interface of all getout*
4292 debug and header options. This makes the interface of all getout*
4288 functions uniform.
4293 functions uniform.
4289 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4294 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4290
4295
4291 * IPython/Magic.py (Magic.default_option): added a function to
4296 * IPython/Magic.py (Magic.default_option): added a function to
4292 allow registering default options for any magic command. This
4297 allow registering default options for any magic command. This
4293 makes it easy to have profiles which customize the magics globally
4298 makes it easy to have profiles which customize the magics globally
4294 for a certain use. The values set through this function are
4299 for a certain use. The values set through this function are
4295 picked up by the parse_options() method, which all magics should
4300 picked up by the parse_options() method, which all magics should
4296 use to parse their options.
4301 use to parse their options.
4297
4302
4298 * IPython/genutils.py (warn): modified the warnings framework to
4303 * IPython/genutils.py (warn): modified the warnings framework to
4299 use the Term I/O class. I'm trying to slowly unify all of
4304 use the Term I/O class. I'm trying to slowly unify all of
4300 IPython's I/O operations to pass through Term.
4305 IPython's I/O operations to pass through Term.
4301
4306
4302 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4307 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4303 the secondary prompt to correctly match the length of the primary
4308 the secondary prompt to correctly match the length of the primary
4304 one for any prompt. Now multi-line code will properly line up
4309 one for any prompt. Now multi-line code will properly line up
4305 even for path dependent prompts, such as the new ones available
4310 even for path dependent prompts, such as the new ones available
4306 via the prompt_specials.
4311 via the prompt_specials.
4307
4312
4308 2004-06-06 Fernando Perez <fperez@colorado.edu>
4313 2004-06-06 Fernando Perez <fperez@colorado.edu>
4309
4314
4310 * IPython/Prompts.py (prompt_specials): Added the ability to have
4315 * IPython/Prompts.py (prompt_specials): Added the ability to have
4311 bash-like special sequences in the prompts, which get
4316 bash-like special sequences in the prompts, which get
4312 automatically expanded. Things like hostname, current working
4317 automatically expanded. Things like hostname, current working
4313 directory and username are implemented already, but it's easy to
4318 directory and username are implemented already, but it's easy to
4314 add more in the future. Thanks to a patch by W.J. van der Laan
4319 add more in the future. Thanks to a patch by W.J. van der Laan
4315 <gnufnork-AT-hetdigitalegat.nl>
4320 <gnufnork-AT-hetdigitalegat.nl>
4316 (prompt_specials): Added color support for prompt strings, so
4321 (prompt_specials): Added color support for prompt strings, so
4317 users can define arbitrary color setups for their prompts.
4322 users can define arbitrary color setups for their prompts.
4318
4323
4319 2004-06-05 Fernando Perez <fperez@colorado.edu>
4324 2004-06-05 Fernando Perez <fperez@colorado.edu>
4320
4325
4321 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4326 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4322 code to load Gary Bishop's readline and configure it
4327 code to load Gary Bishop's readline and configure it
4323 automatically. Thanks to Gary for help on this.
4328 automatically. Thanks to Gary for help on this.
4324
4329
4325 2004-06-01 Fernando Perez <fperez@colorado.edu>
4330 2004-06-01 Fernando Perez <fperez@colorado.edu>
4326
4331
4327 * IPython/Logger.py (Logger.create_log): fix bug for logging
4332 * IPython/Logger.py (Logger.create_log): fix bug for logging
4328 with no filename (previous fix was incomplete).
4333 with no filename (previous fix was incomplete).
4329
4334
4330 2004-05-25 Fernando Perez <fperez@colorado.edu>
4335 2004-05-25 Fernando Perez <fperez@colorado.edu>
4331
4336
4332 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4337 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4333 parens would get passed to the shell.
4338 parens would get passed to the shell.
4334
4339
4335 2004-05-20 Fernando Perez <fperez@colorado.edu>
4340 2004-05-20 Fernando Perez <fperez@colorado.edu>
4336
4341
4337 * IPython/Magic.py (Magic.magic_prun): changed default profile
4342 * IPython/Magic.py (Magic.magic_prun): changed default profile
4338 sort order to 'time' (the more common profiling need).
4343 sort order to 'time' (the more common profiling need).
4339
4344
4340 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4345 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4341 so that source code shown is guaranteed in sync with the file on
4346 so that source code shown is guaranteed in sync with the file on
4342 disk (also changed in psource). Similar fix to the one for
4347 disk (also changed in psource). Similar fix to the one for
4343 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4348 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4344 <yann.ledu-AT-noos.fr>.
4349 <yann.ledu-AT-noos.fr>.
4345
4350
4346 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4351 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4347 with a single option would not be correctly parsed. Closes
4352 with a single option would not be correctly parsed. Closes
4348 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4353 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4349 introduced in 0.6.0 (on 2004-05-06).
4354 introduced in 0.6.0 (on 2004-05-06).
4350
4355
4351 2004-05-13 *** Released version 0.6.0
4356 2004-05-13 *** Released version 0.6.0
4352
4357
4353 2004-05-13 Fernando Perez <fperez@colorado.edu>
4358 2004-05-13 Fernando Perez <fperez@colorado.edu>
4354
4359
4355 * debian/: Added debian/ directory to CVS, so that debian support
4360 * debian/: Added debian/ directory to CVS, so that debian support
4356 is publicly accessible. The debian package is maintained by Jack
4361 is publicly accessible. The debian package is maintained by Jack
4357 Moffit <jack-AT-xiph.org>.
4362 Moffit <jack-AT-xiph.org>.
4358
4363
4359 * Documentation: included the notes about an ipython-based system
4364 * Documentation: included the notes about an ipython-based system
4360 shell (the hypothetical 'pysh') into the new_design.pdf document,
4365 shell (the hypothetical 'pysh') into the new_design.pdf document,
4361 so that these ideas get distributed to users along with the
4366 so that these ideas get distributed to users along with the
4362 official documentation.
4367 official documentation.
4363
4368
4364 2004-05-10 Fernando Perez <fperez@colorado.edu>
4369 2004-05-10 Fernando Perez <fperez@colorado.edu>
4365
4370
4366 * IPython/Logger.py (Logger.create_log): fix recently introduced
4371 * IPython/Logger.py (Logger.create_log): fix recently introduced
4367 bug (misindented line) where logstart would fail when not given an
4372 bug (misindented line) where logstart would fail when not given an
4368 explicit filename.
4373 explicit filename.
4369
4374
4370 2004-05-09 Fernando Perez <fperez@colorado.edu>
4375 2004-05-09 Fernando Perez <fperez@colorado.edu>
4371
4376
4372 * IPython/Magic.py (Magic.parse_options): skip system call when
4377 * IPython/Magic.py (Magic.parse_options): skip system call when
4373 there are no options to look for. Faster, cleaner for the common
4378 there are no options to look for. Faster, cleaner for the common
4374 case.
4379 case.
4375
4380
4376 * Documentation: many updates to the manual: describing Windows
4381 * Documentation: many updates to the manual: describing Windows
4377 support better, Gnuplot updates, credits, misc small stuff. Also
4382 support better, Gnuplot updates, credits, misc small stuff. Also
4378 updated the new_design doc a bit.
4383 updated the new_design doc a bit.
4379
4384
4380 2004-05-06 *** Released version 0.6.0.rc1
4385 2004-05-06 *** Released version 0.6.0.rc1
4381
4386
4382 2004-05-06 Fernando Perez <fperez@colorado.edu>
4387 2004-05-06 Fernando Perez <fperez@colorado.edu>
4383
4388
4384 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4389 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4385 operations to use the vastly more efficient list/''.join() method.
4390 operations to use the vastly more efficient list/''.join() method.
4386 (FormattedTB.text): Fix
4391 (FormattedTB.text): Fix
4387 http://www.scipy.net/roundup/ipython/issue12 - exception source
4392 http://www.scipy.net/roundup/ipython/issue12 - exception source
4388 extract not updated after reload. Thanks to Mike Salib
4393 extract not updated after reload. Thanks to Mike Salib
4389 <msalib-AT-mit.edu> for pinning the source of the problem.
4394 <msalib-AT-mit.edu> for pinning the source of the problem.
4390 Fortunately, the solution works inside ipython and doesn't require
4395 Fortunately, the solution works inside ipython and doesn't require
4391 any changes to python proper.
4396 any changes to python proper.
4392
4397
4393 * IPython/Magic.py (Magic.parse_options): Improved to process the
4398 * IPython/Magic.py (Magic.parse_options): Improved to process the
4394 argument list as a true shell would (by actually using the
4399 argument list as a true shell would (by actually using the
4395 underlying system shell). This way, all @magics automatically get
4400 underlying system shell). This way, all @magics automatically get
4396 shell expansion for variables. Thanks to a comment by Alex
4401 shell expansion for variables. Thanks to a comment by Alex
4397 Schmolck.
4402 Schmolck.
4398
4403
4399 2004-04-04 Fernando Perez <fperez@colorado.edu>
4404 2004-04-04 Fernando Perez <fperez@colorado.edu>
4400
4405
4401 * IPython/iplib.py (InteractiveShell.interact): Added a special
4406 * IPython/iplib.py (InteractiveShell.interact): Added a special
4402 trap for a debugger quit exception, which is basically impossible
4407 trap for a debugger quit exception, which is basically impossible
4403 to handle by normal mechanisms, given what pdb does to the stack.
4408 to handle by normal mechanisms, given what pdb does to the stack.
4404 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4409 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4405
4410
4406 2004-04-03 Fernando Perez <fperez@colorado.edu>
4411 2004-04-03 Fernando Perez <fperez@colorado.edu>
4407
4412
4408 * IPython/genutils.py (Term): Standardized the names of the Term
4413 * IPython/genutils.py (Term): Standardized the names of the Term
4409 class streams to cin/cout/cerr, following C++ naming conventions
4414 class streams to cin/cout/cerr, following C++ naming conventions
4410 (I can't use in/out/err because 'in' is not a valid attribute
4415 (I can't use in/out/err because 'in' is not a valid attribute
4411 name).
4416 name).
4412
4417
4413 * IPython/iplib.py (InteractiveShell.interact): don't increment
4418 * IPython/iplib.py (InteractiveShell.interact): don't increment
4414 the prompt if there's no user input. By Daniel 'Dang' Griffith
4419 the prompt if there's no user input. By Daniel 'Dang' Griffith
4415 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4420 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4416 Francois Pinard.
4421 Francois Pinard.
4417
4422
4418 2004-04-02 Fernando Perez <fperez@colorado.edu>
4423 2004-04-02 Fernando Perez <fperez@colorado.edu>
4419
4424
4420 * IPython/genutils.py (Stream.__init__): Modified to survive at
4425 * IPython/genutils.py (Stream.__init__): Modified to survive at
4421 least importing in contexts where stdin/out/err aren't true file
4426 least importing in contexts where stdin/out/err aren't true file
4422 objects, such as PyCrust (they lack fileno() and mode). However,
4427 objects, such as PyCrust (they lack fileno() and mode). However,
4423 the recovery facilities which rely on these things existing will
4428 the recovery facilities which rely on these things existing will
4424 not work.
4429 not work.
4425
4430
4426 2004-04-01 Fernando Perez <fperez@colorado.edu>
4431 2004-04-01 Fernando Perez <fperez@colorado.edu>
4427
4432
4428 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4433 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4429 use the new getoutputerror() function, so it properly
4434 use the new getoutputerror() function, so it properly
4430 distinguishes stdout/err.
4435 distinguishes stdout/err.
4431
4436
4432 * IPython/genutils.py (getoutputerror): added a function to
4437 * IPython/genutils.py (getoutputerror): added a function to
4433 capture separately the standard output and error of a command.
4438 capture separately the standard output and error of a command.
4434 After a comment from dang on the mailing lists. This code is
4439 After a comment from dang on the mailing lists. This code is
4435 basically a modified version of commands.getstatusoutput(), from
4440 basically a modified version of commands.getstatusoutput(), from
4436 the standard library.
4441 the standard library.
4437
4442
4438 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4443 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4439 '!!' as a special syntax (shorthand) to access @sx.
4444 '!!' as a special syntax (shorthand) to access @sx.
4440
4445
4441 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4446 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4442 command and return its output as a list split on '\n'.
4447 command and return its output as a list split on '\n'.
4443
4448
4444 2004-03-31 Fernando Perez <fperez@colorado.edu>
4449 2004-03-31 Fernando Perez <fperez@colorado.edu>
4445
4450
4446 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4451 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4447 method to dictionaries used as FakeModule instances if they lack
4452 method to dictionaries used as FakeModule instances if they lack
4448 it. At least pydoc in python2.3 breaks for runtime-defined
4453 it. At least pydoc in python2.3 breaks for runtime-defined
4449 functions without this hack. At some point I need to _really_
4454 functions without this hack. At some point I need to _really_
4450 understand what FakeModule is doing, because it's a gross hack.
4455 understand what FakeModule is doing, because it's a gross hack.
4451 But it solves Arnd's problem for now...
4456 But it solves Arnd's problem for now...
4452
4457
4453 2004-02-27 Fernando Perez <fperez@colorado.edu>
4458 2004-02-27 Fernando Perez <fperez@colorado.edu>
4454
4459
4455 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4460 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4456 mode would behave erratically. Also increased the number of
4461 mode would behave erratically. Also increased the number of
4457 possible logs in rotate mod to 999. Thanks to Rod Holland
4462 possible logs in rotate mod to 999. Thanks to Rod Holland
4458 <rhh@StructureLABS.com> for the report and fixes.
4463 <rhh@StructureLABS.com> for the report and fixes.
4459
4464
4460 2004-02-26 Fernando Perez <fperez@colorado.edu>
4465 2004-02-26 Fernando Perez <fperez@colorado.edu>
4461
4466
4462 * IPython/genutils.py (page): Check that the curses module really
4467 * IPython/genutils.py (page): Check that the curses module really
4463 has the initscr attribute before trying to use it. For some
4468 has the initscr attribute before trying to use it. For some
4464 reason, the Solaris curses module is missing this. I think this
4469 reason, the Solaris curses module is missing this. I think this
4465 should be considered a Solaris python bug, but I'm not sure.
4470 should be considered a Solaris python bug, but I'm not sure.
4466
4471
4467 2004-01-17 Fernando Perez <fperez@colorado.edu>
4472 2004-01-17 Fernando Perez <fperez@colorado.edu>
4468
4473
4469 * IPython/genutils.py (Stream.__init__): Changes to try to make
4474 * IPython/genutils.py (Stream.__init__): Changes to try to make
4470 ipython robust against stdin/out/err being closed by the user.
4475 ipython robust against stdin/out/err being closed by the user.
4471 This is 'user error' (and blocks a normal python session, at least
4476 This is 'user error' (and blocks a normal python session, at least
4472 the stdout case). However, Ipython should be able to survive such
4477 the stdout case). However, Ipython should be able to survive such
4473 instances of abuse as gracefully as possible. To simplify the
4478 instances of abuse as gracefully as possible. To simplify the
4474 coding and maintain compatibility with Gary Bishop's Term
4479 coding and maintain compatibility with Gary Bishop's Term
4475 contributions, I've made use of classmethods for this. I think
4480 contributions, I've made use of classmethods for this. I think
4476 this introduces a dependency on python 2.2.
4481 this introduces a dependency on python 2.2.
4477
4482
4478 2004-01-13 Fernando Perez <fperez@colorado.edu>
4483 2004-01-13 Fernando Perez <fperez@colorado.edu>
4479
4484
4480 * IPython/numutils.py (exp_safe): simplified the code a bit and
4485 * IPython/numutils.py (exp_safe): simplified the code a bit and
4481 removed the need for importing the kinds module altogether.
4486 removed the need for importing the kinds module altogether.
4482
4487
4483 2004-01-06 Fernando Perez <fperez@colorado.edu>
4488 2004-01-06 Fernando Perez <fperez@colorado.edu>
4484
4489
4485 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4490 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4486 a magic function instead, after some community feedback. No
4491 a magic function instead, after some community feedback. No
4487 special syntax will exist for it, but its name is deliberately
4492 special syntax will exist for it, but its name is deliberately
4488 very short.
4493 very short.
4489
4494
4490 2003-12-20 Fernando Perez <fperez@colorado.edu>
4495 2003-12-20 Fernando Perez <fperez@colorado.edu>
4491
4496
4492 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4497 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4493 new functionality, to automagically assign the result of a shell
4498 new functionality, to automagically assign the result of a shell
4494 command to a variable. I'll solicit some community feedback on
4499 command to a variable. I'll solicit some community feedback on
4495 this before making it permanent.
4500 this before making it permanent.
4496
4501
4497 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4502 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4498 requested about callables for which inspect couldn't obtain a
4503 requested about callables for which inspect couldn't obtain a
4499 proper argspec. Thanks to a crash report sent by Etienne
4504 proper argspec. Thanks to a crash report sent by Etienne
4500 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4505 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4501
4506
4502 2003-12-09 Fernando Perez <fperez@colorado.edu>
4507 2003-12-09 Fernando Perez <fperez@colorado.edu>
4503
4508
4504 * IPython/genutils.py (page): patch for the pager to work across
4509 * IPython/genutils.py (page): patch for the pager to work across
4505 various versions of Windows. By Gary Bishop.
4510 various versions of Windows. By Gary Bishop.
4506
4511
4507 2003-12-04 Fernando Perez <fperez@colorado.edu>
4512 2003-12-04 Fernando Perez <fperez@colorado.edu>
4508
4513
4509 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4514 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4510 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4515 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4511 While I tested this and it looks ok, there may still be corner
4516 While I tested this and it looks ok, there may still be corner
4512 cases I've missed.
4517 cases I've missed.
4513
4518
4514 2003-12-01 Fernando Perez <fperez@colorado.edu>
4519 2003-12-01 Fernando Perez <fperez@colorado.edu>
4515
4520
4516 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4521 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4517 where a line like 'p,q=1,2' would fail because the automagic
4522 where a line like 'p,q=1,2' would fail because the automagic
4518 system would be triggered for @p.
4523 system would be triggered for @p.
4519
4524
4520 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4525 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4521 cleanups, code unmodified.
4526 cleanups, code unmodified.
4522
4527
4523 * IPython/genutils.py (Term): added a class for IPython to handle
4528 * IPython/genutils.py (Term): added a class for IPython to handle
4524 output. In most cases it will just be a proxy for stdout/err, but
4529 output. In most cases it will just be a proxy for stdout/err, but
4525 having this allows modifications to be made for some platforms,
4530 having this allows modifications to be made for some platforms,
4526 such as handling color escapes under Windows. All of this code
4531 such as handling color escapes under Windows. All of this code
4527 was contributed by Gary Bishop, with minor modifications by me.
4532 was contributed by Gary Bishop, with minor modifications by me.
4528 The actual changes affect many files.
4533 The actual changes affect many files.
4529
4534
4530 2003-11-30 Fernando Perez <fperez@colorado.edu>
4535 2003-11-30 Fernando Perez <fperez@colorado.edu>
4531
4536
4532 * IPython/iplib.py (file_matches): new completion code, courtesy
4537 * IPython/iplib.py (file_matches): new completion code, courtesy
4533 of Jeff Collins. This enables filename completion again under
4538 of Jeff Collins. This enables filename completion again under
4534 python 2.3, which disabled it at the C level.
4539 python 2.3, which disabled it at the C level.
4535
4540
4536 2003-11-11 Fernando Perez <fperez@colorado.edu>
4541 2003-11-11 Fernando Perez <fperez@colorado.edu>
4537
4542
4538 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4543 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4539 for Numeric.array(map(...)), but often convenient.
4544 for Numeric.array(map(...)), but often convenient.
4540
4545
4541 2003-11-05 Fernando Perez <fperez@colorado.edu>
4546 2003-11-05 Fernando Perez <fperez@colorado.edu>
4542
4547
4543 * IPython/numutils.py (frange): Changed a call from int() to
4548 * IPython/numutils.py (frange): Changed a call from int() to
4544 int(round()) to prevent a problem reported with arange() in the
4549 int(round()) to prevent a problem reported with arange() in the
4545 numpy list.
4550 numpy list.
4546
4551
4547 2003-10-06 Fernando Perez <fperez@colorado.edu>
4552 2003-10-06 Fernando Perez <fperez@colorado.edu>
4548
4553
4549 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4554 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4550 prevent crashes if sys lacks an argv attribute (it happens with
4555 prevent crashes if sys lacks an argv attribute (it happens with
4551 embedded interpreters which build a bare-bones sys module).
4556 embedded interpreters which build a bare-bones sys module).
4552 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4557 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4553
4558
4554 2003-09-24 Fernando Perez <fperez@colorado.edu>
4559 2003-09-24 Fernando Perez <fperez@colorado.edu>
4555
4560
4556 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4561 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4557 to protect against poorly written user objects where __getattr__
4562 to protect against poorly written user objects where __getattr__
4558 raises exceptions other than AttributeError. Thanks to a bug
4563 raises exceptions other than AttributeError. Thanks to a bug
4559 report by Oliver Sander <osander-AT-gmx.de>.
4564 report by Oliver Sander <osander-AT-gmx.de>.
4560
4565
4561 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4566 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4562 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4567 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4563
4568
4564 2003-09-09 Fernando Perez <fperez@colorado.edu>
4569 2003-09-09 Fernando Perez <fperez@colorado.edu>
4565
4570
4566 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4571 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4567 unpacking a list whith a callable as first element would
4572 unpacking a list whith a callable as first element would
4568 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4573 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4569 Collins.
4574 Collins.
4570
4575
4571 2003-08-25 *** Released version 0.5.0
4576 2003-08-25 *** Released version 0.5.0
4572
4577
4573 2003-08-22 Fernando Perez <fperez@colorado.edu>
4578 2003-08-22 Fernando Perez <fperez@colorado.edu>
4574
4579
4575 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4580 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4576 improperly defined user exceptions. Thanks to feedback from Mark
4581 improperly defined user exceptions. Thanks to feedback from Mark
4577 Russell <mrussell-AT-verio.net>.
4582 Russell <mrussell-AT-verio.net>.
4578
4583
4579 2003-08-20 Fernando Perez <fperez@colorado.edu>
4584 2003-08-20 Fernando Perez <fperez@colorado.edu>
4580
4585
4581 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4586 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4582 printing so that it would print multi-line string forms starting
4587 printing so that it would print multi-line string forms starting
4583 with a new line. This way the formatting is better respected for
4588 with a new line. This way the formatting is better respected for
4584 objects which work hard to make nice string forms.
4589 objects which work hard to make nice string forms.
4585
4590
4586 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4591 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4587 autocall would overtake data access for objects with both
4592 autocall would overtake data access for objects with both
4588 __getitem__ and __call__.
4593 __getitem__ and __call__.
4589
4594
4590 2003-08-19 *** Released version 0.5.0-rc1
4595 2003-08-19 *** Released version 0.5.0-rc1
4591
4596
4592 2003-08-19 Fernando Perez <fperez@colorado.edu>
4597 2003-08-19 Fernando Perez <fperez@colorado.edu>
4593
4598
4594 * IPython/deep_reload.py (load_tail): single tiny change here
4599 * IPython/deep_reload.py (load_tail): single tiny change here
4595 seems to fix the long-standing bug of dreload() failing to work
4600 seems to fix the long-standing bug of dreload() failing to work
4596 for dotted names. But this module is pretty tricky, so I may have
4601 for dotted names. But this module is pretty tricky, so I may have
4597 missed some subtlety. Needs more testing!.
4602 missed some subtlety. Needs more testing!.
4598
4603
4599 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4604 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4600 exceptions which have badly implemented __str__ methods.
4605 exceptions which have badly implemented __str__ methods.
4601 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4606 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4602 which I've been getting reports about from Python 2.3 users. I
4607 which I've been getting reports about from Python 2.3 users. I
4603 wish I had a simple test case to reproduce the problem, so I could
4608 wish I had a simple test case to reproduce the problem, so I could
4604 either write a cleaner workaround or file a bug report if
4609 either write a cleaner workaround or file a bug report if
4605 necessary.
4610 necessary.
4606
4611
4607 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4612 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4608 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4613 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4609 a bug report by Tjabo Kloppenburg.
4614 a bug report by Tjabo Kloppenburg.
4610
4615
4611 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4616 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4612 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4617 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4613 seems rather unstable. Thanks to a bug report by Tjabo
4618 seems rather unstable. Thanks to a bug report by Tjabo
4614 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4619 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4615
4620
4616 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4621 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4617 this out soon because of the critical fixes in the inner loop for
4622 this out soon because of the critical fixes in the inner loop for
4618 generators.
4623 generators.
4619
4624
4620 * IPython/Magic.py (Magic.getargspec): removed. This (and
4625 * IPython/Magic.py (Magic.getargspec): removed. This (and
4621 _get_def) have been obsoleted by OInspect for a long time, I
4626 _get_def) have been obsoleted by OInspect for a long time, I
4622 hadn't noticed that they were dead code.
4627 hadn't noticed that they were dead code.
4623 (Magic._ofind): restored _ofind functionality for a few literals
4628 (Magic._ofind): restored _ofind functionality for a few literals
4624 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4629 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4625 for things like "hello".capitalize?, since that would require a
4630 for things like "hello".capitalize?, since that would require a
4626 potentially dangerous eval() again.
4631 potentially dangerous eval() again.
4627
4632
4628 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4633 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4629 logic a bit more to clean up the escapes handling and minimize the
4634 logic a bit more to clean up the escapes handling and minimize the
4630 use of _ofind to only necessary cases. The interactive 'feel' of
4635 use of _ofind to only necessary cases. The interactive 'feel' of
4631 IPython should have improved quite a bit with the changes in
4636 IPython should have improved quite a bit with the changes in
4632 _prefilter and _ofind (besides being far safer than before).
4637 _prefilter and _ofind (besides being far safer than before).
4633
4638
4634 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4639 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4635 obscure, never reported). Edit would fail to find the object to
4640 obscure, never reported). Edit would fail to find the object to
4636 edit under some circumstances.
4641 edit under some circumstances.
4637 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4642 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4638 which were causing double-calling of generators. Those eval calls
4643 which were causing double-calling of generators. Those eval calls
4639 were _very_ dangerous, since code with side effects could be
4644 were _very_ dangerous, since code with side effects could be
4640 triggered. As they say, 'eval is evil'... These were the
4645 triggered. As they say, 'eval is evil'... These were the
4641 nastiest evals in IPython. Besides, _ofind is now far simpler,
4646 nastiest evals in IPython. Besides, _ofind is now far simpler,
4642 and it should also be quite a bit faster. Its use of inspect is
4647 and it should also be quite a bit faster. Its use of inspect is
4643 also safer, so perhaps some of the inspect-related crashes I've
4648 also safer, so perhaps some of the inspect-related crashes I've
4644 seen lately with Python 2.3 might be taken care of. That will
4649 seen lately with Python 2.3 might be taken care of. That will
4645 need more testing.
4650 need more testing.
4646
4651
4647 2003-08-17 Fernando Perez <fperez@colorado.edu>
4652 2003-08-17 Fernando Perez <fperez@colorado.edu>
4648
4653
4649 * IPython/iplib.py (InteractiveShell._prefilter): significant
4654 * IPython/iplib.py (InteractiveShell._prefilter): significant
4650 simplifications to the logic for handling user escapes. Faster
4655 simplifications to the logic for handling user escapes. Faster
4651 and simpler code.
4656 and simpler code.
4652
4657
4653 2003-08-14 Fernando Perez <fperez@colorado.edu>
4658 2003-08-14 Fernando Perez <fperez@colorado.edu>
4654
4659
4655 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4660 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4656 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4661 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4657 but it should be quite a bit faster. And the recursive version
4662 but it should be quite a bit faster. And the recursive version
4658 generated O(log N) intermediate storage for all rank>1 arrays,
4663 generated O(log N) intermediate storage for all rank>1 arrays,
4659 even if they were contiguous.
4664 even if they were contiguous.
4660 (l1norm): Added this function.
4665 (l1norm): Added this function.
4661 (norm): Added this function for arbitrary norms (including
4666 (norm): Added this function for arbitrary norms (including
4662 l-infinity). l1 and l2 are still special cases for convenience
4667 l-infinity). l1 and l2 are still special cases for convenience
4663 and speed.
4668 and speed.
4664
4669
4665 2003-08-03 Fernando Perez <fperez@colorado.edu>
4670 2003-08-03 Fernando Perez <fperez@colorado.edu>
4666
4671
4667 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4672 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4668 exceptions, which now raise PendingDeprecationWarnings in Python
4673 exceptions, which now raise PendingDeprecationWarnings in Python
4669 2.3. There were some in Magic and some in Gnuplot2.
4674 2.3. There were some in Magic and some in Gnuplot2.
4670
4675
4671 2003-06-30 Fernando Perez <fperez@colorado.edu>
4676 2003-06-30 Fernando Perez <fperez@colorado.edu>
4672
4677
4673 * IPython/genutils.py (page): modified to call curses only for
4678 * IPython/genutils.py (page): modified to call curses only for
4674 terminals where TERM=='xterm'. After problems under many other
4679 terminals where TERM=='xterm'. After problems under many other
4675 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4680 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4676
4681
4677 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4682 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4678 would be triggered when readline was absent. This was just an old
4683 would be triggered when readline was absent. This was just an old
4679 debugging statement I'd forgotten to take out.
4684 debugging statement I'd forgotten to take out.
4680
4685
4681 2003-06-20 Fernando Perez <fperez@colorado.edu>
4686 2003-06-20 Fernando Perez <fperez@colorado.edu>
4682
4687
4683 * IPython/genutils.py (clock): modified to return only user time
4688 * IPython/genutils.py (clock): modified to return only user time
4684 (not counting system time), after a discussion on scipy. While
4689 (not counting system time), after a discussion on scipy. While
4685 system time may be a useful quantity occasionally, it may much
4690 system time may be a useful quantity occasionally, it may much
4686 more easily be skewed by occasional swapping or other similar
4691 more easily be skewed by occasional swapping or other similar
4687 activity.
4692 activity.
4688
4693
4689 2003-06-05 Fernando Perez <fperez@colorado.edu>
4694 2003-06-05 Fernando Perez <fperez@colorado.edu>
4690
4695
4691 * IPython/numutils.py (identity): new function, for building
4696 * IPython/numutils.py (identity): new function, for building
4692 arbitrary rank Kronecker deltas (mostly backwards compatible with
4697 arbitrary rank Kronecker deltas (mostly backwards compatible with
4693 Numeric.identity)
4698 Numeric.identity)
4694
4699
4695 2003-06-03 Fernando Perez <fperez@colorado.edu>
4700 2003-06-03 Fernando Perez <fperez@colorado.edu>
4696
4701
4697 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4702 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4698 arguments passed to magics with spaces, to allow trailing '\' to
4703 arguments passed to magics with spaces, to allow trailing '\' to
4699 work normally (mainly for Windows users).
4704 work normally (mainly for Windows users).
4700
4705
4701 2003-05-29 Fernando Perez <fperez@colorado.edu>
4706 2003-05-29 Fernando Perez <fperez@colorado.edu>
4702
4707
4703 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4708 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4704 instead of pydoc.help. This fixes a bizarre behavior where
4709 instead of pydoc.help. This fixes a bizarre behavior where
4705 printing '%s' % locals() would trigger the help system. Now
4710 printing '%s' % locals() would trigger the help system. Now
4706 ipython behaves like normal python does.
4711 ipython behaves like normal python does.
4707
4712
4708 Note that if one does 'from pydoc import help', the bizarre
4713 Note that if one does 'from pydoc import help', the bizarre
4709 behavior returns, but this will also happen in normal python, so
4714 behavior returns, but this will also happen in normal python, so
4710 it's not an ipython bug anymore (it has to do with how pydoc.help
4715 it's not an ipython bug anymore (it has to do with how pydoc.help
4711 is implemented).
4716 is implemented).
4712
4717
4713 2003-05-22 Fernando Perez <fperez@colorado.edu>
4718 2003-05-22 Fernando Perez <fperez@colorado.edu>
4714
4719
4715 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4720 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4716 return [] instead of None when nothing matches, also match to end
4721 return [] instead of None when nothing matches, also match to end
4717 of line. Patch by Gary Bishop.
4722 of line. Patch by Gary Bishop.
4718
4723
4719 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4724 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4720 protection as before, for files passed on the command line. This
4725 protection as before, for files passed on the command line. This
4721 prevents the CrashHandler from kicking in if user files call into
4726 prevents the CrashHandler from kicking in if user files call into
4722 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4727 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4723 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4728 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4724
4729
4725 2003-05-20 *** Released version 0.4.0
4730 2003-05-20 *** Released version 0.4.0
4726
4731
4727 2003-05-20 Fernando Perez <fperez@colorado.edu>
4732 2003-05-20 Fernando Perez <fperez@colorado.edu>
4728
4733
4729 * setup.py: added support for manpages. It's a bit hackish b/c of
4734 * setup.py: added support for manpages. It's a bit hackish b/c of
4730 a bug in the way the bdist_rpm distutils target handles gzipped
4735 a bug in the way the bdist_rpm distutils target handles gzipped
4731 manpages, but it works. After a patch by Jack.
4736 manpages, but it works. After a patch by Jack.
4732
4737
4733 2003-05-19 Fernando Perez <fperez@colorado.edu>
4738 2003-05-19 Fernando Perez <fperez@colorado.edu>
4734
4739
4735 * IPython/numutils.py: added a mockup of the kinds module, since
4740 * IPython/numutils.py: added a mockup of the kinds module, since
4736 it was recently removed from Numeric. This way, numutils will
4741 it was recently removed from Numeric. This way, numutils will
4737 work for all users even if they are missing kinds.
4742 work for all users even if they are missing kinds.
4738
4743
4739 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4744 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4740 failure, which can occur with SWIG-wrapped extensions. After a
4745 failure, which can occur with SWIG-wrapped extensions. After a
4741 crash report from Prabhu.
4746 crash report from Prabhu.
4742
4747
4743 2003-05-16 Fernando Perez <fperez@colorado.edu>
4748 2003-05-16 Fernando Perez <fperez@colorado.edu>
4744
4749
4745 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4750 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4746 protect ipython from user code which may call directly
4751 protect ipython from user code which may call directly
4747 sys.excepthook (this looks like an ipython crash to the user, even
4752 sys.excepthook (this looks like an ipython crash to the user, even
4748 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4753 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4749 This is especially important to help users of WxWindows, but may
4754 This is especially important to help users of WxWindows, but may
4750 also be useful in other cases.
4755 also be useful in other cases.
4751
4756
4752 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4757 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4753 an optional tb_offset to be specified, and to preserve exception
4758 an optional tb_offset to be specified, and to preserve exception
4754 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4759 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4755
4760
4756 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4761 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4757
4762
4758 2003-05-15 Fernando Perez <fperez@colorado.edu>
4763 2003-05-15 Fernando Perez <fperez@colorado.edu>
4759
4764
4760 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4765 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4761 installing for a new user under Windows.
4766 installing for a new user under Windows.
4762
4767
4763 2003-05-12 Fernando Perez <fperez@colorado.edu>
4768 2003-05-12 Fernando Perez <fperez@colorado.edu>
4764
4769
4765 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4770 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4766 handler for Emacs comint-based lines. Currently it doesn't do
4771 handler for Emacs comint-based lines. Currently it doesn't do
4767 much (but importantly, it doesn't update the history cache). In
4772 much (but importantly, it doesn't update the history cache). In
4768 the future it may be expanded if Alex needs more functionality
4773 the future it may be expanded if Alex needs more functionality
4769 there.
4774 there.
4770
4775
4771 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4776 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4772 info to crash reports.
4777 info to crash reports.
4773
4778
4774 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4779 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4775 just like Python's -c. Also fixed crash with invalid -color
4780 just like Python's -c. Also fixed crash with invalid -color
4776 option value at startup. Thanks to Will French
4781 option value at startup. Thanks to Will French
4777 <wfrench-AT-bestweb.net> for the bug report.
4782 <wfrench-AT-bestweb.net> for the bug report.
4778
4783
4779 2003-05-09 Fernando Perez <fperez@colorado.edu>
4784 2003-05-09 Fernando Perez <fperez@colorado.edu>
4780
4785
4781 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4786 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4782 to EvalDict (it's a mapping, after all) and simplified its code
4787 to EvalDict (it's a mapping, after all) and simplified its code
4783 quite a bit, after a nice discussion on c.l.py where Gustavo
4788 quite a bit, after a nice discussion on c.l.py where Gustavo
4784 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4789 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4785
4790
4786 2003-04-30 Fernando Perez <fperez@colorado.edu>
4791 2003-04-30 Fernando Perez <fperez@colorado.edu>
4787
4792
4788 * IPython/genutils.py (timings_out): modified it to reduce its
4793 * IPython/genutils.py (timings_out): modified it to reduce its
4789 overhead in the common reps==1 case.
4794 overhead in the common reps==1 case.
4790
4795
4791 2003-04-29 Fernando Perez <fperez@colorado.edu>
4796 2003-04-29 Fernando Perez <fperez@colorado.edu>
4792
4797
4793 * IPython/genutils.py (timings_out): Modified to use the resource
4798 * IPython/genutils.py (timings_out): Modified to use the resource
4794 module, which avoids the wraparound problems of time.clock().
4799 module, which avoids the wraparound problems of time.clock().
4795
4800
4796 2003-04-17 *** Released version 0.2.15pre4
4801 2003-04-17 *** Released version 0.2.15pre4
4797
4802
4798 2003-04-17 Fernando Perez <fperez@colorado.edu>
4803 2003-04-17 Fernando Perez <fperez@colorado.edu>
4799
4804
4800 * setup.py (scriptfiles): Split windows-specific stuff over to a
4805 * setup.py (scriptfiles): Split windows-specific stuff over to a
4801 separate file, in an attempt to have a Windows GUI installer.
4806 separate file, in an attempt to have a Windows GUI installer.
4802 That didn't work, but part of the groundwork is done.
4807 That didn't work, but part of the groundwork is done.
4803
4808
4804 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4809 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4805 indent/unindent with 4 spaces. Particularly useful in combination
4810 indent/unindent with 4 spaces. Particularly useful in combination
4806 with the new auto-indent option.
4811 with the new auto-indent option.
4807
4812
4808 2003-04-16 Fernando Perez <fperez@colorado.edu>
4813 2003-04-16 Fernando Perez <fperez@colorado.edu>
4809
4814
4810 * IPython/Magic.py: various replacements of self.rc for
4815 * IPython/Magic.py: various replacements of self.rc for
4811 self.shell.rc. A lot more remains to be done to fully disentangle
4816 self.shell.rc. A lot more remains to be done to fully disentangle
4812 this class from the main Shell class.
4817 this class from the main Shell class.
4813
4818
4814 * IPython/GnuplotRuntime.py: added checks for mouse support so
4819 * IPython/GnuplotRuntime.py: added checks for mouse support so
4815 that we don't try to enable it if the current gnuplot doesn't
4820 that we don't try to enable it if the current gnuplot doesn't
4816 really support it. Also added checks so that we don't try to
4821 really support it. Also added checks so that we don't try to
4817 enable persist under Windows (where Gnuplot doesn't recognize the
4822 enable persist under Windows (where Gnuplot doesn't recognize the
4818 option).
4823 option).
4819
4824
4820 * IPython/iplib.py (InteractiveShell.interact): Added optional
4825 * IPython/iplib.py (InteractiveShell.interact): Added optional
4821 auto-indenting code, after a patch by King C. Shu
4826 auto-indenting code, after a patch by King C. Shu
4822 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4827 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4823 get along well with pasting indented code. If I ever figure out
4828 get along well with pasting indented code. If I ever figure out
4824 how to make that part go well, it will become on by default.
4829 how to make that part go well, it will become on by default.
4825
4830
4826 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4831 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4827 crash ipython if there was an unmatched '%' in the user's prompt
4832 crash ipython if there was an unmatched '%' in the user's prompt
4828 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4833 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4829
4834
4830 * IPython/iplib.py (InteractiveShell.interact): removed the
4835 * IPython/iplib.py (InteractiveShell.interact): removed the
4831 ability to ask the user whether he wants to crash or not at the
4836 ability to ask the user whether he wants to crash or not at the
4832 'last line' exception handler. Calling functions at that point
4837 'last line' exception handler. Calling functions at that point
4833 changes the stack, and the error reports would have incorrect
4838 changes the stack, and the error reports would have incorrect
4834 tracebacks.
4839 tracebacks.
4835
4840
4836 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4841 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4837 pass through a peger a pretty-printed form of any object. After a
4842 pass through a peger a pretty-printed form of any object. After a
4838 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4843 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4839
4844
4840 2003-04-14 Fernando Perez <fperez@colorado.edu>
4845 2003-04-14 Fernando Perez <fperez@colorado.edu>
4841
4846
4842 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4847 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4843 all files in ~ would be modified at first install (instead of
4848 all files in ~ would be modified at first install (instead of
4844 ~/.ipython). This could be potentially disastrous, as the
4849 ~/.ipython). This could be potentially disastrous, as the
4845 modification (make line-endings native) could damage binary files.
4850 modification (make line-endings native) could damage binary files.
4846
4851
4847 2003-04-10 Fernando Perez <fperez@colorado.edu>
4852 2003-04-10 Fernando Perez <fperez@colorado.edu>
4848
4853
4849 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4854 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4850 handle only lines which are invalid python. This now means that
4855 handle only lines which are invalid python. This now means that
4851 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4856 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4852 for the bug report.
4857 for the bug report.
4853
4858
4854 2003-04-01 Fernando Perez <fperez@colorado.edu>
4859 2003-04-01 Fernando Perez <fperez@colorado.edu>
4855
4860
4856 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4861 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4857 where failing to set sys.last_traceback would crash pdb.pm().
4862 where failing to set sys.last_traceback would crash pdb.pm().
4858 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4863 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4859 report.
4864 report.
4860
4865
4861 2003-03-25 Fernando Perez <fperez@colorado.edu>
4866 2003-03-25 Fernando Perez <fperez@colorado.edu>
4862
4867
4863 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4868 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4864 before printing it (it had a lot of spurious blank lines at the
4869 before printing it (it had a lot of spurious blank lines at the
4865 end).
4870 end).
4866
4871
4867 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4872 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4868 output would be sent 21 times! Obviously people don't use this
4873 output would be sent 21 times! Obviously people don't use this
4869 too often, or I would have heard about it.
4874 too often, or I would have heard about it.
4870
4875
4871 2003-03-24 Fernando Perez <fperez@colorado.edu>
4876 2003-03-24 Fernando Perez <fperez@colorado.edu>
4872
4877
4873 * setup.py (scriptfiles): renamed the data_files parameter from
4878 * setup.py (scriptfiles): renamed the data_files parameter from
4874 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4879 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4875 for the patch.
4880 for the patch.
4876
4881
4877 2003-03-20 Fernando Perez <fperez@colorado.edu>
4882 2003-03-20 Fernando Perez <fperez@colorado.edu>
4878
4883
4879 * IPython/genutils.py (error): added error() and fatal()
4884 * IPython/genutils.py (error): added error() and fatal()
4880 functions.
4885 functions.
4881
4886
4882 2003-03-18 *** Released version 0.2.15pre3
4887 2003-03-18 *** Released version 0.2.15pre3
4883
4888
4884 2003-03-18 Fernando Perez <fperez@colorado.edu>
4889 2003-03-18 Fernando Perez <fperez@colorado.edu>
4885
4890
4886 * setupext/install_data_ext.py
4891 * setupext/install_data_ext.py
4887 (install_data_ext.initialize_options): Class contributed by Jack
4892 (install_data_ext.initialize_options): Class contributed by Jack
4888 Moffit for fixing the old distutils hack. He is sending this to
4893 Moffit for fixing the old distutils hack. He is sending this to
4889 the distutils folks so in the future we may not need it as a
4894 the distutils folks so in the future we may not need it as a
4890 private fix.
4895 private fix.
4891
4896
4892 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4897 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4893 changes for Debian packaging. See his patch for full details.
4898 changes for Debian packaging. See his patch for full details.
4894 The old distutils hack of making the ipythonrc* files carry a
4899 The old distutils hack of making the ipythonrc* files carry a
4895 bogus .py extension is gone, at last. Examples were moved to a
4900 bogus .py extension is gone, at last. Examples were moved to a
4896 separate subdir under doc/, and the separate executable scripts
4901 separate subdir under doc/, and the separate executable scripts
4897 now live in their own directory. Overall a great cleanup. The
4902 now live in their own directory. Overall a great cleanup. The
4898 manual was updated to use the new files, and setup.py has been
4903 manual was updated to use the new files, and setup.py has been
4899 fixed for this setup.
4904 fixed for this setup.
4900
4905
4901 * IPython/PyColorize.py (Parser.usage): made non-executable and
4906 * IPython/PyColorize.py (Parser.usage): made non-executable and
4902 created a pycolor wrapper around it to be included as a script.
4907 created a pycolor wrapper around it to be included as a script.
4903
4908
4904 2003-03-12 *** Released version 0.2.15pre2
4909 2003-03-12 *** Released version 0.2.15pre2
4905
4910
4906 2003-03-12 Fernando Perez <fperez@colorado.edu>
4911 2003-03-12 Fernando Perez <fperez@colorado.edu>
4907
4912
4908 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4913 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4909 long-standing problem with garbage characters in some terminals.
4914 long-standing problem with garbage characters in some terminals.
4910 The issue was really that the \001 and \002 escapes must _only_ be
4915 The issue was really that the \001 and \002 escapes must _only_ be
4911 passed to input prompts (which call readline), but _never_ to
4916 passed to input prompts (which call readline), but _never_ to
4912 normal text to be printed on screen. I changed ColorANSI to have
4917 normal text to be printed on screen. I changed ColorANSI to have
4913 two classes: TermColors and InputTermColors, each with the
4918 two classes: TermColors and InputTermColors, each with the
4914 appropriate escapes for input prompts or normal text. The code in
4919 appropriate escapes for input prompts or normal text. The code in
4915 Prompts.py got slightly more complicated, but this very old and
4920 Prompts.py got slightly more complicated, but this very old and
4916 annoying bug is finally fixed.
4921 annoying bug is finally fixed.
4917
4922
4918 All the credit for nailing down the real origin of this problem
4923 All the credit for nailing down the real origin of this problem
4919 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4924 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4920 *Many* thanks to him for spending quite a bit of effort on this.
4925 *Many* thanks to him for spending quite a bit of effort on this.
4921
4926
4922 2003-03-05 *** Released version 0.2.15pre1
4927 2003-03-05 *** Released version 0.2.15pre1
4923
4928
4924 2003-03-03 Fernando Perez <fperez@colorado.edu>
4929 2003-03-03 Fernando Perez <fperez@colorado.edu>
4925
4930
4926 * IPython/FakeModule.py: Moved the former _FakeModule to a
4931 * IPython/FakeModule.py: Moved the former _FakeModule to a
4927 separate file, because it's also needed by Magic (to fix a similar
4932 separate file, because it's also needed by Magic (to fix a similar
4928 pickle-related issue in @run).
4933 pickle-related issue in @run).
4929
4934
4930 2003-03-02 Fernando Perez <fperez@colorado.edu>
4935 2003-03-02 Fernando Perez <fperez@colorado.edu>
4931
4936
4932 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4937 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4933 the autocall option at runtime.
4938 the autocall option at runtime.
4934 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4939 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4935 across Magic.py to start separating Magic from InteractiveShell.
4940 across Magic.py to start separating Magic from InteractiveShell.
4936 (Magic._ofind): Fixed to return proper namespace for dotted
4941 (Magic._ofind): Fixed to return proper namespace for dotted
4937 names. Before, a dotted name would always return 'not currently
4942 names. Before, a dotted name would always return 'not currently
4938 defined', because it would find the 'parent'. s.x would be found,
4943 defined', because it would find the 'parent'. s.x would be found,
4939 but since 'x' isn't defined by itself, it would get confused.
4944 but since 'x' isn't defined by itself, it would get confused.
4940 (Magic.magic_run): Fixed pickling problems reported by Ralf
4945 (Magic.magic_run): Fixed pickling problems reported by Ralf
4941 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4946 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4942 that I'd used when Mike Heeter reported similar issues at the
4947 that I'd used when Mike Heeter reported similar issues at the
4943 top-level, but now for @run. It boils down to injecting the
4948 top-level, but now for @run. It boils down to injecting the
4944 namespace where code is being executed with something that looks
4949 namespace where code is being executed with something that looks
4945 enough like a module to fool pickle.dump(). Since a pickle stores
4950 enough like a module to fool pickle.dump(). Since a pickle stores
4946 a named reference to the importing module, we need this for
4951 a named reference to the importing module, we need this for
4947 pickles to save something sensible.
4952 pickles to save something sensible.
4948
4953
4949 * IPython/ipmaker.py (make_IPython): added an autocall option.
4954 * IPython/ipmaker.py (make_IPython): added an autocall option.
4950
4955
4951 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4956 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4952 the auto-eval code. Now autocalling is an option, and the code is
4957 the auto-eval code. Now autocalling is an option, and the code is
4953 also vastly safer. There is no more eval() involved at all.
4958 also vastly safer. There is no more eval() involved at all.
4954
4959
4955 2003-03-01 Fernando Perez <fperez@colorado.edu>
4960 2003-03-01 Fernando Perez <fperez@colorado.edu>
4956
4961
4957 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4962 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4958 dict with named keys instead of a tuple.
4963 dict with named keys instead of a tuple.
4959
4964
4960 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4965 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4961
4966
4962 * setup.py (make_shortcut): Fixed message about directories
4967 * setup.py (make_shortcut): Fixed message about directories
4963 created during Windows installation (the directories were ok, just
4968 created during Windows installation (the directories were ok, just
4964 the printed message was misleading). Thanks to Chris Liechti
4969 the printed message was misleading). Thanks to Chris Liechti
4965 <cliechti-AT-gmx.net> for the heads up.
4970 <cliechti-AT-gmx.net> for the heads up.
4966
4971
4967 2003-02-21 Fernando Perez <fperez@colorado.edu>
4972 2003-02-21 Fernando Perez <fperez@colorado.edu>
4968
4973
4969 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4974 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4970 of ValueError exception when checking for auto-execution. This
4975 of ValueError exception when checking for auto-execution. This
4971 one is raised by things like Numeric arrays arr.flat when the
4976 one is raised by things like Numeric arrays arr.flat when the
4972 array is non-contiguous.
4977 array is non-contiguous.
4973
4978
4974 2003-01-31 Fernando Perez <fperez@colorado.edu>
4979 2003-01-31 Fernando Perez <fperez@colorado.edu>
4975
4980
4976 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4981 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4977 not return any value at all (even though the command would get
4982 not return any value at all (even though the command would get
4978 executed).
4983 executed).
4979 (xsys): Flush stdout right after printing the command to ensure
4984 (xsys): Flush stdout right after printing the command to ensure
4980 proper ordering of commands and command output in the total
4985 proper ordering of commands and command output in the total
4981 output.
4986 output.
4982 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4987 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4983 system/getoutput as defaults. The old ones are kept for
4988 system/getoutput as defaults. The old ones are kept for
4984 compatibility reasons, so no code which uses this library needs
4989 compatibility reasons, so no code which uses this library needs
4985 changing.
4990 changing.
4986
4991
4987 2003-01-27 *** Released version 0.2.14
4992 2003-01-27 *** Released version 0.2.14
4988
4993
4989 2003-01-25 Fernando Perez <fperez@colorado.edu>
4994 2003-01-25 Fernando Perez <fperez@colorado.edu>
4990
4995
4991 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4996 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4992 functions defined in previous edit sessions could not be re-edited
4997 functions defined in previous edit sessions could not be re-edited
4993 (because the temp files were immediately removed). Now temp files
4998 (because the temp files were immediately removed). Now temp files
4994 are removed only at IPython's exit.
4999 are removed only at IPython's exit.
4995 (Magic.magic_run): Improved @run to perform shell-like expansions
5000 (Magic.magic_run): Improved @run to perform shell-like expansions
4996 on its arguments (~users and $VARS). With this, @run becomes more
5001 on its arguments (~users and $VARS). With this, @run becomes more
4997 like a normal command-line.
5002 like a normal command-line.
4998
5003
4999 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5004 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5000 bugs related to embedding and cleaned up that code. A fairly
5005 bugs related to embedding and cleaned up that code. A fairly
5001 important one was the impossibility to access the global namespace
5006 important one was the impossibility to access the global namespace
5002 through the embedded IPython (only local variables were visible).
5007 through the embedded IPython (only local variables were visible).
5003
5008
5004 2003-01-14 Fernando Perez <fperez@colorado.edu>
5009 2003-01-14 Fernando Perez <fperez@colorado.edu>
5005
5010
5006 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5011 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5007 auto-calling to be a bit more conservative. Now it doesn't get
5012 auto-calling to be a bit more conservative. Now it doesn't get
5008 triggered if any of '!=()<>' are in the rest of the input line, to
5013 triggered if any of '!=()<>' are in the rest of the input line, to
5009 allow comparing callables. Thanks to Alex for the heads up.
5014 allow comparing callables. Thanks to Alex for the heads up.
5010
5015
5011 2003-01-07 Fernando Perez <fperez@colorado.edu>
5016 2003-01-07 Fernando Perez <fperez@colorado.edu>
5012
5017
5013 * IPython/genutils.py (page): fixed estimation of the number of
5018 * IPython/genutils.py (page): fixed estimation of the number of
5014 lines in a string to be paged to simply count newlines. This
5019 lines in a string to be paged to simply count newlines. This
5015 prevents over-guessing due to embedded escape sequences. A better
5020 prevents over-guessing due to embedded escape sequences. A better
5016 long-term solution would involve stripping out the control chars
5021 long-term solution would involve stripping out the control chars
5017 for the count, but it's potentially so expensive I just don't
5022 for the count, but it's potentially so expensive I just don't
5018 think it's worth doing.
5023 think it's worth doing.
5019
5024
5020 2002-12-19 *** Released version 0.2.14pre50
5025 2002-12-19 *** Released version 0.2.14pre50
5021
5026
5022 2002-12-19 Fernando Perez <fperez@colorado.edu>
5027 2002-12-19 Fernando Perez <fperez@colorado.edu>
5023
5028
5024 * tools/release (version): Changed release scripts to inform
5029 * tools/release (version): Changed release scripts to inform
5025 Andrea and build a NEWS file with a list of recent changes.
5030 Andrea and build a NEWS file with a list of recent changes.
5026
5031
5027 * IPython/ColorANSI.py (__all__): changed terminal detection
5032 * IPython/ColorANSI.py (__all__): changed terminal detection
5028 code. Seems to work better for xterms without breaking
5033 code. Seems to work better for xterms without breaking
5029 konsole. Will need more testing to determine if WinXP and Mac OSX
5034 konsole. Will need more testing to determine if WinXP and Mac OSX
5030 also work ok.
5035 also work ok.
5031
5036
5032 2002-12-18 *** Released version 0.2.14pre49
5037 2002-12-18 *** Released version 0.2.14pre49
5033
5038
5034 2002-12-18 Fernando Perez <fperez@colorado.edu>
5039 2002-12-18 Fernando Perez <fperez@colorado.edu>
5035
5040
5036 * Docs: added new info about Mac OSX, from Andrea.
5041 * Docs: added new info about Mac OSX, from Andrea.
5037
5042
5038 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5043 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5039 allow direct plotting of python strings whose format is the same
5044 allow direct plotting of python strings whose format is the same
5040 of gnuplot data files.
5045 of gnuplot data files.
5041
5046
5042 2002-12-16 Fernando Perez <fperez@colorado.edu>
5047 2002-12-16 Fernando Perez <fperez@colorado.edu>
5043
5048
5044 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5049 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5045 value of exit question to be acknowledged.
5050 value of exit question to be acknowledged.
5046
5051
5047 2002-12-03 Fernando Perez <fperez@colorado.edu>
5052 2002-12-03 Fernando Perez <fperez@colorado.edu>
5048
5053
5049 * IPython/ipmaker.py: removed generators, which had been added
5054 * IPython/ipmaker.py: removed generators, which had been added
5050 by mistake in an earlier debugging run. This was causing trouble
5055 by mistake in an earlier debugging run. This was causing trouble
5051 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5056 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5052 for pointing this out.
5057 for pointing this out.
5053
5058
5054 2002-11-17 Fernando Perez <fperez@colorado.edu>
5059 2002-11-17 Fernando Perez <fperez@colorado.edu>
5055
5060
5056 * Manual: updated the Gnuplot section.
5061 * Manual: updated the Gnuplot section.
5057
5062
5058 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5063 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5059 a much better split of what goes in Runtime and what goes in
5064 a much better split of what goes in Runtime and what goes in
5060 Interactive.
5065 Interactive.
5061
5066
5062 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5067 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5063 being imported from iplib.
5068 being imported from iplib.
5064
5069
5065 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5070 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5066 for command-passing. Now the global Gnuplot instance is called
5071 for command-passing. Now the global Gnuplot instance is called
5067 'gp' instead of 'g', which was really a far too fragile and
5072 'gp' instead of 'g', which was really a far too fragile and
5068 common name.
5073 common name.
5069
5074
5070 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5075 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5071 bounding boxes generated by Gnuplot for square plots.
5076 bounding boxes generated by Gnuplot for square plots.
5072
5077
5073 * IPython/genutils.py (popkey): new function added. I should
5078 * IPython/genutils.py (popkey): new function added. I should
5074 suggest this on c.l.py as a dict method, it seems useful.
5079 suggest this on c.l.py as a dict method, it seems useful.
5075
5080
5076 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5081 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5077 to transparently handle PostScript generation. MUCH better than
5082 to transparently handle PostScript generation. MUCH better than
5078 the previous plot_eps/replot_eps (which I removed now). The code
5083 the previous plot_eps/replot_eps (which I removed now). The code
5079 is also fairly clean and well documented now (including
5084 is also fairly clean and well documented now (including
5080 docstrings).
5085 docstrings).
5081
5086
5082 2002-11-13 Fernando Perez <fperez@colorado.edu>
5087 2002-11-13 Fernando Perez <fperez@colorado.edu>
5083
5088
5084 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5089 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5085 (inconsistent with options).
5090 (inconsistent with options).
5086
5091
5087 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5092 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5088 manually disabled, I don't know why. Fixed it.
5093 manually disabled, I don't know why. Fixed it.
5089 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5094 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5090 eps output.
5095 eps output.
5091
5096
5092 2002-11-12 Fernando Perez <fperez@colorado.edu>
5097 2002-11-12 Fernando Perez <fperez@colorado.edu>
5093
5098
5094 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5099 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5095 don't propagate up to caller. Fixes crash reported by François
5100 don't propagate up to caller. Fixes crash reported by François
5096 Pinard.
5101 Pinard.
5097
5102
5098 2002-11-09 Fernando Perez <fperez@colorado.edu>
5103 2002-11-09 Fernando Perez <fperez@colorado.edu>
5099
5104
5100 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5105 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5101 history file for new users.
5106 history file for new users.
5102 (make_IPython): fixed bug where initial install would leave the
5107 (make_IPython): fixed bug where initial install would leave the
5103 user running in the .ipython dir.
5108 user running in the .ipython dir.
5104 (make_IPython): fixed bug where config dir .ipython would be
5109 (make_IPython): fixed bug where config dir .ipython would be
5105 created regardless of the given -ipythondir option. Thanks to Cory
5110 created regardless of the given -ipythondir option. Thanks to Cory
5106 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5111 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5107
5112
5108 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5113 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5109 type confirmations. Will need to use it in all of IPython's code
5114 type confirmations. Will need to use it in all of IPython's code
5110 consistently.
5115 consistently.
5111
5116
5112 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5117 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5113 context to print 31 lines instead of the default 5. This will make
5118 context to print 31 lines instead of the default 5. This will make
5114 the crash reports extremely detailed in case the problem is in
5119 the crash reports extremely detailed in case the problem is in
5115 libraries I don't have access to.
5120 libraries I don't have access to.
5116
5121
5117 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5122 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5118 line of defense' code to still crash, but giving users fair
5123 line of defense' code to still crash, but giving users fair
5119 warning. I don't want internal errors to go unreported: if there's
5124 warning. I don't want internal errors to go unreported: if there's
5120 an internal problem, IPython should crash and generate a full
5125 an internal problem, IPython should crash and generate a full
5121 report.
5126 report.
5122
5127
5123 2002-11-08 Fernando Perez <fperez@colorado.edu>
5128 2002-11-08 Fernando Perez <fperez@colorado.edu>
5124
5129
5125 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5130 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5126 otherwise uncaught exceptions which can appear if people set
5131 otherwise uncaught exceptions which can appear if people set
5127 sys.stdout to something badly broken. Thanks to a crash report
5132 sys.stdout to something badly broken. Thanks to a crash report
5128 from henni-AT-mail.brainbot.com.
5133 from henni-AT-mail.brainbot.com.
5129
5134
5130 2002-11-04 Fernando Perez <fperez@colorado.edu>
5135 2002-11-04 Fernando Perez <fperez@colorado.edu>
5131
5136
5132 * IPython/iplib.py (InteractiveShell.interact): added
5137 * IPython/iplib.py (InteractiveShell.interact): added
5133 __IPYTHON__active to the builtins. It's a flag which goes on when
5138 __IPYTHON__active to the builtins. It's a flag which goes on when
5134 the interaction starts and goes off again when it stops. This
5139 the interaction starts and goes off again when it stops. This
5135 allows embedding code to detect being inside IPython. Before this
5140 allows embedding code to detect being inside IPython. Before this
5136 was done via __IPYTHON__, but that only shows that an IPython
5141 was done via __IPYTHON__, but that only shows that an IPython
5137 instance has been created.
5142 instance has been created.
5138
5143
5139 * IPython/Magic.py (Magic.magic_env): I realized that in a
5144 * IPython/Magic.py (Magic.magic_env): I realized that in a
5140 UserDict, instance.data holds the data as a normal dict. So I
5145 UserDict, instance.data holds the data as a normal dict. So I
5141 modified @env to return os.environ.data instead of rebuilding a
5146 modified @env to return os.environ.data instead of rebuilding a
5142 dict by hand.
5147 dict by hand.
5143
5148
5144 2002-11-02 Fernando Perez <fperez@colorado.edu>
5149 2002-11-02 Fernando Perez <fperez@colorado.edu>
5145
5150
5146 * IPython/genutils.py (warn): changed so that level 1 prints no
5151 * IPython/genutils.py (warn): changed so that level 1 prints no
5147 header. Level 2 is now the default (with 'WARNING' header, as
5152 header. Level 2 is now the default (with 'WARNING' header, as
5148 before). I think I tracked all places where changes were needed in
5153 before). I think I tracked all places where changes were needed in
5149 IPython, but outside code using the old level numbering may have
5154 IPython, but outside code using the old level numbering may have
5150 broken.
5155 broken.
5151
5156
5152 * IPython/iplib.py (InteractiveShell.runcode): added this to
5157 * IPython/iplib.py (InteractiveShell.runcode): added this to
5153 handle the tracebacks in SystemExit traps correctly. The previous
5158 handle the tracebacks in SystemExit traps correctly. The previous
5154 code (through interact) was printing more of the stack than
5159 code (through interact) was printing more of the stack than
5155 necessary, showing IPython internal code to the user.
5160 necessary, showing IPython internal code to the user.
5156
5161
5157 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5162 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5158 default. Now that the default at the confirmation prompt is yes,
5163 default. Now that the default at the confirmation prompt is yes,
5159 it's not so intrusive. François' argument that ipython sessions
5164 it's not so intrusive. François' argument that ipython sessions
5160 tend to be complex enough not to lose them from an accidental C-d,
5165 tend to be complex enough not to lose them from an accidental C-d,
5161 is a valid one.
5166 is a valid one.
5162
5167
5163 * IPython/iplib.py (InteractiveShell.interact): added a
5168 * IPython/iplib.py (InteractiveShell.interact): added a
5164 showtraceback() call to the SystemExit trap, and modified the exit
5169 showtraceback() call to the SystemExit trap, and modified the exit
5165 confirmation to have yes as the default.
5170 confirmation to have yes as the default.
5166
5171
5167 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5172 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5168 this file. It's been gone from the code for a long time, this was
5173 this file. It's been gone from the code for a long time, this was
5169 simply leftover junk.
5174 simply leftover junk.
5170
5175
5171 2002-11-01 Fernando Perez <fperez@colorado.edu>
5176 2002-11-01 Fernando Perez <fperez@colorado.edu>
5172
5177
5173 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5178 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5174 added. If set, IPython now traps EOF and asks for
5179 added. If set, IPython now traps EOF and asks for
5175 confirmation. After a request by François Pinard.
5180 confirmation. After a request by François Pinard.
5176
5181
5177 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5182 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5178 of @abort, and with a new (better) mechanism for handling the
5183 of @abort, and with a new (better) mechanism for handling the
5179 exceptions.
5184 exceptions.
5180
5185
5181 2002-10-27 Fernando Perez <fperez@colorado.edu>
5186 2002-10-27 Fernando Perez <fperez@colorado.edu>
5182
5187
5183 * IPython/usage.py (__doc__): updated the --help information and
5188 * IPython/usage.py (__doc__): updated the --help information and
5184 the ipythonrc file to indicate that -log generates
5189 the ipythonrc file to indicate that -log generates
5185 ./ipython.log. Also fixed the corresponding info in @logstart.
5190 ./ipython.log. Also fixed the corresponding info in @logstart.
5186 This and several other fixes in the manuals thanks to reports by
5191 This and several other fixes in the manuals thanks to reports by
5187 François Pinard <pinard-AT-iro.umontreal.ca>.
5192 François Pinard <pinard-AT-iro.umontreal.ca>.
5188
5193
5189 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5194 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5190 refer to @logstart (instead of @log, which doesn't exist).
5195 refer to @logstart (instead of @log, which doesn't exist).
5191
5196
5192 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5197 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5193 AttributeError crash. Thanks to Christopher Armstrong
5198 AttributeError crash. Thanks to Christopher Armstrong
5194 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5199 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5195 introduced recently (in 0.2.14pre37) with the fix to the eval
5200 introduced recently (in 0.2.14pre37) with the fix to the eval
5196 problem mentioned below.
5201 problem mentioned below.
5197
5202
5198 2002-10-17 Fernando Perez <fperez@colorado.edu>
5203 2002-10-17 Fernando Perez <fperez@colorado.edu>
5199
5204
5200 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5205 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5201 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5206 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5202
5207
5203 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5208 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5204 this function to fix a problem reported by Alex Schmolck. He saw
5209 this function to fix a problem reported by Alex Schmolck. He saw
5205 it with list comprehensions and generators, which were getting
5210 it with list comprehensions and generators, which were getting
5206 called twice. The real problem was an 'eval' call in testing for
5211 called twice. The real problem was an 'eval' call in testing for
5207 automagic which was evaluating the input line silently.
5212 automagic which was evaluating the input line silently.
5208
5213
5209 This is a potentially very nasty bug, if the input has side
5214 This is a potentially very nasty bug, if the input has side
5210 effects which must not be repeated. The code is much cleaner now,
5215 effects which must not be repeated. The code is much cleaner now,
5211 without any blanket 'except' left and with a regexp test for
5216 without any blanket 'except' left and with a regexp test for
5212 actual function names.
5217 actual function names.
5213
5218
5214 But an eval remains, which I'm not fully comfortable with. I just
5219 But an eval remains, which I'm not fully comfortable with. I just
5215 don't know how to find out if an expression could be a callable in
5220 don't know how to find out if an expression could be a callable in
5216 the user's namespace without doing an eval on the string. However
5221 the user's namespace without doing an eval on the string. However
5217 that string is now much more strictly checked so that no code
5222 that string is now much more strictly checked so that no code
5218 slips by, so the eval should only happen for things that can
5223 slips by, so the eval should only happen for things that can
5219 really be only function/method names.
5224 really be only function/method names.
5220
5225
5221 2002-10-15 Fernando Perez <fperez@colorado.edu>
5226 2002-10-15 Fernando Perez <fperez@colorado.edu>
5222
5227
5223 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5228 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5224 OSX information to main manual, removed README_Mac_OSX file from
5229 OSX information to main manual, removed README_Mac_OSX file from
5225 distribution. Also updated credits for recent additions.
5230 distribution. Also updated credits for recent additions.
5226
5231
5227 2002-10-10 Fernando Perez <fperez@colorado.edu>
5232 2002-10-10 Fernando Perez <fperez@colorado.edu>
5228
5233
5229 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5234 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5230 terminal-related issues. Many thanks to Andrea Riciputi
5235 terminal-related issues. Many thanks to Andrea Riciputi
5231 <andrea.riciputi-AT-libero.it> for writing it.
5236 <andrea.riciputi-AT-libero.it> for writing it.
5232
5237
5233 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5238 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5234 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5239 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5235
5240
5236 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5241 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5237 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5242 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5238 <syver-en-AT-online.no> who both submitted patches for this problem.
5243 <syver-en-AT-online.no> who both submitted patches for this problem.
5239
5244
5240 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5245 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5241 global embedding to make sure that things don't overwrite user
5246 global embedding to make sure that things don't overwrite user
5242 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5247 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5243
5248
5244 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5249 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5245 compatibility. Thanks to Hayden Callow
5250 compatibility. Thanks to Hayden Callow
5246 <h.callow-AT-elec.canterbury.ac.nz>
5251 <h.callow-AT-elec.canterbury.ac.nz>
5247
5252
5248 2002-10-04 Fernando Perez <fperez@colorado.edu>
5253 2002-10-04 Fernando Perez <fperez@colorado.edu>
5249
5254
5250 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5255 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5251 Gnuplot.File objects.
5256 Gnuplot.File objects.
5252
5257
5253 2002-07-23 Fernando Perez <fperez@colorado.edu>
5258 2002-07-23 Fernando Perez <fperez@colorado.edu>
5254
5259
5255 * IPython/genutils.py (timing): Added timings() and timing() for
5260 * IPython/genutils.py (timing): Added timings() and timing() for
5256 quick access to the most commonly needed data, the execution
5261 quick access to the most commonly needed data, the execution
5257 times. Old timing() renamed to timings_out().
5262 times. Old timing() renamed to timings_out().
5258
5263
5259 2002-07-18 Fernando Perez <fperez@colorado.edu>
5264 2002-07-18 Fernando Perez <fperez@colorado.edu>
5260
5265
5261 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5266 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5262 bug with nested instances disrupting the parent's tab completion.
5267 bug with nested instances disrupting the parent's tab completion.
5263
5268
5264 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5269 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5265 all_completions code to begin the emacs integration.
5270 all_completions code to begin the emacs integration.
5266
5271
5267 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5272 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5268 argument to allow titling individual arrays when plotting.
5273 argument to allow titling individual arrays when plotting.
5269
5274
5270 2002-07-15 Fernando Perez <fperez@colorado.edu>
5275 2002-07-15 Fernando Perez <fperez@colorado.edu>
5271
5276
5272 * setup.py (make_shortcut): changed to retrieve the value of
5277 * setup.py (make_shortcut): changed to retrieve the value of
5273 'Program Files' directory from the registry (this value changes in
5278 'Program Files' directory from the registry (this value changes in
5274 non-english versions of Windows). Thanks to Thomas Fanslau
5279 non-english versions of Windows). Thanks to Thomas Fanslau
5275 <tfanslau-AT-gmx.de> for the report.
5280 <tfanslau-AT-gmx.de> for the report.
5276
5281
5277 2002-07-10 Fernando Perez <fperez@colorado.edu>
5282 2002-07-10 Fernando Perez <fperez@colorado.edu>
5278
5283
5279 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5284 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5280 a bug in pdb, which crashes if a line with only whitespace is
5285 a bug in pdb, which crashes if a line with only whitespace is
5281 entered. Bug report submitted to sourceforge.
5286 entered. Bug report submitted to sourceforge.
5282
5287
5283 2002-07-09 Fernando Perez <fperez@colorado.edu>
5288 2002-07-09 Fernando Perez <fperez@colorado.edu>
5284
5289
5285 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5290 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5286 reporting exceptions (it's a bug in inspect.py, I just set a
5291 reporting exceptions (it's a bug in inspect.py, I just set a
5287 workaround).
5292 workaround).
5288
5293
5289 2002-07-08 Fernando Perez <fperez@colorado.edu>
5294 2002-07-08 Fernando Perez <fperez@colorado.edu>
5290
5295
5291 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5296 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5292 __IPYTHON__ in __builtins__ to show up in user_ns.
5297 __IPYTHON__ in __builtins__ to show up in user_ns.
5293
5298
5294 2002-07-03 Fernando Perez <fperez@colorado.edu>
5299 2002-07-03 Fernando Perez <fperez@colorado.edu>
5295
5300
5296 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5301 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5297 name from @gp_set_instance to @gp_set_default.
5302 name from @gp_set_instance to @gp_set_default.
5298
5303
5299 * IPython/ipmaker.py (make_IPython): default editor value set to
5304 * IPython/ipmaker.py (make_IPython): default editor value set to
5300 '0' (a string), to match the rc file. Otherwise will crash when
5305 '0' (a string), to match the rc file. Otherwise will crash when
5301 .strip() is called on it.
5306 .strip() is called on it.
5302
5307
5303
5308
5304 2002-06-28 Fernando Perez <fperez@colorado.edu>
5309 2002-06-28 Fernando Perez <fperez@colorado.edu>
5305
5310
5306 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5311 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5307 of files in current directory when a file is executed via
5312 of files in current directory when a file is executed via
5308 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5313 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5309
5314
5310 * setup.py (manfiles): fix for rpm builds, submitted by RA
5315 * setup.py (manfiles): fix for rpm builds, submitted by RA
5311 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5316 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5312
5317
5313 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5318 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5314 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5319 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5315 string!). A. Schmolck caught this one.
5320 string!). A. Schmolck caught this one.
5316
5321
5317 2002-06-27 Fernando Perez <fperez@colorado.edu>
5322 2002-06-27 Fernando Perez <fperez@colorado.edu>
5318
5323
5319 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5324 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5320 defined files at the cmd line. __name__ wasn't being set to
5325 defined files at the cmd line. __name__ wasn't being set to
5321 __main__.
5326 __main__.
5322
5327
5323 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5328 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5324 regular lists and tuples besides Numeric arrays.
5329 regular lists and tuples besides Numeric arrays.
5325
5330
5326 * IPython/Prompts.py (CachedOutput.__call__): Added output
5331 * IPython/Prompts.py (CachedOutput.__call__): Added output
5327 supression for input ending with ';'. Similar to Mathematica and
5332 supression for input ending with ';'. Similar to Mathematica and
5328 Matlab. The _* vars and Out[] list are still updated, just like
5333 Matlab. The _* vars and Out[] list are still updated, just like
5329 Mathematica behaves.
5334 Mathematica behaves.
5330
5335
5331 2002-06-25 Fernando Perez <fperez@colorado.edu>
5336 2002-06-25 Fernando Perez <fperez@colorado.edu>
5332
5337
5333 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5338 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5334 .ini extensions for profiels under Windows.
5339 .ini extensions for profiels under Windows.
5335
5340
5336 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5341 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5337 string form. Fix contributed by Alexander Schmolck
5342 string form. Fix contributed by Alexander Schmolck
5338 <a.schmolck-AT-gmx.net>
5343 <a.schmolck-AT-gmx.net>
5339
5344
5340 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5345 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5341 pre-configured Gnuplot instance.
5346 pre-configured Gnuplot instance.
5342
5347
5343 2002-06-21 Fernando Perez <fperez@colorado.edu>
5348 2002-06-21 Fernando Perez <fperez@colorado.edu>
5344
5349
5345 * IPython/numutils.py (exp_safe): new function, works around the
5350 * IPython/numutils.py (exp_safe): new function, works around the
5346 underflow problems in Numeric.
5351 underflow problems in Numeric.
5347 (log2): New fn. Safe log in base 2: returns exact integer answer
5352 (log2): New fn. Safe log in base 2: returns exact integer answer
5348 for exact integer powers of 2.
5353 for exact integer powers of 2.
5349
5354
5350 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5355 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5351 properly.
5356 properly.
5352
5357
5353 2002-06-20 Fernando Perez <fperez@colorado.edu>
5358 2002-06-20 Fernando Perez <fperez@colorado.edu>
5354
5359
5355 * IPython/genutils.py (timing): new function like
5360 * IPython/genutils.py (timing): new function like
5356 Mathematica's. Similar to time_test, but returns more info.
5361 Mathematica's. Similar to time_test, but returns more info.
5357
5362
5358 2002-06-18 Fernando Perez <fperez@colorado.edu>
5363 2002-06-18 Fernando Perez <fperez@colorado.edu>
5359
5364
5360 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5365 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5361 according to Mike Heeter's suggestions.
5366 according to Mike Heeter's suggestions.
5362
5367
5363 2002-06-16 Fernando Perez <fperez@colorado.edu>
5368 2002-06-16 Fernando Perez <fperez@colorado.edu>
5364
5369
5365 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5370 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5366 system. GnuplotMagic is gone as a user-directory option. New files
5371 system. GnuplotMagic is gone as a user-directory option. New files
5367 make it easier to use all the gnuplot stuff both from external
5372 make it easier to use all the gnuplot stuff both from external
5368 programs as well as from IPython. Had to rewrite part of
5373 programs as well as from IPython. Had to rewrite part of
5369 hardcopy() b/c of a strange bug: often the ps files simply don't
5374 hardcopy() b/c of a strange bug: often the ps files simply don't
5370 get created, and require a repeat of the command (often several
5375 get created, and require a repeat of the command (often several
5371 times).
5376 times).
5372
5377
5373 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5378 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5374 resolve output channel at call time, so that if sys.stderr has
5379 resolve output channel at call time, so that if sys.stderr has
5375 been redirected by user this gets honored.
5380 been redirected by user this gets honored.
5376
5381
5377 2002-06-13 Fernando Perez <fperez@colorado.edu>
5382 2002-06-13 Fernando Perez <fperez@colorado.edu>
5378
5383
5379 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5384 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5380 IPShell. Kept a copy with the old names to avoid breaking people's
5385 IPShell. Kept a copy with the old names to avoid breaking people's
5381 embedded code.
5386 embedded code.
5382
5387
5383 * IPython/ipython: simplified it to the bare minimum after
5388 * IPython/ipython: simplified it to the bare minimum after
5384 Holger's suggestions. Added info about how to use it in
5389 Holger's suggestions. Added info about how to use it in
5385 PYTHONSTARTUP.
5390 PYTHONSTARTUP.
5386
5391
5387 * IPython/Shell.py (IPythonShell): changed the options passing
5392 * IPython/Shell.py (IPythonShell): changed the options passing
5388 from a string with funky %s replacements to a straight list. Maybe
5393 from a string with funky %s replacements to a straight list. Maybe
5389 a bit more typing, but it follows sys.argv conventions, so there's
5394 a bit more typing, but it follows sys.argv conventions, so there's
5390 less special-casing to remember.
5395 less special-casing to remember.
5391
5396
5392 2002-06-12 Fernando Perez <fperez@colorado.edu>
5397 2002-06-12 Fernando Perez <fperez@colorado.edu>
5393
5398
5394 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5399 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5395 command. Thanks to a suggestion by Mike Heeter.
5400 command. Thanks to a suggestion by Mike Heeter.
5396 (Magic.magic_pfile): added behavior to look at filenames if given
5401 (Magic.magic_pfile): added behavior to look at filenames if given
5397 arg is not a defined object.
5402 arg is not a defined object.
5398 (Magic.magic_save): New @save function to save code snippets. Also
5403 (Magic.magic_save): New @save function to save code snippets. Also
5399 a Mike Heeter idea.
5404 a Mike Heeter idea.
5400
5405
5401 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5406 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5402 plot() and replot(). Much more convenient now, especially for
5407 plot() and replot(). Much more convenient now, especially for
5403 interactive use.
5408 interactive use.
5404
5409
5405 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5410 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5406 filenames.
5411 filenames.
5407
5412
5408 2002-06-02 Fernando Perez <fperez@colorado.edu>
5413 2002-06-02 Fernando Perez <fperez@colorado.edu>
5409
5414
5410 * IPython/Struct.py (Struct.__init__): modified to admit
5415 * IPython/Struct.py (Struct.__init__): modified to admit
5411 initialization via another struct.
5416 initialization via another struct.
5412
5417
5413 * IPython/genutils.py (SystemExec.__init__): New stateful
5418 * IPython/genutils.py (SystemExec.__init__): New stateful
5414 interface to xsys and bq. Useful for writing system scripts.
5419 interface to xsys and bq. Useful for writing system scripts.
5415
5420
5416 2002-05-30 Fernando Perez <fperez@colorado.edu>
5421 2002-05-30 Fernando Perez <fperez@colorado.edu>
5417
5422
5418 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5423 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5419 documents. This will make the user download smaller (it's getting
5424 documents. This will make the user download smaller (it's getting
5420 too big).
5425 too big).
5421
5426
5422 2002-05-29 Fernando Perez <fperez@colorado.edu>
5427 2002-05-29 Fernando Perez <fperez@colorado.edu>
5423
5428
5424 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5429 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5425 fix problems with shelve and pickle. Seems to work, but I don't
5430 fix problems with shelve and pickle. Seems to work, but I don't
5426 know if corner cases break it. Thanks to Mike Heeter
5431 know if corner cases break it. Thanks to Mike Heeter
5427 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5432 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5428
5433
5429 2002-05-24 Fernando Perez <fperez@colorado.edu>
5434 2002-05-24 Fernando Perez <fperez@colorado.edu>
5430
5435
5431 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5436 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5432 macros having broken.
5437 macros having broken.
5433
5438
5434 2002-05-21 Fernando Perez <fperez@colorado.edu>
5439 2002-05-21 Fernando Perez <fperez@colorado.edu>
5435
5440
5436 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5441 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5437 introduced logging bug: all history before logging started was
5442 introduced logging bug: all history before logging started was
5438 being written one character per line! This came from the redesign
5443 being written one character per line! This came from the redesign
5439 of the input history as a special list which slices to strings,
5444 of the input history as a special list which slices to strings,
5440 not to lists.
5445 not to lists.
5441
5446
5442 2002-05-20 Fernando Perez <fperez@colorado.edu>
5447 2002-05-20 Fernando Perez <fperez@colorado.edu>
5443
5448
5444 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5449 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5445 be an attribute of all classes in this module. The design of these
5450 be an attribute of all classes in this module. The design of these
5446 classes needs some serious overhauling.
5451 classes needs some serious overhauling.
5447
5452
5448 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5453 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5449 which was ignoring '_' in option names.
5454 which was ignoring '_' in option names.
5450
5455
5451 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5456 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5452 'Verbose_novars' to 'Context' and made it the new default. It's a
5457 'Verbose_novars' to 'Context' and made it the new default. It's a
5453 bit more readable and also safer than verbose.
5458 bit more readable and also safer than verbose.
5454
5459
5455 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5460 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5456 triple-quoted strings.
5461 triple-quoted strings.
5457
5462
5458 * IPython/OInspect.py (__all__): new module exposing the object
5463 * IPython/OInspect.py (__all__): new module exposing the object
5459 introspection facilities. Now the corresponding magics are dummy
5464 introspection facilities. Now the corresponding magics are dummy
5460 wrappers around this. Having this module will make it much easier
5465 wrappers around this. Having this module will make it much easier
5461 to put these functions into our modified pdb.
5466 to put these functions into our modified pdb.
5462 This new object inspector system uses the new colorizing module,
5467 This new object inspector system uses the new colorizing module,
5463 so source code and other things are nicely syntax highlighted.
5468 so source code and other things are nicely syntax highlighted.
5464
5469
5465 2002-05-18 Fernando Perez <fperez@colorado.edu>
5470 2002-05-18 Fernando Perez <fperez@colorado.edu>
5466
5471
5467 * IPython/ColorANSI.py: Split the coloring tools into a separate
5472 * IPython/ColorANSI.py: Split the coloring tools into a separate
5468 module so I can use them in other code easier (they were part of
5473 module so I can use them in other code easier (they were part of
5469 ultraTB).
5474 ultraTB).
5470
5475
5471 2002-05-17 Fernando Perez <fperez@colorado.edu>
5476 2002-05-17 Fernando Perez <fperez@colorado.edu>
5472
5477
5473 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5478 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5474 fixed it to set the global 'g' also to the called instance, as
5479 fixed it to set the global 'g' also to the called instance, as
5475 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5480 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5476 user's 'g' variables).
5481 user's 'g' variables).
5477
5482
5478 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5483 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5479 global variables (aliases to _ih,_oh) so that users which expect
5484 global variables (aliases to _ih,_oh) so that users which expect
5480 In[5] or Out[7] to work aren't unpleasantly surprised.
5485 In[5] or Out[7] to work aren't unpleasantly surprised.
5481 (InputList.__getslice__): new class to allow executing slices of
5486 (InputList.__getslice__): new class to allow executing slices of
5482 input history directly. Very simple class, complements the use of
5487 input history directly. Very simple class, complements the use of
5483 macros.
5488 macros.
5484
5489
5485 2002-05-16 Fernando Perez <fperez@colorado.edu>
5490 2002-05-16 Fernando Perez <fperez@colorado.edu>
5486
5491
5487 * setup.py (docdirbase): make doc directory be just doc/IPython
5492 * setup.py (docdirbase): make doc directory be just doc/IPython
5488 without version numbers, it will reduce clutter for users.
5493 without version numbers, it will reduce clutter for users.
5489
5494
5490 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5495 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5491 execfile call to prevent possible memory leak. See for details:
5496 execfile call to prevent possible memory leak. See for details:
5492 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5497 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5493
5498
5494 2002-05-15 Fernando Perez <fperez@colorado.edu>
5499 2002-05-15 Fernando Perez <fperez@colorado.edu>
5495
5500
5496 * IPython/Magic.py (Magic.magic_psource): made the object
5501 * IPython/Magic.py (Magic.magic_psource): made the object
5497 introspection names be more standard: pdoc, pdef, pfile and
5502 introspection names be more standard: pdoc, pdef, pfile and
5498 psource. They all print/page their output, and it makes
5503 psource. They all print/page their output, and it makes
5499 remembering them easier. Kept old names for compatibility as
5504 remembering them easier. Kept old names for compatibility as
5500 aliases.
5505 aliases.
5501
5506
5502 2002-05-14 Fernando Perez <fperez@colorado.edu>
5507 2002-05-14 Fernando Perez <fperez@colorado.edu>
5503
5508
5504 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5509 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5505 what the mouse problem was. The trick is to use gnuplot with temp
5510 what the mouse problem was. The trick is to use gnuplot with temp
5506 files and NOT with pipes (for data communication), because having
5511 files and NOT with pipes (for data communication), because having
5507 both pipes and the mouse on is bad news.
5512 both pipes and the mouse on is bad news.
5508
5513
5509 2002-05-13 Fernando Perez <fperez@colorado.edu>
5514 2002-05-13 Fernando Perez <fperez@colorado.edu>
5510
5515
5511 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5516 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5512 bug. Information would be reported about builtins even when
5517 bug. Information would be reported about builtins even when
5513 user-defined functions overrode them.
5518 user-defined functions overrode them.
5514
5519
5515 2002-05-11 Fernando Perez <fperez@colorado.edu>
5520 2002-05-11 Fernando Perez <fperez@colorado.edu>
5516
5521
5517 * IPython/__init__.py (__all__): removed FlexCompleter from
5522 * IPython/__init__.py (__all__): removed FlexCompleter from
5518 __all__ so that things don't fail in platforms without readline.
5523 __all__ so that things don't fail in platforms without readline.
5519
5524
5520 2002-05-10 Fernando Perez <fperez@colorado.edu>
5525 2002-05-10 Fernando Perez <fperez@colorado.edu>
5521
5526
5522 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5527 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5523 it requires Numeric, effectively making Numeric a dependency for
5528 it requires Numeric, effectively making Numeric a dependency for
5524 IPython.
5529 IPython.
5525
5530
5526 * Released 0.2.13
5531 * Released 0.2.13
5527
5532
5528 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5533 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5529 profiler interface. Now all the major options from the profiler
5534 profiler interface. Now all the major options from the profiler
5530 module are directly supported in IPython, both for single
5535 module are directly supported in IPython, both for single
5531 expressions (@prun) and for full programs (@run -p).
5536 expressions (@prun) and for full programs (@run -p).
5532
5537
5533 2002-05-09 Fernando Perez <fperez@colorado.edu>
5538 2002-05-09 Fernando Perez <fperez@colorado.edu>
5534
5539
5535 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5540 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5536 magic properly formatted for screen.
5541 magic properly formatted for screen.
5537
5542
5538 * setup.py (make_shortcut): Changed things to put pdf version in
5543 * setup.py (make_shortcut): Changed things to put pdf version in
5539 doc/ instead of doc/manual (had to change lyxport a bit).
5544 doc/ instead of doc/manual (had to change lyxport a bit).
5540
5545
5541 * IPython/Magic.py (Profile.string_stats): made profile runs go
5546 * IPython/Magic.py (Profile.string_stats): made profile runs go
5542 through pager (they are long and a pager allows searching, saving,
5547 through pager (they are long and a pager allows searching, saving,
5543 etc.)
5548 etc.)
5544
5549
5545 2002-05-08 Fernando Perez <fperez@colorado.edu>
5550 2002-05-08 Fernando Perez <fperez@colorado.edu>
5546
5551
5547 * Released 0.2.12
5552 * Released 0.2.12
5548
5553
5549 2002-05-06 Fernando Perez <fperez@colorado.edu>
5554 2002-05-06 Fernando Perez <fperez@colorado.edu>
5550
5555
5551 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5556 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5552 introduced); 'hist n1 n2' was broken.
5557 introduced); 'hist n1 n2' was broken.
5553 (Magic.magic_pdb): added optional on/off arguments to @pdb
5558 (Magic.magic_pdb): added optional on/off arguments to @pdb
5554 (Magic.magic_run): added option -i to @run, which executes code in
5559 (Magic.magic_run): added option -i to @run, which executes code in
5555 the IPython namespace instead of a clean one. Also added @irun as
5560 the IPython namespace instead of a clean one. Also added @irun as
5556 an alias to @run -i.
5561 an alias to @run -i.
5557
5562
5558 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5563 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5559 fixed (it didn't really do anything, the namespaces were wrong).
5564 fixed (it didn't really do anything, the namespaces were wrong).
5560
5565
5561 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5566 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5562
5567
5563 * IPython/__init__.py (__all__): Fixed package namespace, now
5568 * IPython/__init__.py (__all__): Fixed package namespace, now
5564 'import IPython' does give access to IPython.<all> as
5569 'import IPython' does give access to IPython.<all> as
5565 expected. Also renamed __release__ to Release.
5570 expected. Also renamed __release__ to Release.
5566
5571
5567 * IPython/Debugger.py (__license__): created new Pdb class which
5572 * IPython/Debugger.py (__license__): created new Pdb class which
5568 functions like a drop-in for the normal pdb.Pdb but does NOT
5573 functions like a drop-in for the normal pdb.Pdb but does NOT
5569 import readline by default. This way it doesn't muck up IPython's
5574 import readline by default. This way it doesn't muck up IPython's
5570 readline handling, and now tab-completion finally works in the
5575 readline handling, and now tab-completion finally works in the
5571 debugger -- sort of. It completes things globally visible, but the
5576 debugger -- sort of. It completes things globally visible, but the
5572 completer doesn't track the stack as pdb walks it. That's a bit
5577 completer doesn't track the stack as pdb walks it. That's a bit
5573 tricky, and I'll have to implement it later.
5578 tricky, and I'll have to implement it later.
5574
5579
5575 2002-05-05 Fernando Perez <fperez@colorado.edu>
5580 2002-05-05 Fernando Perez <fperez@colorado.edu>
5576
5581
5577 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5582 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5578 magic docstrings when printed via ? (explicit \'s were being
5583 magic docstrings when printed via ? (explicit \'s were being
5579 printed).
5584 printed).
5580
5585
5581 * IPython/ipmaker.py (make_IPython): fixed namespace
5586 * IPython/ipmaker.py (make_IPython): fixed namespace
5582 identification bug. Now variables loaded via logs or command-line
5587 identification bug. Now variables loaded via logs or command-line
5583 files are recognized in the interactive namespace by @who.
5588 files are recognized in the interactive namespace by @who.
5584
5589
5585 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5590 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5586 log replay system stemming from the string form of Structs.
5591 log replay system stemming from the string form of Structs.
5587
5592
5588 * IPython/Magic.py (Macro.__init__): improved macros to properly
5593 * IPython/Magic.py (Macro.__init__): improved macros to properly
5589 handle magic commands in them.
5594 handle magic commands in them.
5590 (Magic.magic_logstart): usernames are now expanded so 'logstart
5595 (Magic.magic_logstart): usernames are now expanded so 'logstart
5591 ~/mylog' now works.
5596 ~/mylog' now works.
5592
5597
5593 * IPython/iplib.py (complete): fixed bug where paths starting with
5598 * IPython/iplib.py (complete): fixed bug where paths starting with
5594 '/' would be completed as magic names.
5599 '/' would be completed as magic names.
5595
5600
5596 2002-05-04 Fernando Perez <fperez@colorado.edu>
5601 2002-05-04 Fernando Perez <fperez@colorado.edu>
5597
5602
5598 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5603 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5599 allow running full programs under the profiler's control.
5604 allow running full programs under the profiler's control.
5600
5605
5601 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5606 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5602 mode to report exceptions verbosely but without formatting
5607 mode to report exceptions verbosely but without formatting
5603 variables. This addresses the issue of ipython 'freezing' (it's
5608 variables. This addresses the issue of ipython 'freezing' (it's
5604 not frozen, but caught in an expensive formatting loop) when huge
5609 not frozen, but caught in an expensive formatting loop) when huge
5605 variables are in the context of an exception.
5610 variables are in the context of an exception.
5606 (VerboseTB.text): Added '--->' markers at line where exception was
5611 (VerboseTB.text): Added '--->' markers at line where exception was
5607 triggered. Much clearer to read, especially in NoColor modes.
5612 triggered. Much clearer to read, especially in NoColor modes.
5608
5613
5609 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5614 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5610 implemented in reverse when changing to the new parse_options().
5615 implemented in reverse when changing to the new parse_options().
5611
5616
5612 2002-05-03 Fernando Perez <fperez@colorado.edu>
5617 2002-05-03 Fernando Perez <fperez@colorado.edu>
5613
5618
5614 * IPython/Magic.py (Magic.parse_options): new function so that
5619 * IPython/Magic.py (Magic.parse_options): new function so that
5615 magics can parse options easier.
5620 magics can parse options easier.
5616 (Magic.magic_prun): new function similar to profile.run(),
5621 (Magic.magic_prun): new function similar to profile.run(),
5617 suggested by Chris Hart.
5622 suggested by Chris Hart.
5618 (Magic.magic_cd): fixed behavior so that it only changes if
5623 (Magic.magic_cd): fixed behavior so that it only changes if
5619 directory actually is in history.
5624 directory actually is in history.
5620
5625
5621 * IPython/usage.py (__doc__): added information about potential
5626 * IPython/usage.py (__doc__): added information about potential
5622 slowness of Verbose exception mode when there are huge data
5627 slowness of Verbose exception mode when there are huge data
5623 structures to be formatted (thanks to Archie Paulson).
5628 structures to be formatted (thanks to Archie Paulson).
5624
5629
5625 * IPython/ipmaker.py (make_IPython): Changed default logging
5630 * IPython/ipmaker.py (make_IPython): Changed default logging
5626 (when simply called with -log) to use curr_dir/ipython.log in
5631 (when simply called with -log) to use curr_dir/ipython.log in
5627 rotate mode. Fixed crash which was occuring with -log before
5632 rotate mode. Fixed crash which was occuring with -log before
5628 (thanks to Jim Boyle).
5633 (thanks to Jim Boyle).
5629
5634
5630 2002-05-01 Fernando Perez <fperez@colorado.edu>
5635 2002-05-01 Fernando Perez <fperez@colorado.edu>
5631
5636
5632 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5637 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5633 was nasty -- though somewhat of a corner case).
5638 was nasty -- though somewhat of a corner case).
5634
5639
5635 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5640 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5636 text (was a bug).
5641 text (was a bug).
5637
5642
5638 2002-04-30 Fernando Perez <fperez@colorado.edu>
5643 2002-04-30 Fernando Perez <fperez@colorado.edu>
5639
5644
5640 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5645 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5641 a print after ^D or ^C from the user so that the In[] prompt
5646 a print after ^D or ^C from the user so that the In[] prompt
5642 doesn't over-run the gnuplot one.
5647 doesn't over-run the gnuplot one.
5643
5648
5644 2002-04-29 Fernando Perez <fperez@colorado.edu>
5649 2002-04-29 Fernando Perez <fperez@colorado.edu>
5645
5650
5646 * Released 0.2.10
5651 * Released 0.2.10
5647
5652
5648 * IPython/__release__.py (version): get date dynamically.
5653 * IPython/__release__.py (version): get date dynamically.
5649
5654
5650 * Misc. documentation updates thanks to Arnd's comments. Also ran
5655 * Misc. documentation updates thanks to Arnd's comments. Also ran
5651 a full spellcheck on the manual (hadn't been done in a while).
5656 a full spellcheck on the manual (hadn't been done in a while).
5652
5657
5653 2002-04-27 Fernando Perez <fperez@colorado.edu>
5658 2002-04-27 Fernando Perez <fperez@colorado.edu>
5654
5659
5655 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5660 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5656 starting a log in mid-session would reset the input history list.
5661 starting a log in mid-session would reset the input history list.
5657
5662
5658 2002-04-26 Fernando Perez <fperez@colorado.edu>
5663 2002-04-26 Fernando Perez <fperez@colorado.edu>
5659
5664
5660 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5665 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5661 all files were being included in an update. Now anything in
5666 all files were being included in an update. Now anything in
5662 UserConfig that matches [A-Za-z]*.py will go (this excludes
5667 UserConfig that matches [A-Za-z]*.py will go (this excludes
5663 __init__.py)
5668 __init__.py)
5664
5669
5665 2002-04-25 Fernando Perez <fperez@colorado.edu>
5670 2002-04-25 Fernando Perez <fperez@colorado.edu>
5666
5671
5667 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5672 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5668 to __builtins__ so that any form of embedded or imported code can
5673 to __builtins__ so that any form of embedded or imported code can
5669 test for being inside IPython.
5674 test for being inside IPython.
5670
5675
5671 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5676 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5672 changed to GnuplotMagic because it's now an importable module,
5677 changed to GnuplotMagic because it's now an importable module,
5673 this makes the name follow that of the standard Gnuplot module.
5678 this makes the name follow that of the standard Gnuplot module.
5674 GnuplotMagic can now be loaded at any time in mid-session.
5679 GnuplotMagic can now be loaded at any time in mid-session.
5675
5680
5676 2002-04-24 Fernando Perez <fperez@colorado.edu>
5681 2002-04-24 Fernando Perez <fperez@colorado.edu>
5677
5682
5678 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5683 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5679 the globals (IPython has its own namespace) and the
5684 the globals (IPython has its own namespace) and the
5680 PhysicalQuantity stuff is much better anyway.
5685 PhysicalQuantity stuff is much better anyway.
5681
5686
5682 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5687 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5683 embedding example to standard user directory for
5688 embedding example to standard user directory for
5684 distribution. Also put it in the manual.
5689 distribution. Also put it in the manual.
5685
5690
5686 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5691 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5687 instance as first argument (so it doesn't rely on some obscure
5692 instance as first argument (so it doesn't rely on some obscure
5688 hidden global).
5693 hidden global).
5689
5694
5690 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5695 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5691 delimiters. While it prevents ().TAB from working, it allows
5696 delimiters. While it prevents ().TAB from working, it allows
5692 completions in open (... expressions. This is by far a more common
5697 completions in open (... expressions. This is by far a more common
5693 case.
5698 case.
5694
5699
5695 2002-04-23 Fernando Perez <fperez@colorado.edu>
5700 2002-04-23 Fernando Perez <fperez@colorado.edu>
5696
5701
5697 * IPython/Extensions/InterpreterPasteInput.py: new
5702 * IPython/Extensions/InterpreterPasteInput.py: new
5698 syntax-processing module for pasting lines with >>> or ... at the
5703 syntax-processing module for pasting lines with >>> or ... at the
5699 start.
5704 start.
5700
5705
5701 * IPython/Extensions/PhysicalQ_Interactive.py
5706 * IPython/Extensions/PhysicalQ_Interactive.py
5702 (PhysicalQuantityInteractive.__int__): fixed to work with either
5707 (PhysicalQuantityInteractive.__int__): fixed to work with either
5703 Numeric or math.
5708 Numeric or math.
5704
5709
5705 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5710 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5706 provided profiles. Now we have:
5711 provided profiles. Now we have:
5707 -math -> math module as * and cmath with its own namespace.
5712 -math -> math module as * and cmath with its own namespace.
5708 -numeric -> Numeric as *, plus gnuplot & grace
5713 -numeric -> Numeric as *, plus gnuplot & grace
5709 -physics -> same as before
5714 -physics -> same as before
5710
5715
5711 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5716 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5712 user-defined magics wouldn't be found by @magic if they were
5717 user-defined magics wouldn't be found by @magic if they were
5713 defined as class methods. Also cleaned up the namespace search
5718 defined as class methods. Also cleaned up the namespace search
5714 logic and the string building (to use %s instead of many repeated
5719 logic and the string building (to use %s instead of many repeated
5715 string adds).
5720 string adds).
5716
5721
5717 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5722 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5718 of user-defined magics to operate with class methods (cleaner, in
5723 of user-defined magics to operate with class methods (cleaner, in
5719 line with the gnuplot code).
5724 line with the gnuplot code).
5720
5725
5721 2002-04-22 Fernando Perez <fperez@colorado.edu>
5726 2002-04-22 Fernando Perez <fperez@colorado.edu>
5722
5727
5723 * setup.py: updated dependency list so that manual is updated when
5728 * setup.py: updated dependency list so that manual is updated when
5724 all included files change.
5729 all included files change.
5725
5730
5726 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5731 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5727 the delimiter removal option (the fix is ugly right now).
5732 the delimiter removal option (the fix is ugly right now).
5728
5733
5729 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5734 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5730 all of the math profile (quicker loading, no conflict between
5735 all of the math profile (quicker loading, no conflict between
5731 g-9.8 and g-gnuplot).
5736 g-9.8 and g-gnuplot).
5732
5737
5733 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5738 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5734 name of post-mortem files to IPython_crash_report.txt.
5739 name of post-mortem files to IPython_crash_report.txt.
5735
5740
5736 * Cleanup/update of the docs. Added all the new readline info and
5741 * Cleanup/update of the docs. Added all the new readline info and
5737 formatted all lists as 'real lists'.
5742 formatted all lists as 'real lists'.
5738
5743
5739 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5744 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5740 tab-completion options, since the full readline parse_and_bind is
5745 tab-completion options, since the full readline parse_and_bind is
5741 now accessible.
5746 now accessible.
5742
5747
5743 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5748 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5744 handling of readline options. Now users can specify any string to
5749 handling of readline options. Now users can specify any string to
5745 be passed to parse_and_bind(), as well as the delimiters to be
5750 be passed to parse_and_bind(), as well as the delimiters to be
5746 removed.
5751 removed.
5747 (InteractiveShell.__init__): Added __name__ to the global
5752 (InteractiveShell.__init__): Added __name__ to the global
5748 namespace so that things like Itpl which rely on its existence
5753 namespace so that things like Itpl which rely on its existence
5749 don't crash.
5754 don't crash.
5750 (InteractiveShell._prefilter): Defined the default with a _ so
5755 (InteractiveShell._prefilter): Defined the default with a _ so
5751 that prefilter() is easier to override, while the default one
5756 that prefilter() is easier to override, while the default one
5752 remains available.
5757 remains available.
5753
5758
5754 2002-04-18 Fernando Perez <fperez@colorado.edu>
5759 2002-04-18 Fernando Perez <fperez@colorado.edu>
5755
5760
5756 * Added information about pdb in the docs.
5761 * Added information about pdb in the docs.
5757
5762
5758 2002-04-17 Fernando Perez <fperez@colorado.edu>
5763 2002-04-17 Fernando Perez <fperez@colorado.edu>
5759
5764
5760 * IPython/ipmaker.py (make_IPython): added rc_override option to
5765 * IPython/ipmaker.py (make_IPython): added rc_override option to
5761 allow passing config options at creation time which may override
5766 allow passing config options at creation time which may override
5762 anything set in the config files or command line. This is
5767 anything set in the config files or command line. This is
5763 particularly useful for configuring embedded instances.
5768 particularly useful for configuring embedded instances.
5764
5769
5765 2002-04-15 Fernando Perez <fperez@colorado.edu>
5770 2002-04-15 Fernando Perez <fperez@colorado.edu>
5766
5771
5767 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5772 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5768 crash embedded instances because of the input cache falling out of
5773 crash embedded instances because of the input cache falling out of
5769 sync with the output counter.
5774 sync with the output counter.
5770
5775
5771 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5776 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5772 mode which calls pdb after an uncaught exception in IPython itself.
5777 mode which calls pdb after an uncaught exception in IPython itself.
5773
5778
5774 2002-04-14 Fernando Perez <fperez@colorado.edu>
5779 2002-04-14 Fernando Perez <fperez@colorado.edu>
5775
5780
5776 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5781 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5777 readline, fix it back after each call.
5782 readline, fix it back after each call.
5778
5783
5779 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5784 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5780 method to force all access via __call__(), which guarantees that
5785 method to force all access via __call__(), which guarantees that
5781 traceback references are properly deleted.
5786 traceback references are properly deleted.
5782
5787
5783 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5788 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5784 improve printing when pprint is in use.
5789 improve printing when pprint is in use.
5785
5790
5786 2002-04-13 Fernando Perez <fperez@colorado.edu>
5791 2002-04-13 Fernando Perez <fperez@colorado.edu>
5787
5792
5788 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5793 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5789 exceptions aren't caught anymore. If the user triggers one, he
5794 exceptions aren't caught anymore. If the user triggers one, he
5790 should know why he's doing it and it should go all the way up,
5795 should know why he's doing it and it should go all the way up,
5791 just like any other exception. So now @abort will fully kill the
5796 just like any other exception. So now @abort will fully kill the
5792 embedded interpreter and the embedding code (unless that happens
5797 embedded interpreter and the embedding code (unless that happens
5793 to catch SystemExit).
5798 to catch SystemExit).
5794
5799
5795 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5800 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5796 and a debugger() method to invoke the interactive pdb debugger
5801 and a debugger() method to invoke the interactive pdb debugger
5797 after printing exception information. Also added the corresponding
5802 after printing exception information. Also added the corresponding
5798 -pdb option and @pdb magic to control this feature, and updated
5803 -pdb option and @pdb magic to control this feature, and updated
5799 the docs. After a suggestion from Christopher Hart
5804 the docs. After a suggestion from Christopher Hart
5800 (hart-AT-caltech.edu).
5805 (hart-AT-caltech.edu).
5801
5806
5802 2002-04-12 Fernando Perez <fperez@colorado.edu>
5807 2002-04-12 Fernando Perez <fperez@colorado.edu>
5803
5808
5804 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5809 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5805 the exception handlers defined by the user (not the CrashHandler)
5810 the exception handlers defined by the user (not the CrashHandler)
5806 so that user exceptions don't trigger an ipython bug report.
5811 so that user exceptions don't trigger an ipython bug report.
5807
5812
5808 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5813 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5809 configurable (it should have always been so).
5814 configurable (it should have always been so).
5810
5815
5811 2002-03-26 Fernando Perez <fperez@colorado.edu>
5816 2002-03-26 Fernando Perez <fperez@colorado.edu>
5812
5817
5813 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5818 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5814 and there to fix embedding namespace issues. This should all be
5819 and there to fix embedding namespace issues. This should all be
5815 done in a more elegant way.
5820 done in a more elegant way.
5816
5821
5817 2002-03-25 Fernando Perez <fperez@colorado.edu>
5822 2002-03-25 Fernando Perez <fperez@colorado.edu>
5818
5823
5819 * IPython/genutils.py (get_home_dir): Try to make it work under
5824 * IPython/genutils.py (get_home_dir): Try to make it work under
5820 win9x also.
5825 win9x also.
5821
5826
5822 2002-03-20 Fernando Perez <fperez@colorado.edu>
5827 2002-03-20 Fernando Perez <fperez@colorado.edu>
5823
5828
5824 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5829 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5825 sys.displayhook untouched upon __init__.
5830 sys.displayhook untouched upon __init__.
5826
5831
5827 2002-03-19 Fernando Perez <fperez@colorado.edu>
5832 2002-03-19 Fernando Perez <fperez@colorado.edu>
5828
5833
5829 * Released 0.2.9 (for embedding bug, basically).
5834 * Released 0.2.9 (for embedding bug, basically).
5830
5835
5831 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5836 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5832 exceptions so that enclosing shell's state can be restored.
5837 exceptions so that enclosing shell's state can be restored.
5833
5838
5834 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5839 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5835 naming conventions in the .ipython/ dir.
5840 naming conventions in the .ipython/ dir.
5836
5841
5837 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5842 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5838 from delimiters list so filenames with - in them get expanded.
5843 from delimiters list so filenames with - in them get expanded.
5839
5844
5840 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5845 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5841 sys.displayhook not being properly restored after an embedded call.
5846 sys.displayhook not being properly restored after an embedded call.
5842
5847
5843 2002-03-18 Fernando Perez <fperez@colorado.edu>
5848 2002-03-18 Fernando Perez <fperez@colorado.edu>
5844
5849
5845 * Released 0.2.8
5850 * Released 0.2.8
5846
5851
5847 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5852 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5848 some files weren't being included in a -upgrade.
5853 some files weren't being included in a -upgrade.
5849 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5854 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5850 on' so that the first tab completes.
5855 on' so that the first tab completes.
5851 (InteractiveShell.handle_magic): fixed bug with spaces around
5856 (InteractiveShell.handle_magic): fixed bug with spaces around
5852 quotes breaking many magic commands.
5857 quotes breaking many magic commands.
5853
5858
5854 * setup.py: added note about ignoring the syntax error messages at
5859 * setup.py: added note about ignoring the syntax error messages at
5855 installation.
5860 installation.
5856
5861
5857 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5862 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5858 streamlining the gnuplot interface, now there's only one magic @gp.
5863 streamlining the gnuplot interface, now there's only one magic @gp.
5859
5864
5860 2002-03-17 Fernando Perez <fperez@colorado.edu>
5865 2002-03-17 Fernando Perez <fperez@colorado.edu>
5861
5866
5862 * IPython/UserConfig/magic_gnuplot.py: new name for the
5867 * IPython/UserConfig/magic_gnuplot.py: new name for the
5863 example-magic_pm.py file. Much enhanced system, now with a shell
5868 example-magic_pm.py file. Much enhanced system, now with a shell
5864 for communicating directly with gnuplot, one command at a time.
5869 for communicating directly with gnuplot, one command at a time.
5865
5870
5866 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5871 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5867 setting __name__=='__main__'.
5872 setting __name__=='__main__'.
5868
5873
5869 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5874 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5870 mini-shell for accessing gnuplot from inside ipython. Should
5875 mini-shell for accessing gnuplot from inside ipython. Should
5871 extend it later for grace access too. Inspired by Arnd's
5876 extend it later for grace access too. Inspired by Arnd's
5872 suggestion.
5877 suggestion.
5873
5878
5874 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5879 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5875 calling magic functions with () in their arguments. Thanks to Arnd
5880 calling magic functions with () in their arguments. Thanks to Arnd
5876 Baecker for pointing this to me.
5881 Baecker for pointing this to me.
5877
5882
5878 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5883 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5879 infinitely for integer or complex arrays (only worked with floats).
5884 infinitely for integer or complex arrays (only worked with floats).
5880
5885
5881 2002-03-16 Fernando Perez <fperez@colorado.edu>
5886 2002-03-16 Fernando Perez <fperez@colorado.edu>
5882
5887
5883 * setup.py: Merged setup and setup_windows into a single script
5888 * setup.py: Merged setup and setup_windows into a single script
5884 which properly handles things for windows users.
5889 which properly handles things for windows users.
5885
5890
5886 2002-03-15 Fernando Perez <fperez@colorado.edu>
5891 2002-03-15 Fernando Perez <fperez@colorado.edu>
5887
5892
5888 * Big change to the manual: now the magics are all automatically
5893 * Big change to the manual: now the magics are all automatically
5889 documented. This information is generated from their docstrings
5894 documented. This information is generated from their docstrings
5890 and put in a latex file included by the manual lyx file. This way
5895 and put in a latex file included by the manual lyx file. This way
5891 we get always up to date information for the magics. The manual
5896 we get always up to date information for the magics. The manual
5892 now also has proper version information, also auto-synced.
5897 now also has proper version information, also auto-synced.
5893
5898
5894 For this to work, an undocumented --magic_docstrings option was added.
5899 For this to work, an undocumented --magic_docstrings option was added.
5895
5900
5896 2002-03-13 Fernando Perez <fperez@colorado.edu>
5901 2002-03-13 Fernando Perez <fperez@colorado.edu>
5897
5902
5898 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5903 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5899 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5904 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5900
5905
5901 2002-03-12 Fernando Perez <fperez@colorado.edu>
5906 2002-03-12 Fernando Perez <fperez@colorado.edu>
5902
5907
5903 * IPython/ultraTB.py (TermColors): changed color escapes again to
5908 * IPython/ultraTB.py (TermColors): changed color escapes again to
5904 fix the (old, reintroduced) line-wrapping bug. Basically, if
5909 fix the (old, reintroduced) line-wrapping bug. Basically, if
5905 \001..\002 aren't given in the color escapes, lines get wrapped
5910 \001..\002 aren't given in the color escapes, lines get wrapped
5906 weirdly. But giving those screws up old xterms and emacs terms. So
5911 weirdly. But giving those screws up old xterms and emacs terms. So
5907 I added some logic for emacs terms to be ok, but I can't identify old
5912 I added some logic for emacs terms to be ok, but I can't identify old
5908 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5913 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5909
5914
5910 2002-03-10 Fernando Perez <fperez@colorado.edu>
5915 2002-03-10 Fernando Perez <fperez@colorado.edu>
5911
5916
5912 * IPython/usage.py (__doc__): Various documentation cleanups and
5917 * IPython/usage.py (__doc__): Various documentation cleanups and
5913 updates, both in usage docstrings and in the manual.
5918 updates, both in usage docstrings and in the manual.
5914
5919
5915 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5920 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5916 handling of caching. Set minimum acceptabe value for having a
5921 handling of caching. Set minimum acceptabe value for having a
5917 cache at 20 values.
5922 cache at 20 values.
5918
5923
5919 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5924 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5920 install_first_time function to a method, renamed it and added an
5925 install_first_time function to a method, renamed it and added an
5921 'upgrade' mode. Now people can update their config directory with
5926 'upgrade' mode. Now people can update their config directory with
5922 a simple command line switch (-upgrade, also new).
5927 a simple command line switch (-upgrade, also new).
5923
5928
5924 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5929 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5925 @file (convenient for automagic users under Python >= 2.2).
5930 @file (convenient for automagic users under Python >= 2.2).
5926 Removed @files (it seemed more like a plural than an abbrev. of
5931 Removed @files (it seemed more like a plural than an abbrev. of
5927 'file show').
5932 'file show').
5928
5933
5929 * IPython/iplib.py (install_first_time): Fixed crash if there were
5934 * IPython/iplib.py (install_first_time): Fixed crash if there were
5930 backup files ('~') in .ipython/ install directory.
5935 backup files ('~') in .ipython/ install directory.
5931
5936
5932 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5937 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5933 system. Things look fine, but these changes are fairly
5938 system. Things look fine, but these changes are fairly
5934 intrusive. Test them for a few days.
5939 intrusive. Test them for a few days.
5935
5940
5936 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5941 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5937 the prompts system. Now all in/out prompt strings are user
5942 the prompts system. Now all in/out prompt strings are user
5938 controllable. This is particularly useful for embedding, as one
5943 controllable. This is particularly useful for embedding, as one
5939 can tag embedded instances with particular prompts.
5944 can tag embedded instances with particular prompts.
5940
5945
5941 Also removed global use of sys.ps1/2, which now allows nested
5946 Also removed global use of sys.ps1/2, which now allows nested
5942 embeddings without any problems. Added command-line options for
5947 embeddings without any problems. Added command-line options for
5943 the prompt strings.
5948 the prompt strings.
5944
5949
5945 2002-03-08 Fernando Perez <fperez@colorado.edu>
5950 2002-03-08 Fernando Perez <fperez@colorado.edu>
5946
5951
5947 * IPython/UserConfig/example-embed-short.py (ipshell): added
5952 * IPython/UserConfig/example-embed-short.py (ipshell): added
5948 example file with the bare minimum code for embedding.
5953 example file with the bare minimum code for embedding.
5949
5954
5950 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5955 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5951 functionality for the embeddable shell to be activated/deactivated
5956 functionality for the embeddable shell to be activated/deactivated
5952 either globally or at each call.
5957 either globally or at each call.
5953
5958
5954 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5959 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5955 rewriting the prompt with '--->' for auto-inputs with proper
5960 rewriting the prompt with '--->' for auto-inputs with proper
5956 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5961 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5957 this is handled by the prompts class itself, as it should.
5962 this is handled by the prompts class itself, as it should.
5958
5963
5959 2002-03-05 Fernando Perez <fperez@colorado.edu>
5964 2002-03-05 Fernando Perez <fperez@colorado.edu>
5960
5965
5961 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5966 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5962 @logstart to avoid name clashes with the math log function.
5967 @logstart to avoid name clashes with the math log function.
5963
5968
5964 * Big updates to X/Emacs section of the manual.
5969 * Big updates to X/Emacs section of the manual.
5965
5970
5966 * Removed ipython_emacs. Milan explained to me how to pass
5971 * Removed ipython_emacs. Milan explained to me how to pass
5967 arguments to ipython through Emacs. Some day I'm going to end up
5972 arguments to ipython through Emacs. Some day I'm going to end up
5968 learning some lisp...
5973 learning some lisp...
5969
5974
5970 2002-03-04 Fernando Perez <fperez@colorado.edu>
5975 2002-03-04 Fernando Perez <fperez@colorado.edu>
5971
5976
5972 * IPython/ipython_emacs: Created script to be used as the
5977 * IPython/ipython_emacs: Created script to be used as the
5973 py-python-command Emacs variable so we can pass IPython
5978 py-python-command Emacs variable so we can pass IPython
5974 parameters. I can't figure out how to tell Emacs directly to pass
5979 parameters. I can't figure out how to tell Emacs directly to pass
5975 parameters to IPython, so a dummy shell script will do it.
5980 parameters to IPython, so a dummy shell script will do it.
5976
5981
5977 Other enhancements made for things to work better under Emacs'
5982 Other enhancements made for things to work better under Emacs'
5978 various types of terminals. Many thanks to Milan Zamazal
5983 various types of terminals. Many thanks to Milan Zamazal
5979 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5984 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5980
5985
5981 2002-03-01 Fernando Perez <fperez@colorado.edu>
5986 2002-03-01 Fernando Perez <fperez@colorado.edu>
5982
5987
5983 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5988 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5984 that loading of readline is now optional. This gives better
5989 that loading of readline is now optional. This gives better
5985 control to emacs users.
5990 control to emacs users.
5986
5991
5987 * IPython/ultraTB.py (__date__): Modified color escape sequences
5992 * IPython/ultraTB.py (__date__): Modified color escape sequences
5988 and now things work fine under xterm and in Emacs' term buffers
5993 and now things work fine under xterm and in Emacs' term buffers
5989 (though not shell ones). Well, in emacs you get colors, but all
5994 (though not shell ones). Well, in emacs you get colors, but all
5990 seem to be 'light' colors (no difference between dark and light
5995 seem to be 'light' colors (no difference between dark and light
5991 ones). But the garbage chars are gone, and also in xterms. It
5996 ones). But the garbage chars are gone, and also in xterms. It
5992 seems that now I'm using 'cleaner' ansi sequences.
5997 seems that now I'm using 'cleaner' ansi sequences.
5993
5998
5994 2002-02-21 Fernando Perez <fperez@colorado.edu>
5999 2002-02-21 Fernando Perez <fperez@colorado.edu>
5995
6000
5996 * Released 0.2.7 (mainly to publish the scoping fix).
6001 * Released 0.2.7 (mainly to publish the scoping fix).
5997
6002
5998 * IPython/Logger.py (Logger.logstate): added. A corresponding
6003 * IPython/Logger.py (Logger.logstate): added. A corresponding
5999 @logstate magic was created.
6004 @logstate magic was created.
6000
6005
6001 * IPython/Magic.py: fixed nested scoping problem under Python
6006 * IPython/Magic.py: fixed nested scoping problem under Python
6002 2.1.x (automagic wasn't working).
6007 2.1.x (automagic wasn't working).
6003
6008
6004 2002-02-20 Fernando Perez <fperez@colorado.edu>
6009 2002-02-20 Fernando Perez <fperez@colorado.edu>
6005
6010
6006 * Released 0.2.6.
6011 * Released 0.2.6.
6007
6012
6008 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6013 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6009 option so that logs can come out without any headers at all.
6014 option so that logs can come out without any headers at all.
6010
6015
6011 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6016 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6012 SciPy.
6017 SciPy.
6013
6018
6014 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6019 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6015 that embedded IPython calls don't require vars() to be explicitly
6020 that embedded IPython calls don't require vars() to be explicitly
6016 passed. Now they are extracted from the caller's frame (code
6021 passed. Now they are extracted from the caller's frame (code
6017 snatched from Eric Jones' weave). Added better documentation to
6022 snatched from Eric Jones' weave). Added better documentation to
6018 the section on embedding and the example file.
6023 the section on embedding and the example file.
6019
6024
6020 * IPython/genutils.py (page): Changed so that under emacs, it just
6025 * IPython/genutils.py (page): Changed so that under emacs, it just
6021 prints the string. You can then page up and down in the emacs
6026 prints the string. You can then page up and down in the emacs
6022 buffer itself. This is how the builtin help() works.
6027 buffer itself. This is how the builtin help() works.
6023
6028
6024 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6029 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6025 macro scoping: macros need to be executed in the user's namespace
6030 macro scoping: macros need to be executed in the user's namespace
6026 to work as if they had been typed by the user.
6031 to work as if they had been typed by the user.
6027
6032
6028 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6033 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6029 execute automatically (no need to type 'exec...'). They then
6034 execute automatically (no need to type 'exec...'). They then
6030 behave like 'true macros'. The printing system was also modified
6035 behave like 'true macros'. The printing system was also modified
6031 for this to work.
6036 for this to work.
6032
6037
6033 2002-02-19 Fernando Perez <fperez@colorado.edu>
6038 2002-02-19 Fernando Perez <fperez@colorado.edu>
6034
6039
6035 * IPython/genutils.py (page_file): new function for paging files
6040 * IPython/genutils.py (page_file): new function for paging files
6036 in an OS-independent way. Also necessary for file viewing to work
6041 in an OS-independent way. Also necessary for file viewing to work
6037 well inside Emacs buffers.
6042 well inside Emacs buffers.
6038 (page): Added checks for being in an emacs buffer.
6043 (page): Added checks for being in an emacs buffer.
6039 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6044 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6040 same bug in iplib.
6045 same bug in iplib.
6041
6046
6042 2002-02-18 Fernando Perez <fperez@colorado.edu>
6047 2002-02-18 Fernando Perez <fperez@colorado.edu>
6043
6048
6044 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6049 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6045 of readline so that IPython can work inside an Emacs buffer.
6050 of readline so that IPython can work inside an Emacs buffer.
6046
6051
6047 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6052 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6048 method signatures (they weren't really bugs, but it looks cleaner
6053 method signatures (they weren't really bugs, but it looks cleaner
6049 and keeps PyChecker happy).
6054 and keeps PyChecker happy).
6050
6055
6051 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6056 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6052 for implementing various user-defined hooks. Currently only
6057 for implementing various user-defined hooks. Currently only
6053 display is done.
6058 display is done.
6054
6059
6055 * IPython/Prompts.py (CachedOutput._display): changed display
6060 * IPython/Prompts.py (CachedOutput._display): changed display
6056 functions so that they can be dynamically changed by users easily.
6061 functions so that they can be dynamically changed by users easily.
6057
6062
6058 * IPython/Extensions/numeric_formats.py (num_display): added an
6063 * IPython/Extensions/numeric_formats.py (num_display): added an
6059 extension for printing NumPy arrays in flexible manners. It
6064 extension for printing NumPy arrays in flexible manners. It
6060 doesn't do anything yet, but all the structure is in
6065 doesn't do anything yet, but all the structure is in
6061 place. Ultimately the plan is to implement output format control
6066 place. Ultimately the plan is to implement output format control
6062 like in Octave.
6067 like in Octave.
6063
6068
6064 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6069 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6065 methods are found at run-time by all the automatic machinery.
6070 methods are found at run-time by all the automatic machinery.
6066
6071
6067 2002-02-17 Fernando Perez <fperez@colorado.edu>
6072 2002-02-17 Fernando Perez <fperez@colorado.edu>
6068
6073
6069 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6074 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6070 whole file a little.
6075 whole file a little.
6071
6076
6072 * ToDo: closed this document. Now there's a new_design.lyx
6077 * ToDo: closed this document. Now there's a new_design.lyx
6073 document for all new ideas. Added making a pdf of it for the
6078 document for all new ideas. Added making a pdf of it for the
6074 end-user distro.
6079 end-user distro.
6075
6080
6076 * IPython/Logger.py (Logger.switch_log): Created this to replace
6081 * IPython/Logger.py (Logger.switch_log): Created this to replace
6077 logon() and logoff(). It also fixes a nasty crash reported by
6082 logon() and logoff(). It also fixes a nasty crash reported by
6078 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6083 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6079
6084
6080 * IPython/iplib.py (complete): got auto-completion to work with
6085 * IPython/iplib.py (complete): got auto-completion to work with
6081 automagic (I had wanted this for a long time).
6086 automagic (I had wanted this for a long time).
6082
6087
6083 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6088 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6084 to @file, since file() is now a builtin and clashes with automagic
6089 to @file, since file() is now a builtin and clashes with automagic
6085 for @file.
6090 for @file.
6086
6091
6087 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6092 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6088 of this was previously in iplib, which had grown to more than 2000
6093 of this was previously in iplib, which had grown to more than 2000
6089 lines, way too long. No new functionality, but it makes managing
6094 lines, way too long. No new functionality, but it makes managing
6090 the code a bit easier.
6095 the code a bit easier.
6091
6096
6092 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6097 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6093 information to crash reports.
6098 information to crash reports.
6094
6099
6095 2002-02-12 Fernando Perez <fperez@colorado.edu>
6100 2002-02-12 Fernando Perez <fperez@colorado.edu>
6096
6101
6097 * Released 0.2.5.
6102 * Released 0.2.5.
6098
6103
6099 2002-02-11 Fernando Perez <fperez@colorado.edu>
6104 2002-02-11 Fernando Perez <fperez@colorado.edu>
6100
6105
6101 * Wrote a relatively complete Windows installer. It puts
6106 * Wrote a relatively complete Windows installer. It puts
6102 everything in place, creates Start Menu entries and fixes the
6107 everything in place, creates Start Menu entries and fixes the
6103 color issues. Nothing fancy, but it works.
6108 color issues. Nothing fancy, but it works.
6104
6109
6105 2002-02-10 Fernando Perez <fperez@colorado.edu>
6110 2002-02-10 Fernando Perez <fperez@colorado.edu>
6106
6111
6107 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6112 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6108 os.path.expanduser() call so that we can type @run ~/myfile.py and
6113 os.path.expanduser() call so that we can type @run ~/myfile.py and
6109 have thigs work as expected.
6114 have thigs work as expected.
6110
6115
6111 * IPython/genutils.py (page): fixed exception handling so things
6116 * IPython/genutils.py (page): fixed exception handling so things
6112 work both in Unix and Windows correctly. Quitting a pager triggers
6117 work both in Unix and Windows correctly. Quitting a pager triggers
6113 an IOError/broken pipe in Unix, and in windows not finding a pager
6118 an IOError/broken pipe in Unix, and in windows not finding a pager
6114 is also an IOError, so I had to actually look at the return value
6119 is also an IOError, so I had to actually look at the return value
6115 of the exception, not just the exception itself. Should be ok now.
6120 of the exception, not just the exception itself. Should be ok now.
6116
6121
6117 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6122 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6118 modified to allow case-insensitive color scheme changes.
6123 modified to allow case-insensitive color scheme changes.
6119
6124
6120 2002-02-09 Fernando Perez <fperez@colorado.edu>
6125 2002-02-09 Fernando Perez <fperez@colorado.edu>
6121
6126
6122 * IPython/genutils.py (native_line_ends): new function to leave
6127 * IPython/genutils.py (native_line_ends): new function to leave
6123 user config files with os-native line-endings.
6128 user config files with os-native line-endings.
6124
6129
6125 * README and manual updates.
6130 * README and manual updates.
6126
6131
6127 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6132 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6128 instead of StringType to catch Unicode strings.
6133 instead of StringType to catch Unicode strings.
6129
6134
6130 * IPython/genutils.py (filefind): fixed bug for paths with
6135 * IPython/genutils.py (filefind): fixed bug for paths with
6131 embedded spaces (very common in Windows).
6136 embedded spaces (very common in Windows).
6132
6137
6133 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6138 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6134 files under Windows, so that they get automatically associated
6139 files under Windows, so that they get automatically associated
6135 with a text editor. Windows makes it a pain to handle
6140 with a text editor. Windows makes it a pain to handle
6136 extension-less files.
6141 extension-less files.
6137
6142
6138 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6143 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6139 warning about readline only occur for Posix. In Windows there's no
6144 warning about readline only occur for Posix. In Windows there's no
6140 way to get readline, so why bother with the warning.
6145 way to get readline, so why bother with the warning.
6141
6146
6142 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6147 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6143 for __str__ instead of dir(self), since dir() changed in 2.2.
6148 for __str__ instead of dir(self), since dir() changed in 2.2.
6144
6149
6145 * Ported to Windows! Tested on XP, I suspect it should work fine
6150 * Ported to Windows! Tested on XP, I suspect it should work fine
6146 on NT/2000, but I don't think it will work on 98 et al. That
6151 on NT/2000, but I don't think it will work on 98 et al. That
6147 series of Windows is such a piece of junk anyway that I won't try
6152 series of Windows is such a piece of junk anyway that I won't try
6148 porting it there. The XP port was straightforward, showed a few
6153 porting it there. The XP port was straightforward, showed a few
6149 bugs here and there (fixed all), in particular some string
6154 bugs here and there (fixed all), in particular some string
6150 handling stuff which required considering Unicode strings (which
6155 handling stuff which required considering Unicode strings (which
6151 Windows uses). This is good, but hasn't been too tested :) No
6156 Windows uses). This is good, but hasn't been too tested :) No
6152 fancy installer yet, I'll put a note in the manual so people at
6157 fancy installer yet, I'll put a note in the manual so people at
6153 least make manually a shortcut.
6158 least make manually a shortcut.
6154
6159
6155 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6160 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6156 into a single one, "colors". This now controls both prompt and
6161 into a single one, "colors". This now controls both prompt and
6157 exception color schemes, and can be changed both at startup
6162 exception color schemes, and can be changed both at startup
6158 (either via command-line switches or via ipythonrc files) and at
6163 (either via command-line switches or via ipythonrc files) and at
6159 runtime, with @colors.
6164 runtime, with @colors.
6160 (Magic.magic_run): renamed @prun to @run and removed the old
6165 (Magic.magic_run): renamed @prun to @run and removed the old
6161 @run. The two were too similar to warrant keeping both.
6166 @run. The two were too similar to warrant keeping both.
6162
6167
6163 2002-02-03 Fernando Perez <fperez@colorado.edu>
6168 2002-02-03 Fernando Perez <fperez@colorado.edu>
6164
6169
6165 * IPython/iplib.py (install_first_time): Added comment on how to
6170 * IPython/iplib.py (install_first_time): Added comment on how to
6166 configure the color options for first-time users. Put a <return>
6171 configure the color options for first-time users. Put a <return>
6167 request at the end so that small-terminal users get a chance to
6172 request at the end so that small-terminal users get a chance to
6168 read the startup info.
6173 read the startup info.
6169
6174
6170 2002-01-23 Fernando Perez <fperez@colorado.edu>
6175 2002-01-23 Fernando Perez <fperez@colorado.edu>
6171
6176
6172 * IPython/iplib.py (CachedOutput.update): Changed output memory
6177 * IPython/iplib.py (CachedOutput.update): Changed output memory
6173 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6178 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6174 input history we still use _i. Did this b/c these variable are
6179 input history we still use _i. Did this b/c these variable are
6175 very commonly used in interactive work, so the less we need to
6180 very commonly used in interactive work, so the less we need to
6176 type the better off we are.
6181 type the better off we are.
6177 (Magic.magic_prun): updated @prun to better handle the namespaces
6182 (Magic.magic_prun): updated @prun to better handle the namespaces
6178 the file will run in, including a fix for __name__ not being set
6183 the file will run in, including a fix for __name__ not being set
6179 before.
6184 before.
6180
6185
6181 2002-01-20 Fernando Perez <fperez@colorado.edu>
6186 2002-01-20 Fernando Perez <fperez@colorado.edu>
6182
6187
6183 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6188 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6184 extra garbage for Python 2.2. Need to look more carefully into
6189 extra garbage for Python 2.2. Need to look more carefully into
6185 this later.
6190 this later.
6186
6191
6187 2002-01-19 Fernando Perez <fperez@colorado.edu>
6192 2002-01-19 Fernando Perez <fperez@colorado.edu>
6188
6193
6189 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6194 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6190 display SyntaxError exceptions properly formatted when they occur
6195 display SyntaxError exceptions properly formatted when they occur
6191 (they can be triggered by imported code).
6196 (they can be triggered by imported code).
6192
6197
6193 2002-01-18 Fernando Perez <fperez@colorado.edu>
6198 2002-01-18 Fernando Perez <fperez@colorado.edu>
6194
6199
6195 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6200 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6196 SyntaxError exceptions are reported nicely formatted, instead of
6201 SyntaxError exceptions are reported nicely formatted, instead of
6197 spitting out only offset information as before.
6202 spitting out only offset information as before.
6198 (Magic.magic_prun): Added the @prun function for executing
6203 (Magic.magic_prun): Added the @prun function for executing
6199 programs with command line args inside IPython.
6204 programs with command line args inside IPython.
6200
6205
6201 2002-01-16 Fernando Perez <fperez@colorado.edu>
6206 2002-01-16 Fernando Perez <fperez@colorado.edu>
6202
6207
6203 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6208 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6204 to *not* include the last item given in a range. This brings their
6209 to *not* include the last item given in a range. This brings their
6205 behavior in line with Python's slicing:
6210 behavior in line with Python's slicing:
6206 a[n1:n2] -> a[n1]...a[n2-1]
6211 a[n1:n2] -> a[n1]...a[n2-1]
6207 It may be a bit less convenient, but I prefer to stick to Python's
6212 It may be a bit less convenient, but I prefer to stick to Python's
6208 conventions *everywhere*, so users never have to wonder.
6213 conventions *everywhere*, so users never have to wonder.
6209 (Magic.magic_macro): Added @macro function to ease the creation of
6214 (Magic.magic_macro): Added @macro function to ease the creation of
6210 macros.
6215 macros.
6211
6216
6212 2002-01-05 Fernando Perez <fperez@colorado.edu>
6217 2002-01-05 Fernando Perez <fperez@colorado.edu>
6213
6218
6214 * Released 0.2.4.
6219 * Released 0.2.4.
6215
6220
6216 * IPython/iplib.py (Magic.magic_pdef):
6221 * IPython/iplib.py (Magic.magic_pdef):
6217 (InteractiveShell.safe_execfile): report magic lines and error
6222 (InteractiveShell.safe_execfile): report magic lines and error
6218 lines without line numbers so one can easily copy/paste them for
6223 lines without line numbers so one can easily copy/paste them for
6219 re-execution.
6224 re-execution.
6220
6225
6221 * Updated manual with recent changes.
6226 * Updated manual with recent changes.
6222
6227
6223 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6228 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6224 docstring printing when class? is called. Very handy for knowing
6229 docstring printing when class? is called. Very handy for knowing
6225 how to create class instances (as long as __init__ is well
6230 how to create class instances (as long as __init__ is well
6226 documented, of course :)
6231 documented, of course :)
6227 (Magic.magic_doc): print both class and constructor docstrings.
6232 (Magic.magic_doc): print both class and constructor docstrings.
6228 (Magic.magic_pdef): give constructor info if passed a class and
6233 (Magic.magic_pdef): give constructor info if passed a class and
6229 __call__ info for callable object instances.
6234 __call__ info for callable object instances.
6230
6235
6231 2002-01-04 Fernando Perez <fperez@colorado.edu>
6236 2002-01-04 Fernando Perez <fperez@colorado.edu>
6232
6237
6233 * Made deep_reload() off by default. It doesn't always work
6238 * Made deep_reload() off by default. It doesn't always work
6234 exactly as intended, so it's probably safer to have it off. It's
6239 exactly as intended, so it's probably safer to have it off. It's
6235 still available as dreload() anyway, so nothing is lost.
6240 still available as dreload() anyway, so nothing is lost.
6236
6241
6237 2002-01-02 Fernando Perez <fperez@colorado.edu>
6242 2002-01-02 Fernando Perez <fperez@colorado.edu>
6238
6243
6239 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6244 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6240 so I wanted an updated release).
6245 so I wanted an updated release).
6241
6246
6242 2001-12-27 Fernando Perez <fperez@colorado.edu>
6247 2001-12-27 Fernando Perez <fperez@colorado.edu>
6243
6248
6244 * IPython/iplib.py (InteractiveShell.interact): Added the original
6249 * IPython/iplib.py (InteractiveShell.interact): Added the original
6245 code from 'code.py' for this module in order to change the
6250 code from 'code.py' for this module in order to change the
6246 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6251 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6247 the history cache would break when the user hit Ctrl-C, and
6252 the history cache would break when the user hit Ctrl-C, and
6248 interact() offers no way to add any hooks to it.
6253 interact() offers no way to add any hooks to it.
6249
6254
6250 2001-12-23 Fernando Perez <fperez@colorado.edu>
6255 2001-12-23 Fernando Perez <fperez@colorado.edu>
6251
6256
6252 * setup.py: added check for 'MANIFEST' before trying to remove
6257 * setup.py: added check for 'MANIFEST' before trying to remove
6253 it. Thanks to Sean Reifschneider.
6258 it. Thanks to Sean Reifschneider.
6254
6259
6255 2001-12-22 Fernando Perez <fperez@colorado.edu>
6260 2001-12-22 Fernando Perez <fperez@colorado.edu>
6256
6261
6257 * Released 0.2.2.
6262 * Released 0.2.2.
6258
6263
6259 * Finished (reasonably) writing the manual. Later will add the
6264 * Finished (reasonably) writing the manual. Later will add the
6260 python-standard navigation stylesheets, but for the time being
6265 python-standard navigation stylesheets, but for the time being
6261 it's fairly complete. Distribution will include html and pdf
6266 it's fairly complete. Distribution will include html and pdf
6262 versions.
6267 versions.
6263
6268
6264 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6269 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6265 (MayaVi author).
6270 (MayaVi author).
6266
6271
6267 2001-12-21 Fernando Perez <fperez@colorado.edu>
6272 2001-12-21 Fernando Perez <fperez@colorado.edu>
6268
6273
6269 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6274 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6270 good public release, I think (with the manual and the distutils
6275 good public release, I think (with the manual and the distutils
6271 installer). The manual can use some work, but that can go
6276 installer). The manual can use some work, but that can go
6272 slowly. Otherwise I think it's quite nice for end users. Next
6277 slowly. Otherwise I think it's quite nice for end users. Next
6273 summer, rewrite the guts of it...
6278 summer, rewrite the guts of it...
6274
6279
6275 * Changed format of ipythonrc files to use whitespace as the
6280 * Changed format of ipythonrc files to use whitespace as the
6276 separator instead of an explicit '='. Cleaner.
6281 separator instead of an explicit '='. Cleaner.
6277
6282
6278 2001-12-20 Fernando Perez <fperez@colorado.edu>
6283 2001-12-20 Fernando Perez <fperez@colorado.edu>
6279
6284
6280 * Started a manual in LyX. For now it's just a quick merge of the
6285 * Started a manual in LyX. For now it's just a quick merge of the
6281 various internal docstrings and READMEs. Later it may grow into a
6286 various internal docstrings and READMEs. Later it may grow into a
6282 nice, full-blown manual.
6287 nice, full-blown manual.
6283
6288
6284 * Set up a distutils based installer. Installation should now be
6289 * Set up a distutils based installer. Installation should now be
6285 trivially simple for end-users.
6290 trivially simple for end-users.
6286
6291
6287 2001-12-11 Fernando Perez <fperez@colorado.edu>
6292 2001-12-11 Fernando Perez <fperez@colorado.edu>
6288
6293
6289 * Released 0.2.0. First public release, announced it at
6294 * Released 0.2.0. First public release, announced it at
6290 comp.lang.python. From now on, just bugfixes...
6295 comp.lang.python. From now on, just bugfixes...
6291
6296
6292 * Went through all the files, set copyright/license notices and
6297 * Went through all the files, set copyright/license notices and
6293 cleaned up things. Ready for release.
6298 cleaned up things. Ready for release.
6294
6299
6295 2001-12-10 Fernando Perez <fperez@colorado.edu>
6300 2001-12-10 Fernando Perez <fperez@colorado.edu>
6296
6301
6297 * Changed the first-time installer not to use tarfiles. It's more
6302 * Changed the first-time installer not to use tarfiles. It's more
6298 robust now and less unix-dependent. Also makes it easier for
6303 robust now and less unix-dependent. Also makes it easier for
6299 people to later upgrade versions.
6304 people to later upgrade versions.
6300
6305
6301 * Changed @exit to @abort to reflect the fact that it's pretty
6306 * Changed @exit to @abort to reflect the fact that it's pretty
6302 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6307 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6303 becomes significant only when IPyhton is embedded: in that case,
6308 becomes significant only when IPyhton is embedded: in that case,
6304 C-D closes IPython only, but @abort kills the enclosing program
6309 C-D closes IPython only, but @abort kills the enclosing program
6305 too (unless it had called IPython inside a try catching
6310 too (unless it had called IPython inside a try catching
6306 SystemExit).
6311 SystemExit).
6307
6312
6308 * Created Shell module which exposes the actuall IPython Shell
6313 * Created Shell module which exposes the actuall IPython Shell
6309 classes, currently the normal and the embeddable one. This at
6314 classes, currently the normal and the embeddable one. This at
6310 least offers a stable interface we won't need to change when
6315 least offers a stable interface we won't need to change when
6311 (later) the internals are rewritten. That rewrite will be confined
6316 (later) the internals are rewritten. That rewrite will be confined
6312 to iplib and ipmaker, but the Shell interface should remain as is.
6317 to iplib and ipmaker, but the Shell interface should remain as is.
6313
6318
6314 * Added embed module which offers an embeddable IPShell object,
6319 * Added embed module which offers an embeddable IPShell object,
6315 useful to fire up IPython *inside* a running program. Great for
6320 useful to fire up IPython *inside* a running program. Great for
6316 debugging or dynamical data analysis.
6321 debugging or dynamical data analysis.
6317
6322
6318 2001-12-08 Fernando Perez <fperez@colorado.edu>
6323 2001-12-08 Fernando Perez <fperez@colorado.edu>
6319
6324
6320 * Fixed small bug preventing seeing info from methods of defined
6325 * Fixed small bug preventing seeing info from methods of defined
6321 objects (incorrect namespace in _ofind()).
6326 objects (incorrect namespace in _ofind()).
6322
6327
6323 * Documentation cleanup. Moved the main usage docstrings to a
6328 * Documentation cleanup. Moved the main usage docstrings to a
6324 separate file, usage.py (cleaner to maintain, and hopefully in the
6329 separate file, usage.py (cleaner to maintain, and hopefully in the
6325 future some perlpod-like way of producing interactive, man and
6330 future some perlpod-like way of producing interactive, man and
6326 html docs out of it will be found).
6331 html docs out of it will be found).
6327
6332
6328 * Added @profile to see your profile at any time.
6333 * Added @profile to see your profile at any time.
6329
6334
6330 * Added @p as an alias for 'print'. It's especially convenient if
6335 * Added @p as an alias for 'print'. It's especially convenient if
6331 using automagic ('p x' prints x).
6336 using automagic ('p x' prints x).
6332
6337
6333 * Small cleanups and fixes after a pychecker run.
6338 * Small cleanups and fixes after a pychecker run.
6334
6339
6335 * Changed the @cd command to handle @cd - and @cd -<n> for
6340 * Changed the @cd command to handle @cd - and @cd -<n> for
6336 visiting any directory in _dh.
6341 visiting any directory in _dh.
6337
6342
6338 * Introduced _dh, a history of visited directories. @dhist prints
6343 * Introduced _dh, a history of visited directories. @dhist prints
6339 it out with numbers.
6344 it out with numbers.
6340
6345
6341 2001-12-07 Fernando Perez <fperez@colorado.edu>
6346 2001-12-07 Fernando Perez <fperez@colorado.edu>
6342
6347
6343 * Released 0.1.22
6348 * Released 0.1.22
6344
6349
6345 * Made initialization a bit more robust against invalid color
6350 * Made initialization a bit more robust against invalid color
6346 options in user input (exit, not traceback-crash).
6351 options in user input (exit, not traceback-crash).
6347
6352
6348 * Changed the bug crash reporter to write the report only in the
6353 * Changed the bug crash reporter to write the report only in the
6349 user's .ipython directory. That way IPython won't litter people's
6354 user's .ipython directory. That way IPython won't litter people's
6350 hard disks with crash files all over the place. Also print on
6355 hard disks with crash files all over the place. Also print on
6351 screen the necessary mail command.
6356 screen the necessary mail command.
6352
6357
6353 * With the new ultraTB, implemented LightBG color scheme for light
6358 * With the new ultraTB, implemented LightBG color scheme for light
6354 background terminals. A lot of people like white backgrounds, so I
6359 background terminals. A lot of people like white backgrounds, so I
6355 guess we should at least give them something readable.
6360 guess we should at least give them something readable.
6356
6361
6357 2001-12-06 Fernando Perez <fperez@colorado.edu>
6362 2001-12-06 Fernando Perez <fperez@colorado.edu>
6358
6363
6359 * Modified the structure of ultraTB. Now there's a proper class
6364 * Modified the structure of ultraTB. Now there's a proper class
6360 for tables of color schemes which allow adding schemes easily and
6365 for tables of color schemes which allow adding schemes easily and
6361 switching the active scheme without creating a new instance every
6366 switching the active scheme without creating a new instance every
6362 time (which was ridiculous). The syntax for creating new schemes
6367 time (which was ridiculous). The syntax for creating new schemes
6363 is also cleaner. I think ultraTB is finally done, with a clean
6368 is also cleaner. I think ultraTB is finally done, with a clean
6364 class structure. Names are also much cleaner (now there's proper
6369 class structure. Names are also much cleaner (now there's proper
6365 color tables, no need for every variable to also have 'color' in
6370 color tables, no need for every variable to also have 'color' in
6366 its name).
6371 its name).
6367
6372
6368 * Broke down genutils into separate files. Now genutils only
6373 * Broke down genutils into separate files. Now genutils only
6369 contains utility functions, and classes have been moved to their
6374 contains utility functions, and classes have been moved to their
6370 own files (they had enough independent functionality to warrant
6375 own files (they had enough independent functionality to warrant
6371 it): ConfigLoader, OutputTrap, Struct.
6376 it): ConfigLoader, OutputTrap, Struct.
6372
6377
6373 2001-12-05 Fernando Perez <fperez@colorado.edu>
6378 2001-12-05 Fernando Perez <fperez@colorado.edu>
6374
6379
6375 * IPython turns 21! Released version 0.1.21, as a candidate for
6380 * IPython turns 21! Released version 0.1.21, as a candidate for
6376 public consumption. If all goes well, release in a few days.
6381 public consumption. If all goes well, release in a few days.
6377
6382
6378 * Fixed path bug (files in Extensions/ directory wouldn't be found
6383 * Fixed path bug (files in Extensions/ directory wouldn't be found
6379 unless IPython/ was explicitly in sys.path).
6384 unless IPython/ was explicitly in sys.path).
6380
6385
6381 * Extended the FlexCompleter class as MagicCompleter to allow
6386 * Extended the FlexCompleter class as MagicCompleter to allow
6382 completion of @-starting lines.
6387 completion of @-starting lines.
6383
6388
6384 * Created __release__.py file as a central repository for release
6389 * Created __release__.py file as a central repository for release
6385 info that other files can read from.
6390 info that other files can read from.
6386
6391
6387 * Fixed small bug in logging: when logging was turned on in
6392 * Fixed small bug in logging: when logging was turned on in
6388 mid-session, old lines with special meanings (!@?) were being
6393 mid-session, old lines with special meanings (!@?) were being
6389 logged without the prepended comment, which is necessary since
6394 logged without the prepended comment, which is necessary since
6390 they are not truly valid python syntax. This should make session
6395 they are not truly valid python syntax. This should make session
6391 restores produce less errors.
6396 restores produce less errors.
6392
6397
6393 * The namespace cleanup forced me to make a FlexCompleter class
6398 * The namespace cleanup forced me to make a FlexCompleter class
6394 which is nothing but a ripoff of rlcompleter, but with selectable
6399 which is nothing but a ripoff of rlcompleter, but with selectable
6395 namespace (rlcompleter only works in __main__.__dict__). I'll try
6400 namespace (rlcompleter only works in __main__.__dict__). I'll try
6396 to submit a note to the authors to see if this change can be
6401 to submit a note to the authors to see if this change can be
6397 incorporated in future rlcompleter releases (Dec.6: done)
6402 incorporated in future rlcompleter releases (Dec.6: done)
6398
6403
6399 * More fixes to namespace handling. It was a mess! Now all
6404 * More fixes to namespace handling. It was a mess! Now all
6400 explicit references to __main__.__dict__ are gone (except when
6405 explicit references to __main__.__dict__ are gone (except when
6401 really needed) and everything is handled through the namespace
6406 really needed) and everything is handled through the namespace
6402 dicts in the IPython instance. We seem to be getting somewhere
6407 dicts in the IPython instance. We seem to be getting somewhere
6403 with this, finally...
6408 with this, finally...
6404
6409
6405 * Small documentation updates.
6410 * Small documentation updates.
6406
6411
6407 * Created the Extensions directory under IPython (with an
6412 * Created the Extensions directory under IPython (with an
6408 __init__.py). Put the PhysicalQ stuff there. This directory should
6413 __init__.py). Put the PhysicalQ stuff there. This directory should
6409 be used for all special-purpose extensions.
6414 be used for all special-purpose extensions.
6410
6415
6411 * File renaming:
6416 * File renaming:
6412 ipythonlib --> ipmaker
6417 ipythonlib --> ipmaker
6413 ipplib --> iplib
6418 ipplib --> iplib
6414 This makes a bit more sense in terms of what these files actually do.
6419 This makes a bit more sense in terms of what these files actually do.
6415
6420
6416 * Moved all the classes and functions in ipythonlib to ipplib, so
6421 * Moved all the classes and functions in ipythonlib to ipplib, so
6417 now ipythonlib only has make_IPython(). This will ease up its
6422 now ipythonlib only has make_IPython(). This will ease up its
6418 splitting in smaller functional chunks later.
6423 splitting in smaller functional chunks later.
6419
6424
6420 * Cleaned up (done, I think) output of @whos. Better column
6425 * Cleaned up (done, I think) output of @whos. Better column
6421 formatting, and now shows str(var) for as much as it can, which is
6426 formatting, and now shows str(var) for as much as it can, which is
6422 typically what one gets with a 'print var'.
6427 typically what one gets with a 'print var'.
6423
6428
6424 2001-12-04 Fernando Perez <fperez@colorado.edu>
6429 2001-12-04 Fernando Perez <fperez@colorado.edu>
6425
6430
6426 * Fixed namespace problems. Now builtin/IPyhton/user names get
6431 * Fixed namespace problems. Now builtin/IPyhton/user names get
6427 properly reported in their namespace. Internal namespace handling
6432 properly reported in their namespace. Internal namespace handling
6428 is finally getting decent (not perfect yet, but much better than
6433 is finally getting decent (not perfect yet, but much better than
6429 the ad-hoc mess we had).
6434 the ad-hoc mess we had).
6430
6435
6431 * Removed -exit option. If people just want to run a python
6436 * Removed -exit option. If people just want to run a python
6432 script, that's what the normal interpreter is for. Less
6437 script, that's what the normal interpreter is for. Less
6433 unnecessary options, less chances for bugs.
6438 unnecessary options, less chances for bugs.
6434
6439
6435 * Added a crash handler which generates a complete post-mortem if
6440 * Added a crash handler which generates a complete post-mortem if
6436 IPython crashes. This will help a lot in tracking bugs down the
6441 IPython crashes. This will help a lot in tracking bugs down the
6437 road.
6442 road.
6438
6443
6439 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6444 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6440 which were boud to functions being reassigned would bypass the
6445 which were boud to functions being reassigned would bypass the
6441 logger, breaking the sync of _il with the prompt counter. This
6446 logger, breaking the sync of _il with the prompt counter. This
6442 would then crash IPython later when a new line was logged.
6447 would then crash IPython later when a new line was logged.
6443
6448
6444 2001-12-02 Fernando Perez <fperez@colorado.edu>
6449 2001-12-02 Fernando Perez <fperez@colorado.edu>
6445
6450
6446 * Made IPython a package. This means people don't have to clutter
6451 * Made IPython a package. This means people don't have to clutter
6447 their sys.path with yet another directory. Changed the INSTALL
6452 their sys.path with yet another directory. Changed the INSTALL
6448 file accordingly.
6453 file accordingly.
6449
6454
6450 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6455 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6451 sorts its output (so @who shows it sorted) and @whos formats the
6456 sorts its output (so @who shows it sorted) and @whos formats the
6452 table according to the width of the first column. Nicer, easier to
6457 table according to the width of the first column. Nicer, easier to
6453 read. Todo: write a generic table_format() which takes a list of
6458 read. Todo: write a generic table_format() which takes a list of
6454 lists and prints it nicely formatted, with optional row/column
6459 lists and prints it nicely formatted, with optional row/column
6455 separators and proper padding and justification.
6460 separators and proper padding and justification.
6456
6461
6457 * Released 0.1.20
6462 * Released 0.1.20
6458
6463
6459 * Fixed bug in @log which would reverse the inputcache list (a
6464 * Fixed bug in @log which would reverse the inputcache list (a
6460 copy operation was missing).
6465 copy operation was missing).
6461
6466
6462 * Code cleanup. @config was changed to use page(). Better, since
6467 * Code cleanup. @config was changed to use page(). Better, since
6463 its output is always quite long.
6468 its output is always quite long.
6464
6469
6465 * Itpl is back as a dependency. I was having too many problems
6470 * Itpl is back as a dependency. I was having too many problems
6466 getting the parametric aliases to work reliably, and it's just
6471 getting the parametric aliases to work reliably, and it's just
6467 easier to code weird string operations with it than playing %()s
6472 easier to code weird string operations with it than playing %()s
6468 games. It's only ~6k, so I don't think it's too big a deal.
6473 games. It's only ~6k, so I don't think it's too big a deal.
6469
6474
6470 * Found (and fixed) a very nasty bug with history. !lines weren't
6475 * Found (and fixed) a very nasty bug with history. !lines weren't
6471 getting cached, and the out of sync caches would crash
6476 getting cached, and the out of sync caches would crash
6472 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6477 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6473 division of labor a bit better. Bug fixed, cleaner structure.
6478 division of labor a bit better. Bug fixed, cleaner structure.
6474
6479
6475 2001-12-01 Fernando Perez <fperez@colorado.edu>
6480 2001-12-01 Fernando Perez <fperez@colorado.edu>
6476
6481
6477 * Released 0.1.19
6482 * Released 0.1.19
6478
6483
6479 * Added option -n to @hist to prevent line number printing. Much
6484 * Added option -n to @hist to prevent line number printing. Much
6480 easier to copy/paste code this way.
6485 easier to copy/paste code this way.
6481
6486
6482 * Created global _il to hold the input list. Allows easy
6487 * Created global _il to hold the input list. Allows easy
6483 re-execution of blocks of code by slicing it (inspired by Janko's
6488 re-execution of blocks of code by slicing it (inspired by Janko's
6484 comment on 'macros').
6489 comment on 'macros').
6485
6490
6486 * Small fixes and doc updates.
6491 * Small fixes and doc updates.
6487
6492
6488 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6493 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6489 much too fragile with automagic. Handles properly multi-line
6494 much too fragile with automagic. Handles properly multi-line
6490 statements and takes parameters.
6495 statements and takes parameters.
6491
6496
6492 2001-11-30 Fernando Perez <fperez@colorado.edu>
6497 2001-11-30 Fernando Perez <fperez@colorado.edu>
6493
6498
6494 * Version 0.1.18 released.
6499 * Version 0.1.18 released.
6495
6500
6496 * Fixed nasty namespace bug in initial module imports.
6501 * Fixed nasty namespace bug in initial module imports.
6497
6502
6498 * Added copyright/license notes to all code files (except
6503 * Added copyright/license notes to all code files (except
6499 DPyGetOpt). For the time being, LGPL. That could change.
6504 DPyGetOpt). For the time being, LGPL. That could change.
6500
6505
6501 * Rewrote a much nicer README, updated INSTALL, cleaned up
6506 * Rewrote a much nicer README, updated INSTALL, cleaned up
6502 ipythonrc-* samples.
6507 ipythonrc-* samples.
6503
6508
6504 * Overall code/documentation cleanup. Basically ready for
6509 * Overall code/documentation cleanup. Basically ready for
6505 release. Only remaining thing: licence decision (LGPL?).
6510 release. Only remaining thing: licence decision (LGPL?).
6506
6511
6507 * Converted load_config to a class, ConfigLoader. Now recursion
6512 * Converted load_config to a class, ConfigLoader. Now recursion
6508 control is better organized. Doesn't include the same file twice.
6513 control is better organized. Doesn't include the same file twice.
6509
6514
6510 2001-11-29 Fernando Perez <fperez@colorado.edu>
6515 2001-11-29 Fernando Perez <fperez@colorado.edu>
6511
6516
6512 * Got input history working. Changed output history variables from
6517 * Got input history working. Changed output history variables from
6513 _p to _o so that _i is for input and _o for output. Just cleaner
6518 _p to _o so that _i is for input and _o for output. Just cleaner
6514 convention.
6519 convention.
6515
6520
6516 * Implemented parametric aliases. This pretty much allows the
6521 * Implemented parametric aliases. This pretty much allows the
6517 alias system to offer full-blown shell convenience, I think.
6522 alias system to offer full-blown shell convenience, I think.
6518
6523
6519 * Version 0.1.17 released, 0.1.18 opened.
6524 * Version 0.1.17 released, 0.1.18 opened.
6520
6525
6521 * dot_ipython/ipythonrc (alias): added documentation.
6526 * dot_ipython/ipythonrc (alias): added documentation.
6522 (xcolor): Fixed small bug (xcolors -> xcolor)
6527 (xcolor): Fixed small bug (xcolors -> xcolor)
6523
6528
6524 * Changed the alias system. Now alias is a magic command to define
6529 * Changed the alias system. Now alias is a magic command to define
6525 aliases just like the shell. Rationale: the builtin magics should
6530 aliases just like the shell. Rationale: the builtin magics should
6526 be there for things deeply connected to IPython's
6531 be there for things deeply connected to IPython's
6527 architecture. And this is a much lighter system for what I think
6532 architecture. And this is a much lighter system for what I think
6528 is the really important feature: allowing users to define quickly
6533 is the really important feature: allowing users to define quickly
6529 magics that will do shell things for them, so they can customize
6534 magics that will do shell things for them, so they can customize
6530 IPython easily to match their work habits. If someone is really
6535 IPython easily to match their work habits. If someone is really
6531 desperate to have another name for a builtin alias, they can
6536 desperate to have another name for a builtin alias, they can
6532 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6537 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6533 works.
6538 works.
6534
6539
6535 2001-11-28 Fernando Perez <fperez@colorado.edu>
6540 2001-11-28 Fernando Perez <fperez@colorado.edu>
6536
6541
6537 * Changed @file so that it opens the source file at the proper
6542 * Changed @file so that it opens the source file at the proper
6538 line. Since it uses less, if your EDITOR environment is
6543 line. Since it uses less, if your EDITOR environment is
6539 configured, typing v will immediately open your editor of choice
6544 configured, typing v will immediately open your editor of choice
6540 right at the line where the object is defined. Not as quick as
6545 right at the line where the object is defined. Not as quick as
6541 having a direct @edit command, but for all intents and purposes it
6546 having a direct @edit command, but for all intents and purposes it
6542 works. And I don't have to worry about writing @edit to deal with
6547 works. And I don't have to worry about writing @edit to deal with
6543 all the editors, less does that.
6548 all the editors, less does that.
6544
6549
6545 * Version 0.1.16 released, 0.1.17 opened.
6550 * Version 0.1.16 released, 0.1.17 opened.
6546
6551
6547 * Fixed some nasty bugs in the page/page_dumb combo that could
6552 * Fixed some nasty bugs in the page/page_dumb combo that could
6548 crash IPython.
6553 crash IPython.
6549
6554
6550 2001-11-27 Fernando Perez <fperez@colorado.edu>
6555 2001-11-27 Fernando Perez <fperez@colorado.edu>
6551
6556
6552 * Version 0.1.15 released, 0.1.16 opened.
6557 * Version 0.1.15 released, 0.1.16 opened.
6553
6558
6554 * Finally got ? and ?? to work for undefined things: now it's
6559 * Finally got ? and ?? to work for undefined things: now it's
6555 possible to type {}.get? and get information about the get method
6560 possible to type {}.get? and get information about the get method
6556 of dicts, or os.path? even if only os is defined (so technically
6561 of dicts, or os.path? even if only os is defined (so technically
6557 os.path isn't). Works at any level. For example, after import os,
6562 os.path isn't). Works at any level. For example, after import os,
6558 os?, os.path?, os.path.abspath? all work. This is great, took some
6563 os?, os.path?, os.path.abspath? all work. This is great, took some
6559 work in _ofind.
6564 work in _ofind.
6560
6565
6561 * Fixed more bugs with logging. The sanest way to do it was to add
6566 * Fixed more bugs with logging. The sanest way to do it was to add
6562 to @log a 'mode' parameter. Killed two in one shot (this mode
6567 to @log a 'mode' parameter. Killed two in one shot (this mode
6563 option was a request of Janko's). I think it's finally clean
6568 option was a request of Janko's). I think it's finally clean
6564 (famous last words).
6569 (famous last words).
6565
6570
6566 * Added a page_dumb() pager which does a decent job of paging on
6571 * Added a page_dumb() pager which does a decent job of paging on
6567 screen, if better things (like less) aren't available. One less
6572 screen, if better things (like less) aren't available. One less
6568 unix dependency (someday maybe somebody will port this to
6573 unix dependency (someday maybe somebody will port this to
6569 windows).
6574 windows).
6570
6575
6571 * Fixed problem in magic_log: would lock of logging out if log
6576 * Fixed problem in magic_log: would lock of logging out if log
6572 creation failed (because it would still think it had succeeded).
6577 creation failed (because it would still think it had succeeded).
6573
6578
6574 * Improved the page() function using curses to auto-detect screen
6579 * Improved the page() function using curses to auto-detect screen
6575 size. Now it can make a much better decision on whether to print
6580 size. Now it can make a much better decision on whether to print
6576 or page a string. Option screen_length was modified: a value 0
6581 or page a string. Option screen_length was modified: a value 0
6577 means auto-detect, and that's the default now.
6582 means auto-detect, and that's the default now.
6578
6583
6579 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6584 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6580 go out. I'll test it for a few days, then talk to Janko about
6585 go out. I'll test it for a few days, then talk to Janko about
6581 licences and announce it.
6586 licences and announce it.
6582
6587
6583 * Fixed the length of the auto-generated ---> prompt which appears
6588 * Fixed the length of the auto-generated ---> prompt which appears
6584 for auto-parens and auto-quotes. Getting this right isn't trivial,
6589 for auto-parens and auto-quotes. Getting this right isn't trivial,
6585 with all the color escapes, different prompt types and optional
6590 with all the color escapes, different prompt types and optional
6586 separators. But it seems to be working in all the combinations.
6591 separators. But it seems to be working in all the combinations.
6587
6592
6588 2001-11-26 Fernando Perez <fperez@colorado.edu>
6593 2001-11-26 Fernando Perez <fperez@colorado.edu>
6589
6594
6590 * Wrote a regexp filter to get option types from the option names
6595 * Wrote a regexp filter to get option types from the option names
6591 string. This eliminates the need to manually keep two duplicate
6596 string. This eliminates the need to manually keep two duplicate
6592 lists.
6597 lists.
6593
6598
6594 * Removed the unneeded check_option_names. Now options are handled
6599 * Removed the unneeded check_option_names. Now options are handled
6595 in a much saner manner and it's easy to visually check that things
6600 in a much saner manner and it's easy to visually check that things
6596 are ok.
6601 are ok.
6597
6602
6598 * Updated version numbers on all files I modified to carry a
6603 * Updated version numbers on all files I modified to carry a
6599 notice so Janko and Nathan have clear version markers.
6604 notice so Janko and Nathan have clear version markers.
6600
6605
6601 * Updated docstring for ultraTB with my changes. I should send
6606 * Updated docstring for ultraTB with my changes. I should send
6602 this to Nathan.
6607 this to Nathan.
6603
6608
6604 * Lots of small fixes. Ran everything through pychecker again.
6609 * Lots of small fixes. Ran everything through pychecker again.
6605
6610
6606 * Made loading of deep_reload an cmd line option. If it's not too
6611 * Made loading of deep_reload an cmd line option. If it's not too
6607 kosher, now people can just disable it. With -nodeep_reload it's
6612 kosher, now people can just disable it. With -nodeep_reload it's
6608 still available as dreload(), it just won't overwrite reload().
6613 still available as dreload(), it just won't overwrite reload().
6609
6614
6610 * Moved many options to the no| form (-opt and -noopt
6615 * Moved many options to the no| form (-opt and -noopt
6611 accepted). Cleaner.
6616 accepted). Cleaner.
6612
6617
6613 * Changed magic_log so that if called with no parameters, it uses
6618 * Changed magic_log so that if called with no parameters, it uses
6614 'rotate' mode. That way auto-generated logs aren't automatically
6619 'rotate' mode. That way auto-generated logs aren't automatically
6615 over-written. For normal logs, now a backup is made if it exists
6620 over-written. For normal logs, now a backup is made if it exists
6616 (only 1 level of backups). A new 'backup' mode was added to the
6621 (only 1 level of backups). A new 'backup' mode was added to the
6617 Logger class to support this. This was a request by Janko.
6622 Logger class to support this. This was a request by Janko.
6618
6623
6619 * Added @logoff/@logon to stop/restart an active log.
6624 * Added @logoff/@logon to stop/restart an active log.
6620
6625
6621 * Fixed a lot of bugs in log saving/replay. It was pretty
6626 * Fixed a lot of bugs in log saving/replay. It was pretty
6622 broken. Now special lines (!@,/) appear properly in the command
6627 broken. Now special lines (!@,/) appear properly in the command
6623 history after a log replay.
6628 history after a log replay.
6624
6629
6625 * Tried and failed to implement full session saving via pickle. My
6630 * Tried and failed to implement full session saving via pickle. My
6626 idea was to pickle __main__.__dict__, but modules can't be
6631 idea was to pickle __main__.__dict__, but modules can't be
6627 pickled. This would be a better alternative to replaying logs, but
6632 pickled. This would be a better alternative to replaying logs, but
6628 seems quite tricky to get to work. Changed -session to be called
6633 seems quite tricky to get to work. Changed -session to be called
6629 -logplay, which more accurately reflects what it does. And if we
6634 -logplay, which more accurately reflects what it does. And if we
6630 ever get real session saving working, -session is now available.
6635 ever get real session saving working, -session is now available.
6631
6636
6632 * Implemented color schemes for prompts also. As for tracebacks,
6637 * Implemented color schemes for prompts also. As for tracebacks,
6633 currently only NoColor and Linux are supported. But now the
6638 currently only NoColor and Linux are supported. But now the
6634 infrastructure is in place, based on a generic ColorScheme
6639 infrastructure is in place, based on a generic ColorScheme
6635 class. So writing and activating new schemes both for the prompts
6640 class. So writing and activating new schemes both for the prompts
6636 and the tracebacks should be straightforward.
6641 and the tracebacks should be straightforward.
6637
6642
6638 * Version 0.1.13 released, 0.1.14 opened.
6643 * Version 0.1.13 released, 0.1.14 opened.
6639
6644
6640 * Changed handling of options for output cache. Now counter is
6645 * Changed handling of options for output cache. Now counter is
6641 hardwired starting at 1 and one specifies the maximum number of
6646 hardwired starting at 1 and one specifies the maximum number of
6642 entries *in the outcache* (not the max prompt counter). This is
6647 entries *in the outcache* (not the max prompt counter). This is
6643 much better, since many statements won't increase the cache
6648 much better, since many statements won't increase the cache
6644 count. It also eliminated some confusing options, now there's only
6649 count. It also eliminated some confusing options, now there's only
6645 one: cache_size.
6650 one: cache_size.
6646
6651
6647 * Added 'alias' magic function and magic_alias option in the
6652 * Added 'alias' magic function and magic_alias option in the
6648 ipythonrc file. Now the user can easily define whatever names he
6653 ipythonrc file. Now the user can easily define whatever names he
6649 wants for the magic functions without having to play weird
6654 wants for the magic functions without having to play weird
6650 namespace games. This gives IPython a real shell-like feel.
6655 namespace games. This gives IPython a real shell-like feel.
6651
6656
6652 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6657 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6653 @ or not).
6658 @ or not).
6654
6659
6655 This was one of the last remaining 'visible' bugs (that I know
6660 This was one of the last remaining 'visible' bugs (that I know
6656 of). I think if I can clean up the session loading so it works
6661 of). I think if I can clean up the session loading so it works
6657 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6662 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6658 about licensing).
6663 about licensing).
6659
6664
6660 2001-11-25 Fernando Perez <fperez@colorado.edu>
6665 2001-11-25 Fernando Perez <fperez@colorado.edu>
6661
6666
6662 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6667 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6663 there's a cleaner distinction between what ? and ?? show.
6668 there's a cleaner distinction between what ? and ?? show.
6664
6669
6665 * Added screen_length option. Now the user can define his own
6670 * Added screen_length option. Now the user can define his own
6666 screen size for page() operations.
6671 screen size for page() operations.
6667
6672
6668 * Implemented magic shell-like functions with automatic code
6673 * Implemented magic shell-like functions with automatic code
6669 generation. Now adding another function is just a matter of adding
6674 generation. Now adding another function is just a matter of adding
6670 an entry to a dict, and the function is dynamically generated at
6675 an entry to a dict, and the function is dynamically generated at
6671 run-time. Python has some really cool features!
6676 run-time. Python has some really cool features!
6672
6677
6673 * Renamed many options to cleanup conventions a little. Now all
6678 * Renamed many options to cleanup conventions a little. Now all
6674 are lowercase, and only underscores where needed. Also in the code
6679 are lowercase, and only underscores where needed. Also in the code
6675 option name tables are clearer.
6680 option name tables are clearer.
6676
6681
6677 * Changed prompts a little. Now input is 'In [n]:' instead of
6682 * Changed prompts a little. Now input is 'In [n]:' instead of
6678 'In[n]:='. This allows it the numbers to be aligned with the
6683 'In[n]:='. This allows it the numbers to be aligned with the
6679 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6684 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6680 Python (it was a Mathematica thing). The '...' continuation prompt
6685 Python (it was a Mathematica thing). The '...' continuation prompt
6681 was also changed a little to align better.
6686 was also changed a little to align better.
6682
6687
6683 * Fixed bug when flushing output cache. Not all _p<n> variables
6688 * Fixed bug when flushing output cache. Not all _p<n> variables
6684 exist, so their deletion needs to be wrapped in a try:
6689 exist, so their deletion needs to be wrapped in a try:
6685
6690
6686 * Figured out how to properly use inspect.formatargspec() (it
6691 * Figured out how to properly use inspect.formatargspec() (it
6687 requires the args preceded by *). So I removed all the code from
6692 requires the args preceded by *). So I removed all the code from
6688 _get_pdef in Magic, which was just replicating that.
6693 _get_pdef in Magic, which was just replicating that.
6689
6694
6690 * Added test to prefilter to allow redefining magic function names
6695 * Added test to prefilter to allow redefining magic function names
6691 as variables. This is ok, since the @ form is always available,
6696 as variables. This is ok, since the @ form is always available,
6692 but whe should allow the user to define a variable called 'ls' if
6697 but whe should allow the user to define a variable called 'ls' if
6693 he needs it.
6698 he needs it.
6694
6699
6695 * Moved the ToDo information from README into a separate ToDo.
6700 * Moved the ToDo information from README into a separate ToDo.
6696
6701
6697 * General code cleanup and small bugfixes. I think it's close to a
6702 * General code cleanup and small bugfixes. I think it's close to a
6698 state where it can be released, obviously with a big 'beta'
6703 state where it can be released, obviously with a big 'beta'
6699 warning on it.
6704 warning on it.
6700
6705
6701 * Got the magic function split to work. Now all magics are defined
6706 * Got the magic function split to work. Now all magics are defined
6702 in a separate class. It just organizes things a bit, and now
6707 in a separate class. It just organizes things a bit, and now
6703 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6708 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6704 was too long).
6709 was too long).
6705
6710
6706 * Changed @clear to @reset to avoid potential confusions with
6711 * Changed @clear to @reset to avoid potential confusions with
6707 the shell command clear. Also renamed @cl to @clear, which does
6712 the shell command clear. Also renamed @cl to @clear, which does
6708 exactly what people expect it to from their shell experience.
6713 exactly what people expect it to from their shell experience.
6709
6714
6710 Added a check to the @reset command (since it's so
6715 Added a check to the @reset command (since it's so
6711 destructive, it's probably a good idea to ask for confirmation).
6716 destructive, it's probably a good idea to ask for confirmation).
6712 But now reset only works for full namespace resetting. Since the
6717 But now reset only works for full namespace resetting. Since the
6713 del keyword is already there for deleting a few specific
6718 del keyword is already there for deleting a few specific
6714 variables, I don't see the point of having a redundant magic
6719 variables, I don't see the point of having a redundant magic
6715 function for the same task.
6720 function for the same task.
6716
6721
6717 2001-11-24 Fernando Perez <fperez@colorado.edu>
6722 2001-11-24 Fernando Perez <fperez@colorado.edu>
6718
6723
6719 * Updated the builtin docs (esp. the ? ones).
6724 * Updated the builtin docs (esp. the ? ones).
6720
6725
6721 * Ran all the code through pychecker. Not terribly impressed with
6726 * Ran all the code through pychecker. Not terribly impressed with
6722 it: lots of spurious warnings and didn't really find anything of
6727 it: lots of spurious warnings and didn't really find anything of
6723 substance (just a few modules being imported and not used).
6728 substance (just a few modules being imported and not used).
6724
6729
6725 * Implemented the new ultraTB functionality into IPython. New
6730 * Implemented the new ultraTB functionality into IPython. New
6726 option: xcolors. This chooses color scheme. xmode now only selects
6731 option: xcolors. This chooses color scheme. xmode now only selects
6727 between Plain and Verbose. Better orthogonality.
6732 between Plain and Verbose. Better orthogonality.
6728
6733
6729 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6734 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6730 mode and color scheme for the exception handlers. Now it's
6735 mode and color scheme for the exception handlers. Now it's
6731 possible to have the verbose traceback with no coloring.
6736 possible to have the verbose traceback with no coloring.
6732
6737
6733 2001-11-23 Fernando Perez <fperez@colorado.edu>
6738 2001-11-23 Fernando Perez <fperez@colorado.edu>
6734
6739
6735 * Version 0.1.12 released, 0.1.13 opened.
6740 * Version 0.1.12 released, 0.1.13 opened.
6736
6741
6737 * Removed option to set auto-quote and auto-paren escapes by
6742 * Removed option to set auto-quote and auto-paren escapes by
6738 user. The chances of breaking valid syntax are just too high. If
6743 user. The chances of breaking valid syntax are just too high. If
6739 someone *really* wants, they can always dig into the code.
6744 someone *really* wants, they can always dig into the code.
6740
6745
6741 * Made prompt separators configurable.
6746 * Made prompt separators configurable.
6742
6747
6743 2001-11-22 Fernando Perez <fperez@colorado.edu>
6748 2001-11-22 Fernando Perez <fperez@colorado.edu>
6744
6749
6745 * Small bugfixes in many places.
6750 * Small bugfixes in many places.
6746
6751
6747 * Removed the MyCompleter class from ipplib. It seemed redundant
6752 * Removed the MyCompleter class from ipplib. It seemed redundant
6748 with the C-p,C-n history search functionality. Less code to
6753 with the C-p,C-n history search functionality. Less code to
6749 maintain.
6754 maintain.
6750
6755
6751 * Moved all the original ipython.py code into ipythonlib.py. Right
6756 * Moved all the original ipython.py code into ipythonlib.py. Right
6752 now it's just one big dump into a function called make_IPython, so
6757 now it's just one big dump into a function called make_IPython, so
6753 no real modularity has been gained. But at least it makes the
6758 no real modularity has been gained. But at least it makes the
6754 wrapper script tiny, and since ipythonlib is a module, it gets
6759 wrapper script tiny, and since ipythonlib is a module, it gets
6755 compiled and startup is much faster.
6760 compiled and startup is much faster.
6756
6761
6757 This is a reasobably 'deep' change, so we should test it for a
6762 This is a reasobably 'deep' change, so we should test it for a
6758 while without messing too much more with the code.
6763 while without messing too much more with the code.
6759
6764
6760 2001-11-21 Fernando Perez <fperez@colorado.edu>
6765 2001-11-21 Fernando Perez <fperez@colorado.edu>
6761
6766
6762 * Version 0.1.11 released, 0.1.12 opened for further work.
6767 * Version 0.1.11 released, 0.1.12 opened for further work.
6763
6768
6764 * Removed dependency on Itpl. It was only needed in one place. It
6769 * Removed dependency on Itpl. It was only needed in one place. It
6765 would be nice if this became part of python, though. It makes life
6770 would be nice if this became part of python, though. It makes life
6766 *a lot* easier in some cases.
6771 *a lot* easier in some cases.
6767
6772
6768 * Simplified the prefilter code a bit. Now all handlers are
6773 * Simplified the prefilter code a bit. Now all handlers are
6769 expected to explicitly return a value (at least a blank string).
6774 expected to explicitly return a value (at least a blank string).
6770
6775
6771 * Heavy edits in ipplib. Removed the help system altogether. Now
6776 * Heavy edits in ipplib. Removed the help system altogether. Now
6772 obj?/?? is used for inspecting objects, a magic @doc prints
6777 obj?/?? is used for inspecting objects, a magic @doc prints
6773 docstrings, and full-blown Python help is accessed via the 'help'
6778 docstrings, and full-blown Python help is accessed via the 'help'
6774 keyword. This cleans up a lot of code (less to maintain) and does
6779 keyword. This cleans up a lot of code (less to maintain) and does
6775 the job. Since 'help' is now a standard Python component, might as
6780 the job. Since 'help' is now a standard Python component, might as
6776 well use it and remove duplicate functionality.
6781 well use it and remove duplicate functionality.
6777
6782
6778 Also removed the option to use ipplib as a standalone program. By
6783 Also removed the option to use ipplib as a standalone program. By
6779 now it's too dependent on other parts of IPython to function alone.
6784 now it's too dependent on other parts of IPython to function alone.
6780
6785
6781 * Fixed bug in genutils.pager. It would crash if the pager was
6786 * Fixed bug in genutils.pager. It would crash if the pager was
6782 exited immediately after opening (broken pipe).
6787 exited immediately after opening (broken pipe).
6783
6788
6784 * Trimmed down the VerboseTB reporting a little. The header is
6789 * Trimmed down the VerboseTB reporting a little. The header is
6785 much shorter now and the repeated exception arguments at the end
6790 much shorter now and the repeated exception arguments at the end
6786 have been removed. For interactive use the old header seemed a bit
6791 have been removed. For interactive use the old header seemed a bit
6787 excessive.
6792 excessive.
6788
6793
6789 * Fixed small bug in output of @whos for variables with multi-word
6794 * Fixed small bug in output of @whos for variables with multi-word
6790 types (only first word was displayed).
6795 types (only first word was displayed).
6791
6796
6792 2001-11-17 Fernando Perez <fperez@colorado.edu>
6797 2001-11-17 Fernando Perez <fperez@colorado.edu>
6793
6798
6794 * Version 0.1.10 released, 0.1.11 opened for further work.
6799 * Version 0.1.10 released, 0.1.11 opened for further work.
6795
6800
6796 * Modified dirs and friends. dirs now *returns* the stack (not
6801 * Modified dirs and friends. dirs now *returns* the stack (not
6797 prints), so one can manipulate it as a variable. Convenient to
6802 prints), so one can manipulate it as a variable. Convenient to
6798 travel along many directories.
6803 travel along many directories.
6799
6804
6800 * Fixed bug in magic_pdef: would only work with functions with
6805 * Fixed bug in magic_pdef: would only work with functions with
6801 arguments with default values.
6806 arguments with default values.
6802
6807
6803 2001-11-14 Fernando Perez <fperez@colorado.edu>
6808 2001-11-14 Fernando Perez <fperez@colorado.edu>
6804
6809
6805 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6810 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6806 example with IPython. Various other minor fixes and cleanups.
6811 example with IPython. Various other minor fixes and cleanups.
6807
6812
6808 * Version 0.1.9 released, 0.1.10 opened for further work.
6813 * Version 0.1.9 released, 0.1.10 opened for further work.
6809
6814
6810 * Added sys.path to the list of directories searched in the
6815 * Added sys.path to the list of directories searched in the
6811 execfile= option. It used to be the current directory and the
6816 execfile= option. It used to be the current directory and the
6812 user's IPYTHONDIR only.
6817 user's IPYTHONDIR only.
6813
6818
6814 2001-11-13 Fernando Perez <fperez@colorado.edu>
6819 2001-11-13 Fernando Perez <fperez@colorado.edu>
6815
6820
6816 * Reinstated the raw_input/prefilter separation that Janko had
6821 * Reinstated the raw_input/prefilter separation that Janko had
6817 initially. This gives a more convenient setup for extending the
6822 initially. This gives a more convenient setup for extending the
6818 pre-processor from the outside: raw_input always gets a string,
6823 pre-processor from the outside: raw_input always gets a string,
6819 and prefilter has to process it. We can then redefine prefilter
6824 and prefilter has to process it. We can then redefine prefilter
6820 from the outside and implement extensions for special
6825 from the outside and implement extensions for special
6821 purposes.
6826 purposes.
6822
6827
6823 Today I got one for inputting PhysicalQuantity objects
6828 Today I got one for inputting PhysicalQuantity objects
6824 (from Scientific) without needing any function calls at
6829 (from Scientific) without needing any function calls at
6825 all. Extremely convenient, and it's all done as a user-level
6830 all. Extremely convenient, and it's all done as a user-level
6826 extension (no IPython code was touched). Now instead of:
6831 extension (no IPython code was touched). Now instead of:
6827 a = PhysicalQuantity(4.2,'m/s**2')
6832 a = PhysicalQuantity(4.2,'m/s**2')
6828 one can simply say
6833 one can simply say
6829 a = 4.2 m/s**2
6834 a = 4.2 m/s**2
6830 or even
6835 or even
6831 a = 4.2 m/s^2
6836 a = 4.2 m/s^2
6832
6837
6833 I use this, but it's also a proof of concept: IPython really is
6838 I use this, but it's also a proof of concept: IPython really is
6834 fully user-extensible, even at the level of the parsing of the
6839 fully user-extensible, even at the level of the parsing of the
6835 command line. It's not trivial, but it's perfectly doable.
6840 command line. It's not trivial, but it's perfectly doable.
6836
6841
6837 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6842 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6838 the problem of modules being loaded in the inverse order in which
6843 the problem of modules being loaded in the inverse order in which
6839 they were defined in
6844 they were defined in
6840
6845
6841 * Version 0.1.8 released, 0.1.9 opened for further work.
6846 * Version 0.1.8 released, 0.1.9 opened for further work.
6842
6847
6843 * Added magics pdef, source and file. They respectively show the
6848 * Added magics pdef, source and file. They respectively show the
6844 definition line ('prototype' in C), source code and full python
6849 definition line ('prototype' in C), source code and full python
6845 file for any callable object. The object inspector oinfo uses
6850 file for any callable object. The object inspector oinfo uses
6846 these to show the same information.
6851 these to show the same information.
6847
6852
6848 * Version 0.1.7 released, 0.1.8 opened for further work.
6853 * Version 0.1.7 released, 0.1.8 opened for further work.
6849
6854
6850 * Separated all the magic functions into a class called Magic. The
6855 * Separated all the magic functions into a class called Magic. The
6851 InteractiveShell class was becoming too big for Xemacs to handle
6856 InteractiveShell class was becoming too big for Xemacs to handle
6852 (de-indenting a line would lock it up for 10 seconds while it
6857 (de-indenting a line would lock it up for 10 seconds while it
6853 backtracked on the whole class!)
6858 backtracked on the whole class!)
6854
6859
6855 FIXME: didn't work. It can be done, but right now namespaces are
6860 FIXME: didn't work. It can be done, but right now namespaces are
6856 all messed up. Do it later (reverted it for now, so at least
6861 all messed up. Do it later (reverted it for now, so at least
6857 everything works as before).
6862 everything works as before).
6858
6863
6859 * Got the object introspection system (magic_oinfo) working! I
6864 * Got the object introspection system (magic_oinfo) working! I
6860 think this is pretty much ready for release to Janko, so he can
6865 think this is pretty much ready for release to Janko, so he can
6861 test it for a while and then announce it. Pretty much 100% of what
6866 test it for a while and then announce it. Pretty much 100% of what
6862 I wanted for the 'phase 1' release is ready. Happy, tired.
6867 I wanted for the 'phase 1' release is ready. Happy, tired.
6863
6868
6864 2001-11-12 Fernando Perez <fperez@colorado.edu>
6869 2001-11-12 Fernando Perez <fperez@colorado.edu>
6865
6870
6866 * Version 0.1.6 released, 0.1.7 opened for further work.
6871 * Version 0.1.6 released, 0.1.7 opened for further work.
6867
6872
6868 * Fixed bug in printing: it used to test for truth before
6873 * Fixed bug in printing: it used to test for truth before
6869 printing, so 0 wouldn't print. Now checks for None.
6874 printing, so 0 wouldn't print. Now checks for None.
6870
6875
6871 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6876 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6872 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6877 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6873 reaches by hand into the outputcache. Think of a better way to do
6878 reaches by hand into the outputcache. Think of a better way to do
6874 this later.
6879 this later.
6875
6880
6876 * Various small fixes thanks to Nathan's comments.
6881 * Various small fixes thanks to Nathan's comments.
6877
6882
6878 * Changed magic_pprint to magic_Pprint. This way it doesn't
6883 * Changed magic_pprint to magic_Pprint. This way it doesn't
6879 collide with pprint() and the name is consistent with the command
6884 collide with pprint() and the name is consistent with the command
6880 line option.
6885 line option.
6881
6886
6882 * Changed prompt counter behavior to be fully like
6887 * Changed prompt counter behavior to be fully like
6883 Mathematica's. That is, even input that doesn't return a result
6888 Mathematica's. That is, even input that doesn't return a result
6884 raises the prompt counter. The old behavior was kind of confusing
6889 raises the prompt counter. The old behavior was kind of confusing
6885 (getting the same prompt number several times if the operation
6890 (getting the same prompt number several times if the operation
6886 didn't return a result).
6891 didn't return a result).
6887
6892
6888 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6893 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6889
6894
6890 * Fixed -Classic mode (wasn't working anymore).
6895 * Fixed -Classic mode (wasn't working anymore).
6891
6896
6892 * Added colored prompts using Nathan's new code. Colors are
6897 * Added colored prompts using Nathan's new code. Colors are
6893 currently hardwired, they can be user-configurable. For
6898 currently hardwired, they can be user-configurable. For
6894 developers, they can be chosen in file ipythonlib.py, at the
6899 developers, they can be chosen in file ipythonlib.py, at the
6895 beginning of the CachedOutput class def.
6900 beginning of the CachedOutput class def.
6896
6901
6897 2001-11-11 Fernando Perez <fperez@colorado.edu>
6902 2001-11-11 Fernando Perez <fperez@colorado.edu>
6898
6903
6899 * Version 0.1.5 released, 0.1.6 opened for further work.
6904 * Version 0.1.5 released, 0.1.6 opened for further work.
6900
6905
6901 * Changed magic_env to *return* the environment as a dict (not to
6906 * Changed magic_env to *return* the environment as a dict (not to
6902 print it). This way it prints, but it can also be processed.
6907 print it). This way it prints, but it can also be processed.
6903
6908
6904 * Added Verbose exception reporting to interactive
6909 * Added Verbose exception reporting to interactive
6905 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6910 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6906 traceback. Had to make some changes to the ultraTB file. This is
6911 traceback. Had to make some changes to the ultraTB file. This is
6907 probably the last 'big' thing in my mental todo list. This ties
6912 probably the last 'big' thing in my mental todo list. This ties
6908 in with the next entry:
6913 in with the next entry:
6909
6914
6910 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6915 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6911 has to specify is Plain, Color or Verbose for all exception
6916 has to specify is Plain, Color or Verbose for all exception
6912 handling.
6917 handling.
6913
6918
6914 * Removed ShellServices option. All this can really be done via
6919 * Removed ShellServices option. All this can really be done via
6915 the magic system. It's easier to extend, cleaner and has automatic
6920 the magic system. It's easier to extend, cleaner and has automatic
6916 namespace protection and documentation.
6921 namespace protection and documentation.
6917
6922
6918 2001-11-09 Fernando Perez <fperez@colorado.edu>
6923 2001-11-09 Fernando Perez <fperez@colorado.edu>
6919
6924
6920 * Fixed bug in output cache flushing (missing parameter to
6925 * Fixed bug in output cache flushing (missing parameter to
6921 __init__). Other small bugs fixed (found using pychecker).
6926 __init__). Other small bugs fixed (found using pychecker).
6922
6927
6923 * Version 0.1.4 opened for bugfixing.
6928 * Version 0.1.4 opened for bugfixing.
6924
6929
6925 2001-11-07 Fernando Perez <fperez@colorado.edu>
6930 2001-11-07 Fernando Perez <fperez@colorado.edu>
6926
6931
6927 * Version 0.1.3 released, mainly because of the raw_input bug.
6932 * Version 0.1.3 released, mainly because of the raw_input bug.
6928
6933
6929 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6934 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6930 and when testing for whether things were callable, a call could
6935 and when testing for whether things were callable, a call could
6931 actually be made to certain functions. They would get called again
6936 actually be made to certain functions. They would get called again
6932 once 'really' executed, with a resulting double call. A disaster
6937 once 'really' executed, with a resulting double call. A disaster
6933 in many cases (list.reverse() would never work!).
6938 in many cases (list.reverse() would never work!).
6934
6939
6935 * Removed prefilter() function, moved its code to raw_input (which
6940 * Removed prefilter() function, moved its code to raw_input (which
6936 after all was just a near-empty caller for prefilter). This saves
6941 after all was just a near-empty caller for prefilter). This saves
6937 a function call on every prompt, and simplifies the class a tiny bit.
6942 a function call on every prompt, and simplifies the class a tiny bit.
6938
6943
6939 * Fix _ip to __ip name in magic example file.
6944 * Fix _ip to __ip name in magic example file.
6940
6945
6941 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6946 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6942 work with non-gnu versions of tar.
6947 work with non-gnu versions of tar.
6943
6948
6944 2001-11-06 Fernando Perez <fperez@colorado.edu>
6949 2001-11-06 Fernando Perez <fperez@colorado.edu>
6945
6950
6946 * Version 0.1.2. Just to keep track of the recent changes.
6951 * Version 0.1.2. Just to keep track of the recent changes.
6947
6952
6948 * Fixed nasty bug in output prompt routine. It used to check 'if
6953 * Fixed nasty bug in output prompt routine. It used to check 'if
6949 arg != None...'. Problem is, this fails if arg implements a
6954 arg != None...'. Problem is, this fails if arg implements a
6950 special comparison (__cmp__) which disallows comparing to
6955 special comparison (__cmp__) which disallows comparing to
6951 None. Found it when trying to use the PhysicalQuantity module from
6956 None. Found it when trying to use the PhysicalQuantity module from
6952 ScientificPython.
6957 ScientificPython.
6953
6958
6954 2001-11-05 Fernando Perez <fperez@colorado.edu>
6959 2001-11-05 Fernando Perez <fperez@colorado.edu>
6955
6960
6956 * Also added dirs. Now the pushd/popd/dirs family functions
6961 * Also added dirs. Now the pushd/popd/dirs family functions
6957 basically like the shell, with the added convenience of going home
6962 basically like the shell, with the added convenience of going home
6958 when called with no args.
6963 when called with no args.
6959
6964
6960 * pushd/popd slightly modified to mimic shell behavior more
6965 * pushd/popd slightly modified to mimic shell behavior more
6961 closely.
6966 closely.
6962
6967
6963 * Added env,pushd,popd from ShellServices as magic functions. I
6968 * Added env,pushd,popd from ShellServices as magic functions. I
6964 think the cleanest will be to port all desired functions from
6969 think the cleanest will be to port all desired functions from
6965 ShellServices as magics and remove ShellServices altogether. This
6970 ShellServices as magics and remove ShellServices altogether. This
6966 will provide a single, clean way of adding functionality
6971 will provide a single, clean way of adding functionality
6967 (shell-type or otherwise) to IP.
6972 (shell-type or otherwise) to IP.
6968
6973
6969 2001-11-04 Fernando Perez <fperez@colorado.edu>
6974 2001-11-04 Fernando Perez <fperez@colorado.edu>
6970
6975
6971 * Added .ipython/ directory to sys.path. This way users can keep
6976 * Added .ipython/ directory to sys.path. This way users can keep
6972 customizations there and access them via import.
6977 customizations there and access them via import.
6973
6978
6974 2001-11-03 Fernando Perez <fperez@colorado.edu>
6979 2001-11-03 Fernando Perez <fperez@colorado.edu>
6975
6980
6976 * Opened version 0.1.1 for new changes.
6981 * Opened version 0.1.1 for new changes.
6977
6982
6978 * Changed version number to 0.1.0: first 'public' release, sent to
6983 * Changed version number to 0.1.0: first 'public' release, sent to
6979 Nathan and Janko.
6984 Nathan and Janko.
6980
6985
6981 * Lots of small fixes and tweaks.
6986 * Lots of small fixes and tweaks.
6982
6987
6983 * Minor changes to whos format. Now strings are shown, snipped if
6988 * Minor changes to whos format. Now strings are shown, snipped if
6984 too long.
6989 too long.
6985
6990
6986 * Changed ShellServices to work on __main__ so they show up in @who
6991 * Changed ShellServices to work on __main__ so they show up in @who
6987
6992
6988 * Help also works with ? at the end of a line:
6993 * Help also works with ? at the end of a line:
6989 ?sin and sin?
6994 ?sin and sin?
6990 both produce the same effect. This is nice, as often I use the
6995 both produce the same effect. This is nice, as often I use the
6991 tab-complete to find the name of a method, but I used to then have
6996 tab-complete to find the name of a method, but I used to then have
6992 to go to the beginning of the line to put a ? if I wanted more
6997 to go to the beginning of the line to put a ? if I wanted more
6993 info. Now I can just add the ? and hit return. Convenient.
6998 info. Now I can just add the ? and hit return. Convenient.
6994
6999
6995 2001-11-02 Fernando Perez <fperez@colorado.edu>
7000 2001-11-02 Fernando Perez <fperez@colorado.edu>
6996
7001
6997 * Python version check (>=2.1) added.
7002 * Python version check (>=2.1) added.
6998
7003
6999 * Added LazyPython documentation. At this point the docs are quite
7004 * Added LazyPython documentation. At this point the docs are quite
7000 a mess. A cleanup is in order.
7005 a mess. A cleanup is in order.
7001
7006
7002 * Auto-installer created. For some bizarre reason, the zipfiles
7007 * Auto-installer created. For some bizarre reason, the zipfiles
7003 module isn't working on my system. So I made a tar version
7008 module isn't working on my system. So I made a tar version
7004 (hopefully the command line options in various systems won't kill
7009 (hopefully the command line options in various systems won't kill
7005 me).
7010 me).
7006
7011
7007 * Fixes to Struct in genutils. Now all dictionary-like methods are
7012 * Fixes to Struct in genutils. Now all dictionary-like methods are
7008 protected (reasonably).
7013 protected (reasonably).
7009
7014
7010 * Added pager function to genutils and changed ? to print usage
7015 * Added pager function to genutils and changed ? to print usage
7011 note through it (it was too long).
7016 note through it (it was too long).
7012
7017
7013 * Added the LazyPython functionality. Works great! I changed the
7018 * Added the LazyPython functionality. Works great! I changed the
7014 auto-quote escape to ';', it's on home row and next to '. But
7019 auto-quote escape to ';', it's on home row and next to '. But
7015 both auto-quote and auto-paren (still /) escapes are command-line
7020 both auto-quote and auto-paren (still /) escapes are command-line
7016 parameters.
7021 parameters.
7017
7022
7018
7023
7019 2001-11-01 Fernando Perez <fperez@colorado.edu>
7024 2001-11-01 Fernando Perez <fperez@colorado.edu>
7020
7025
7021 * Version changed to 0.0.7. Fairly large change: configuration now
7026 * Version changed to 0.0.7. Fairly large change: configuration now
7022 is all stored in a directory, by default .ipython. There, all
7027 is all stored in a directory, by default .ipython. There, all
7023 config files have normal looking names (not .names)
7028 config files have normal looking names (not .names)
7024
7029
7025 * Version 0.0.6 Released first to Lucas and Archie as a test
7030 * Version 0.0.6 Released first to Lucas and Archie as a test
7026 run. Since it's the first 'semi-public' release, change version to
7031 run. Since it's the first 'semi-public' release, change version to
7027 > 0.0.6 for any changes now.
7032 > 0.0.6 for any changes now.
7028
7033
7029 * Stuff I had put in the ipplib.py changelog:
7034 * Stuff I had put in the ipplib.py changelog:
7030
7035
7031 Changes to InteractiveShell:
7036 Changes to InteractiveShell:
7032
7037
7033 - Made the usage message a parameter.
7038 - Made the usage message a parameter.
7034
7039
7035 - Require the name of the shell variable to be given. It's a bit
7040 - Require the name of the shell variable to be given. It's a bit
7036 of a hack, but allows the name 'shell' not to be hardwired in the
7041 of a hack, but allows the name 'shell' not to be hardwired in the
7037 magic (@) handler, which is problematic b/c it requires
7042 magic (@) handler, which is problematic b/c it requires
7038 polluting the global namespace with 'shell'. This in turn is
7043 polluting the global namespace with 'shell'. This in turn is
7039 fragile: if a user redefines a variable called shell, things
7044 fragile: if a user redefines a variable called shell, things
7040 break.
7045 break.
7041
7046
7042 - magic @: all functions available through @ need to be defined
7047 - magic @: all functions available through @ need to be defined
7043 as magic_<name>, even though they can be called simply as
7048 as magic_<name>, even though they can be called simply as
7044 @<name>. This allows the special command @magic to gather
7049 @<name>. This allows the special command @magic to gather
7045 information automatically about all existing magic functions,
7050 information automatically about all existing magic functions,
7046 even if they are run-time user extensions, by parsing the shell
7051 even if they are run-time user extensions, by parsing the shell
7047 instance __dict__ looking for special magic_ names.
7052 instance __dict__ looking for special magic_ names.
7048
7053
7049 - mainloop: added *two* local namespace parameters. This allows
7054 - mainloop: added *two* local namespace parameters. This allows
7050 the class to differentiate between parameters which were there
7055 the class to differentiate between parameters which were there
7051 before and after command line initialization was processed. This
7056 before and after command line initialization was processed. This
7052 way, later @who can show things loaded at startup by the
7057 way, later @who can show things loaded at startup by the
7053 user. This trick was necessary to make session saving/reloading
7058 user. This trick was necessary to make session saving/reloading
7054 really work: ideally after saving/exiting/reloading a session,
7059 really work: ideally after saving/exiting/reloading a session,
7055 *everything* should look the same, including the output of @who. I
7060 *everything* should look the same, including the output of @who. I
7056 was only able to make this work with this double namespace
7061 was only able to make this work with this double namespace
7057 trick.
7062 trick.
7058
7063
7059 - added a header to the logfile which allows (almost) full
7064 - added a header to the logfile which allows (almost) full
7060 session restoring.
7065 session restoring.
7061
7066
7062 - prepend lines beginning with @ or !, with a and log
7067 - prepend lines beginning with @ or !, with a and log
7063 them. Why? !lines: may be useful to know what you did @lines:
7068 them. Why? !lines: may be useful to know what you did @lines:
7064 they may affect session state. So when restoring a session, at
7069 they may affect session state. So when restoring a session, at
7065 least inform the user of their presence. I couldn't quite get
7070 least inform the user of their presence. I couldn't quite get
7066 them to properly re-execute, but at least the user is warned.
7071 them to properly re-execute, but at least the user is warned.
7067
7072
7068 * Started ChangeLog.
7073 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now