##// END OF EJS Templates
fix cd to nonexistent dir when dhist is empty, close \#180
vivainio -
Show More
@@ -1,3013 +1,3013 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 2668 2007-08-24 17:10:46Z vivainio $"""
4 $Id: Magic.py 2675 2007-08-27 17:51:15Z 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 try:
1662 try:
1663 mode = 'eval'
1663 mode = 'eval'
1664 code = compile(parameter_s,'<timed eval>',mode)
1664 code = compile(parameter_s,'<timed eval>',mode)
1665 except SyntaxError:
1665 except SyntaxError:
1666 mode = 'exec'
1666 mode = 'exec'
1667 code = compile(parameter_s,'<timed exec>',mode)
1667 code = compile(parameter_s,'<timed exec>',mode)
1668 # skew measurement as little as possible
1668 # skew measurement as little as possible
1669 glob = self.shell.user_ns
1669 glob = self.shell.user_ns
1670 clk = clock2
1670 clk = clock2
1671 wtime = time.time
1671 wtime = time.time
1672 # time execution
1672 # time execution
1673 wall_st = wtime()
1673 wall_st = wtime()
1674 if mode=='eval':
1674 if mode=='eval':
1675 st = clk()
1675 st = clk()
1676 out = eval(code,glob)
1676 out = eval(code,glob)
1677 end = clk()
1677 end = clk()
1678 else:
1678 else:
1679 st = clk()
1679 st = clk()
1680 exec code in glob
1680 exec code in glob
1681 end = clk()
1681 end = clk()
1682 out = None
1682 out = None
1683 wall_end = wtime()
1683 wall_end = wtime()
1684 # Compute actual times and report
1684 # Compute actual times and report
1685 wall_time = wall_end-wall_st
1685 wall_time = wall_end-wall_st
1686 cpu_user = end[0]-st[0]
1686 cpu_user = end[0]-st[0]
1687 cpu_sys = end[1]-st[1]
1687 cpu_sys = end[1]-st[1]
1688 cpu_tot = cpu_user+cpu_sys
1688 cpu_tot = cpu_user+cpu_sys
1689 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1689 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1690 (cpu_user,cpu_sys,cpu_tot)
1690 (cpu_user,cpu_sys,cpu_tot)
1691 print "Wall time: %.2f" % wall_time
1691 print "Wall time: %.2f" % wall_time
1692 return out
1692 return out
1693
1693
1694 def magic_macro(self,parameter_s = ''):
1694 def magic_macro(self,parameter_s = ''):
1695 """Define a set of input lines as a macro for future re-execution.
1695 """Define a set of input lines as a macro for future re-execution.
1696
1696
1697 Usage:\\
1697 Usage:\\
1698 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1698 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1699
1699
1700 Options:
1700 Options:
1701
1701
1702 -r: use 'raw' input. By default, the 'processed' history is used,
1702 -r: use 'raw' input. By default, the 'processed' history is used,
1703 so that magics are loaded in their transformed version to valid
1703 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
1704 Python. If this option is given, the raw input as typed as the
1705 command line is used instead.
1705 command line is used instead.
1706
1706
1707 This will define a global variable called `name` which is a string
1707 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
1708 made of joining the slices and lines you specify (n1,n2,... numbers
1709 above) from your input history into a single string. This variable
1709 above) from your input history into a single string. This variable
1710 acts like an automatic function which re-executes those lines as if
1710 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
1711 you had typed them. You just type 'name' at the prompt and the code
1712 executes.
1712 executes.
1713
1713
1714 The notation for indicating number ranges is: n1-n2 means 'use line
1714 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
1715 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1716 using the lines numbered 5,6 and 7.
1716 using the lines numbered 5,6 and 7.
1717
1717
1718 Note: as a 'hidden' feature, you can also use traditional python slice
1718 Note: as a 'hidden' feature, you can also use traditional python slice
1719 notation, where N:M means numbers N through M-1.
1719 notation, where N:M means numbers N through M-1.
1720
1720
1721 For example, if your history contains (%hist prints it):
1721 For example, if your history contains (%hist prints it):
1722
1722
1723 44: x=1\\
1723 44: x=1\\
1724 45: y=3\\
1724 45: y=3\\
1725 46: z=x+y\\
1725 46: z=x+y\\
1726 47: print x\\
1726 47: print x\\
1727 48: a=5\\
1727 48: a=5\\
1728 49: print 'x',x,'y',y\\
1728 49: print 'x',x,'y',y\\
1729
1729
1730 you can create a macro with lines 44 through 47 (included) and line 49
1730 you can create a macro with lines 44 through 47 (included) and line 49
1731 called my_macro with:
1731 called my_macro with:
1732
1732
1733 In [51]: %macro my_macro 44-47 49
1733 In [51]: %macro my_macro 44-47 49
1734
1734
1735 Now, typing `my_macro` (without quotes) will re-execute all this code
1735 Now, typing `my_macro` (without quotes) will re-execute all this code
1736 in one pass.
1736 in one pass.
1737
1737
1738 You don't need to give the line-numbers in order, and any given line
1738 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
1739 number can appear multiple times. You can assemble macros with any
1740 lines from your input history in any order.
1740 lines from your input history in any order.
1741
1741
1742 The macro is a simple object which holds its value in an attribute,
1742 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
1743 but IPython's display system checks for macros and executes them as
1744 code instead of printing them when you type their name.
1744 code instead of printing them when you type their name.
1745
1745
1746 You can view a macro's contents by explicitly printing it with:
1746 You can view a macro's contents by explicitly printing it with:
1747
1747
1748 'print macro_name'.
1748 'print macro_name'.
1749
1749
1750 For one-off cases which DON'T contain magic function calls in them you
1750 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
1751 can obtain similar results by explicitly executing slices from your
1752 input history with:
1752 input history with:
1753
1753
1754 In [60]: exec In[44:48]+In[49]"""
1754 In [60]: exec In[44:48]+In[49]"""
1755
1755
1756 opts,args = self.parse_options(parameter_s,'r',mode='list')
1756 opts,args = self.parse_options(parameter_s,'r',mode='list')
1757 if not args:
1757 if not args:
1758 macs = [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)]
1758 macs = [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)]
1759 macs.sort()
1759 macs.sort()
1760 return macs
1760 return macs
1761 name,ranges = args[0], args[1:]
1761 name,ranges = args[0], args[1:]
1762 #print 'rng',ranges # dbg
1762 #print 'rng',ranges # dbg
1763 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1763 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1764 macro = Macro(lines)
1764 macro = Macro(lines)
1765 self.shell.user_ns.update({name:macro})
1765 self.shell.user_ns.update({name:macro})
1766 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1766 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1767 print 'Macro contents:'
1767 print 'Macro contents:'
1768 print macro,
1768 print macro,
1769
1769
1770 def magic_save(self,parameter_s = ''):
1770 def magic_save(self,parameter_s = ''):
1771 """Save a set of lines to a given filename.
1771 """Save a set of lines to a given filename.
1772
1772
1773 Usage:\\
1773 Usage:\\
1774 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1774 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1775
1775
1776 Options:
1776 Options:
1777
1777
1778 -r: use 'raw' input. By default, the 'processed' history is used,
1778 -r: use 'raw' input. By default, the 'processed' history is used,
1779 so that magics are loaded in their transformed version to valid
1779 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
1780 Python. If this option is given, the raw input as typed as the
1781 command line is used instead.
1781 command line is used instead.
1782
1782
1783 This function uses the same syntax as %macro for line extraction, but
1783 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
1784 instead of creating a macro it saves the resulting string to the
1785 filename you specify.
1785 filename you specify.
1786
1786
1787 It adds a '.py' extension to the file if you don't do so yourself, and
1787 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."""
1788 it asks for confirmation before overwriting existing files."""
1789
1789
1790 opts,args = self.parse_options(parameter_s,'r',mode='list')
1790 opts,args = self.parse_options(parameter_s,'r',mode='list')
1791 fname,ranges = args[0], args[1:]
1791 fname,ranges = args[0], args[1:]
1792 if not fname.endswith('.py'):
1792 if not fname.endswith('.py'):
1793 fname += '.py'
1793 fname += '.py'
1794 if os.path.isfile(fname):
1794 if os.path.isfile(fname):
1795 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1795 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1796 if ans.lower() not in ['y','yes']:
1796 if ans.lower() not in ['y','yes']:
1797 print 'Operation cancelled.'
1797 print 'Operation cancelled.'
1798 return
1798 return
1799 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1799 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1800 f = file(fname,'w')
1800 f = file(fname,'w')
1801 f.write(cmds)
1801 f.write(cmds)
1802 f.close()
1802 f.close()
1803 print 'The following commands were written to file `%s`:' % fname
1803 print 'The following commands were written to file `%s`:' % fname
1804 print cmds
1804 print cmds
1805
1805
1806 def _edit_macro(self,mname,macro):
1806 def _edit_macro(self,mname,macro):
1807 """open an editor with the macro data in a file"""
1807 """open an editor with the macro data in a file"""
1808 filename = self.shell.mktempfile(macro.value)
1808 filename = self.shell.mktempfile(macro.value)
1809 self.shell.hooks.editor(filename)
1809 self.shell.hooks.editor(filename)
1810
1810
1811 # and make a new macro object, to replace the old one
1811 # and make a new macro object, to replace the old one
1812 mfile = open(filename)
1812 mfile = open(filename)
1813 mvalue = mfile.read()
1813 mvalue = mfile.read()
1814 mfile.close()
1814 mfile.close()
1815 self.shell.user_ns[mname] = Macro(mvalue)
1815 self.shell.user_ns[mname] = Macro(mvalue)
1816
1816
1817 def magic_ed(self,parameter_s=''):
1817 def magic_ed(self,parameter_s=''):
1818 """Alias to %edit."""
1818 """Alias to %edit."""
1819 return self.magic_edit(parameter_s)
1819 return self.magic_edit(parameter_s)
1820
1820
1821 def magic_edit(self,parameter_s='',last_call=['','']):
1821 def magic_edit(self,parameter_s='',last_call=['','']):
1822 """Bring up an editor and execute the resulting code.
1822 """Bring up an editor and execute the resulting code.
1823
1823
1824 Usage:
1824 Usage:
1825 %edit [options] [args]
1825 %edit [options] [args]
1826
1826
1827 %edit runs IPython's editor hook. The default version of this hook is
1827 %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
1828 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
1829 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
1830 vi under Linux/Unix and to notepad under Windows. See the end of this
1831 docstring for how to change the editor hook.
1831 docstring for how to change the editor hook.
1832
1832
1833 You can also set the value of this editor via the command line option
1833 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
1834 '-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
1835 specifically for IPython an editor different from your typical default
1836 (and for Windows users who typically don't set environment variables).
1836 (and for Windows users who typically don't set environment variables).
1837
1837
1838 This command allows you to conveniently edit multi-line code right in
1838 This command allows you to conveniently edit multi-line code right in
1839 your IPython session.
1839 your IPython session.
1840
1840
1841 If called without arguments, %edit opens up an empty editor with a
1841 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
1842 temporary file and will execute the contents of this file when you
1843 close it (don't forget to save it!).
1843 close it (don't forget to save it!).
1844
1844
1845
1845
1846 Options:
1846 Options:
1847
1847
1848 -n <number>: open the editor at a specified line number. By default,
1848 -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
1849 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
1850 you can configure this by providing your own modified hook if your
1851 favorite editor supports line-number specifications with a different
1851 favorite editor supports line-number specifications with a different
1852 syntax.
1852 syntax.
1853
1853
1854 -p: this will call the editor with the same data as the previous time
1854 -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
1855 it was used, regardless of how long ago (in your current session) it
1856 was.
1856 was.
1857
1857
1858 -r: use 'raw' input. This option only applies to input taken from the
1858 -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
1859 user's history. By default, the 'processed' history is used, so that
1860 magics are loaded in their transformed version to valid Python. If
1860 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
1861 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
1862 used instead. When you exit the editor, it will be executed by
1863 IPython's own processor.
1863 IPython's own processor.
1864
1864
1865 -x: do not execute the edited code immediately upon exit. This is
1865 -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
1866 mainly useful if you are editing programs which need to be called with
1867 command line arguments, which you can then do using %run.
1867 command line arguments, which you can then do using %run.
1868
1868
1869
1869
1870 Arguments:
1870 Arguments:
1871
1871
1872 If arguments are given, the following possibilites exist:
1872 If arguments are given, the following possibilites exist:
1873
1873
1874 - The arguments are numbers or pairs of colon-separated numbers (like
1874 - 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
1875 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.
1876 loaded into the editor. The syntax is the same of the %macro command.
1877
1877
1878 - If the argument doesn't start with a number, it is evaluated as a
1878 - 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
1879 variable and its contents loaded into the editor. You can thus edit
1880 any string which contains python code (including the result of
1880 any string which contains python code (including the result of
1881 previous edits).
1881 previous edits).
1882
1882
1883 - If the argument is the name of an object (other than a string),
1883 - 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
1884 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`
1885 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,
1886 to load an editor exactly at the point where 'function' is defined,
1887 edit it and have the file be executed automatically.
1887 edit it and have the file be executed automatically.
1888
1888
1889 If the object is a macro (see %macro for details), this opens up your
1889 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.
1890 specified editor with a temporary file containing the macro's data.
1891 Upon exit, the macro is reloaded with the contents of the file.
1891 Upon exit, the macro is reloaded with the contents of the file.
1892
1892
1893 Note: opening at an exact line is only supported under Unix, and some
1893 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
1894 editors (like kedit and gedit up to Gnome 2.8) do not understand the
1895 '+NUMBER' parameter necessary for this feature. Good editors like
1895 '+NUMBER' parameter necessary for this feature. Good editors like
1896 (X)Emacs, vi, jed, pico and joe all do.
1896 (X)Emacs, vi, jed, pico and joe all do.
1897
1897
1898 - If the argument is not found as a variable, IPython will look for a
1898 - 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
1899 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,
1900 editor. It will execute its contents with execfile() when you exit,
1901 loading any code in the file into your interactive namespace.
1901 loading any code in the file into your interactive namespace.
1902
1902
1903 After executing your code, %edit will return as output the code you
1903 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
1904 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,
1905 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
1906 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
1907 the output.
1907 the output.
1908
1908
1909 Note that %edit is also available through the alias %ed.
1909 Note that %edit is also available through the alias %ed.
1910
1910
1911 This is an example of creating a simple function inside the editor and
1911 This is an example of creating a simple function inside the editor and
1912 then modifying it. First, start up the editor:
1912 then modifying it. First, start up the editor:
1913
1913
1914 In [1]: ed\\
1914 In [1]: ed\\
1915 Editing... done. Executing edited code...\\
1915 Editing... done. Executing edited code...\\
1916 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
1916 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
1917
1917
1918 We can then call the function foo():
1918 We can then call the function foo():
1919
1919
1920 In [2]: foo()\\
1920 In [2]: foo()\\
1921 foo() was defined in an editing session
1921 foo() was defined in an editing session
1922
1922
1923 Now we edit foo. IPython automatically loads the editor with the
1923 Now we edit foo. IPython automatically loads the editor with the
1924 (temporary) file where foo() was previously defined:
1924 (temporary) file where foo() was previously defined:
1925
1925
1926 In [3]: ed foo\\
1926 In [3]: ed foo\\
1927 Editing... done. Executing edited code...
1927 Editing... done. Executing edited code...
1928
1928
1929 And if we call foo() again we get the modified version:
1929 And if we call foo() again we get the modified version:
1930
1930
1931 In [4]: foo()\\
1931 In [4]: foo()\\
1932 foo() has now been changed!
1932 foo() has now been changed!
1933
1933
1934 Here is an example of how to edit a code snippet successive
1934 Here is an example of how to edit a code snippet successive
1935 times. First we call the editor:
1935 times. First we call the editor:
1936
1936
1937 In [8]: ed\\
1937 In [8]: ed\\
1938 Editing... done. Executing edited code...\\
1938 Editing... done. Executing edited code...\\
1939 hello\\
1939 hello\\
1940 Out[8]: "print 'hello'\\n"
1940 Out[8]: "print 'hello'\\n"
1941
1941
1942 Now we call it again with the previous output (stored in _):
1942 Now we call it again with the previous output (stored in _):
1943
1943
1944 In [9]: ed _\\
1944 In [9]: ed _\\
1945 Editing... done. Executing edited code...\\
1945 Editing... done. Executing edited code...\\
1946 hello world\\
1946 hello world\\
1947 Out[9]: "print 'hello world'\\n"
1947 Out[9]: "print 'hello world'\\n"
1948
1948
1949 Now we call it with the output #8 (stored in _8, also as Out[8]):
1949 Now we call it with the output #8 (stored in _8, also as Out[8]):
1950
1950
1951 In [10]: ed _8\\
1951 In [10]: ed _8\\
1952 Editing... done. Executing edited code...\\
1952 Editing... done. Executing edited code...\\
1953 hello again\\
1953 hello again\\
1954 Out[10]: "print 'hello again'\\n"
1954 Out[10]: "print 'hello again'\\n"
1955
1955
1956
1956
1957 Changing the default editor hook:
1957 Changing the default editor hook:
1958
1958
1959 If you wish to write your own editor hook, you can put it in a
1959 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
1960 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
1961 is defined in the IPython.hooks module, and you can use that as a
1962 starting example for further modifications. That file also has
1962 starting example for further modifications. That file also has
1963 general instructions on how to set a new hook for use once you've
1963 general instructions on how to set a new hook for use once you've
1964 defined it."""
1964 defined it."""
1965
1965
1966 # FIXME: This function has become a convoluted mess. It needs a
1966 # FIXME: This function has become a convoluted mess. It needs a
1967 # ground-up rewrite with clean, simple logic.
1967 # ground-up rewrite with clean, simple logic.
1968
1968
1969 def make_filename(arg):
1969 def make_filename(arg):
1970 "Make a filename from the given args"
1970 "Make a filename from the given args"
1971 try:
1971 try:
1972 filename = get_py_filename(arg)
1972 filename = get_py_filename(arg)
1973 except IOError:
1973 except IOError:
1974 if args.endswith('.py'):
1974 if args.endswith('.py'):
1975 filename = arg
1975 filename = arg
1976 else:
1976 else:
1977 filename = None
1977 filename = None
1978 return filename
1978 return filename
1979
1979
1980 # custom exceptions
1980 # custom exceptions
1981 class DataIsObject(Exception): pass
1981 class DataIsObject(Exception): pass
1982
1982
1983 opts,args = self.parse_options(parameter_s,'prxn:')
1983 opts,args = self.parse_options(parameter_s,'prxn:')
1984 # Set a few locals from the options for convenience:
1984 # Set a few locals from the options for convenience:
1985 opts_p = opts.has_key('p')
1985 opts_p = opts.has_key('p')
1986 opts_r = opts.has_key('r')
1986 opts_r = opts.has_key('r')
1987
1987
1988 # Default line number value
1988 # Default line number value
1989 lineno = opts.get('n',None)
1989 lineno = opts.get('n',None)
1990
1990
1991 if opts_p:
1991 if opts_p:
1992 args = '_%s' % last_call[0]
1992 args = '_%s' % last_call[0]
1993 if not self.shell.user_ns.has_key(args):
1993 if not self.shell.user_ns.has_key(args):
1994 args = last_call[1]
1994 args = last_call[1]
1995
1995
1996 # use last_call to remember the state of the previous call, but don't
1996 # use last_call to remember the state of the previous call, but don't
1997 # let it be clobbered by successive '-p' calls.
1997 # let it be clobbered by successive '-p' calls.
1998 try:
1998 try:
1999 last_call[0] = self.shell.outputcache.prompt_count
1999 last_call[0] = self.shell.outputcache.prompt_count
2000 if not opts_p:
2000 if not opts_p:
2001 last_call[1] = parameter_s
2001 last_call[1] = parameter_s
2002 except:
2002 except:
2003 pass
2003 pass
2004
2004
2005 # by default this is done with temp files, except when the given
2005 # by default this is done with temp files, except when the given
2006 # arg is a filename
2006 # arg is a filename
2007 use_temp = 1
2007 use_temp = 1
2008
2008
2009 if re.match(r'\d',args):
2009 if re.match(r'\d',args):
2010 # Mode where user specifies ranges of lines, like in %macro.
2010 # Mode where user specifies ranges of lines, like in %macro.
2011 # This means that you can't edit files whose names begin with
2011 # This means that you can't edit files whose names begin with
2012 # numbers this way. Tough.
2012 # numbers this way. Tough.
2013 ranges = args.split()
2013 ranges = args.split()
2014 data = ''.join(self.extract_input_slices(ranges,opts_r))
2014 data = ''.join(self.extract_input_slices(ranges,opts_r))
2015 elif args.endswith('.py'):
2015 elif args.endswith('.py'):
2016 filename = make_filename(args)
2016 filename = make_filename(args)
2017 data = ''
2017 data = ''
2018 use_temp = 0
2018 use_temp = 0
2019 elif args:
2019 elif args:
2020 try:
2020 try:
2021 # Load the parameter given as a variable. If not a string,
2021 # Load the parameter given as a variable. If not a string,
2022 # process it as an object instead (below)
2022 # process it as an object instead (below)
2023
2023
2024 #print '*** args',args,'type',type(args) # dbg
2024 #print '*** args',args,'type',type(args) # dbg
2025 data = eval(args,self.shell.user_ns)
2025 data = eval(args,self.shell.user_ns)
2026 if not type(data) in StringTypes:
2026 if not type(data) in StringTypes:
2027 raise DataIsObject
2027 raise DataIsObject
2028
2028
2029 except (NameError,SyntaxError):
2029 except (NameError,SyntaxError):
2030 # given argument is not a variable, try as a filename
2030 # given argument is not a variable, try as a filename
2031 filename = make_filename(args)
2031 filename = make_filename(args)
2032 if filename is None:
2032 if filename is None:
2033 warn("Argument given (%s) can't be found as a variable "
2033 warn("Argument given (%s) can't be found as a variable "
2034 "or as a filename." % args)
2034 "or as a filename." % args)
2035 return
2035 return
2036
2036
2037 data = ''
2037 data = ''
2038 use_temp = 0
2038 use_temp = 0
2039 except DataIsObject:
2039 except DataIsObject:
2040
2040
2041 # macros have a special edit function
2041 # macros have a special edit function
2042 if isinstance(data,Macro):
2042 if isinstance(data,Macro):
2043 self._edit_macro(args,data)
2043 self._edit_macro(args,data)
2044 return
2044 return
2045
2045
2046 # For objects, try to edit the file where they are defined
2046 # For objects, try to edit the file where they are defined
2047 try:
2047 try:
2048 filename = inspect.getabsfile(data)
2048 filename = inspect.getabsfile(data)
2049 datafile = 1
2049 datafile = 1
2050 except TypeError:
2050 except TypeError:
2051 filename = make_filename(args)
2051 filename = make_filename(args)
2052 datafile = 1
2052 datafile = 1
2053 warn('Could not find file where `%s` is defined.\n'
2053 warn('Could not find file where `%s` is defined.\n'
2054 'Opening a file named `%s`' % (args,filename))
2054 'Opening a file named `%s`' % (args,filename))
2055 # Now, make sure we can actually read the source (if it was in
2055 # Now, make sure we can actually read the source (if it was in
2056 # a temp file it's gone by now).
2056 # a temp file it's gone by now).
2057 if datafile:
2057 if datafile:
2058 try:
2058 try:
2059 if lineno is None:
2059 if lineno is None:
2060 lineno = inspect.getsourcelines(data)[1]
2060 lineno = inspect.getsourcelines(data)[1]
2061 except IOError:
2061 except IOError:
2062 filename = make_filename(args)
2062 filename = make_filename(args)
2063 if filename is None:
2063 if filename is None:
2064 warn('The file `%s` where `%s` was defined cannot '
2064 warn('The file `%s` where `%s` was defined cannot '
2065 'be read.' % (filename,data))
2065 'be read.' % (filename,data))
2066 return
2066 return
2067 use_temp = 0
2067 use_temp = 0
2068 else:
2068 else:
2069 data = ''
2069 data = ''
2070
2070
2071 if use_temp:
2071 if use_temp:
2072 filename = self.shell.mktempfile(data)
2072 filename = self.shell.mktempfile(data)
2073 print 'IPython will make a temporary file named:',filename
2073 print 'IPython will make a temporary file named:',filename
2074
2074
2075 # do actual editing here
2075 # do actual editing here
2076 print 'Editing...',
2076 print 'Editing...',
2077 sys.stdout.flush()
2077 sys.stdout.flush()
2078 self.shell.hooks.editor(filename,lineno)
2078 self.shell.hooks.editor(filename,lineno)
2079 if opts.has_key('x'): # -x prevents actual execution
2079 if opts.has_key('x'): # -x prevents actual execution
2080 print
2080 print
2081 else:
2081 else:
2082 print 'done. Executing edited code...'
2082 print 'done. Executing edited code...'
2083 if opts_r:
2083 if opts_r:
2084 self.shell.runlines(file_read(filename))
2084 self.shell.runlines(file_read(filename))
2085 else:
2085 else:
2086 self.shell.safe_execfile(filename,self.shell.user_ns,
2086 self.shell.safe_execfile(filename,self.shell.user_ns,
2087 self.shell.user_ns)
2087 self.shell.user_ns)
2088 if use_temp:
2088 if use_temp:
2089 try:
2089 try:
2090 return open(filename).read()
2090 return open(filename).read()
2091 except IOError,msg:
2091 except IOError,msg:
2092 if msg.filename == filename:
2092 if msg.filename == filename:
2093 warn('File not found. Did you forget to save?')
2093 warn('File not found. Did you forget to save?')
2094 return
2094 return
2095 else:
2095 else:
2096 self.shell.showtraceback()
2096 self.shell.showtraceback()
2097
2097
2098 def magic_xmode(self,parameter_s = ''):
2098 def magic_xmode(self,parameter_s = ''):
2099 """Switch modes for the exception handlers.
2099 """Switch modes for the exception handlers.
2100
2100
2101 Valid modes: Plain, Context and Verbose.
2101 Valid modes: Plain, Context and Verbose.
2102
2102
2103 If called without arguments, acts as a toggle."""
2103 If called without arguments, acts as a toggle."""
2104
2104
2105 def xmode_switch_err(name):
2105 def xmode_switch_err(name):
2106 warn('Error changing %s exception modes.\n%s' %
2106 warn('Error changing %s exception modes.\n%s' %
2107 (name,sys.exc_info()[1]))
2107 (name,sys.exc_info()[1]))
2108
2108
2109 shell = self.shell
2109 shell = self.shell
2110 new_mode = parameter_s.strip().capitalize()
2110 new_mode = parameter_s.strip().capitalize()
2111 try:
2111 try:
2112 shell.InteractiveTB.set_mode(mode=new_mode)
2112 shell.InteractiveTB.set_mode(mode=new_mode)
2113 print 'Exception reporting mode:',shell.InteractiveTB.mode
2113 print 'Exception reporting mode:',shell.InteractiveTB.mode
2114 except:
2114 except:
2115 xmode_switch_err('user')
2115 xmode_switch_err('user')
2116
2116
2117 # threaded shells use a special handler in sys.excepthook
2117 # threaded shells use a special handler in sys.excepthook
2118 if shell.isthreaded:
2118 if shell.isthreaded:
2119 try:
2119 try:
2120 shell.sys_excepthook.set_mode(mode=new_mode)
2120 shell.sys_excepthook.set_mode(mode=new_mode)
2121 except:
2121 except:
2122 xmode_switch_err('threaded')
2122 xmode_switch_err('threaded')
2123
2123
2124 def magic_colors(self,parameter_s = ''):
2124 def magic_colors(self,parameter_s = ''):
2125 """Switch color scheme for prompts, info system and exception handlers.
2125 """Switch color scheme for prompts, info system and exception handlers.
2126
2126
2127 Currently implemented schemes: NoColor, Linux, LightBG.
2127 Currently implemented schemes: NoColor, Linux, LightBG.
2128
2128
2129 Color scheme names are not case-sensitive."""
2129 Color scheme names are not case-sensitive."""
2130
2130
2131 def color_switch_err(name):
2131 def color_switch_err(name):
2132 warn('Error changing %s color schemes.\n%s' %
2132 warn('Error changing %s color schemes.\n%s' %
2133 (name,sys.exc_info()[1]))
2133 (name,sys.exc_info()[1]))
2134
2134
2135
2135
2136 new_scheme = parameter_s.strip()
2136 new_scheme = parameter_s.strip()
2137 if not new_scheme:
2137 if not new_scheme:
2138 print 'You must specify a color scheme.'
2138 print 'You must specify a color scheme.'
2139 return
2139 return
2140 # local shortcut
2140 # local shortcut
2141 shell = self.shell
2141 shell = self.shell
2142
2142
2143 import IPython.rlineimpl as readline
2143 import IPython.rlineimpl as readline
2144
2144
2145 if not readline.have_readline and sys.platform == "win32":
2145 if not readline.have_readline and sys.platform == "win32":
2146 msg = """\
2146 msg = """\
2147 Proper color support under MS Windows requires the pyreadline library.
2147 Proper color support under MS Windows requires the pyreadline library.
2148 You can find it at:
2148 You can find it at:
2149 http://ipython.scipy.org/moin/PyReadline/Intro
2149 http://ipython.scipy.org/moin/PyReadline/Intro
2150 Gary's readline needs the ctypes module, from:
2150 Gary's readline needs the ctypes module, from:
2151 http://starship.python.net/crew/theller/ctypes
2151 http://starship.python.net/crew/theller/ctypes
2152 (Note that ctypes is already part of Python versions 2.5 and newer).
2152 (Note that ctypes is already part of Python versions 2.5 and newer).
2153
2153
2154 Defaulting color scheme to 'NoColor'"""
2154 Defaulting color scheme to 'NoColor'"""
2155 new_scheme = 'NoColor'
2155 new_scheme = 'NoColor'
2156 warn(msg)
2156 warn(msg)
2157
2157
2158 # readline option is 0
2158 # readline option is 0
2159 if not shell.has_readline:
2159 if not shell.has_readline:
2160 new_scheme = 'NoColor'
2160 new_scheme = 'NoColor'
2161
2161
2162 # Set prompt colors
2162 # Set prompt colors
2163 try:
2163 try:
2164 shell.outputcache.set_colors(new_scheme)
2164 shell.outputcache.set_colors(new_scheme)
2165 except:
2165 except:
2166 color_switch_err('prompt')
2166 color_switch_err('prompt')
2167 else:
2167 else:
2168 shell.rc.colors = \
2168 shell.rc.colors = \
2169 shell.outputcache.color_table.active_scheme_name
2169 shell.outputcache.color_table.active_scheme_name
2170 # Set exception colors
2170 # Set exception colors
2171 try:
2171 try:
2172 shell.InteractiveTB.set_colors(scheme = new_scheme)
2172 shell.InteractiveTB.set_colors(scheme = new_scheme)
2173 shell.SyntaxTB.set_colors(scheme = new_scheme)
2173 shell.SyntaxTB.set_colors(scheme = new_scheme)
2174 except:
2174 except:
2175 color_switch_err('exception')
2175 color_switch_err('exception')
2176
2176
2177 # threaded shells use a verbose traceback in sys.excepthook
2177 # threaded shells use a verbose traceback in sys.excepthook
2178 if shell.isthreaded:
2178 if shell.isthreaded:
2179 try:
2179 try:
2180 shell.sys_excepthook.set_colors(scheme=new_scheme)
2180 shell.sys_excepthook.set_colors(scheme=new_scheme)
2181 except:
2181 except:
2182 color_switch_err('system exception handler')
2182 color_switch_err('system exception handler')
2183
2183
2184 # Set info (for 'object?') colors
2184 # Set info (for 'object?') colors
2185 if shell.rc.color_info:
2185 if shell.rc.color_info:
2186 try:
2186 try:
2187 shell.inspector.set_active_scheme(new_scheme)
2187 shell.inspector.set_active_scheme(new_scheme)
2188 except:
2188 except:
2189 color_switch_err('object inspector')
2189 color_switch_err('object inspector')
2190 else:
2190 else:
2191 shell.inspector.set_active_scheme('NoColor')
2191 shell.inspector.set_active_scheme('NoColor')
2192
2192
2193 def magic_color_info(self,parameter_s = ''):
2193 def magic_color_info(self,parameter_s = ''):
2194 """Toggle color_info.
2194 """Toggle color_info.
2195
2195
2196 The color_info configuration parameter controls whether colors are
2196 The color_info configuration parameter controls whether colors are
2197 used for displaying object details (by things like %psource, %pfile or
2197 used for displaying object details (by things like %psource, %pfile or
2198 the '?' system). This function toggles this value with each call.
2198 the '?' system). This function toggles this value with each call.
2199
2199
2200 Note that unless you have a fairly recent pager (less works better
2200 Note that unless you have a fairly recent pager (less works better
2201 than more) in your system, using colored object information displays
2201 than more) in your system, using colored object information displays
2202 will not work properly. Test it and see."""
2202 will not work properly. Test it and see."""
2203
2203
2204 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2204 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2205 self.magic_colors(self.shell.rc.colors)
2205 self.magic_colors(self.shell.rc.colors)
2206 print 'Object introspection functions have now coloring:',
2206 print 'Object introspection functions have now coloring:',
2207 print ['OFF','ON'][self.shell.rc.color_info]
2207 print ['OFF','ON'][self.shell.rc.color_info]
2208
2208
2209 def magic_Pprint(self, parameter_s=''):
2209 def magic_Pprint(self, parameter_s=''):
2210 """Toggle pretty printing on/off."""
2210 """Toggle pretty printing on/off."""
2211
2211
2212 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2212 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2213 print 'Pretty printing has been turned', \
2213 print 'Pretty printing has been turned', \
2214 ['OFF','ON'][self.shell.rc.pprint]
2214 ['OFF','ON'][self.shell.rc.pprint]
2215
2215
2216 def magic_exit(self, parameter_s=''):
2216 def magic_exit(self, parameter_s=''):
2217 """Exit IPython, confirming if configured to do so.
2217 """Exit IPython, confirming if configured to do so.
2218
2218
2219 You can configure whether IPython asks for confirmation upon exit by
2219 You can configure whether IPython asks for confirmation upon exit by
2220 setting the confirm_exit flag in the ipythonrc file."""
2220 setting the confirm_exit flag in the ipythonrc file."""
2221
2221
2222 self.shell.exit()
2222 self.shell.exit()
2223
2223
2224 def magic_quit(self, parameter_s=''):
2224 def magic_quit(self, parameter_s=''):
2225 """Exit IPython, confirming if configured to do so (like %exit)"""
2225 """Exit IPython, confirming if configured to do so (like %exit)"""
2226
2226
2227 self.shell.exit()
2227 self.shell.exit()
2228
2228
2229 def magic_Exit(self, parameter_s=''):
2229 def magic_Exit(self, parameter_s=''):
2230 """Exit IPython without confirmation."""
2230 """Exit IPython without confirmation."""
2231
2231
2232 self.shell.exit_now = True
2232 self.shell.exit_now = True
2233
2233
2234 #......................................................................
2234 #......................................................................
2235 # Functions to implement unix shell-type things
2235 # Functions to implement unix shell-type things
2236
2236
2237 def magic_alias(self, parameter_s = ''):
2237 def magic_alias(self, parameter_s = ''):
2238 """Define an alias for a system command.
2238 """Define an alias for a system command.
2239
2239
2240 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2240 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2241
2241
2242 Then, typing 'alias_name params' will execute the system command 'cmd
2242 Then, typing 'alias_name params' will execute the system command 'cmd
2243 params' (from your underlying operating system).
2243 params' (from your underlying operating system).
2244
2244
2245 Aliases have lower precedence than magic functions and Python normal
2245 Aliases have lower precedence than magic functions and Python normal
2246 variables, so if 'foo' is both a Python variable and an alias, the
2246 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.
2247 alias can not be executed until 'del foo' removes the Python variable.
2248
2248
2249 You can use the %l specifier in an alias definition to represent the
2249 You can use the %l specifier in an alias definition to represent the
2250 whole line when the alias is called. For example:
2250 whole line when the alias is called. For example:
2251
2251
2252 In [2]: alias all echo "Input in brackets: <%l>"\\
2252 In [2]: alias all echo "Input in brackets: <%l>"\\
2253 In [3]: all hello world\\
2253 In [3]: all hello world\\
2254 Input in brackets: <hello world>
2254 Input in brackets: <hello world>
2255
2255
2256 You can also define aliases with parameters using %s specifiers (one
2256 You can also define aliases with parameters using %s specifiers (one
2257 per parameter):
2257 per parameter):
2258
2258
2259 In [1]: alias parts echo first %s second %s\\
2259 In [1]: alias parts echo first %s second %s\\
2260 In [2]: %parts A B\\
2260 In [2]: %parts A B\\
2261 first A second B\\
2261 first A second B\\
2262 In [3]: %parts A\\
2262 In [3]: %parts A\\
2263 Incorrect number of arguments: 2 expected.\\
2263 Incorrect number of arguments: 2 expected.\\
2264 parts is an alias to: 'echo first %s second %s'
2264 parts is an alias to: 'echo first %s second %s'
2265
2265
2266 Note that %l and %s are mutually exclusive. You can only use one or
2266 Note that %l and %s are mutually exclusive. You can only use one or
2267 the other in your aliases.
2267 the other in your aliases.
2268
2268
2269 Aliases expand Python variables just like system calls using ! or !!
2269 Aliases expand Python variables just like system calls using ! or !!
2270 do: all expressions prefixed with '$' get expanded. For details of
2270 do: all expressions prefixed with '$' get expanded. For details of
2271 the semantic rules, see PEP-215:
2271 the semantic rules, see PEP-215:
2272 http://www.python.org/peps/pep-0215.html. This is the library used by
2272 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
2273 IPython for variable expansion. If you want to access a true shell
2274 variable, an extra $ is necessary to prevent its expansion by IPython:
2274 variable, an extra $ is necessary to prevent its expansion by IPython:
2275
2275
2276 In [6]: alias show echo\\
2276 In [6]: alias show echo\\
2277 In [7]: PATH='A Python string'\\
2277 In [7]: PATH='A Python string'\\
2278 In [8]: show $PATH\\
2278 In [8]: show $PATH\\
2279 A Python string\\
2279 A Python string\\
2280 In [9]: show $$PATH\\
2280 In [9]: show $$PATH\\
2281 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2281 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2282
2282
2283 You can use the alias facility to acess all of $PATH. See the %rehash
2283 You can use the alias facility to acess all of $PATH. See the %rehash
2284 and %rehashx functions, which automatically create aliases for the
2284 and %rehashx functions, which automatically create aliases for the
2285 contents of your $PATH.
2285 contents of your $PATH.
2286
2286
2287 If called with no parameters, %alias prints the current alias table."""
2287 If called with no parameters, %alias prints the current alias table."""
2288
2288
2289 par = parameter_s.strip()
2289 par = parameter_s.strip()
2290 if not par:
2290 if not par:
2291 stored = self.db.get('stored_aliases', {} )
2291 stored = self.db.get('stored_aliases', {} )
2292 atab = self.shell.alias_table
2292 atab = self.shell.alias_table
2293 aliases = atab.keys()
2293 aliases = atab.keys()
2294 aliases.sort()
2294 aliases.sort()
2295 res = []
2295 res = []
2296 showlast = []
2296 showlast = []
2297 for alias in aliases:
2297 for alias in aliases:
2298 special = False
2298 special = False
2299 try:
2299 try:
2300 tgt = atab[alias][1]
2300 tgt = atab[alias][1]
2301 except (TypeError, AttributeError):
2301 except (TypeError, AttributeError):
2302 # unsubscriptable? probably a callable
2302 # unsubscriptable? probably a callable
2303 tgt = atab[alias]
2303 tgt = atab[alias]
2304 special = True
2304 special = True
2305 # 'interesting' aliases
2305 # 'interesting' aliases
2306 if (alias in stored or
2306 if (alias in stored or
2307 special or
2307 special or
2308 alias.lower() != os.path.splitext(tgt)[0].lower() or
2308 alias.lower() != os.path.splitext(tgt)[0].lower() or
2309 ' ' in tgt):
2309 ' ' in tgt):
2310 showlast.append((alias, tgt))
2310 showlast.append((alias, tgt))
2311 else:
2311 else:
2312 res.append((alias, tgt ))
2312 res.append((alias, tgt ))
2313
2313
2314 # show most interesting aliases last
2314 # show most interesting aliases last
2315 res.extend(showlast)
2315 res.extend(showlast)
2316 print "Total number of aliases:",len(aliases)
2316 print "Total number of aliases:",len(aliases)
2317 return res
2317 return res
2318 try:
2318 try:
2319 alias,cmd = par.split(None,1)
2319 alias,cmd = par.split(None,1)
2320 except:
2320 except:
2321 print OInspect.getdoc(self.magic_alias)
2321 print OInspect.getdoc(self.magic_alias)
2322 else:
2322 else:
2323 nargs = cmd.count('%s')
2323 nargs = cmd.count('%s')
2324 if nargs>0 and cmd.find('%l')>=0:
2324 if nargs>0 and cmd.find('%l')>=0:
2325 error('The %s and %l specifiers are mutually exclusive '
2325 error('The %s and %l specifiers are mutually exclusive '
2326 'in alias definitions.')
2326 'in alias definitions.')
2327 else: # all looks OK
2327 else: # all looks OK
2328 self.shell.alias_table[alias] = (nargs,cmd)
2328 self.shell.alias_table[alias] = (nargs,cmd)
2329 self.shell.alias_table_validate(verbose=0)
2329 self.shell.alias_table_validate(verbose=0)
2330 # end magic_alias
2330 # end magic_alias
2331
2331
2332 def magic_unalias(self, parameter_s = ''):
2332 def magic_unalias(self, parameter_s = ''):
2333 """Remove an alias"""
2333 """Remove an alias"""
2334
2334
2335 aname = parameter_s.strip()
2335 aname = parameter_s.strip()
2336 if aname in self.shell.alias_table:
2336 if aname in self.shell.alias_table:
2337 del self.shell.alias_table[aname]
2337 del self.shell.alias_table[aname]
2338 stored = self.db.get('stored_aliases', {} )
2338 stored = self.db.get('stored_aliases', {} )
2339 if aname in stored:
2339 if aname in stored:
2340 print "Removing %stored alias",aname
2340 print "Removing %stored alias",aname
2341 del stored[aname]
2341 del stored[aname]
2342 self.db['stored_aliases'] = stored
2342 self.db['stored_aliases'] = stored
2343
2343
2344
2344
2345 def magic_rehashx(self, parameter_s = ''):
2345 def magic_rehashx(self, parameter_s = ''):
2346 """Update the alias table with all executable files in $PATH.
2346 """Update the alias table with all executable files in $PATH.
2347
2347
2348 This version explicitly checks that every entry in $PATH is a file
2348 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.
2349 with execute access (os.X_OK), so it is much slower than %rehash.
2350
2350
2351 Under Windows, it checks executability as a match agains a
2351 Under Windows, it checks executability as a match agains a
2352 '|'-separated string of extensions, stored in the IPython config
2352 '|'-separated string of extensions, stored in the IPython config
2353 variable win_exec_ext. This defaults to 'exe|com|bat'.
2353 variable win_exec_ext. This defaults to 'exe|com|bat'.
2354
2354
2355 This function also resets the root module cache of module completer,
2355 This function also resets the root module cache of module completer,
2356 used on slow filesystems.
2356 used on slow filesystems.
2357 """
2357 """
2358
2358
2359
2359
2360 ip = self.api
2360 ip = self.api
2361
2361
2362 # for the benefit of module completer in ipy_completers.py
2362 # for the benefit of module completer in ipy_completers.py
2363 del ip.db['rootmodules']
2363 del ip.db['rootmodules']
2364
2364
2365 path = [os.path.abspath(os.path.expanduser(p)) for p in
2365 path = [os.path.abspath(os.path.expanduser(p)) for p in
2366 os.environ.get('PATH','').split(os.pathsep)]
2366 os.environ.get('PATH','').split(os.pathsep)]
2367 path = filter(os.path.isdir,path)
2367 path = filter(os.path.isdir,path)
2368
2368
2369 alias_table = self.shell.alias_table
2369 alias_table = self.shell.alias_table
2370 syscmdlist = []
2370 syscmdlist = []
2371 if os.name == 'posix':
2371 if os.name == 'posix':
2372 isexec = lambda fname:os.path.isfile(fname) and \
2372 isexec = lambda fname:os.path.isfile(fname) and \
2373 os.access(fname,os.X_OK)
2373 os.access(fname,os.X_OK)
2374 else:
2374 else:
2375
2375
2376 try:
2376 try:
2377 winext = os.environ['pathext'].replace(';','|').replace('.','')
2377 winext = os.environ['pathext'].replace(';','|').replace('.','')
2378 except KeyError:
2378 except KeyError:
2379 winext = 'exe|com|bat|py'
2379 winext = 'exe|com|bat|py'
2380 if 'py' not in winext:
2380 if 'py' not in winext:
2381 winext += '|py'
2381 winext += '|py'
2382 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2382 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2383 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2383 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2384 savedir = os.getcwd()
2384 savedir = os.getcwd()
2385 try:
2385 try:
2386 # write the whole loop for posix/Windows so we don't have an if in
2386 # write the whole loop for posix/Windows so we don't have an if in
2387 # the innermost part
2387 # the innermost part
2388 if os.name == 'posix':
2388 if os.name == 'posix':
2389 for pdir in path:
2389 for pdir in path:
2390 os.chdir(pdir)
2390 os.chdir(pdir)
2391 for ff in os.listdir(pdir):
2391 for ff in os.listdir(pdir):
2392 if isexec(ff) and ff not in self.shell.no_alias:
2392 if isexec(ff) and ff not in self.shell.no_alias:
2393 # each entry in the alias table must be (N,name),
2393 # each entry in the alias table must be (N,name),
2394 # where N is the number of positional arguments of the
2394 # where N is the number of positional arguments of the
2395 # alias.
2395 # alias.
2396 alias_table[ff] = (0,ff)
2396 alias_table[ff] = (0,ff)
2397 syscmdlist.append(ff)
2397 syscmdlist.append(ff)
2398 else:
2398 else:
2399 for pdir in path:
2399 for pdir in path:
2400 os.chdir(pdir)
2400 os.chdir(pdir)
2401 for ff in os.listdir(pdir):
2401 for ff in os.listdir(pdir):
2402 base, ext = os.path.splitext(ff)
2402 base, ext = os.path.splitext(ff)
2403 if isexec(ff) and base not in self.shell.no_alias:
2403 if isexec(ff) and base not in self.shell.no_alias:
2404 if ext.lower() == '.exe':
2404 if ext.lower() == '.exe':
2405 ff = base
2405 ff = base
2406 alias_table[base.lower()] = (0,ff)
2406 alias_table[base.lower()] = (0,ff)
2407 syscmdlist.append(ff)
2407 syscmdlist.append(ff)
2408 # Make sure the alias table doesn't contain keywords or builtins
2408 # Make sure the alias table doesn't contain keywords or builtins
2409 self.shell.alias_table_validate()
2409 self.shell.alias_table_validate()
2410 # Call again init_auto_alias() so we get 'rm -i' and other
2410 # Call again init_auto_alias() so we get 'rm -i' and other
2411 # modified aliases since %rehashx will probably clobber them
2411 # modified aliases since %rehashx will probably clobber them
2412
2412
2413 # no, we don't want them. if %rehashx clobbers them, good,
2413 # no, we don't want them. if %rehashx clobbers them, good,
2414 # we'll probably get better versions
2414 # we'll probably get better versions
2415 # self.shell.init_auto_alias()
2415 # self.shell.init_auto_alias()
2416 db = ip.db
2416 db = ip.db
2417 db['syscmdlist'] = syscmdlist
2417 db['syscmdlist'] = syscmdlist
2418 finally:
2418 finally:
2419 os.chdir(savedir)
2419 os.chdir(savedir)
2420
2420
2421 def magic_pwd(self, parameter_s = ''):
2421 def magic_pwd(self, parameter_s = ''):
2422 """Return the current working directory path."""
2422 """Return the current working directory path."""
2423 return os.getcwd()
2423 return os.getcwd()
2424
2424
2425 def magic_cd(self, parameter_s=''):
2425 def magic_cd(self, parameter_s=''):
2426 """Change the current working directory.
2426 """Change the current working directory.
2427
2427
2428 This command automatically maintains an internal list of directories
2428 This command automatically maintains an internal list of directories
2429 you visit during your IPython session, in the variable _dh. The
2429 you visit during your IPython session, in the variable _dh. The
2430 command %dhist shows this history nicely formatted. You can also
2430 command %dhist shows this history nicely formatted. You can also
2431 do 'cd -<tab>' to see directory history conveniently.
2431 do 'cd -<tab>' to see directory history conveniently.
2432
2432
2433 Usage:
2433 Usage:
2434
2434
2435 cd 'dir': changes to directory 'dir'.
2435 cd 'dir': changes to directory 'dir'.
2436
2436
2437 cd -: changes to the last visited directory.
2437 cd -: changes to the last visited directory.
2438
2438
2439 cd -<n>: changes to the n-th directory in the directory history.
2439 cd -<n>: changes to the n-th directory in the directory history.
2440
2440
2441 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2441 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2442 (note: cd <bookmark_name> is enough if there is no
2442 (note: cd <bookmark_name> is enough if there is no
2443 directory <bookmark_name>, but a bookmark with the name exists.)
2443 directory <bookmark_name>, but a bookmark with the name exists.)
2444 'cd -b <tab>' allows you to tab-complete bookmark names.
2444 'cd -b <tab>' allows you to tab-complete bookmark names.
2445
2445
2446 Options:
2446 Options:
2447
2447
2448 -q: quiet. Do not print the working directory after the cd command is
2448 -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,
2449 executed. By default IPython's cd command does print this directory,
2450 since the default prompts do not display path information.
2450 since the default prompts do not display path information.
2451
2451
2452 Note that !cd doesn't work for this purpose because the shell where
2452 Note that !cd doesn't work for this purpose because the shell where
2453 !command runs is immediately discarded after executing 'command'."""
2453 !command runs is immediately discarded after executing 'command'."""
2454
2454
2455 parameter_s = parameter_s.strip()
2455 parameter_s = parameter_s.strip()
2456 #bkms = self.shell.persist.get("bookmarks",{})
2456 #bkms = self.shell.persist.get("bookmarks",{})
2457
2457
2458 numcd = re.match(r'(-)(\d+)$',parameter_s)
2458 numcd = re.match(r'(-)(\d+)$',parameter_s)
2459 # jump in directory history by number
2459 # jump in directory history by number
2460 if numcd:
2460 if numcd:
2461 nn = int(numcd.group(2))
2461 nn = int(numcd.group(2))
2462 try:
2462 try:
2463 ps = self.shell.user_ns['_dh'][nn]
2463 ps = self.shell.user_ns['_dh'][nn]
2464 except IndexError:
2464 except IndexError:
2465 print 'The requested directory does not exist in history.'
2465 print 'The requested directory does not exist in history.'
2466 return
2466 return
2467 else:
2467 else:
2468 opts = {}
2468 opts = {}
2469 else:
2469 else:
2470 #turn all non-space-escaping backslashes to slashes,
2470 #turn all non-space-escaping backslashes to slashes,
2471 # for c:\windows\directory\names\
2471 # for c:\windows\directory\names\
2472 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2472 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2473 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2473 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2474 # jump to previous
2474 # jump to previous
2475 if ps == '-':
2475 if ps == '-':
2476 try:
2476 try:
2477 ps = self.shell.user_ns['_dh'][-2]
2477 ps = self.shell.user_ns['_dh'][-2]
2478 except IndexError:
2478 except IndexError:
2479 print 'No previous directory to change to.'
2479 print 'No previous directory to change to.'
2480 return
2480 return
2481 # jump to bookmark if needed
2481 # jump to bookmark if needed
2482 else:
2482 else:
2483 if not os.path.isdir(ps) or opts.has_key('b'):
2483 if not os.path.isdir(ps) or opts.has_key('b'):
2484 bkms = self.db.get('bookmarks', {})
2484 bkms = self.db.get('bookmarks', {})
2485
2485
2486 if bkms.has_key(ps):
2486 if bkms.has_key(ps):
2487 target = bkms[ps]
2487 target = bkms[ps]
2488 print '(bookmark:%s) -> %s' % (ps,target)
2488 print '(bookmark:%s) -> %s' % (ps,target)
2489 ps = target
2489 ps = target
2490 else:
2490 else:
2491 if opts.has_key('b'):
2491 if opts.has_key('b'):
2492 error("Bookmark '%s' not found. "
2492 error("Bookmark '%s' not found. "
2493 "Use '%%bookmark -l' to see your bookmarks." % ps)
2493 "Use '%%bookmark -l' to see your bookmarks." % ps)
2494 return
2494 return
2495
2495
2496 # at this point ps should point to the target dir
2496 # at this point ps should point to the target dir
2497 if ps:
2497 if ps:
2498 try:
2498 try:
2499 os.chdir(os.path.expanduser(ps))
2499 os.chdir(os.path.expanduser(ps))
2500 if self.shell.rc.term_title:
2500 if self.shell.rc.term_title:
2501 #print 'set term title:',self.shell.rc.term_title # dbg
2501 #print 'set term title:',self.shell.rc.term_title # dbg
2502 ttitle = 'IPy ' + abbrev_cwd()
2502 ttitle = 'IPy ' + abbrev_cwd()
2503 platutils.set_term_title(ttitle)
2503 platutils.set_term_title(ttitle)
2504 except OSError:
2504 except OSError:
2505 print sys.exc_info()[1]
2505 print sys.exc_info()[1]
2506 else:
2506 else:
2507 cwd = os.getcwd()
2507 cwd = os.getcwd()
2508 dhist = self.shell.user_ns['_dh']
2508 dhist = self.shell.user_ns['_dh']
2509 dhist.append(cwd)
2509 dhist.append(cwd)
2510 self.db['dhist'] = compress_dhist(dhist)[-100:]
2510 self.db['dhist'] = compress_dhist(dhist)[-100:]
2511
2511
2512 else:
2512 else:
2513 os.chdir(self.shell.home_dir)
2513 os.chdir(self.shell.home_dir)
2514 if self.shell.rc.term_title:
2514 if self.shell.rc.term_title:
2515 platutils.set_term_title("IPy ~")
2515 platutils.set_term_title("IPy ~")
2516 cwd = os.getcwd()
2516 cwd = os.getcwd()
2517 dhist = self.shell.user_ns['_dh']
2517 dhist = self.shell.user_ns['_dh']
2518 dhist.append(cwd)
2518 dhist.append(cwd)
2519 self.db['dhist'] = compress_dhist(dhist)[-100:]
2519 self.db['dhist'] = compress_dhist(dhist)[-100:]
2520 if not 'q' in opts:
2520 if not 'q' in opts and self.shell.user_ns['_dh']:
2521 print self.shell.user_ns['_dh'][-1]
2521 print self.shell.user_ns['_dh'][-1]
2522
2522
2523
2523
2524 def magic_env(self, parameter_s=''):
2524 def magic_env(self, parameter_s=''):
2525 """List environment variables."""
2525 """List environment variables."""
2526
2526
2527 return os.environ.data
2527 return os.environ.data
2528
2528
2529 def magic_pushd(self, parameter_s=''):
2529 def magic_pushd(self, parameter_s=''):
2530 """Place the current dir on stack and change directory.
2530 """Place the current dir on stack and change directory.
2531
2531
2532 Usage:\\
2532 Usage:\\
2533 %pushd ['dirname']
2533 %pushd ['dirname']
2534
2534
2535 %pushd with no arguments does a %pushd to your home directory.
2535 %pushd with no arguments does a %pushd to your home directory.
2536 """
2536 """
2537 if parameter_s == '': parameter_s = '~'
2537 if parameter_s == '': parameter_s = '~'
2538 dir_s = self.shell.dir_stack
2538 dir_s = self.shell.dir_stack
2539 if len(dir_s)>0 and os.path.expanduser(parameter_s) != \
2539 if len(dir_s)>0 and os.path.expanduser(parameter_s) != \
2540 os.path.expanduser(self.shell.dir_stack[0]):
2540 os.path.expanduser(self.shell.dir_stack[0]):
2541 try:
2541 try:
2542 self.magic_cd(parameter_s)
2542 self.magic_cd(parameter_s)
2543 dir_s.insert(0,os.getcwd().replace(self.home_dir,'~'))
2543 dir_s.insert(0,os.getcwd().replace(self.home_dir,'~'))
2544 self.magic_dirs()
2544 self.magic_dirs()
2545 except:
2545 except:
2546 print 'Invalid directory'
2546 print 'Invalid directory'
2547 else:
2547 else:
2548 print 'You are already there!'
2548 print 'You are already there!'
2549
2549
2550 def magic_popd(self, parameter_s=''):
2550 def magic_popd(self, parameter_s=''):
2551 """Change to directory popped off the top of the stack.
2551 """Change to directory popped off the top of the stack.
2552 """
2552 """
2553 if len (self.shell.dir_stack) > 1:
2553 if len (self.shell.dir_stack) > 1:
2554 self.shell.dir_stack.pop(0)
2554 self.shell.dir_stack.pop(0)
2555 self.magic_cd(self.shell.dir_stack[0])
2555 self.magic_cd(self.shell.dir_stack[0])
2556 print self.shell.dir_stack[0]
2556 print self.shell.dir_stack[0]
2557 else:
2557 else:
2558 print "You can't remove the starting directory from the stack:",\
2558 print "You can't remove the starting directory from the stack:",\
2559 self.shell.dir_stack
2559 self.shell.dir_stack
2560
2560
2561 def magic_dirs(self, parameter_s=''):
2561 def magic_dirs(self, parameter_s=''):
2562 """Return the current directory stack."""
2562 """Return the current directory stack."""
2563
2563
2564 return self.shell.dir_stack[:]
2564 return self.shell.dir_stack[:]
2565
2565
2566 def magic_sc(self, parameter_s=''):
2566 def magic_sc(self, parameter_s=''):
2567 """Shell capture - execute a shell command and capture its output.
2567 """Shell capture - execute a shell command and capture its output.
2568
2568
2569 DEPRECATED. Suboptimal, retained for backwards compatibility.
2569 DEPRECATED. Suboptimal, retained for backwards compatibility.
2570
2570
2571 You should use the form 'var = !command' instead. Example:
2571 You should use the form 'var = !command' instead. Example:
2572
2572
2573 "%sc -l myfiles = ls ~" should now be written as
2573 "%sc -l myfiles = ls ~" should now be written as
2574
2574
2575 "myfiles = !ls ~"
2575 "myfiles = !ls ~"
2576
2576
2577 myfiles.s, myfiles.l and myfiles.n still apply as documented
2577 myfiles.s, myfiles.l and myfiles.n still apply as documented
2578 below.
2578 below.
2579
2579
2580 --
2580 --
2581 %sc [options] varname=command
2581 %sc [options] varname=command
2582
2582
2583 IPython will run the given command using commands.getoutput(), and
2583 IPython will run the given command using commands.getoutput(), and
2584 will then update the user's interactive namespace with a variable
2584 will then update the user's interactive namespace with a variable
2585 called varname, containing the value of the call. Your command can
2585 called varname, containing the value of the call. Your command can
2586 contain shell wildcards, pipes, etc.
2586 contain shell wildcards, pipes, etc.
2587
2587
2588 The '=' sign in the syntax is mandatory, and the variable name you
2588 The '=' sign in the syntax is mandatory, and the variable name you
2589 supply must follow Python's standard conventions for valid names.
2589 supply must follow Python's standard conventions for valid names.
2590
2590
2591 (A special format without variable name exists for internal use)
2591 (A special format without variable name exists for internal use)
2592
2592
2593 Options:
2593 Options:
2594
2594
2595 -l: list output. Split the output on newlines into a list before
2595 -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
2596 assigning it to the given variable. By default the output is stored
2597 as a single string.
2597 as a single string.
2598
2598
2599 -v: verbose. Print the contents of the variable.
2599 -v: verbose. Print the contents of the variable.
2600
2600
2601 In most cases you should not need to split as a list, because the
2601 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
2602 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
2603 provide its contents either as a list (split on newlines) or as a
2604 space-separated string. These are convenient, respectively, either
2604 space-separated string. These are convenient, respectively, either
2605 for sequential processing or to be passed to a shell command.
2605 for sequential processing or to be passed to a shell command.
2606
2606
2607 For example:
2607 For example:
2608
2608
2609 # Capture into variable a
2609 # Capture into variable a
2610 In [9]: sc a=ls *py
2610 In [9]: sc a=ls *py
2611
2611
2612 # a is a string with embedded newlines
2612 # a is a string with embedded newlines
2613 In [10]: a
2613 In [10]: a
2614 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2614 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2615
2615
2616 # which can be seen as a list:
2616 # which can be seen as a list:
2617 In [11]: a.l
2617 In [11]: a.l
2618 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2618 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2619
2619
2620 # or as a whitespace-separated string:
2620 # or as a whitespace-separated string:
2621 In [12]: a.s
2621 In [12]: a.s
2622 Out[12]: 'setup.py win32_manual_post_install.py'
2622 Out[12]: 'setup.py win32_manual_post_install.py'
2623
2623
2624 # a.s is useful to pass as a single command line:
2624 # a.s is useful to pass as a single command line:
2625 In [13]: !wc -l $a.s
2625 In [13]: !wc -l $a.s
2626 146 setup.py
2626 146 setup.py
2627 130 win32_manual_post_install.py
2627 130 win32_manual_post_install.py
2628 276 total
2628 276 total
2629
2629
2630 # while the list form is useful to loop over:
2630 # while the list form is useful to loop over:
2631 In [14]: for f in a.l:
2631 In [14]: for f in a.l:
2632 ....: !wc -l $f
2632 ....: !wc -l $f
2633 ....:
2633 ....:
2634 146 setup.py
2634 146 setup.py
2635 130 win32_manual_post_install.py
2635 130 win32_manual_post_install.py
2636
2636
2637 Similiarly, the lists returned by the -l option are also special, in
2637 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
2638 the sense that you can equally invoke the .s attribute on them to
2639 automatically get a whitespace-separated string from their contents:
2639 automatically get a whitespace-separated string from their contents:
2640
2640
2641 In [1]: sc -l b=ls *py
2641 In [1]: sc -l b=ls *py
2642
2642
2643 In [2]: b
2643 In [2]: b
2644 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2644 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2645
2645
2646 In [3]: b.s
2646 In [3]: b.s
2647 Out[3]: 'setup.py win32_manual_post_install.py'
2647 Out[3]: 'setup.py win32_manual_post_install.py'
2648
2648
2649 In summary, both the lists and strings used for ouptut capture have
2649 In summary, both the lists and strings used for ouptut capture have
2650 the following special attributes:
2650 the following special attributes:
2651
2651
2652 .l (or .list) : value as list.
2652 .l (or .list) : value as list.
2653 .n (or .nlstr): value as newline-separated string.
2653 .n (or .nlstr): value as newline-separated string.
2654 .s (or .spstr): value as space-separated string.
2654 .s (or .spstr): value as space-separated string.
2655 """
2655 """
2656
2656
2657 opts,args = self.parse_options(parameter_s,'lv')
2657 opts,args = self.parse_options(parameter_s,'lv')
2658 # Try to get a variable name and command to run
2658 # Try to get a variable name and command to run
2659 try:
2659 try:
2660 # the variable name must be obtained from the parse_options
2660 # the variable name must be obtained from the parse_options
2661 # output, which uses shlex.split to strip options out.
2661 # output, which uses shlex.split to strip options out.
2662 var,_ = args.split('=',1)
2662 var,_ = args.split('=',1)
2663 var = var.strip()
2663 var = var.strip()
2664 # But the the command has to be extracted from the original input
2664 # But the the command has to be extracted from the original input
2665 # parameter_s, not on what parse_options returns, to avoid the
2665 # parameter_s, not on what parse_options returns, to avoid the
2666 # quote stripping which shlex.split performs on it.
2666 # quote stripping which shlex.split performs on it.
2667 _,cmd = parameter_s.split('=',1)
2667 _,cmd = parameter_s.split('=',1)
2668 except ValueError:
2668 except ValueError:
2669 var,cmd = '',''
2669 var,cmd = '',''
2670 # If all looks ok, proceed
2670 # If all looks ok, proceed
2671 out,err = self.shell.getoutputerror(cmd)
2671 out,err = self.shell.getoutputerror(cmd)
2672 if err:
2672 if err:
2673 print >> Term.cerr,err
2673 print >> Term.cerr,err
2674 if opts.has_key('l'):
2674 if opts.has_key('l'):
2675 out = SList(out.split('\n'))
2675 out = SList(out.split('\n'))
2676 else:
2676 else:
2677 out = LSString(out)
2677 out = LSString(out)
2678 if opts.has_key('v'):
2678 if opts.has_key('v'):
2679 print '%s ==\n%s' % (var,pformat(out))
2679 print '%s ==\n%s' % (var,pformat(out))
2680 if var:
2680 if var:
2681 self.shell.user_ns.update({var:out})
2681 self.shell.user_ns.update({var:out})
2682 else:
2682 else:
2683 return out
2683 return out
2684
2684
2685 def magic_sx(self, parameter_s=''):
2685 def magic_sx(self, parameter_s=''):
2686 """Shell execute - run a shell command and capture its output.
2686 """Shell execute - run a shell command and capture its output.
2687
2687
2688 %sx command
2688 %sx command
2689
2689
2690 IPython will run the given command using commands.getoutput(), and
2690 IPython will run the given command using commands.getoutput(), and
2691 return the result formatted as a list (split on '\\n'). Since the
2691 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
2692 output is _returned_, it will be stored in ipython's regular output
2693 cache Out[N] and in the '_N' automatic variables.
2693 cache Out[N] and in the '_N' automatic variables.
2694
2694
2695 Notes:
2695 Notes:
2696
2696
2697 1) If an input line begins with '!!', then %sx is automatically
2697 1) If an input line begins with '!!', then %sx is automatically
2698 invoked. That is, while:
2698 invoked. That is, while:
2699 !ls
2699 !ls
2700 causes ipython to simply issue system('ls'), typing
2700 causes ipython to simply issue system('ls'), typing
2701 !!ls
2701 !!ls
2702 is a shorthand equivalent to:
2702 is a shorthand equivalent to:
2703 %sx ls
2703 %sx ls
2704
2704
2705 2) %sx differs from %sc in that %sx automatically splits into a list,
2705 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
2706 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.
2707 to process line-oriented shell output via further python commands.
2708 %sc is meant to provide much finer control, but requires more
2708 %sc is meant to provide much finer control, but requires more
2709 typing.
2709 typing.
2710
2710
2711 3) Just like %sc -l, this is a list with special attributes:
2711 3) Just like %sc -l, this is a list with special attributes:
2712
2712
2713 .l (or .list) : value as list.
2713 .l (or .list) : value as list.
2714 .n (or .nlstr): value as newline-separated string.
2714 .n (or .nlstr): value as newline-separated string.
2715 .s (or .spstr): value as whitespace-separated string.
2715 .s (or .spstr): value as whitespace-separated string.
2716
2716
2717 This is very useful when trying to use such lists as arguments to
2717 This is very useful when trying to use such lists as arguments to
2718 system commands."""
2718 system commands."""
2719
2719
2720 if parameter_s:
2720 if parameter_s:
2721 out,err = self.shell.getoutputerror(parameter_s)
2721 out,err = self.shell.getoutputerror(parameter_s)
2722 if err:
2722 if err:
2723 print >> Term.cerr,err
2723 print >> Term.cerr,err
2724 return SList(out.split('\n'))
2724 return SList(out.split('\n'))
2725
2725
2726 def magic_bg(self, parameter_s=''):
2726 def magic_bg(self, parameter_s=''):
2727 """Run a job in the background, in a separate thread.
2727 """Run a job in the background, in a separate thread.
2728
2728
2729 For example,
2729 For example,
2730
2730
2731 %bg myfunc(x,y,z=1)
2731 %bg myfunc(x,y,z=1)
2732
2732
2733 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2733 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
2734 execution starts, a message will be printed indicating the job
2735 number. If your job number is 5, you can use
2735 number. If your job number is 5, you can use
2736
2736
2737 myvar = jobs.result(5) or myvar = jobs[5].result
2737 myvar = jobs.result(5) or myvar = jobs[5].result
2738
2738
2739 to assign this result to variable 'myvar'.
2739 to assign this result to variable 'myvar'.
2740
2740
2741 IPython has a job manager, accessible via the 'jobs' object. You can
2741 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
2742 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
2743 its attributes. All attributes not starting with an underscore are
2744 meant for public use.
2744 meant for public use.
2745
2745
2746 In particular, look at the jobs.new() method, which is used to create
2746 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
2747 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
2748 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
2749 new job with an explicit function object and arguments, you must call
2750 jobs.new() directly.
2750 jobs.new() directly.
2751
2751
2752 The jobs.new docstring also describes in detail several important
2752 The jobs.new docstring also describes in detail several important
2753 caveats associated with a thread-based model for background job
2753 caveats associated with a thread-based model for background job
2754 execution. Type jobs.new? for details.
2754 execution. Type jobs.new? for details.
2755
2755
2756 You can check the status of all jobs with jobs.status().
2756 You can check the status of all jobs with jobs.status().
2757
2757
2758 The jobs variable is set by IPython into the Python builtin namespace.
2758 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
2759 If you ever declare a variable named 'jobs', you will shadow this
2760 name. You can either delete your global jobs variable to regain
2760 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
2761 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
2762 to the manager (stored in IPython's namespace). For example, to
2763 assign the job manager to the Jobs name, use:
2763 assign the job manager to the Jobs name, use:
2764
2764
2765 Jobs = __builtins__.jobs"""
2765 Jobs = __builtins__.jobs"""
2766
2766
2767 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2767 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2768
2768
2769
2769
2770 def magic_bookmark(self, parameter_s=''):
2770 def magic_bookmark(self, parameter_s=''):
2771 """Manage IPython's bookmark system.
2771 """Manage IPython's bookmark system.
2772
2772
2773 %bookmark <name> - set bookmark to current dir
2773 %bookmark <name> - set bookmark to current dir
2774 %bookmark <name> <dir> - set bookmark to <dir>
2774 %bookmark <name> <dir> - set bookmark to <dir>
2775 %bookmark -l - list all bookmarks
2775 %bookmark -l - list all bookmarks
2776 %bookmark -d <name> - remove bookmark
2776 %bookmark -d <name> - remove bookmark
2777 %bookmark -r - remove all bookmarks
2777 %bookmark -r - remove all bookmarks
2778
2778
2779 You can later on access a bookmarked folder with:
2779 You can later on access a bookmarked folder with:
2780 %cd -b <name>
2780 %cd -b <name>
2781 or simply '%cd <name>' if there is no directory called <name> AND
2781 or simply '%cd <name>' if there is no directory called <name> AND
2782 there is such a bookmark defined.
2782 there is such a bookmark defined.
2783
2783
2784 Your bookmarks persist through IPython sessions, but they are
2784 Your bookmarks persist through IPython sessions, but they are
2785 associated with each profile."""
2785 associated with each profile."""
2786
2786
2787 opts,args = self.parse_options(parameter_s,'drl',mode='list')
2787 opts,args = self.parse_options(parameter_s,'drl',mode='list')
2788 if len(args) > 2:
2788 if len(args) > 2:
2789 error('You can only give at most two arguments')
2789 error('You can only give at most two arguments')
2790 return
2790 return
2791
2791
2792 bkms = self.db.get('bookmarks',{})
2792 bkms = self.db.get('bookmarks',{})
2793
2793
2794 if opts.has_key('d'):
2794 if opts.has_key('d'):
2795 try:
2795 try:
2796 todel = args[0]
2796 todel = args[0]
2797 except IndexError:
2797 except IndexError:
2798 error('You must provide a bookmark to delete')
2798 error('You must provide a bookmark to delete')
2799 else:
2799 else:
2800 try:
2800 try:
2801 del bkms[todel]
2801 del bkms[todel]
2802 except:
2802 except:
2803 error("Can't delete bookmark '%s'" % todel)
2803 error("Can't delete bookmark '%s'" % todel)
2804 elif opts.has_key('r'):
2804 elif opts.has_key('r'):
2805 bkms = {}
2805 bkms = {}
2806 elif opts.has_key('l'):
2806 elif opts.has_key('l'):
2807 bks = bkms.keys()
2807 bks = bkms.keys()
2808 bks.sort()
2808 bks.sort()
2809 if bks:
2809 if bks:
2810 size = max(map(len,bks))
2810 size = max(map(len,bks))
2811 else:
2811 else:
2812 size = 0
2812 size = 0
2813 fmt = '%-'+str(size)+'s -> %s'
2813 fmt = '%-'+str(size)+'s -> %s'
2814 print 'Current bookmarks:'
2814 print 'Current bookmarks:'
2815 for bk in bks:
2815 for bk in bks:
2816 print fmt % (bk,bkms[bk])
2816 print fmt % (bk,bkms[bk])
2817 else:
2817 else:
2818 if not args:
2818 if not args:
2819 error("You must specify the bookmark name")
2819 error("You must specify the bookmark name")
2820 elif len(args)==1:
2820 elif len(args)==1:
2821 bkms[args[0]] = os.getcwd()
2821 bkms[args[0]] = os.getcwd()
2822 elif len(args)==2:
2822 elif len(args)==2:
2823 bkms[args[0]] = args[1]
2823 bkms[args[0]] = args[1]
2824 self.db['bookmarks'] = bkms
2824 self.db['bookmarks'] = bkms
2825
2825
2826 def magic_pycat(self, parameter_s=''):
2826 def magic_pycat(self, parameter_s=''):
2827 """Show a syntax-highlighted file through a pager.
2827 """Show a syntax-highlighted file through a pager.
2828
2828
2829 This magic is similar to the cat utility, but it will assume the file
2829 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. """
2830 to be Python source and will show it with syntax highlighting. """
2831
2831
2832 try:
2832 try:
2833 filename = get_py_filename(parameter_s)
2833 filename = get_py_filename(parameter_s)
2834 cont = file_read(filename)
2834 cont = file_read(filename)
2835 except IOError:
2835 except IOError:
2836 try:
2836 try:
2837 cont = eval(parameter_s,self.user_ns)
2837 cont = eval(parameter_s,self.user_ns)
2838 except NameError:
2838 except NameError:
2839 cont = None
2839 cont = None
2840 if cont is None:
2840 if cont is None:
2841 print "Error: no such file or variable"
2841 print "Error: no such file or variable"
2842 return
2842 return
2843
2843
2844 page(self.shell.pycolorize(cont),
2844 page(self.shell.pycolorize(cont),
2845 screen_lines=self.shell.rc.screen_length)
2845 screen_lines=self.shell.rc.screen_length)
2846
2846
2847 def magic_cpaste(self, parameter_s=''):
2847 def magic_cpaste(self, parameter_s=''):
2848 """Allows you to paste & execute a pre-formatted code block from clipboard
2848 """Allows you to paste & execute a pre-formatted code block from clipboard
2849
2849
2850 You must terminate the block with '--' (two minus-signs) alone on the
2850 You must terminate the block with '--' (two minus-signs) alone on the
2851 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
2851 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
2852 is the new sentinel for this operation)
2852 is the new sentinel for this operation)
2853
2853
2854 The block is dedented prior to execution to enable execution of method
2854 The block is dedented prior to execution to enable execution of method
2855 definitions. '>' and '+' characters at the beginning of a line are
2855 definitions. '>' and '+' characters at the beginning of a line are
2856 ignored, to allow pasting directly from e-mails or diff files. The
2856 ignored, to allow pasting directly from e-mails or diff files. The
2857 executed block is also assigned to variable named 'pasted_block' for
2857 executed block is also assigned to variable named 'pasted_block' for
2858 later editing with '%edit pasted_block'.
2858 later editing with '%edit pasted_block'.
2859
2859
2860 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
2860 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
2861 This assigns the pasted block to variable 'foo' as string, without
2862 dedenting or executing it.
2862 dedenting or executing it.
2863
2863
2864 Do not be alarmed by garbled output on Windows (it's a readline bug).
2864 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
2865 Just press enter and type -- (and press enter again) and the block
2866 will be what was just pasted.
2866 will be what was just pasted.
2867
2867
2868 IPython statements (magics, shell escapes) are not supported (yet).
2868 IPython statements (magics, shell escapes) are not supported (yet).
2869 """
2869 """
2870 opts,args = self.parse_options(parameter_s,'s:',mode='string')
2870 opts,args = self.parse_options(parameter_s,'s:',mode='string')
2871 par = args.strip()
2871 par = args.strip()
2872 sentinel = opts.get('s','--')
2872 sentinel = opts.get('s','--')
2873
2873
2874 from IPython import iplib
2874 from IPython import iplib
2875 lines = []
2875 lines = []
2876 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
2876 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
2877 while 1:
2877 while 1:
2878 l = iplib.raw_input_original(':')
2878 l = iplib.raw_input_original(':')
2879 if l ==sentinel:
2879 if l ==sentinel:
2880 break
2880 break
2881 lines.append(l.lstrip('>').lstrip('+'))
2881 lines.append(l.lstrip('>').lstrip('+'))
2882 block = "\n".join(lines) + '\n'
2882 block = "\n".join(lines) + '\n'
2883 #print "block:\n",block
2883 #print "block:\n",block
2884 if not par:
2884 if not par:
2885 b = textwrap.dedent(block)
2885 b = textwrap.dedent(block)
2886 exec b in self.user_ns
2886 exec b in self.user_ns
2887 self.user_ns['pasted_block'] = b
2887 self.user_ns['pasted_block'] = b
2888 else:
2888 else:
2889 self.user_ns[par] = block
2889 self.user_ns[par] = block
2890 print "Block assigned to '%s'" % par
2890 print "Block assigned to '%s'" % par
2891
2891
2892 def magic_quickref(self,arg):
2892 def magic_quickref(self,arg):
2893 """ Show a quick reference sheet """
2893 """ Show a quick reference sheet """
2894 import IPython.usage
2894 import IPython.usage
2895 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
2895 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
2896
2896
2897 page(qr)
2897 page(qr)
2898
2898
2899 def magic_upgrade(self,arg):
2899 def magic_upgrade(self,arg):
2900 """ Upgrade your IPython installation
2900 """ Upgrade your IPython installation
2901
2901
2902 This will copy the config files that don't yet exist in your
2902 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
2903 ipython dir from the system config dir. Use this after upgrading
2904 IPython if you don't wish to delete your .ipython dir.
2904 IPython if you don't wish to delete your .ipython dir.
2905
2905
2906 Call with -nolegacy to get rid of ipythonrc* files (recommended for
2906 Call with -nolegacy to get rid of ipythonrc* files (recommended for
2907 new users)
2907 new users)
2908
2908
2909 """
2909 """
2910 ip = self.getapi()
2910 ip = self.getapi()
2911 ipinstallation = path(IPython.__file__).dirname()
2911 ipinstallation = path(IPython.__file__).dirname()
2912 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
2912 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
2913 src_config = ipinstallation / 'UserConfig'
2913 src_config = ipinstallation / 'UserConfig'
2914 userdir = path(ip.options.ipythondir)
2914 userdir = path(ip.options.ipythondir)
2915 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
2915 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
2916 print ">",cmd
2916 print ">",cmd
2917 shell(cmd)
2917 shell(cmd)
2918 if arg == '-nolegacy':
2918 if arg == '-nolegacy':
2919 legacy = userdir.files('ipythonrc*')
2919 legacy = userdir.files('ipythonrc*')
2920 print "Nuking legacy files:",legacy
2920 print "Nuking legacy files:",legacy
2921
2921
2922 [p.remove() for p in legacy]
2922 [p.remove() for p in legacy]
2923 suffix = (sys.platform == 'win32' and '.ini' or '')
2923 suffix = (sys.platform == 'win32' and '.ini' or '')
2924 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
2924 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
2925
2925
2926
2926
2927 def magic_doctest_mode(self,parameter_s=''):
2927 def magic_doctest_mode(self,parameter_s=''):
2928 """Toggle doctest mode on and off.
2928 """Toggle doctest mode on and off.
2929
2929
2930 This mode allows you to toggle the prompt behavior between normal
2930 This mode allows you to toggle the prompt behavior between normal
2931 IPython prompts and ones that are as similar to the default IPython
2931 IPython prompts and ones that are as similar to the default IPython
2932 interpreter as possible.
2932 interpreter as possible.
2933
2933
2934 It also supports the pasting of code snippets that have leading '>>>'
2934 It also supports the pasting of code snippets that have leading '>>>'
2935 and '...' prompts in them. This means that you can paste doctests from
2935 and '...' prompts in them. This means that you can paste doctests from
2936 files or docstrings (even if they have leading whitespace), and the
2936 files or docstrings (even if they have leading whitespace), and the
2937 code will execute correctly. You can then use '%history -tn' to see
2937 code will execute correctly. You can then use '%history -tn' to see
2938 the translated history without line numbers; this will give you the
2938 the translated history without line numbers; this will give you the
2939 input after removal of all the leading prompts and whitespace, which
2939 input after removal of all the leading prompts and whitespace, which
2940 can be pasted back into an editor.
2940 can be pasted back into an editor.
2941
2941
2942 With these features, you can switch into this mode easily whenever you
2942 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
2943 need to do testing and changes to doctests, without having to leave
2944 your existing IPython session.
2944 your existing IPython session.
2945 """
2945 """
2946
2946
2947 # XXX - Fix this to have cleaner activate/deactivate calls.
2947 # XXX - Fix this to have cleaner activate/deactivate calls.
2948 from IPython.Extensions import InterpreterPasteInput as ipaste
2948 from IPython.Extensions import InterpreterPasteInput as ipaste
2949 from IPython.ipstruct import Struct
2949 from IPython.ipstruct import Struct
2950
2950
2951 # Shorthands
2951 # Shorthands
2952 shell = self.shell
2952 shell = self.shell
2953 oc = shell.outputcache
2953 oc = shell.outputcache
2954 rc = shell.rc
2954 rc = shell.rc
2955 meta = shell.meta
2955 meta = shell.meta
2956 # dstore is a data store kept in the instance metadata bag to track any
2956 # dstore is a data store kept in the instance metadata bag to track any
2957 # changes we make, so we can undo them later.
2957 # changes we make, so we can undo them later.
2958 dstore = meta.setdefault('doctest_mode',Struct())
2958 dstore = meta.setdefault('doctest_mode',Struct())
2959 save_dstore = dstore.setdefault
2959 save_dstore = dstore.setdefault
2960
2960
2961 # save a few values we'll need to recover later
2961 # save a few values we'll need to recover later
2962 mode = save_dstore('mode',False)
2962 mode = save_dstore('mode',False)
2963 save_dstore('rc_pprint',rc.pprint)
2963 save_dstore('rc_pprint',rc.pprint)
2964 save_dstore('xmode',shell.InteractiveTB.mode)
2964 save_dstore('xmode',shell.InteractiveTB.mode)
2965 save_dstore('rc_separate_in',rc.separate_in)
2965 save_dstore('rc_separate_in',rc.separate_in)
2966 save_dstore('rc_separate_out',rc.separate_out)
2966 save_dstore('rc_separate_out',rc.separate_out)
2967 save_dstore('rc_separate_out2',rc.separate_out2)
2967 save_dstore('rc_separate_out2',rc.separate_out2)
2968 save_dstore('rc_prompts_pad_left',rc.prompts_pad_left)
2968 save_dstore('rc_prompts_pad_left',rc.prompts_pad_left)
2969
2969
2970 if mode == False:
2970 if mode == False:
2971 # turn on
2971 # turn on
2972 ipaste.activate_prefilter()
2972 ipaste.activate_prefilter()
2973
2973
2974 oc.prompt1.p_template = '>>> '
2974 oc.prompt1.p_template = '>>> '
2975 oc.prompt2.p_template = '... '
2975 oc.prompt2.p_template = '... '
2976 oc.prompt_out.p_template = ''
2976 oc.prompt_out.p_template = ''
2977
2977
2978 oc.prompt1.sep = '\n'
2978 oc.prompt1.sep = '\n'
2979 oc.output_sep = ''
2979 oc.output_sep = ''
2980 oc.output_sep2 = ''
2980 oc.output_sep2 = ''
2981
2981
2982 oc.prompt1.pad_left = oc.prompt2.pad_left = \
2982 oc.prompt1.pad_left = oc.prompt2.pad_left = \
2983 oc.prompt_out.pad_left = False
2983 oc.prompt_out.pad_left = False
2984
2984
2985 rc.pprint = False
2985 rc.pprint = False
2986
2986
2987 shell.magic_xmode('Plain')
2987 shell.magic_xmode('Plain')
2988
2988
2989 else:
2989 else:
2990 # turn off
2990 # turn off
2991 ipaste.deactivate_prefilter()
2991 ipaste.deactivate_prefilter()
2992
2992
2993 oc.prompt1.p_template = rc.prompt_in1
2993 oc.prompt1.p_template = rc.prompt_in1
2994 oc.prompt2.p_template = rc.prompt_in2
2994 oc.prompt2.p_template = rc.prompt_in2
2995 oc.prompt_out.p_template = rc.prompt_out
2995 oc.prompt_out.p_template = rc.prompt_out
2996
2996
2997 oc.prompt1.sep = dstore.rc_separate_in
2997 oc.prompt1.sep = dstore.rc_separate_in
2998 oc.output_sep = dstore.rc_separate_out
2998 oc.output_sep = dstore.rc_separate_out
2999 oc.output_sep2 = dstore.rc_separate_out2
2999 oc.output_sep2 = dstore.rc_separate_out2
3000
3000
3001 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3001 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3002 oc.prompt_out.pad_left = dstore.rc_prompts_pad_left
3002 oc.prompt_out.pad_left = dstore.rc_prompts_pad_left
3003
3003
3004 rc.pprint = dstore.rc_pprint
3004 rc.pprint = dstore.rc_pprint
3005
3005
3006 shell.magic_xmode(dstore.xmode)
3006 shell.magic_xmode(dstore.xmode)
3007
3007
3008 # Store new mode and inform
3008 # Store new mode and inform
3009 dstore.mode = bool(1-int(mode))
3009 dstore.mode = bool(1-int(mode))
3010 print 'Doctest mode is:',
3010 print 'Doctest mode is:',
3011 print ['OFF','ON'][dstore.mode]
3011 print ['OFF','ON'][dstore.mode]
3012
3012
3013 # end Magic
3013 # end Magic
@@ -1,7061 +1,7065 b''
1 2007-08-27 Ville Vainio <vivainio@gmail.com>
2
3 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
4
1 2007-08-26 Ville Vainio <vivainio@gmail.com>
5 2007-08-26 Ville Vainio <vivainio@gmail.com>
2
6
3 * ipmaker.py: Command line args have the highest priority again
7 * ipmaker.py: Command line args have the highest priority again
4
8
5 * iplib.py, ipmaker.py: -i command line argument now behaves as in
9 * iplib.py, ipmaker.py: -i command line argument now behaves as in
6 normal python, i.e. leaves the IPython session running after -c
10 normal python, i.e. leaves the IPython session running after -c
7 command or running a batch file from command line.
11 command or running a batch file from command line.
8
12
9 *
13 *
10 2007-08-22 Ville Vainio <vivainio@gmail.com>
14 2007-08-22 Ville Vainio <vivainio@gmail.com>
11
15
12 * iplib.py: no extra empty (last) line in raw hist w/ multiline
16 * iplib.py: no extra empty (last) line in raw hist w/ multiline
13 statements
17 statements
14
18
15 * logger.py: Fix bug where blank lines in history were not
19 * logger.py: Fix bug where blank lines in history were not
16 added until AFTER adding the current line; translated and raw
20 added until AFTER adding the current line; translated and raw
17 history should finally be in sync with prompt now.
21 history should finally be in sync with prompt now.
18
22
19 * ipy_completers.py: quick_completer now makes it easy to create
23 * ipy_completers.py: quick_completer now makes it easy to create
20 trivial custom completers
24 trivial custom completers
21
25
22 * clearcmd.py: shadow history compression & erasing, fixed input hist
26 * clearcmd.py: shadow history compression & erasing, fixed input hist
23 clearing.
27 clearing.
24
28
25 * envpersist.py, history.py: %env (sh profile only), %hist completers
29 * envpersist.py, history.py: %env (sh profile only), %hist completers
26
30
27 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
31 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
28 term title now include the drive letter, and always use / instead of
32 term title now include the drive letter, and always use / instead of
29 os.sep (as per recommended approach for win32 ipython in general).
33 os.sep (as per recommended approach for win32 ipython in general).
30
34
31 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
35 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
32 plain python scripts from ipykit command line by running
36 plain python scripts from ipykit command line by running
33 "py myscript.py", even w/o installed python.
37 "py myscript.py", even w/o installed python.
34
38
35 2007-08-21 Ville Vainio <vivainio@gmail.com>
39 2007-08-21 Ville Vainio <vivainio@gmail.com>
36
40
37 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
41 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
38 (for backwards compatibility)
42 (for backwards compatibility)
39
43
40 * history.py: switch back to %hist -t from %hist -r as default.
44 * history.py: switch back to %hist -t from %hist -r as default.
41 At least until raw history is fixed for good.
45 At least until raw history is fixed for good.
42
46
43 2007-08-20 Ville Vainio <vivainio@gmail.com>
47 2007-08-20 Ville Vainio <vivainio@gmail.com>
44
48
45 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
49 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
46 locate alias redeclarations etc. Also, avoid handling
50 locate alias redeclarations etc. Also, avoid handling
47 _ip.IP.alias_table directly, prefer using _ip.defalias.
51 _ip.IP.alias_table directly, prefer using _ip.defalias.
48
52
49
53
50 2007-08-15 Ville Vainio <vivainio@gmail.com>
54 2007-08-15 Ville Vainio <vivainio@gmail.com>
51
55
52 * prefilter.py: ! is now always served first
56 * prefilter.py: ! is now always served first
53
57
54 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
58 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
55
59
56 * IPython/iplib.py (safe_execfile): fix the SystemExit
60 * IPython/iplib.py (safe_execfile): fix the SystemExit
57 auto-suppression code to work in Python2.4 (the internal structure
61 auto-suppression code to work in Python2.4 (the internal structure
58 of that exception changed and I'd only tested the code with 2.5).
62 of that exception changed and I'd only tested the code with 2.5).
59 Bug reported by a SciPy attendee.
63 Bug reported by a SciPy attendee.
60
64
61 2007-08-13 Ville Vainio <vivainio@gmail.com>
65 2007-08-13 Ville Vainio <vivainio@gmail.com>
62
66
63 * prefilter.py: reverted !c:/bin/foo fix, made % in
67 * prefilter.py: reverted !c:/bin/foo fix, made % in
64 multiline specials work again
68 multiline specials work again
65
69
66 2007-08-13 Ville Vainio <vivainio@gmail.com>
70 2007-08-13 Ville Vainio <vivainio@gmail.com>
67
71
68 * prefilter.py: Take more care to special-case !, so that
72 * prefilter.py: Take more care to special-case !, so that
69 !c:/bin/foo.exe works.
73 !c:/bin/foo.exe works.
70
74
71 * setup.py: if we are building eggs, strip all docs and
75 * setup.py: if we are building eggs, strip all docs and
72 examples (it doesn't make sense to bytecompile examples,
76 examples (it doesn't make sense to bytecompile examples,
73 and docs would be in an awkward place anyway).
77 and docs would be in an awkward place anyway).
74
78
75 * Ryan Krauss' patch fixes start menu shortcuts when IPython
79 * Ryan Krauss' patch fixes start menu shortcuts when IPython
76 is installed into a directory that has spaces in the name.
80 is installed into a directory that has spaces in the name.
77
81
78 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
82 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
79
83
80 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
84 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
81 doctest profile and %doctest_mode, so they actually generate the
85 doctest profile and %doctest_mode, so they actually generate the
82 blank lines needed by doctest to separate individual tests.
86 blank lines needed by doctest to separate individual tests.
83
87
84 * IPython/iplib.py (safe_execfile): modify so that running code
88 * IPython/iplib.py (safe_execfile): modify so that running code
85 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
89 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
86 doesn't get a printed traceback. Any other value in sys.exit(),
90 doesn't get a printed traceback. Any other value in sys.exit(),
87 including the empty call, still generates a traceback. This
91 including the empty call, still generates a traceback. This
88 enables use of %run without having to pass '-e' for codes that
92 enables use of %run without having to pass '-e' for codes that
89 correctly set the exit status flag.
93 correctly set the exit status flag.
90
94
91 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
95 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
92
96
93 * IPython/iplib.py (InteractiveShell.post_config_initialization):
97 * IPython/iplib.py (InteractiveShell.post_config_initialization):
94 fix problems with doctests failing when run inside IPython due to
98 fix problems with doctests failing when run inside IPython due to
95 IPython's modifications of sys.displayhook.
99 IPython's modifications of sys.displayhook.
96
100
97 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
101 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
98
102
99 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
103 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
100 a string with names.
104 a string with names.
101
105
102 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
106 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
103
107
104 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
108 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
105 magic to toggle on/off the doctest pasting support without having
109 magic to toggle on/off the doctest pasting support without having
106 to leave a session to switch to a separate profile.
110 to leave a session to switch to a separate profile.
107
111
108 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
112 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
109
113
110 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
114 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
111 introduce a blank line between inputs, to conform to doctest
115 introduce a blank line between inputs, to conform to doctest
112 requirements.
116 requirements.
113
117
114 * IPython/OInspect.py (Inspector.pinfo): fix another part where
118 * IPython/OInspect.py (Inspector.pinfo): fix another part where
115 auto-generated docstrings for new-style classes were showing up.
119 auto-generated docstrings for new-style classes were showing up.
116
120
117 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
121 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
118
122
119 * api_changes: Add new file to track backward-incompatible
123 * api_changes: Add new file to track backward-incompatible
120 user-visible changes.
124 user-visible changes.
121
125
122 2007-08-06 Ville Vainio <vivainio@gmail.com>
126 2007-08-06 Ville Vainio <vivainio@gmail.com>
123
127
124 * ipmaker.py: fix bug where user_config_ns didn't exist at all
128 * ipmaker.py: fix bug where user_config_ns didn't exist at all
125 before all the config files were handled.
129 before all the config files were handled.
126
130
127 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
131 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
128
132
129 * IPython/irunner.py (RunnerFactory): Add new factory class for
133 * IPython/irunner.py (RunnerFactory): Add new factory class for
130 creating reusable runners based on filenames.
134 creating reusable runners based on filenames.
131
135
132 * IPython/Extensions/ipy_profile_doctest.py: New profile for
136 * IPython/Extensions/ipy_profile_doctest.py: New profile for
133 doctest support. It sets prompts/exceptions as similar to
137 doctest support. It sets prompts/exceptions as similar to
134 standard Python as possible, so that ipython sessions in this
138 standard Python as possible, so that ipython sessions in this
135 profile can be easily pasted as doctests with minimal
139 profile can be easily pasted as doctests with minimal
136 modifications. It also enables pasting of doctests from external
140 modifications. It also enables pasting of doctests from external
137 sources (even if they have leading whitespace), so that you can
141 sources (even if they have leading whitespace), so that you can
138 rerun doctests from existing sources.
142 rerun doctests from existing sources.
139
143
140 * IPython/iplib.py (_prefilter): fix a buglet where after entering
144 * IPython/iplib.py (_prefilter): fix a buglet where after entering
141 some whitespace, the prompt would become a continuation prompt
145 some whitespace, the prompt would become a continuation prompt
142 with no way of exiting it other than Ctrl-C. This fix brings us
146 with no way of exiting it other than Ctrl-C. This fix brings us
143 into conformity with how the default python prompt works.
147 into conformity with how the default python prompt works.
144
148
145 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
149 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
146 Add support for pasting not only lines that start with '>>>', but
150 Add support for pasting not only lines that start with '>>>', but
147 also with ' >>>'. That is, arbitrary whitespace can now precede
151 also with ' >>>'. That is, arbitrary whitespace can now precede
148 the prompts. This makes the system useful for pasting doctests
152 the prompts. This makes the system useful for pasting doctests
149 from docstrings back into a normal session.
153 from docstrings back into a normal session.
150
154
151 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
155 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
152
156
153 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
157 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
154 r1357, which had killed multiple invocations of an embedded
158 r1357, which had killed multiple invocations of an embedded
155 ipython (this means that example-embed has been broken for over 1
159 ipython (this means that example-embed has been broken for over 1
156 year!!!). Rather than possibly breaking the batch stuff for which
160 year!!!). Rather than possibly breaking the batch stuff for which
157 the code in iplib.py/interact was introduced, I worked around the
161 the code in iplib.py/interact was introduced, I worked around the
158 problem in the embedding class in Shell.py. We really need a
162 problem in the embedding class in Shell.py. We really need a
159 bloody test suite for this code, I'm sick of finding stuff that
163 bloody test suite for this code, I'm sick of finding stuff that
160 used to work breaking left and right every time I use an old
164 used to work breaking left and right every time I use an old
161 feature I hadn't touched in a few months.
165 feature I hadn't touched in a few months.
162 (kill_embedded): Add a new magic that only shows up in embedded
166 (kill_embedded): Add a new magic that only shows up in embedded
163 mode, to allow users to permanently deactivate an embedded instance.
167 mode, to allow users to permanently deactivate an embedded instance.
164
168
165 2007-08-01 Ville Vainio <vivainio@gmail.com>
169 2007-08-01 Ville Vainio <vivainio@gmail.com>
166
170
167 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
171 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
168 history gets out of sync on runlines (e.g. when running macros).
172 history gets out of sync on runlines (e.g. when running macros).
169
173
170 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
174 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
171
175
172 * IPython/Magic.py (magic_colors): fix win32-related error message
176 * IPython/Magic.py (magic_colors): fix win32-related error message
173 that could appear under *nix when readline was missing. Patch by
177 that could appear under *nix when readline was missing. Patch by
174 Scott Jackson, closes #175.
178 Scott Jackson, closes #175.
175
179
176 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
180 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
177
181
178 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
182 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
179 completer that it traits-aware, so that traits objects don't show
183 completer that it traits-aware, so that traits objects don't show
180 all of their internal attributes all the time.
184 all of their internal attributes all the time.
181
185
182 * IPython/genutils.py (dir2): moved this code from inside
186 * IPython/genutils.py (dir2): moved this code from inside
183 completer.py to expose it publicly, so I could use it in the
187 completer.py to expose it publicly, so I could use it in the
184 wildcards bugfix.
188 wildcards bugfix.
185
189
186 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
190 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
187 Stefan with Traits.
191 Stefan with Traits.
188
192
189 * IPython/completer.py (Completer.attr_matches): change internal
193 * IPython/completer.py (Completer.attr_matches): change internal
190 var name from 'object' to 'obj', since 'object' is now a builtin
194 var name from 'object' to 'obj', since 'object' is now a builtin
191 and this can lead to weird bugs if reusing this code elsewhere.
195 and this can lead to weird bugs if reusing this code elsewhere.
192
196
193 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
197 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
194
198
195 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
199 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
196 'foo?' and update the code to prevent printing of default
200 'foo?' and update the code to prevent printing of default
197 docstrings that started appearing after I added support for
201 docstrings that started appearing after I added support for
198 new-style classes. The approach I'm using isn't ideal (I just
202 new-style classes. The approach I'm using isn't ideal (I just
199 special-case those strings) but I'm not sure how to more robustly
203 special-case those strings) but I'm not sure how to more robustly
200 differentiate between truly user-written strings and Python's
204 differentiate between truly user-written strings and Python's
201 automatic ones.
205 automatic ones.
202
206
203 2007-07-09 Ville Vainio <vivainio@gmail.com>
207 2007-07-09 Ville Vainio <vivainio@gmail.com>
204
208
205 * completer.py: Applied Matthew Neeley's patch:
209 * completer.py: Applied Matthew Neeley's patch:
206 Dynamic attributes from trait_names and _getAttributeNames are added
210 Dynamic attributes from trait_names and _getAttributeNames are added
207 to the list of tab completions, but when this happens, the attribute
211 to the list of tab completions, but when this happens, the attribute
208 list is turned into a set, so the attributes are unordered when
212 list is turned into a set, so the attributes are unordered when
209 printed, which makes it hard to find the right completion. This patch
213 printed, which makes it hard to find the right completion. This patch
210 turns this set back into a list and sort it.
214 turns this set back into a list and sort it.
211
215
212 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
216 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
213
217
214 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
218 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
215 classes in various inspector functions.
219 classes in various inspector functions.
216
220
217 2007-06-28 Ville Vainio <vivainio@gmail.com>
221 2007-06-28 Ville Vainio <vivainio@gmail.com>
218
222
219 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
223 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
220 Implement "shadow" namespace, and callable aliases that reside there.
224 Implement "shadow" namespace, and callable aliases that reside there.
221 Use them by:
225 Use them by:
222
226
223 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
227 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
224
228
225 foo hello world
229 foo hello world
226 (gets translated to:)
230 (gets translated to:)
227 _sh.foo(r"""hello world""")
231 _sh.foo(r"""hello world""")
228
232
229 In practice, this kind of alias can take the role of a magic function
233 In practice, this kind of alias can take the role of a magic function
230
234
231 * New generic inspect_object, called on obj? and obj??
235 * New generic inspect_object, called on obj? and obj??
232
236
233 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
237 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
234
238
235 * IPython/ultraTB.py (findsource): fix a problem with
239 * IPython/ultraTB.py (findsource): fix a problem with
236 inspect.getfile that can cause crashes during traceback construction.
240 inspect.getfile that can cause crashes during traceback construction.
237
241
238 2007-06-14 Ville Vainio <vivainio@gmail.com>
242 2007-06-14 Ville Vainio <vivainio@gmail.com>
239
243
240 * iplib.py (handle_auto): Try to use ascii for printing "--->"
244 * iplib.py (handle_auto): Try to use ascii for printing "--->"
241 autocall rewrite indication, becausesometimes unicode fails to print
245 autocall rewrite indication, becausesometimes unicode fails to print
242 properly (and you get ' - - - '). Use plain uncoloured ---> for
246 properly (and you get ' - - - '). Use plain uncoloured ---> for
243 unicode.
247 unicode.
244
248
245 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
249 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
246
250
247 . pickleshare 'hash' commands (hget, hset, hcompress,
251 . pickleshare 'hash' commands (hget, hset, hcompress,
248 hdict) for efficient shadow history storage.
252 hdict) for efficient shadow history storage.
249
253
250 2007-06-13 Ville Vainio <vivainio@gmail.com>
254 2007-06-13 Ville Vainio <vivainio@gmail.com>
251
255
252 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
256 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
253 Added kw arg 'interactive', tell whether vars should be visible
257 Added kw arg 'interactive', tell whether vars should be visible
254 with %whos.
258 with %whos.
255
259
256 2007-06-11 Ville Vainio <vivainio@gmail.com>
260 2007-06-11 Ville Vainio <vivainio@gmail.com>
257
261
258 * pspersistence.py, Magic.py, iplib.py: directory history now saved
262 * pspersistence.py, Magic.py, iplib.py: directory history now saved
259 to db
263 to db
260
264
261 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
265 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
262 Also, it exits IPython immediately after evaluating the command (just like
266 Also, it exits IPython immediately after evaluating the command (just like
263 std python)
267 std python)
264
268
265 2007-06-05 Walter Doerwald <walter@livinglogic.de>
269 2007-06-05 Walter Doerwald <walter@livinglogic.de>
266
270
267 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
271 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
268 Python string and captures the output. (Idea and original patch by
272 Python string and captures the output. (Idea and original patch by
269 StοΏ½fan van der Walt)
273 StοΏ½fan van der Walt)
270
274
271 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
275 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
272
276
273 * IPython/ultraTB.py (VerboseTB.text): update printing of
277 * IPython/ultraTB.py (VerboseTB.text): update printing of
274 exception types for Python 2.5 (now all exceptions in the stdlib
278 exception types for Python 2.5 (now all exceptions in the stdlib
275 are new-style classes).
279 are new-style classes).
276
280
277 2007-05-31 Walter Doerwald <walter@livinglogic.de>
281 2007-05-31 Walter Doerwald <walter@livinglogic.de>
278
282
279 * IPython/Extensions/igrid.py: Add new commands refresh and
283 * IPython/Extensions/igrid.py: Add new commands refresh and
280 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
284 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
281 the iterator once (refresh) or after every x seconds (refresh_timer).
285 the iterator once (refresh) or after every x seconds (refresh_timer).
282 Add a working implementation of "searchexpression", where the text
286 Add a working implementation of "searchexpression", where the text
283 entered is not the text to search for, but an expression that must
287 entered is not the text to search for, but an expression that must
284 be true. Added display of shortcuts to the menu. Added commands "pickinput"
288 be true. Added display of shortcuts to the menu. Added commands "pickinput"
285 and "pickinputattr" that put the object or attribute under the cursor
289 and "pickinputattr" that put the object or attribute under the cursor
286 in the input line. Split the statusbar to be able to display the currently
290 in the input line. Split the statusbar to be able to display the currently
287 active refresh interval. (Patch by Nik Tautenhahn)
291 active refresh interval. (Patch by Nik Tautenhahn)
288
292
289 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
293 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
290
294
291 * fixing set_term_title to use ctypes as default
295 * fixing set_term_title to use ctypes as default
292
296
293 * fixing set_term_title fallback to work when curent dir
297 * fixing set_term_title fallback to work when curent dir
294 is on a windows network share
298 is on a windows network share
295
299
296 2007-05-28 Ville Vainio <vivainio@gmail.com>
300 2007-05-28 Ville Vainio <vivainio@gmail.com>
297
301
298 * %cpaste: strip + with > from left (diffs).
302 * %cpaste: strip + with > from left (diffs).
299
303
300 * iplib.py: Fix crash when readline not installed
304 * iplib.py: Fix crash when readline not installed
301
305
302 2007-05-26 Ville Vainio <vivainio@gmail.com>
306 2007-05-26 Ville Vainio <vivainio@gmail.com>
303
307
304 * generics.py: intruduce easy to extend result_display generic
308 * generics.py: intruduce easy to extend result_display generic
305 function (using simplegeneric.py).
309 function (using simplegeneric.py).
306
310
307 * Fixed the append functionality of %set.
311 * Fixed the append functionality of %set.
308
312
309 2007-05-25 Ville Vainio <vivainio@gmail.com>
313 2007-05-25 Ville Vainio <vivainio@gmail.com>
310
314
311 * New magic: %rep (fetch / run old commands from history)
315 * New magic: %rep (fetch / run old commands from history)
312
316
313 * New extension: mglob (%mglob magic), for powerful glob / find /filter
317 * New extension: mglob (%mglob magic), for powerful glob / find /filter
314 like functionality
318 like functionality
315
319
316 % maghistory.py: %hist -g PATTERM greps the history for pattern
320 % maghistory.py: %hist -g PATTERM greps the history for pattern
317
321
318 2007-05-24 Walter Doerwald <walter@livinglogic.de>
322 2007-05-24 Walter Doerwald <walter@livinglogic.de>
319
323
320 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
324 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
321 browse the IPython input history
325 browse the IPython input history
322
326
323 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
327 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
324 (mapped to "i") can be used to put the object under the curser in the input
328 (mapped to "i") can be used to put the object under the curser in the input
325 line. pickinputattr (mapped to "I") does the same for the attribute under
329 line. pickinputattr (mapped to "I") does the same for the attribute under
326 the cursor.
330 the cursor.
327
331
328 2007-05-24 Ville Vainio <vivainio@gmail.com>
332 2007-05-24 Ville Vainio <vivainio@gmail.com>
329
333
330 * Grand magic cleansing (changeset [2380]):
334 * Grand magic cleansing (changeset [2380]):
331
335
332 * Introduce ipy_legacy.py where the following magics were
336 * Introduce ipy_legacy.py where the following magics were
333 moved:
337 moved:
334
338
335 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
339 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
336
340
337 If you need them, either use default profile or "import ipy_legacy"
341 If you need them, either use default profile or "import ipy_legacy"
338 in your ipy_user_conf.py
342 in your ipy_user_conf.py
339
343
340 * Move sh and scipy profile to Extensions from UserConfig. this implies
344 * Move sh and scipy profile to Extensions from UserConfig. this implies
341 you should not edit them, but you don't need to run %upgrade when
345 you should not edit them, but you don't need to run %upgrade when
342 upgrading IPython anymore.
346 upgrading IPython anymore.
343
347
344 * %hist/%history now operates in "raw" mode by default. To get the old
348 * %hist/%history now operates in "raw" mode by default. To get the old
345 behaviour, run '%hist -n' (native mode).
349 behaviour, run '%hist -n' (native mode).
346
350
347 * split ipy_stock_completers.py to ipy_stock_completers.py and
351 * split ipy_stock_completers.py to ipy_stock_completers.py and
348 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
352 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
349 installed as default.
353 installed as default.
350
354
351 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
355 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
352 handling.
356 handling.
353
357
354 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
358 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
355 input if readline is available.
359 input if readline is available.
356
360
357 2007-05-23 Ville Vainio <vivainio@gmail.com>
361 2007-05-23 Ville Vainio <vivainio@gmail.com>
358
362
359 * macro.py: %store uses __getstate__ properly
363 * macro.py: %store uses __getstate__ properly
360
364
361 * exesetup.py: added new setup script for creating
365 * exesetup.py: added new setup script for creating
362 standalone IPython executables with py2exe (i.e.
366 standalone IPython executables with py2exe (i.e.
363 no python installation required).
367 no python installation required).
364
368
365 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
369 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
366 its place.
370 its place.
367
371
368 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
372 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
369
373
370 2007-05-21 Ville Vainio <vivainio@gmail.com>
374 2007-05-21 Ville Vainio <vivainio@gmail.com>
371
375
372 * platutil_win32.py (set_term_title): handle
376 * platutil_win32.py (set_term_title): handle
373 failure of 'title' system call properly.
377 failure of 'title' system call properly.
374
378
375 2007-05-17 Walter Doerwald <walter@livinglogic.de>
379 2007-05-17 Walter Doerwald <walter@livinglogic.de>
376
380
377 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
381 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
378 (Bug detected by Paul Mueller).
382 (Bug detected by Paul Mueller).
379
383
380 2007-05-16 Ville Vainio <vivainio@gmail.com>
384 2007-05-16 Ville Vainio <vivainio@gmail.com>
381
385
382 * ipy_profile_sci.py, ipython_win_post_install.py: Create
386 * ipy_profile_sci.py, ipython_win_post_install.py: Create
383 new "sci" profile, effectively a modern version of the old
387 new "sci" profile, effectively a modern version of the old
384 "scipy" profile (which is now slated for deprecation).
388 "scipy" profile (which is now slated for deprecation).
385
389
386 2007-05-15 Ville Vainio <vivainio@gmail.com>
390 2007-05-15 Ville Vainio <vivainio@gmail.com>
387
391
388 * pycolorize.py, pycolor.1: Paul Mueller's patches that
392 * pycolorize.py, pycolor.1: Paul Mueller's patches that
389 make pycolorize read input from stdin when run without arguments.
393 make pycolorize read input from stdin when run without arguments.
390
394
391 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
395 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
392
396
393 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
397 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
394 it in sh profile (instead of ipy_system_conf.py).
398 it in sh profile (instead of ipy_system_conf.py).
395
399
396 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
400 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
397 aliases are now lower case on windows (MyCommand.exe => mycommand).
401 aliases are now lower case on windows (MyCommand.exe => mycommand).
398
402
399 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
403 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
400 Macros are now callable objects that inherit from ipapi.IPyAutocall,
404 Macros are now callable objects that inherit from ipapi.IPyAutocall,
401 i.e. get autocalled regardless of system autocall setting.
405 i.e. get autocalled regardless of system autocall setting.
402
406
403 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
407 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
404
408
405 * IPython/rlineimpl.py: check for clear_history in readline and
409 * IPython/rlineimpl.py: check for clear_history in readline and
406 make it a dummy no-op if not available. This function isn't
410 make it a dummy no-op if not available. This function isn't
407 guaranteed to be in the API and appeared in Python 2.4, so we need
411 guaranteed to be in the API and appeared in Python 2.4, so we need
408 to check it ourselves. Also, clean up this file quite a bit.
412 to check it ourselves. Also, clean up this file quite a bit.
409
413
410 * ipython.1: update man page and full manual with information
414 * ipython.1: update man page and full manual with information
411 about threads (remove outdated warning). Closes #151.
415 about threads (remove outdated warning). Closes #151.
412
416
413 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
417 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
414
418
415 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
419 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
416 in trunk (note that this made it into the 0.8.1 release already,
420 in trunk (note that this made it into the 0.8.1 release already,
417 but the changelogs didn't get coordinated). Many thanks to Gael
421 but the changelogs didn't get coordinated). Many thanks to Gael
418 Varoquaux <gael.varoquaux-AT-normalesup.org>
422 Varoquaux <gael.varoquaux-AT-normalesup.org>
419
423
420 2007-05-09 *** Released version 0.8.1
424 2007-05-09 *** Released version 0.8.1
421
425
422 2007-05-10 Walter Doerwald <walter@livinglogic.de>
426 2007-05-10 Walter Doerwald <walter@livinglogic.de>
423
427
424 * IPython/Extensions/igrid.py: Incorporate html help into
428 * IPython/Extensions/igrid.py: Incorporate html help into
425 the module, so we don't have to search for the file.
429 the module, so we don't have to search for the file.
426
430
427 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
431 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
428
432
429 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
433 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
430
434
431 2007-04-30 Ville Vainio <vivainio@gmail.com>
435 2007-04-30 Ville Vainio <vivainio@gmail.com>
432
436
433 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
437 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
434 user has illegal (non-ascii) home directory name
438 user has illegal (non-ascii) home directory name
435
439
436 2007-04-27 Ville Vainio <vivainio@gmail.com>
440 2007-04-27 Ville Vainio <vivainio@gmail.com>
437
441
438 * platutils_win32.py: implement set_term_title for windows
442 * platutils_win32.py: implement set_term_title for windows
439
443
440 * Update version number
444 * Update version number
441
445
442 * ipy_profile_sh.py: more informative prompt (2 dir levels)
446 * ipy_profile_sh.py: more informative prompt (2 dir levels)
443
447
444 2007-04-26 Walter Doerwald <walter@livinglogic.de>
448 2007-04-26 Walter Doerwald <walter@livinglogic.de>
445
449
446 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
450 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
447 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
451 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
448 bug discovered by Ville).
452 bug discovered by Ville).
449
453
450 2007-04-26 Ville Vainio <vivainio@gmail.com>
454 2007-04-26 Ville Vainio <vivainio@gmail.com>
451
455
452 * Extensions/ipy_completers.py: Olivier's module completer now
456 * Extensions/ipy_completers.py: Olivier's module completer now
453 saves the list of root modules if it takes > 4 secs on the first run.
457 saves the list of root modules if it takes > 4 secs on the first run.
454
458
455 * Magic.py (%rehashx): %rehashx now clears the completer cache
459 * Magic.py (%rehashx): %rehashx now clears the completer cache
456
460
457
461
458 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
462 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
459
463
460 * ipython.el: fix incorrect color scheme, reported by Stefan.
464 * ipython.el: fix incorrect color scheme, reported by Stefan.
461 Closes #149.
465 Closes #149.
462
466
463 * IPython/PyColorize.py (Parser.format2): fix state-handling
467 * IPython/PyColorize.py (Parser.format2): fix state-handling
464 logic. I still don't like how that code handles state, but at
468 logic. I still don't like how that code handles state, but at
465 least now it should be correct, if inelegant. Closes #146.
469 least now it should be correct, if inelegant. Closes #146.
466
470
467 2007-04-25 Ville Vainio <vivainio@gmail.com>
471 2007-04-25 Ville Vainio <vivainio@gmail.com>
468
472
469 * Extensions/ipy_which.py: added extension for %which magic, works
473 * Extensions/ipy_which.py: added extension for %which magic, works
470 a lot like unix 'which' but also finds and expands aliases, and
474 a lot like unix 'which' but also finds and expands aliases, and
471 allows wildcards.
475 allows wildcards.
472
476
473 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
477 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
474 as opposed to returning nothing.
478 as opposed to returning nothing.
475
479
476 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
480 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
477 ipy_stock_completers on default profile, do import on sh profile.
481 ipy_stock_completers on default profile, do import on sh profile.
478
482
479 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
483 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
480
484
481 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
485 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
482 like ipython.py foo.py which raised a IndexError.
486 like ipython.py foo.py which raised a IndexError.
483
487
484 2007-04-21 Ville Vainio <vivainio@gmail.com>
488 2007-04-21 Ville Vainio <vivainio@gmail.com>
485
489
486 * Extensions/ipy_extutil.py: added extension to manage other ipython
490 * Extensions/ipy_extutil.py: added extension to manage other ipython
487 extensions. Now only supports 'ls' == list extensions.
491 extensions. Now only supports 'ls' == list extensions.
488
492
489 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
493 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
490
494
491 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
495 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
492 would prevent use of the exception system outside of a running
496 would prevent use of the exception system outside of a running
493 IPython instance.
497 IPython instance.
494
498
495 2007-04-20 Ville Vainio <vivainio@gmail.com>
499 2007-04-20 Ville Vainio <vivainio@gmail.com>
496
500
497 * Extensions/ipy_render.py: added extension for easy
501 * Extensions/ipy_render.py: added extension for easy
498 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
502 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
499 'Iptl' template notation,
503 'Iptl' template notation,
500
504
501 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
505 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
502 safer & faster 'import' completer.
506 safer & faster 'import' completer.
503
507
504 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
508 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
505 and _ip.defalias(name, command).
509 and _ip.defalias(name, command).
506
510
507 * Extensions/ipy_exportdb.py: New extension for exporting all the
511 * Extensions/ipy_exportdb.py: New extension for exporting all the
508 %store'd data in a portable format (normal ipapi calls like
512 %store'd data in a portable format (normal ipapi calls like
509 defmacro() etc.)
513 defmacro() etc.)
510
514
511 2007-04-19 Ville Vainio <vivainio@gmail.com>
515 2007-04-19 Ville Vainio <vivainio@gmail.com>
512
516
513 * upgrade_dir.py: skip junk files like *.pyc
517 * upgrade_dir.py: skip junk files like *.pyc
514
518
515 * Release.py: version number to 0.8.1
519 * Release.py: version number to 0.8.1
516
520
517 2007-04-18 Ville Vainio <vivainio@gmail.com>
521 2007-04-18 Ville Vainio <vivainio@gmail.com>
518
522
519 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
523 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
520 and later on win32.
524 and later on win32.
521
525
522 2007-04-16 Ville Vainio <vivainio@gmail.com>
526 2007-04-16 Ville Vainio <vivainio@gmail.com>
523
527
524 * iplib.py (showtraceback): Do not crash when running w/o readline.
528 * iplib.py (showtraceback): Do not crash when running w/o readline.
525
529
526 2007-04-12 Walter Doerwald <walter@livinglogic.de>
530 2007-04-12 Walter Doerwald <walter@livinglogic.de>
527
531
528 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
532 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
529 sorted (case sensitive with files and dirs mixed).
533 sorted (case sensitive with files and dirs mixed).
530
534
531 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
535 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
532
536
533 * IPython/Release.py (version): Open trunk for 0.8.1 development.
537 * IPython/Release.py (version): Open trunk for 0.8.1 development.
534
538
535 2007-04-10 *** Released version 0.8.0
539 2007-04-10 *** Released version 0.8.0
536
540
537 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
541 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
538
542
539 * Tag 0.8.0 for release.
543 * Tag 0.8.0 for release.
540
544
541 * IPython/iplib.py (reloadhist): add API function to cleanly
545 * IPython/iplib.py (reloadhist): add API function to cleanly
542 reload the readline history, which was growing inappropriately on
546 reload the readline history, which was growing inappropriately on
543 every %run call.
547 every %run call.
544
548
545 * win32_manual_post_install.py (run): apply last part of Nicolas
549 * win32_manual_post_install.py (run): apply last part of Nicolas
546 Pernetty's patch (I'd accidentally applied it in a different
550 Pernetty's patch (I'd accidentally applied it in a different
547 directory and this particular file didn't get patched).
551 directory and this particular file didn't get patched).
548
552
549 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
553 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
550
554
551 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
555 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
552 find the main thread id and use the proper API call. Thanks to
556 find the main thread id and use the proper API call. Thanks to
553 Stefan for the fix.
557 Stefan for the fix.
554
558
555 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
559 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
556 unit tests to reflect fixed ticket #52, and add more tests sent by
560 unit tests to reflect fixed ticket #52, and add more tests sent by
557 him.
561 him.
558
562
559 * IPython/iplib.py (raw_input): restore the readline completer
563 * IPython/iplib.py (raw_input): restore the readline completer
560 state on every input, in case third-party code messed it up.
564 state on every input, in case third-party code messed it up.
561 (_prefilter): revert recent addition of early-escape checks which
565 (_prefilter): revert recent addition of early-escape checks which
562 prevent many valid alias calls from working.
566 prevent many valid alias calls from working.
563
567
564 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
568 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
565 flag for sigint handler so we don't run a full signal() call on
569 flag for sigint handler so we don't run a full signal() call on
566 each runcode access.
570 each runcode access.
567
571
568 * IPython/Magic.py (magic_whos): small improvement to diagnostic
572 * IPython/Magic.py (magic_whos): small improvement to diagnostic
569 message.
573 message.
570
574
571 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
575 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
572
576
573 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
577 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
574 asynchronous exceptions working, i.e., Ctrl-C can actually
578 asynchronous exceptions working, i.e., Ctrl-C can actually
575 interrupt long-running code in the multithreaded shells.
579 interrupt long-running code in the multithreaded shells.
576
580
577 This is using Tomer Filiba's great ctypes-based trick:
581 This is using Tomer Filiba's great ctypes-based trick:
578 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
582 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
579 this in the past, but hadn't been able to make it work before. So
583 this in the past, but hadn't been able to make it work before. So
580 far it looks like it's actually running, but this needs more
584 far it looks like it's actually running, but this needs more
581 testing. If it really works, I'll be *very* happy, and we'll owe
585 testing. If it really works, I'll be *very* happy, and we'll owe
582 a huge thank you to Tomer. My current implementation is ugly,
586 a huge thank you to Tomer. My current implementation is ugly,
583 hackish and uses nasty globals, but I don't want to try and clean
587 hackish and uses nasty globals, but I don't want to try and clean
584 anything up until we know if it actually works.
588 anything up until we know if it actually works.
585
589
586 NOTE: this feature needs ctypes to work. ctypes is included in
590 NOTE: this feature needs ctypes to work. ctypes is included in
587 Python2.5, but 2.4 users will need to manually install it. This
591 Python2.5, but 2.4 users will need to manually install it. This
588 feature makes multi-threaded shells so much more usable that it's
592 feature makes multi-threaded shells so much more usable that it's
589 a minor price to pay (ctypes is very easy to install, already a
593 a minor price to pay (ctypes is very easy to install, already a
590 requirement for win32 and available in major linux distros).
594 requirement for win32 and available in major linux distros).
591
595
592 2007-04-04 Ville Vainio <vivainio@gmail.com>
596 2007-04-04 Ville Vainio <vivainio@gmail.com>
593
597
594 * Extensions/ipy_completers.py, ipy_stock_completers.py:
598 * Extensions/ipy_completers.py, ipy_stock_completers.py:
595 Moved implementations of 'bundled' completers to ipy_completers.py,
599 Moved implementations of 'bundled' completers to ipy_completers.py,
596 they are only enabled in ipy_stock_completers.py.
600 they are only enabled in ipy_stock_completers.py.
597
601
598 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
602 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
599
603
600 * IPython/PyColorize.py (Parser.format2): Fix identation of
604 * IPython/PyColorize.py (Parser.format2): Fix identation of
601 colorzied output and return early if color scheme is NoColor, to
605 colorzied output and return early if color scheme is NoColor, to
602 avoid unnecessary and expensive tokenization. Closes #131.
606 avoid unnecessary and expensive tokenization. Closes #131.
603
607
604 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
608 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
605
609
606 * IPython/Debugger.py: disable the use of pydb version 1.17. It
610 * IPython/Debugger.py: disable the use of pydb version 1.17. It
607 has a critical bug (a missing import that makes post-mortem not
611 has a critical bug (a missing import that makes post-mortem not
608 work at all). Unfortunately as of this time, this is the version
612 work at all). Unfortunately as of this time, this is the version
609 shipped with Ubuntu Edgy, so quite a few people have this one. I
613 shipped with Ubuntu Edgy, so quite a few people have this one. I
610 hope Edgy will update to a more recent package.
614 hope Edgy will update to a more recent package.
611
615
612 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
616 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
613
617
614 * IPython/iplib.py (_prefilter): close #52, second part of a patch
618 * IPython/iplib.py (_prefilter): close #52, second part of a patch
615 set by Stefan (only the first part had been applied before).
619 set by Stefan (only the first part had been applied before).
616
620
617 * IPython/Extensions/ipy_stock_completers.py (module_completer):
621 * IPython/Extensions/ipy_stock_completers.py (module_completer):
618 remove usage of the dangerous pkgutil.walk_packages(). See
622 remove usage of the dangerous pkgutil.walk_packages(). See
619 details in comments left in the code.
623 details in comments left in the code.
620
624
621 * IPython/Magic.py (magic_whos): add support for numpy arrays
625 * IPython/Magic.py (magic_whos): add support for numpy arrays
622 similar to what we had for Numeric.
626 similar to what we had for Numeric.
623
627
624 * IPython/completer.py (IPCompleter.complete): extend the
628 * IPython/completer.py (IPCompleter.complete): extend the
625 complete() call API to support completions by other mechanisms
629 complete() call API to support completions by other mechanisms
626 than readline. Closes #109.
630 than readline. Closes #109.
627
631
628 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
632 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
629 protect against a bug in Python's execfile(). Closes #123.
633 protect against a bug in Python's execfile(). Closes #123.
630
634
631 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
635 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
632
636
633 * IPython/iplib.py (split_user_input): ensure that when splitting
637 * IPython/iplib.py (split_user_input): ensure that when splitting
634 user input, the part that can be treated as a python name is pure
638 user input, the part that can be treated as a python name is pure
635 ascii (Python identifiers MUST be pure ascii). Part of the
639 ascii (Python identifiers MUST be pure ascii). Part of the
636 ongoing Unicode support work.
640 ongoing Unicode support work.
637
641
638 * IPython/Prompts.py (prompt_specials_color): Add \N for the
642 * IPython/Prompts.py (prompt_specials_color): Add \N for the
639 actual prompt number, without any coloring. This allows users to
643 actual prompt number, without any coloring. This allows users to
640 produce numbered prompts with their own colors. Added after a
644 produce numbered prompts with their own colors. Added after a
641 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
645 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
642
646
643 2007-03-31 Walter Doerwald <walter@livinglogic.de>
647 2007-03-31 Walter Doerwald <walter@livinglogic.de>
644
648
645 * IPython/Extensions/igrid.py: Map the return key
649 * IPython/Extensions/igrid.py: Map the return key
646 to enter() and shift-return to enterattr().
650 to enter() and shift-return to enterattr().
647
651
648 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
652 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
649
653
650 * IPython/Magic.py (magic_psearch): add unicode support by
654 * IPython/Magic.py (magic_psearch): add unicode support by
651 encoding to ascii the input, since this routine also only deals
655 encoding to ascii the input, since this routine also only deals
652 with valid Python names. Fixes a bug reported by Stefan.
656 with valid Python names. Fixes a bug reported by Stefan.
653
657
654 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
658 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
655
659
656 * IPython/Magic.py (_inspect): convert unicode input into ascii
660 * IPython/Magic.py (_inspect): convert unicode input into ascii
657 before trying to evaluate it as a Python identifier. This fixes a
661 before trying to evaluate it as a Python identifier. This fixes a
658 problem that the new unicode support had introduced when analyzing
662 problem that the new unicode support had introduced when analyzing
659 long definition lines for functions.
663 long definition lines for functions.
660
664
661 2007-03-24 Walter Doerwald <walter@livinglogic.de>
665 2007-03-24 Walter Doerwald <walter@livinglogic.de>
662
666
663 * IPython/Extensions/igrid.py: Fix picking. Using
667 * IPython/Extensions/igrid.py: Fix picking. Using
664 igrid with wxPython 2.6 and -wthread should work now.
668 igrid with wxPython 2.6 and -wthread should work now.
665 igrid.display() simply tries to create a frame without
669 igrid.display() simply tries to create a frame without
666 an application. Only if this fails an application is created.
670 an application. Only if this fails an application is created.
667
671
668 2007-03-23 Walter Doerwald <walter@livinglogic.de>
672 2007-03-23 Walter Doerwald <walter@livinglogic.de>
669
673
670 * IPython/Extensions/path.py: Updated to version 2.2.
674 * IPython/Extensions/path.py: Updated to version 2.2.
671
675
672 2007-03-23 Ville Vainio <vivainio@gmail.com>
676 2007-03-23 Ville Vainio <vivainio@gmail.com>
673
677
674 * iplib.py: recursive alias expansion now works better, so that
678 * iplib.py: recursive alias expansion now works better, so that
675 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
679 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
676 doesn't trip up the process, if 'd' has been aliased to 'ls'.
680 doesn't trip up the process, if 'd' has been aliased to 'ls'.
677
681
678 * Extensions/ipy_gnuglobal.py added, provides %global magic
682 * Extensions/ipy_gnuglobal.py added, provides %global magic
679 for users of http://www.gnu.org/software/global
683 for users of http://www.gnu.org/software/global
680
684
681 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
685 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
682 Closes #52. Patch by Stefan van der Walt.
686 Closes #52. Patch by Stefan van der Walt.
683
687
684 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
688 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
685
689
686 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
690 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
687 respect the __file__ attribute when using %run. Thanks to a bug
691 respect the __file__ attribute when using %run. Thanks to a bug
688 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
692 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
689
693
690 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
694 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
691
695
692 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
696 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
693 input. Patch sent by Stefan.
697 input. Patch sent by Stefan.
694
698
695 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
699 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
696 * IPython/Extensions/ipy_stock_completer.py
700 * IPython/Extensions/ipy_stock_completer.py
697 shlex_split, fix bug in shlex_split. len function
701 shlex_split, fix bug in shlex_split. len function
698 call was missing an if statement. Caused shlex_split to
702 call was missing an if statement. Caused shlex_split to
699 sometimes return "" as last element.
703 sometimes return "" as last element.
700
704
701 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
705 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
702
706
703 * IPython/completer.py
707 * IPython/completer.py
704 (IPCompleter.file_matches.single_dir_expand): fix a problem
708 (IPCompleter.file_matches.single_dir_expand): fix a problem
705 reported by Stefan, where directories containign a single subdir
709 reported by Stefan, where directories containign a single subdir
706 would be completed too early.
710 would be completed too early.
707
711
708 * IPython/Shell.py (_load_pylab): Make the execution of 'from
712 * IPython/Shell.py (_load_pylab): Make the execution of 'from
709 pylab import *' when -pylab is given be optional. A new flag,
713 pylab import *' when -pylab is given be optional. A new flag,
710 pylab_import_all controls this behavior, the default is True for
714 pylab_import_all controls this behavior, the default is True for
711 backwards compatibility.
715 backwards compatibility.
712
716
713 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
717 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
714 modified) R. Bernstein's patch for fully syntax highlighted
718 modified) R. Bernstein's patch for fully syntax highlighted
715 tracebacks. The functionality is also available under ultraTB for
719 tracebacks. The functionality is also available under ultraTB for
716 non-ipython users (someone using ultraTB but outside an ipython
720 non-ipython users (someone using ultraTB but outside an ipython
717 session). They can select the color scheme by setting the
721 session). They can select the color scheme by setting the
718 module-level global DEFAULT_SCHEME. The highlight functionality
722 module-level global DEFAULT_SCHEME. The highlight functionality
719 also works when debugging.
723 also works when debugging.
720
724
721 * IPython/genutils.py (IOStream.close): small patch by
725 * IPython/genutils.py (IOStream.close): small patch by
722 R. Bernstein for improved pydb support.
726 R. Bernstein for improved pydb support.
723
727
724 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
728 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
725 DaveS <davls@telus.net> to improve support of debugging under
729 DaveS <davls@telus.net> to improve support of debugging under
726 NTEmacs, including improved pydb behavior.
730 NTEmacs, including improved pydb behavior.
727
731
728 * IPython/Magic.py (magic_prun): Fix saving of profile info for
732 * IPython/Magic.py (magic_prun): Fix saving of profile info for
729 Python 2.5, where the stats object API changed a little. Thanks
733 Python 2.5, where the stats object API changed a little. Thanks
730 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
734 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
731
735
732 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
736 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
733 Pernetty's patch to improve support for (X)Emacs under Win32.
737 Pernetty's patch to improve support for (X)Emacs under Win32.
734
738
735 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
739 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
736
740
737 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
741 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
738 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
742 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
739 a report by Nik Tautenhahn.
743 a report by Nik Tautenhahn.
740
744
741 2007-03-16 Walter Doerwald <walter@livinglogic.de>
745 2007-03-16 Walter Doerwald <walter@livinglogic.de>
742
746
743 * setup.py: Add the igrid help files to the list of data files
747 * setup.py: Add the igrid help files to the list of data files
744 to be installed alongside igrid.
748 to be installed alongside igrid.
745 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
749 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
746 Show the input object of the igrid browser as the window tile.
750 Show the input object of the igrid browser as the window tile.
747 Show the object the cursor is on in the statusbar.
751 Show the object the cursor is on in the statusbar.
748
752
749 2007-03-15 Ville Vainio <vivainio@gmail.com>
753 2007-03-15 Ville Vainio <vivainio@gmail.com>
750
754
751 * Extensions/ipy_stock_completers.py: Fixed exception
755 * Extensions/ipy_stock_completers.py: Fixed exception
752 on mismatching quotes in %run completer. Patch by
756 on mismatching quotes in %run completer. Patch by
753 JοΏ½rgen Stenarson. Closes #127.
757 JοΏ½rgen Stenarson. Closes #127.
754
758
755 2007-03-14 Ville Vainio <vivainio@gmail.com>
759 2007-03-14 Ville Vainio <vivainio@gmail.com>
756
760
757 * Extensions/ext_rehashdir.py: Do not do auto_alias
761 * Extensions/ext_rehashdir.py: Do not do auto_alias
758 in %rehashdir, it clobbers %store'd aliases.
762 in %rehashdir, it clobbers %store'd aliases.
759
763
760 * UserConfig/ipy_profile_sh.py: envpersist.py extension
764 * UserConfig/ipy_profile_sh.py: envpersist.py extension
761 (beefed up %env) imported for sh profile.
765 (beefed up %env) imported for sh profile.
762
766
763 2007-03-10 Walter Doerwald <walter@livinglogic.de>
767 2007-03-10 Walter Doerwald <walter@livinglogic.de>
764
768
765 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
769 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
766 as the default browser.
770 as the default browser.
767 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
771 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
768 As igrid displays all attributes it ever encounters, fetch() (which has
772 As igrid displays all attributes it ever encounters, fetch() (which has
769 been renamed to _fetch()) doesn't have to recalculate the display attributes
773 been renamed to _fetch()) doesn't have to recalculate the display attributes
770 every time a new item is fetched. This should speed up scrolling.
774 every time a new item is fetched. This should speed up scrolling.
771
775
772 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
776 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
773
777
774 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
778 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
775 Schmolck's recently reported tab-completion bug (my previous one
779 Schmolck's recently reported tab-completion bug (my previous one
776 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
780 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
777
781
778 2007-03-09 Walter Doerwald <walter@livinglogic.de>
782 2007-03-09 Walter Doerwald <walter@livinglogic.de>
779
783
780 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
784 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
781 Close help window if exiting igrid.
785 Close help window if exiting igrid.
782
786
783 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
787 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
784
788
785 * IPython/Extensions/ipy_defaults.py: Check if readline is available
789 * IPython/Extensions/ipy_defaults.py: Check if readline is available
786 before calling functions from readline.
790 before calling functions from readline.
787
791
788 2007-03-02 Walter Doerwald <walter@livinglogic.de>
792 2007-03-02 Walter Doerwald <walter@livinglogic.de>
789
793
790 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
794 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
791 igrid is a wxPython-based display object for ipipe. If your system has
795 igrid is a wxPython-based display object for ipipe. If your system has
792 wx installed igrid will be the default display. Without wx ipipe falls
796 wx installed igrid will be the default display. Without wx ipipe falls
793 back to ibrowse (which needs curses). If no curses is installed ipipe
797 back to ibrowse (which needs curses). If no curses is installed ipipe
794 falls back to idump.
798 falls back to idump.
795
799
796 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
800 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
797
801
798 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
802 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
799 my changes from yesterday, they introduced bugs. Will reactivate
803 my changes from yesterday, they introduced bugs. Will reactivate
800 once I get a correct solution, which will be much easier thanks to
804 once I get a correct solution, which will be much easier thanks to
801 Dan Milstein's new prefilter test suite.
805 Dan Milstein's new prefilter test suite.
802
806
803 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
807 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
804
808
805 * IPython/iplib.py (split_user_input): fix input splitting so we
809 * IPython/iplib.py (split_user_input): fix input splitting so we
806 don't attempt attribute accesses on things that can't possibly be
810 don't attempt attribute accesses on things that can't possibly be
807 valid Python attributes. After a bug report by Alex Schmolck.
811 valid Python attributes. After a bug report by Alex Schmolck.
808 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
812 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
809 %magic with explicit % prefix.
813 %magic with explicit % prefix.
810
814
811 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
815 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
812
816
813 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
817 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
814 avoid a DeprecationWarning from GTK.
818 avoid a DeprecationWarning from GTK.
815
819
816 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
820 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
817
821
818 * IPython/genutils.py (clock): I modified clock() to return total
822 * IPython/genutils.py (clock): I modified clock() to return total
819 time, user+system. This is a more commonly needed metric. I also
823 time, user+system. This is a more commonly needed metric. I also
820 introduced the new clocku/clocks to get only user/system time if
824 introduced the new clocku/clocks to get only user/system time if
821 one wants those instead.
825 one wants those instead.
822
826
823 ***WARNING: API CHANGE*** clock() used to return only user time,
827 ***WARNING: API CHANGE*** clock() used to return only user time,
824 so if you want exactly the same results as before, use clocku
828 so if you want exactly the same results as before, use clocku
825 instead.
829 instead.
826
830
827 2007-02-22 Ville Vainio <vivainio@gmail.com>
831 2007-02-22 Ville Vainio <vivainio@gmail.com>
828
832
829 * IPython/Extensions/ipy_p4.py: Extension for improved
833 * IPython/Extensions/ipy_p4.py: Extension for improved
830 p4 (perforce version control system) experience.
834 p4 (perforce version control system) experience.
831 Adds %p4 magic with p4 command completion and
835 Adds %p4 magic with p4 command completion and
832 automatic -G argument (marshall output as python dict)
836 automatic -G argument (marshall output as python dict)
833
837
834 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
838 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
835
839
836 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
840 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
837 stop marks.
841 stop marks.
838 (ClearingMixin): a simple mixin to easily make a Demo class clear
842 (ClearingMixin): a simple mixin to easily make a Demo class clear
839 the screen in between blocks and have empty marquees. The
843 the screen in between blocks and have empty marquees. The
840 ClearDemo and ClearIPDemo classes that use it are included.
844 ClearDemo and ClearIPDemo classes that use it are included.
841
845
842 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
846 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
843
847
844 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
848 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
845 protect against exceptions at Python shutdown time. Patch
849 protect against exceptions at Python shutdown time. Patch
846 sumbmitted to upstream.
850 sumbmitted to upstream.
847
851
848 2007-02-14 Walter Doerwald <walter@livinglogic.de>
852 2007-02-14 Walter Doerwald <walter@livinglogic.de>
849
853
850 * IPython/Extensions/ibrowse.py: If entering the first object level
854 * IPython/Extensions/ibrowse.py: If entering the first object level
851 (i.e. the object for which the browser has been started) fails,
855 (i.e. the object for which the browser has been started) fails,
852 now the error is raised directly (aborting the browser) instead of
856 now the error is raised directly (aborting the browser) instead of
853 running into an empty levels list later.
857 running into an empty levels list later.
854
858
855 2007-02-03 Walter Doerwald <walter@livinglogic.de>
859 2007-02-03 Walter Doerwald <walter@livinglogic.de>
856
860
857 * IPython/Extensions/ipipe.py: Add an xrepr implementation
861 * IPython/Extensions/ipipe.py: Add an xrepr implementation
858 for the noitem object.
862 for the noitem object.
859
863
860 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
864 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
861
865
862 * IPython/completer.py (Completer.attr_matches): Fix small
866 * IPython/completer.py (Completer.attr_matches): Fix small
863 tab-completion bug with Enthought Traits objects with units.
867 tab-completion bug with Enthought Traits objects with units.
864 Thanks to a bug report by Tom Denniston
868 Thanks to a bug report by Tom Denniston
865 <tom.denniston-AT-alum.dartmouth.org>.
869 <tom.denniston-AT-alum.dartmouth.org>.
866
870
867 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
871 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
868
872
869 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
873 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
870 bug where only .ipy or .py would be completed. Once the first
874 bug where only .ipy or .py would be completed. Once the first
871 argument to %run has been given, all completions are valid because
875 argument to %run has been given, all completions are valid because
872 they are the arguments to the script, which may well be non-python
876 they are the arguments to the script, which may well be non-python
873 filenames.
877 filenames.
874
878
875 * IPython/irunner.py (InteractiveRunner.run_source): major updates
879 * IPython/irunner.py (InteractiveRunner.run_source): major updates
876 to irunner to allow it to correctly support real doctesting of
880 to irunner to allow it to correctly support real doctesting of
877 out-of-process ipython code.
881 out-of-process ipython code.
878
882
879 * IPython/Magic.py (magic_cd): Make the setting of the terminal
883 * IPython/Magic.py (magic_cd): Make the setting of the terminal
880 title an option (-noterm_title) because it completely breaks
884 title an option (-noterm_title) because it completely breaks
881 doctesting.
885 doctesting.
882
886
883 * IPython/demo.py: fix IPythonDemo class that was not actually working.
887 * IPython/demo.py: fix IPythonDemo class that was not actually working.
884
888
885 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
889 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
886
890
887 * IPython/irunner.py (main): fix small bug where extensions were
891 * IPython/irunner.py (main): fix small bug where extensions were
888 not being correctly recognized.
892 not being correctly recognized.
889
893
890 2007-01-23 Walter Doerwald <walter@livinglogic.de>
894 2007-01-23 Walter Doerwald <walter@livinglogic.de>
891
895
892 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
896 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
893 a string containing a single line yields the string itself as the
897 a string containing a single line yields the string itself as the
894 only item.
898 only item.
895
899
896 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
900 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
897 object if it's the same as the one on the last level (This avoids
901 object if it's the same as the one on the last level (This avoids
898 infinite recursion for one line strings).
902 infinite recursion for one line strings).
899
903
900 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
904 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
901
905
902 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
906 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
903 all output streams before printing tracebacks. This ensures that
907 all output streams before printing tracebacks. This ensures that
904 user output doesn't end up interleaved with traceback output.
908 user output doesn't end up interleaved with traceback output.
905
909
906 2007-01-10 Ville Vainio <vivainio@gmail.com>
910 2007-01-10 Ville Vainio <vivainio@gmail.com>
907
911
908 * Extensions/envpersist.py: Turbocharged %env that remembers
912 * Extensions/envpersist.py: Turbocharged %env that remembers
909 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
913 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
910 "%env VISUAL=jed".
914 "%env VISUAL=jed".
911
915
912 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
916 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
913
917
914 * IPython/iplib.py (showtraceback): ensure that we correctly call
918 * IPython/iplib.py (showtraceback): ensure that we correctly call
915 custom handlers in all cases (some with pdb were slipping through,
919 custom handlers in all cases (some with pdb were slipping through,
916 but I'm not exactly sure why).
920 but I'm not exactly sure why).
917
921
918 * IPython/Debugger.py (Tracer.__init__): added new class to
922 * IPython/Debugger.py (Tracer.__init__): added new class to
919 support set_trace-like usage of IPython's enhanced debugger.
923 support set_trace-like usage of IPython's enhanced debugger.
920
924
921 2006-12-24 Ville Vainio <vivainio@gmail.com>
925 2006-12-24 Ville Vainio <vivainio@gmail.com>
922
926
923 * ipmaker.py: more informative message when ipy_user_conf
927 * ipmaker.py: more informative message when ipy_user_conf
924 import fails (suggest running %upgrade).
928 import fails (suggest running %upgrade).
925
929
926 * tools/run_ipy_in_profiler.py: Utility to see where
930 * tools/run_ipy_in_profiler.py: Utility to see where
927 the time during IPython startup is spent.
931 the time during IPython startup is spent.
928
932
929 2006-12-20 Ville Vainio <vivainio@gmail.com>
933 2006-12-20 Ville Vainio <vivainio@gmail.com>
930
934
931 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
935 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
932
936
933 * ipapi.py: Add new ipapi method, expand_alias.
937 * ipapi.py: Add new ipapi method, expand_alias.
934
938
935 * Release.py: Bump up version to 0.7.4.svn
939 * Release.py: Bump up version to 0.7.4.svn
936
940
937 2006-12-17 Ville Vainio <vivainio@gmail.com>
941 2006-12-17 Ville Vainio <vivainio@gmail.com>
938
942
939 * Extensions/jobctrl.py: Fixed &cmd arg arg...
943 * Extensions/jobctrl.py: Fixed &cmd arg arg...
940 to work properly on posix too
944 to work properly on posix too
941
945
942 * Release.py: Update revnum (version is still just 0.7.3).
946 * Release.py: Update revnum (version is still just 0.7.3).
943
947
944 2006-12-15 Ville Vainio <vivainio@gmail.com>
948 2006-12-15 Ville Vainio <vivainio@gmail.com>
945
949
946 * scripts/ipython_win_post_install: create ipython.py in
950 * scripts/ipython_win_post_install: create ipython.py in
947 prefix + "/scripts".
951 prefix + "/scripts".
948
952
949 * Release.py: Update version to 0.7.3.
953 * Release.py: Update version to 0.7.3.
950
954
951 2006-12-14 Ville Vainio <vivainio@gmail.com>
955 2006-12-14 Ville Vainio <vivainio@gmail.com>
952
956
953 * scripts/ipython_win_post_install: Overwrite old shortcuts
957 * scripts/ipython_win_post_install: Overwrite old shortcuts
954 if they already exist
958 if they already exist
955
959
956 * Release.py: release 0.7.3rc2
960 * Release.py: release 0.7.3rc2
957
961
958 2006-12-13 Ville Vainio <vivainio@gmail.com>
962 2006-12-13 Ville Vainio <vivainio@gmail.com>
959
963
960 * Branch and update Release.py for 0.7.3rc1
964 * Branch and update Release.py for 0.7.3rc1
961
965
962 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
966 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
963
967
964 * IPython/Shell.py (IPShellWX): update for current WX naming
968 * IPython/Shell.py (IPShellWX): update for current WX naming
965 conventions, to avoid a deprecation warning with current WX
969 conventions, to avoid a deprecation warning with current WX
966 versions. Thanks to a report by Danny Shevitz.
970 versions. Thanks to a report by Danny Shevitz.
967
971
968 2006-12-12 Ville Vainio <vivainio@gmail.com>
972 2006-12-12 Ville Vainio <vivainio@gmail.com>
969
973
970 * ipmaker.py: apply david cournapeau's patch to make
974 * ipmaker.py: apply david cournapeau's patch to make
971 import_some work properly even when ipythonrc does
975 import_some work properly even when ipythonrc does
972 import_some on empty list (it was an old bug!).
976 import_some on empty list (it was an old bug!).
973
977
974 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
978 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
975 Add deprecation note to ipythonrc and a url to wiki
979 Add deprecation note to ipythonrc and a url to wiki
976 in ipy_user_conf.py
980 in ipy_user_conf.py
977
981
978
982
979 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
983 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
980 as if it was typed on IPython command prompt, i.e.
984 as if it was typed on IPython command prompt, i.e.
981 as IPython script.
985 as IPython script.
982
986
983 * example-magic.py, magic_grepl.py: remove outdated examples
987 * example-magic.py, magic_grepl.py: remove outdated examples
984
988
985 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
989 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
986
990
987 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
991 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
988 is called before any exception has occurred.
992 is called before any exception has occurred.
989
993
990 2006-12-08 Ville Vainio <vivainio@gmail.com>
994 2006-12-08 Ville Vainio <vivainio@gmail.com>
991
995
992 * Extensions/ipy_stock_completers.py: fix cd completer
996 * Extensions/ipy_stock_completers.py: fix cd completer
993 to translate /'s to \'s again.
997 to translate /'s to \'s again.
994
998
995 * completer.py: prevent traceback on file completions w/
999 * completer.py: prevent traceback on file completions w/
996 backslash.
1000 backslash.
997
1001
998 * Release.py: Update release number to 0.7.3b3 for release
1002 * Release.py: Update release number to 0.7.3b3 for release
999
1003
1000 2006-12-07 Ville Vainio <vivainio@gmail.com>
1004 2006-12-07 Ville Vainio <vivainio@gmail.com>
1001
1005
1002 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1006 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1003 while executing external code. Provides more shell-like behaviour
1007 while executing external code. Provides more shell-like behaviour
1004 and overall better response to ctrl + C / ctrl + break.
1008 and overall better response to ctrl + C / ctrl + break.
1005
1009
1006 * tools/make_tarball.py: new script to create tarball straight from svn
1010 * tools/make_tarball.py: new script to create tarball straight from svn
1007 (setup.py sdist doesn't work on win32).
1011 (setup.py sdist doesn't work on win32).
1008
1012
1009 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1013 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1010 on dirnames with spaces and use the default completer instead.
1014 on dirnames with spaces and use the default completer instead.
1011
1015
1012 * Revision.py: Change version to 0.7.3b2 for release.
1016 * Revision.py: Change version to 0.7.3b2 for release.
1013
1017
1014 2006-12-05 Ville Vainio <vivainio@gmail.com>
1018 2006-12-05 Ville Vainio <vivainio@gmail.com>
1015
1019
1016 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1020 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1017 pydb patch 4 (rm debug printing, py 2.5 checking)
1021 pydb patch 4 (rm debug printing, py 2.5 checking)
1018
1022
1019 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1023 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1020 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1024 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1021 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1025 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1022 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1026 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1023 object the cursor was on before the refresh. The command "markrange" is
1027 object the cursor was on before the refresh. The command "markrange" is
1024 mapped to "%" now.
1028 mapped to "%" now.
1025 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1029 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1026
1030
1027 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1031 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1028
1032
1029 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1033 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1030 interactive debugger on the last traceback, without having to call
1034 interactive debugger on the last traceback, without having to call
1031 %pdb and rerun your code. Made minor changes in various modules,
1035 %pdb and rerun your code. Made minor changes in various modules,
1032 should automatically recognize pydb if available.
1036 should automatically recognize pydb if available.
1033
1037
1034 2006-11-28 Ville Vainio <vivainio@gmail.com>
1038 2006-11-28 Ville Vainio <vivainio@gmail.com>
1035
1039
1036 * completer.py: If the text start with !, show file completions
1040 * completer.py: If the text start with !, show file completions
1037 properly. This helps when trying to complete command name
1041 properly. This helps when trying to complete command name
1038 for shell escapes.
1042 for shell escapes.
1039
1043
1040 2006-11-27 Ville Vainio <vivainio@gmail.com>
1044 2006-11-27 Ville Vainio <vivainio@gmail.com>
1041
1045
1042 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1046 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1043 der Walt. Clean up svn and hg completers by using a common
1047 der Walt. Clean up svn and hg completers by using a common
1044 vcs_completer.
1048 vcs_completer.
1045
1049
1046 2006-11-26 Ville Vainio <vivainio@gmail.com>
1050 2006-11-26 Ville Vainio <vivainio@gmail.com>
1047
1051
1048 * Remove ipconfig and %config; you should use _ip.options structure
1052 * Remove ipconfig and %config; you should use _ip.options structure
1049 directly instead!
1053 directly instead!
1050
1054
1051 * genutils.py: add wrap_deprecated function for deprecating callables
1055 * genutils.py: add wrap_deprecated function for deprecating callables
1052
1056
1053 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1057 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1054 _ip.system instead. ipalias is redundant.
1058 _ip.system instead. ipalias is redundant.
1055
1059
1056 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1060 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1057 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1061 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1058 explicit.
1062 explicit.
1059
1063
1060 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1064 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1061 completer. Try it by entering 'hg ' and pressing tab.
1065 completer. Try it by entering 'hg ' and pressing tab.
1062
1066
1063 * macro.py: Give Macro a useful __repr__ method
1067 * macro.py: Give Macro a useful __repr__ method
1064
1068
1065 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1069 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1066
1070
1067 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1071 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1068 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1072 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1069 we don't get a duplicate ipipe module, where registration of the xrepr
1073 we don't get a duplicate ipipe module, where registration of the xrepr
1070 implementation for Text is useless.
1074 implementation for Text is useless.
1071
1075
1072 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1076 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1073
1077
1074 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1078 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1075
1079
1076 2006-11-24 Ville Vainio <vivainio@gmail.com>
1080 2006-11-24 Ville Vainio <vivainio@gmail.com>
1077
1081
1078 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1082 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1079 try to use "cProfile" instead of the slower pure python
1083 try to use "cProfile" instead of the slower pure python
1080 "profile"
1084 "profile"
1081
1085
1082 2006-11-23 Ville Vainio <vivainio@gmail.com>
1086 2006-11-23 Ville Vainio <vivainio@gmail.com>
1083
1087
1084 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1088 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1085 Qt+IPython+Designer link in documentation.
1089 Qt+IPython+Designer link in documentation.
1086
1090
1087 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1091 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1088 correct Pdb object to %pydb.
1092 correct Pdb object to %pydb.
1089
1093
1090
1094
1091 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1095 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1092 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1096 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1093 generic xrepr(), otherwise the list implementation would kick in.
1097 generic xrepr(), otherwise the list implementation would kick in.
1094
1098
1095 2006-11-21 Ville Vainio <vivainio@gmail.com>
1099 2006-11-21 Ville Vainio <vivainio@gmail.com>
1096
1100
1097 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1101 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1098 with one from UserConfig.
1102 with one from UserConfig.
1099
1103
1100 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1104 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1101 it was missing which broke the sh profile.
1105 it was missing which broke the sh profile.
1102
1106
1103 * completer.py: file completer now uses explicit '/' instead
1107 * completer.py: file completer now uses explicit '/' instead
1104 of os.path.join, expansion of 'foo' was broken on win32
1108 of os.path.join, expansion of 'foo' was broken on win32
1105 if there was one directory with name 'foobar'.
1109 if there was one directory with name 'foobar'.
1106
1110
1107 * A bunch of patches from Kirill Smelkov:
1111 * A bunch of patches from Kirill Smelkov:
1108
1112
1109 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1113 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1110
1114
1111 * [patch 7/9] Implement %page -r (page in raw mode) -
1115 * [patch 7/9] Implement %page -r (page in raw mode) -
1112
1116
1113 * [patch 5/9] ScientificPython webpage has moved
1117 * [patch 5/9] ScientificPython webpage has moved
1114
1118
1115 * [patch 4/9] The manual mentions %ds, should be %dhist
1119 * [patch 4/9] The manual mentions %ds, should be %dhist
1116
1120
1117 * [patch 3/9] Kill old bits from %prun doc.
1121 * [patch 3/9] Kill old bits from %prun doc.
1118
1122
1119 * [patch 1/9] Fix typos here and there.
1123 * [patch 1/9] Fix typos here and there.
1120
1124
1121 2006-11-08 Ville Vainio <vivainio@gmail.com>
1125 2006-11-08 Ville Vainio <vivainio@gmail.com>
1122
1126
1123 * completer.py (attr_matches): catch all exceptions raised
1127 * completer.py (attr_matches): catch all exceptions raised
1124 by eval of expr with dots.
1128 by eval of expr with dots.
1125
1129
1126 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1130 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1127
1131
1128 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1132 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1129 input if it starts with whitespace. This allows you to paste
1133 input if it starts with whitespace. This allows you to paste
1130 indented input from any editor without manually having to type in
1134 indented input from any editor without manually having to type in
1131 the 'if 1:', which is convenient when working interactively.
1135 the 'if 1:', which is convenient when working interactively.
1132 Slightly modifed version of a patch by Bo Peng
1136 Slightly modifed version of a patch by Bo Peng
1133 <bpeng-AT-rice.edu>.
1137 <bpeng-AT-rice.edu>.
1134
1138
1135 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1139 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1136
1140
1137 * IPython/irunner.py (main): modified irunner so it automatically
1141 * IPython/irunner.py (main): modified irunner so it automatically
1138 recognizes the right runner to use based on the extension (.py for
1142 recognizes the right runner to use based on the extension (.py for
1139 python, .ipy for ipython and .sage for sage).
1143 python, .ipy for ipython and .sage for sage).
1140
1144
1141 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1145 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1142 visible in ipapi as ip.config(), to programatically control the
1146 visible in ipapi as ip.config(), to programatically control the
1143 internal rc object. There's an accompanying %config magic for
1147 internal rc object. There's an accompanying %config magic for
1144 interactive use, which has been enhanced to match the
1148 interactive use, which has been enhanced to match the
1145 funtionality in ipconfig.
1149 funtionality in ipconfig.
1146
1150
1147 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1151 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1148 so it's not just a toggle, it now takes an argument. Add support
1152 so it's not just a toggle, it now takes an argument. Add support
1149 for a customizable header when making system calls, as the new
1153 for a customizable header when making system calls, as the new
1150 system_header variable in the ipythonrc file.
1154 system_header variable in the ipythonrc file.
1151
1155
1152 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1156 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1153
1157
1154 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1158 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1155 generic functions (using Philip J. Eby's simplegeneric package).
1159 generic functions (using Philip J. Eby's simplegeneric package).
1156 This makes it possible to customize the display of third-party classes
1160 This makes it possible to customize the display of third-party classes
1157 without having to monkeypatch them. xiter() no longer supports a mode
1161 without having to monkeypatch them. xiter() no longer supports a mode
1158 argument and the XMode class has been removed. The same functionality can
1162 argument and the XMode class has been removed. The same functionality can
1159 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1163 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1160 One consequence of the switch to generic functions is that xrepr() and
1164 One consequence of the switch to generic functions is that xrepr() and
1161 xattrs() implementation must define the default value for the mode
1165 xattrs() implementation must define the default value for the mode
1162 argument themselves and xattrs() implementations must return real
1166 argument themselves and xattrs() implementations must return real
1163 descriptors.
1167 descriptors.
1164
1168
1165 * IPython/external: This new subpackage will contain all third-party
1169 * IPython/external: This new subpackage will contain all third-party
1166 packages that are bundled with IPython. (The first one is simplegeneric).
1170 packages that are bundled with IPython. (The first one is simplegeneric).
1167
1171
1168 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1172 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1169 directory which as been dropped in r1703.
1173 directory which as been dropped in r1703.
1170
1174
1171 * IPython/Extensions/ipipe.py (iless): Fixed.
1175 * IPython/Extensions/ipipe.py (iless): Fixed.
1172
1176
1173 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1177 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1174
1178
1175 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1179 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1176
1180
1177 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1181 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1178 handling in variable expansion so that shells and magics recognize
1182 handling in variable expansion so that shells and magics recognize
1179 function local scopes correctly. Bug reported by Brian.
1183 function local scopes correctly. Bug reported by Brian.
1180
1184
1181 * scripts/ipython: remove the very first entry in sys.path which
1185 * scripts/ipython: remove the very first entry in sys.path which
1182 Python auto-inserts for scripts, so that sys.path under IPython is
1186 Python auto-inserts for scripts, so that sys.path under IPython is
1183 as similar as possible to that under plain Python.
1187 as similar as possible to that under plain Python.
1184
1188
1185 * IPython/completer.py (IPCompleter.file_matches): Fix
1189 * IPython/completer.py (IPCompleter.file_matches): Fix
1186 tab-completion so that quotes are not closed unless the completion
1190 tab-completion so that quotes are not closed unless the completion
1187 is unambiguous. After a request by Stefan. Minor cleanups in
1191 is unambiguous. After a request by Stefan. Minor cleanups in
1188 ipy_stock_completers.
1192 ipy_stock_completers.
1189
1193
1190 2006-11-02 Ville Vainio <vivainio@gmail.com>
1194 2006-11-02 Ville Vainio <vivainio@gmail.com>
1191
1195
1192 * ipy_stock_completers.py: Add %run and %cd completers.
1196 * ipy_stock_completers.py: Add %run and %cd completers.
1193
1197
1194 * completer.py: Try running custom completer for both
1198 * completer.py: Try running custom completer for both
1195 "foo" and "%foo" if the command is just "foo". Ignore case
1199 "foo" and "%foo" if the command is just "foo". Ignore case
1196 when filtering possible completions.
1200 when filtering possible completions.
1197
1201
1198 * UserConfig/ipy_user_conf.py: install stock completers as default
1202 * UserConfig/ipy_user_conf.py: install stock completers as default
1199
1203
1200 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1204 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1201 simplified readline history save / restore through a wrapper
1205 simplified readline history save / restore through a wrapper
1202 function
1206 function
1203
1207
1204
1208
1205 2006-10-31 Ville Vainio <vivainio@gmail.com>
1209 2006-10-31 Ville Vainio <vivainio@gmail.com>
1206
1210
1207 * strdispatch.py, completer.py, ipy_stock_completers.py:
1211 * strdispatch.py, completer.py, ipy_stock_completers.py:
1208 Allow str_key ("command") in completer hooks. Implement
1212 Allow str_key ("command") in completer hooks. Implement
1209 trivial completer for 'import' (stdlib modules only). Rename
1213 trivial completer for 'import' (stdlib modules only). Rename
1210 ipy_linux_package_managers.py to ipy_stock_completers.py.
1214 ipy_linux_package_managers.py to ipy_stock_completers.py.
1211 SVN completer.
1215 SVN completer.
1212
1216
1213 * Extensions/ledit.py: %magic line editor for easily and
1217 * Extensions/ledit.py: %magic line editor for easily and
1214 incrementally manipulating lists of strings. The magic command
1218 incrementally manipulating lists of strings. The magic command
1215 name is %led.
1219 name is %led.
1216
1220
1217 2006-10-30 Ville Vainio <vivainio@gmail.com>
1221 2006-10-30 Ville Vainio <vivainio@gmail.com>
1218
1222
1219 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1223 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1220 Bernsteins's patches for pydb integration.
1224 Bernsteins's patches for pydb integration.
1221 http://bashdb.sourceforge.net/pydb/
1225 http://bashdb.sourceforge.net/pydb/
1222
1226
1223 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1227 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1224 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1228 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1225 custom completer hook to allow the users to implement their own
1229 custom completer hook to allow the users to implement their own
1226 completers. See ipy_linux_package_managers.py for example. The
1230 completers. See ipy_linux_package_managers.py for example. The
1227 hook name is 'complete_command'.
1231 hook name is 'complete_command'.
1228
1232
1229 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1233 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1230
1234
1231 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1235 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1232 Numeric leftovers.
1236 Numeric leftovers.
1233
1237
1234 * ipython.el (py-execute-region): apply Stefan's patch to fix
1238 * ipython.el (py-execute-region): apply Stefan's patch to fix
1235 garbled results if the python shell hasn't been previously started.
1239 garbled results if the python shell hasn't been previously started.
1236
1240
1237 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1241 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1238 pretty generic function and useful for other things.
1242 pretty generic function and useful for other things.
1239
1243
1240 * IPython/OInspect.py (getsource): Add customizable source
1244 * IPython/OInspect.py (getsource): Add customizable source
1241 extractor. After a request/patch form W. Stein (SAGE).
1245 extractor. After a request/patch form W. Stein (SAGE).
1242
1246
1243 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1247 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1244 window size to a more reasonable value from what pexpect does,
1248 window size to a more reasonable value from what pexpect does,
1245 since their choice causes wrapping bugs with long input lines.
1249 since their choice causes wrapping bugs with long input lines.
1246
1250
1247 2006-10-28 Ville Vainio <vivainio@gmail.com>
1251 2006-10-28 Ville Vainio <vivainio@gmail.com>
1248
1252
1249 * Magic.py (%run): Save and restore the readline history from
1253 * Magic.py (%run): Save and restore the readline history from
1250 file around %run commands to prevent side effects from
1254 file around %run commands to prevent side effects from
1251 %runned programs that might use readline (e.g. pydb).
1255 %runned programs that might use readline (e.g. pydb).
1252
1256
1253 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1257 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1254 invoking the pydb enhanced debugger.
1258 invoking the pydb enhanced debugger.
1255
1259
1256 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1260 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1257
1261
1258 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1262 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1259 call the base class method and propagate the return value to
1263 call the base class method and propagate the return value to
1260 ifile. This is now done by path itself.
1264 ifile. This is now done by path itself.
1261
1265
1262 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1266 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1263
1267
1264 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1268 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1265 api: set_crash_handler(), to expose the ability to change the
1269 api: set_crash_handler(), to expose the ability to change the
1266 internal crash handler.
1270 internal crash handler.
1267
1271
1268 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1272 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1269 the various parameters of the crash handler so that apps using
1273 the various parameters of the crash handler so that apps using
1270 IPython as their engine can customize crash handling. Ipmlemented
1274 IPython as their engine can customize crash handling. Ipmlemented
1271 at the request of SAGE.
1275 at the request of SAGE.
1272
1276
1273 2006-10-14 Ville Vainio <vivainio@gmail.com>
1277 2006-10-14 Ville Vainio <vivainio@gmail.com>
1274
1278
1275 * Magic.py, ipython.el: applied first "safe" part of Rocky
1279 * Magic.py, ipython.el: applied first "safe" part of Rocky
1276 Bernstein's patch set for pydb integration.
1280 Bernstein's patch set for pydb integration.
1277
1281
1278 * Magic.py (%unalias, %alias): %store'd aliases can now be
1282 * Magic.py (%unalias, %alias): %store'd aliases can now be
1279 removed with '%unalias'. %alias w/o args now shows most
1283 removed with '%unalias'. %alias w/o args now shows most
1280 interesting (stored / manually defined) aliases last
1284 interesting (stored / manually defined) aliases last
1281 where they catch the eye w/o scrolling.
1285 where they catch the eye w/o scrolling.
1282
1286
1283 * Magic.py (%rehashx), ext_rehashdir.py: files with
1287 * Magic.py (%rehashx), ext_rehashdir.py: files with
1284 'py' extension are always considered executable, even
1288 'py' extension are always considered executable, even
1285 when not in PATHEXT environment variable.
1289 when not in PATHEXT environment variable.
1286
1290
1287 2006-10-12 Ville Vainio <vivainio@gmail.com>
1291 2006-10-12 Ville Vainio <vivainio@gmail.com>
1288
1292
1289 * jobctrl.py: Add new "jobctrl" extension for spawning background
1293 * jobctrl.py: Add new "jobctrl" extension for spawning background
1290 processes with "&find /". 'import jobctrl' to try it out. Requires
1294 processes with "&find /". 'import jobctrl' to try it out. Requires
1291 'subprocess' module, standard in python 2.4+.
1295 'subprocess' module, standard in python 2.4+.
1292
1296
1293 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1297 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1294 so if foo -> bar and bar -> baz, then foo -> baz.
1298 so if foo -> bar and bar -> baz, then foo -> baz.
1295
1299
1296 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1300 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1297
1301
1298 * IPython/Magic.py (Magic.parse_options): add a new posix option
1302 * IPython/Magic.py (Magic.parse_options): add a new posix option
1299 to allow parsing of input args in magics that doesn't strip quotes
1303 to allow parsing of input args in magics that doesn't strip quotes
1300 (if posix=False). This also closes %timeit bug reported by
1304 (if posix=False). This also closes %timeit bug reported by
1301 Stefan.
1305 Stefan.
1302
1306
1303 2006-10-03 Ville Vainio <vivainio@gmail.com>
1307 2006-10-03 Ville Vainio <vivainio@gmail.com>
1304
1308
1305 * iplib.py (raw_input, interact): Return ValueError catching for
1309 * iplib.py (raw_input, interact): Return ValueError catching for
1306 raw_input. Fixes infinite loop for sys.stdin.close() or
1310 raw_input. Fixes infinite loop for sys.stdin.close() or
1307 sys.stdout.close().
1311 sys.stdout.close().
1308
1312
1309 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1313 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1310
1314
1311 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1315 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1312 to help in handling doctests. irunner is now pretty useful for
1316 to help in handling doctests. irunner is now pretty useful for
1313 running standalone scripts and simulate a full interactive session
1317 running standalone scripts and simulate a full interactive session
1314 in a format that can be then pasted as a doctest.
1318 in a format that can be then pasted as a doctest.
1315
1319
1316 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1320 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1317 on top of the default (useless) ones. This also fixes the nasty
1321 on top of the default (useless) ones. This also fixes the nasty
1318 way in which 2.5's Quitter() exits (reverted [1785]).
1322 way in which 2.5's Quitter() exits (reverted [1785]).
1319
1323
1320 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1324 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1321 2.5.
1325 2.5.
1322
1326
1323 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1327 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1324 color scheme is updated as well when color scheme is changed
1328 color scheme is updated as well when color scheme is changed
1325 interactively.
1329 interactively.
1326
1330
1327 2006-09-27 Ville Vainio <vivainio@gmail.com>
1331 2006-09-27 Ville Vainio <vivainio@gmail.com>
1328
1332
1329 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1333 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1330 infinite loop and just exit. It's a hack, but will do for a while.
1334 infinite loop and just exit. It's a hack, but will do for a while.
1331
1335
1332 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1336 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1333
1337
1334 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1338 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1335 the constructor, this makes it possible to get a list of only directories
1339 the constructor, this makes it possible to get a list of only directories
1336 or only files.
1340 or only files.
1337
1341
1338 2006-08-12 Ville Vainio <vivainio@gmail.com>
1342 2006-08-12 Ville Vainio <vivainio@gmail.com>
1339
1343
1340 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1344 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1341 they broke unittest
1345 they broke unittest
1342
1346
1343 2006-08-11 Ville Vainio <vivainio@gmail.com>
1347 2006-08-11 Ville Vainio <vivainio@gmail.com>
1344
1348
1345 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1349 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1346 by resolving issue properly, i.e. by inheriting FakeModule
1350 by resolving issue properly, i.e. by inheriting FakeModule
1347 from types.ModuleType. Pickling ipython interactive data
1351 from types.ModuleType. Pickling ipython interactive data
1348 should still work as usual (testing appreciated).
1352 should still work as usual (testing appreciated).
1349
1353
1350 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1354 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1351
1355
1352 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1356 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1353 running under python 2.3 with code from 2.4 to fix a bug with
1357 running under python 2.3 with code from 2.4 to fix a bug with
1354 help(). Reported by the Debian maintainers, Norbert Tretkowski
1358 help(). Reported by the Debian maintainers, Norbert Tretkowski
1355 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1359 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1356 <afayolle-AT-debian.org>.
1360 <afayolle-AT-debian.org>.
1357
1361
1358 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1362 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1359
1363
1360 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1364 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1361 (which was displaying "quit" twice).
1365 (which was displaying "quit" twice).
1362
1366
1363 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1367 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1364
1368
1365 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1369 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1366 the mode argument).
1370 the mode argument).
1367
1371
1368 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1372 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1369
1373
1370 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1374 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1371 not running under IPython.
1375 not running under IPython.
1372
1376
1373 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1377 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1374 and make it iterable (iterating over the attribute itself). Add two new
1378 and make it iterable (iterating over the attribute itself). Add two new
1375 magic strings for __xattrs__(): If the string starts with "-", the attribute
1379 magic strings for __xattrs__(): If the string starts with "-", the attribute
1376 will not be displayed in ibrowse's detail view (but it can still be
1380 will not be displayed in ibrowse's detail view (but it can still be
1377 iterated over). This makes it possible to add attributes that are large
1381 iterated over). This makes it possible to add attributes that are large
1378 lists or generator methods to the detail view. Replace magic attribute names
1382 lists or generator methods to the detail view. Replace magic attribute names
1379 and _attrname() and _getattr() with "descriptors": For each type of magic
1383 and _attrname() and _getattr() with "descriptors": For each type of magic
1380 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1384 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1381 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1385 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1382 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1386 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1383 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1387 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1384 are still supported.
1388 are still supported.
1385
1389
1386 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1390 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1387 fails in ibrowse.fetch(), the exception object is added as the last item
1391 fails in ibrowse.fetch(), the exception object is added as the last item
1388 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1392 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1389 a generator throws an exception midway through execution.
1393 a generator throws an exception midway through execution.
1390
1394
1391 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1395 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1392 encoding into methods.
1396 encoding into methods.
1393
1397
1394 2006-07-26 Ville Vainio <vivainio@gmail.com>
1398 2006-07-26 Ville Vainio <vivainio@gmail.com>
1395
1399
1396 * iplib.py: history now stores multiline input as single
1400 * iplib.py: history now stores multiline input as single
1397 history entries. Patch by Jorgen Cederlof.
1401 history entries. Patch by Jorgen Cederlof.
1398
1402
1399 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1403 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1400
1404
1401 * IPython/Extensions/ibrowse.py: Make cursor visible over
1405 * IPython/Extensions/ibrowse.py: Make cursor visible over
1402 non existing attributes.
1406 non existing attributes.
1403
1407
1404 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1408 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1405
1409
1406 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1410 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1407 error output of the running command doesn't mess up the screen.
1411 error output of the running command doesn't mess up the screen.
1408
1412
1409 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1413 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1410
1414
1411 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1415 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1412 argument. This sorts the items themselves.
1416 argument. This sorts the items themselves.
1413
1417
1414 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1418 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1415
1419
1416 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1420 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1417 Compile expression strings into code objects. This should speed
1421 Compile expression strings into code objects. This should speed
1418 up ifilter and friends somewhat.
1422 up ifilter and friends somewhat.
1419
1423
1420 2006-07-08 Ville Vainio <vivainio@gmail.com>
1424 2006-07-08 Ville Vainio <vivainio@gmail.com>
1421
1425
1422 * Magic.py: %cpaste now strips > from the beginning of lines
1426 * Magic.py: %cpaste now strips > from the beginning of lines
1423 to ease pasting quoted code from emails. Contributed by
1427 to ease pasting quoted code from emails. Contributed by
1424 Stefan van der Walt.
1428 Stefan van der Walt.
1425
1429
1426 2006-06-29 Ville Vainio <vivainio@gmail.com>
1430 2006-06-29 Ville Vainio <vivainio@gmail.com>
1427
1431
1428 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1432 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1429 mode, patch contributed by Darren Dale. NEEDS TESTING!
1433 mode, patch contributed by Darren Dale. NEEDS TESTING!
1430
1434
1431 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1435 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1432
1436
1433 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1437 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1434 a blue background. Fix fetching new display rows when the browser
1438 a blue background. Fix fetching new display rows when the browser
1435 scrolls more than a screenful (e.g. by using the goto command).
1439 scrolls more than a screenful (e.g. by using the goto command).
1436
1440
1437 2006-06-27 Ville Vainio <vivainio@gmail.com>
1441 2006-06-27 Ville Vainio <vivainio@gmail.com>
1438
1442
1439 * Magic.py (_inspect, _ofind) Apply David Huard's
1443 * Magic.py (_inspect, _ofind) Apply David Huard's
1440 patch for displaying the correct docstring for 'property'
1444 patch for displaying the correct docstring for 'property'
1441 attributes.
1445 attributes.
1442
1446
1443 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1447 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1444
1448
1445 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1449 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1446 commands into the methods implementing them.
1450 commands into the methods implementing them.
1447
1451
1448 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1452 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1449
1453
1450 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1454 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1451 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1455 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1452 autoindent support was authored by Jin Liu.
1456 autoindent support was authored by Jin Liu.
1453
1457
1454 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1458 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1455
1459
1456 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1460 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1457 for keymaps with a custom class that simplifies handling.
1461 for keymaps with a custom class that simplifies handling.
1458
1462
1459 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1463 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1460
1464
1461 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1465 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1462 resizing. This requires Python 2.5 to work.
1466 resizing. This requires Python 2.5 to work.
1463
1467
1464 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1468 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1465
1469
1466 * IPython/Extensions/ibrowse.py: Add two new commands to
1470 * IPython/Extensions/ibrowse.py: Add two new commands to
1467 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1471 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1468 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1472 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1469 attributes again. Remapped the help command to "?". Display
1473 attributes again. Remapped the help command to "?". Display
1470 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1474 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1471 as keys for the "home" and "end" commands. Add three new commands
1475 as keys for the "home" and "end" commands. Add three new commands
1472 to the input mode for "find" and friends: "delend" (CTRL-K)
1476 to the input mode for "find" and friends: "delend" (CTRL-K)
1473 deletes to the end of line. "incsearchup" searches upwards in the
1477 deletes to the end of line. "incsearchup" searches upwards in the
1474 command history for an input that starts with the text before the cursor.
1478 command history for an input that starts with the text before the cursor.
1475 "incsearchdown" does the same downwards. Removed a bogus mapping of
1479 "incsearchdown" does the same downwards. Removed a bogus mapping of
1476 the x key to "delete".
1480 the x key to "delete".
1477
1481
1478 2006-06-15 Ville Vainio <vivainio@gmail.com>
1482 2006-06-15 Ville Vainio <vivainio@gmail.com>
1479
1483
1480 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1484 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1481 used to create prompts dynamically, instead of the "old" way of
1485 used to create prompts dynamically, instead of the "old" way of
1482 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1486 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1483 way still works (it's invoked by the default hook), of course.
1487 way still works (it's invoked by the default hook), of course.
1484
1488
1485 * Prompts.py: added generate_output_prompt hook for altering output
1489 * Prompts.py: added generate_output_prompt hook for altering output
1486 prompt
1490 prompt
1487
1491
1488 * Release.py: Changed version string to 0.7.3.svn.
1492 * Release.py: Changed version string to 0.7.3.svn.
1489
1493
1490 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1494 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1491
1495
1492 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1496 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1493 the call to fetch() always tries to fetch enough data for at least one
1497 the call to fetch() always tries to fetch enough data for at least one
1494 full screen. This makes it possible to simply call moveto(0,0,True) in
1498 full screen. This makes it possible to simply call moveto(0,0,True) in
1495 the constructor. Fix typos and removed the obsolete goto attribute.
1499 the constructor. Fix typos and removed the obsolete goto attribute.
1496
1500
1497 2006-06-12 Ville Vainio <vivainio@gmail.com>
1501 2006-06-12 Ville Vainio <vivainio@gmail.com>
1498
1502
1499 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1503 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1500 allowing $variable interpolation within multiline statements,
1504 allowing $variable interpolation within multiline statements,
1501 though so far only with "sh" profile for a testing period.
1505 though so far only with "sh" profile for a testing period.
1502 The patch also enables splitting long commands with \ but it
1506 The patch also enables splitting long commands with \ but it
1503 doesn't work properly yet.
1507 doesn't work properly yet.
1504
1508
1505 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1509 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1506
1510
1507 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1511 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1508 input history and the position of the cursor in the input history for
1512 input history and the position of the cursor in the input history for
1509 the find, findbackwards and goto command.
1513 the find, findbackwards and goto command.
1510
1514
1511 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1515 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1512
1516
1513 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1517 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1514 implements the basic functionality of browser commands that require
1518 implements the basic functionality of browser commands that require
1515 input. Reimplement the goto, find and findbackwards commands as
1519 input. Reimplement the goto, find and findbackwards commands as
1516 subclasses of _CommandInput. Add an input history and keymaps to those
1520 subclasses of _CommandInput. Add an input history and keymaps to those
1517 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1521 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1518 execute commands.
1522 execute commands.
1519
1523
1520 2006-06-07 Ville Vainio <vivainio@gmail.com>
1524 2006-06-07 Ville Vainio <vivainio@gmail.com>
1521
1525
1522 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1526 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1523 running the batch files instead of leaving the session open.
1527 running the batch files instead of leaving the session open.
1524
1528
1525 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1529 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1526
1530
1527 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1531 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1528 the original fix was incomplete. Patch submitted by W. Maier.
1532 the original fix was incomplete. Patch submitted by W. Maier.
1529
1533
1530 2006-06-07 Ville Vainio <vivainio@gmail.com>
1534 2006-06-07 Ville Vainio <vivainio@gmail.com>
1531
1535
1532 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1536 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1533 Confirmation prompts can be supressed by 'quiet' option.
1537 Confirmation prompts can be supressed by 'quiet' option.
1534 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1538 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1535
1539
1536 2006-06-06 *** Released version 0.7.2
1540 2006-06-06 *** Released version 0.7.2
1537
1541
1538 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1542 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1539
1543
1540 * IPython/Release.py (version): Made 0.7.2 final for release.
1544 * IPython/Release.py (version): Made 0.7.2 final for release.
1541 Repo tagged and release cut.
1545 Repo tagged and release cut.
1542
1546
1543 2006-06-05 Ville Vainio <vivainio@gmail.com>
1547 2006-06-05 Ville Vainio <vivainio@gmail.com>
1544
1548
1545 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1549 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1546 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1550 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1547
1551
1548 * upgrade_dir.py: try import 'path' module a bit harder
1552 * upgrade_dir.py: try import 'path' module a bit harder
1549 (for %upgrade)
1553 (for %upgrade)
1550
1554
1551 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1555 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1552
1556
1553 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1557 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1554 instead of looping 20 times.
1558 instead of looping 20 times.
1555
1559
1556 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1560 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1557 correctly at initialization time. Bug reported by Krishna Mohan
1561 correctly at initialization time. Bug reported by Krishna Mohan
1558 Gundu <gkmohan-AT-gmail.com> on the user list.
1562 Gundu <gkmohan-AT-gmail.com> on the user list.
1559
1563
1560 * IPython/Release.py (version): Mark 0.7.2 version to start
1564 * IPython/Release.py (version): Mark 0.7.2 version to start
1561 testing for release on 06/06.
1565 testing for release on 06/06.
1562
1566
1563 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1567 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1564
1568
1565 * scripts/irunner: thin script interface so users don't have to
1569 * scripts/irunner: thin script interface so users don't have to
1566 find the module and call it as an executable, since modules rarely
1570 find the module and call it as an executable, since modules rarely
1567 live in people's PATH.
1571 live in people's PATH.
1568
1572
1569 * IPython/irunner.py (InteractiveRunner.__init__): added
1573 * IPython/irunner.py (InteractiveRunner.__init__): added
1570 delaybeforesend attribute to control delays with newer versions of
1574 delaybeforesend attribute to control delays with newer versions of
1571 pexpect. Thanks to detailed help from pexpect's author, Noah
1575 pexpect. Thanks to detailed help from pexpect's author, Noah
1572 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1576 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1573 correctly (it works in NoColor mode).
1577 correctly (it works in NoColor mode).
1574
1578
1575 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1579 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1576 SAGE list, from improper log() calls.
1580 SAGE list, from improper log() calls.
1577
1581
1578 2006-05-31 Ville Vainio <vivainio@gmail.com>
1582 2006-05-31 Ville Vainio <vivainio@gmail.com>
1579
1583
1580 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1584 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1581 with args in parens to work correctly with dirs that have spaces.
1585 with args in parens to work correctly with dirs that have spaces.
1582
1586
1583 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1587 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1584
1588
1585 * IPython/Logger.py (Logger.logstart): add option to log raw input
1589 * IPython/Logger.py (Logger.logstart): add option to log raw input
1586 instead of the processed one. A -r flag was added to the
1590 instead of the processed one. A -r flag was added to the
1587 %logstart magic used for controlling logging.
1591 %logstart magic used for controlling logging.
1588
1592
1589 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1593 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1590
1594
1591 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1595 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1592 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1596 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1593 recognize the option. After a bug report by Will Maier. This
1597 recognize the option. After a bug report by Will Maier. This
1594 closes #64 (will do it after confirmation from W. Maier).
1598 closes #64 (will do it after confirmation from W. Maier).
1595
1599
1596 * IPython/irunner.py: New module to run scripts as if manually
1600 * IPython/irunner.py: New module to run scripts as if manually
1597 typed into an interactive environment, based on pexpect. After a
1601 typed into an interactive environment, based on pexpect. After a
1598 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1602 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1599 ipython-user list. Simple unittests in the tests/ directory.
1603 ipython-user list. Simple unittests in the tests/ directory.
1600
1604
1601 * tools/release: add Will Maier, OpenBSD port maintainer, to
1605 * tools/release: add Will Maier, OpenBSD port maintainer, to
1602 recepients list. We are now officially part of the OpenBSD ports:
1606 recepients list. We are now officially part of the OpenBSD ports:
1603 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1607 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1604 work.
1608 work.
1605
1609
1606 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1610 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1607
1611
1608 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1612 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1609 so that it doesn't break tkinter apps.
1613 so that it doesn't break tkinter apps.
1610
1614
1611 * IPython/iplib.py (_prefilter): fix bug where aliases would
1615 * IPython/iplib.py (_prefilter): fix bug where aliases would
1612 shadow variables when autocall was fully off. Reported by SAGE
1616 shadow variables when autocall was fully off. Reported by SAGE
1613 author William Stein.
1617 author William Stein.
1614
1618
1615 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1619 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1616 at what detail level strings are computed when foo? is requested.
1620 at what detail level strings are computed when foo? is requested.
1617 This allows users to ask for example that the string form of an
1621 This allows users to ask for example that the string form of an
1618 object is only computed when foo?? is called, or even never, by
1622 object is only computed when foo?? is called, or even never, by
1619 setting the object_info_string_level >= 2 in the configuration
1623 setting the object_info_string_level >= 2 in the configuration
1620 file. This new option has been added and documented. After a
1624 file. This new option has been added and documented. After a
1621 request by SAGE to be able to control the printing of very large
1625 request by SAGE to be able to control the printing of very large
1622 objects more easily.
1626 objects more easily.
1623
1627
1624 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1628 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1625
1629
1626 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1630 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1627 from sys.argv, to be 100% consistent with how Python itself works
1631 from sys.argv, to be 100% consistent with how Python itself works
1628 (as seen for example with python -i file.py). After a bug report
1632 (as seen for example with python -i file.py). After a bug report
1629 by Jeffrey Collins.
1633 by Jeffrey Collins.
1630
1634
1631 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1635 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1632 nasty bug which was preventing custom namespaces with -pylab,
1636 nasty bug which was preventing custom namespaces with -pylab,
1633 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1637 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1634 compatibility (long gone from mpl).
1638 compatibility (long gone from mpl).
1635
1639
1636 * IPython/ipapi.py (make_session): name change: create->make. We
1640 * IPython/ipapi.py (make_session): name change: create->make. We
1637 use make in other places (ipmaker,...), it's shorter and easier to
1641 use make in other places (ipmaker,...), it's shorter and easier to
1638 type and say, etc. I'm trying to clean things before 0.7.2 so
1642 type and say, etc. I'm trying to clean things before 0.7.2 so
1639 that I can keep things stable wrt to ipapi in the chainsaw branch.
1643 that I can keep things stable wrt to ipapi in the chainsaw branch.
1640
1644
1641 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1645 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1642 python-mode recognizes our debugger mode. Add support for
1646 python-mode recognizes our debugger mode. Add support for
1643 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1647 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1644 <m.liu.jin-AT-gmail.com> originally written by
1648 <m.liu.jin-AT-gmail.com> originally written by
1645 doxgen-AT-newsmth.net (with minor modifications for xemacs
1649 doxgen-AT-newsmth.net (with minor modifications for xemacs
1646 compatibility)
1650 compatibility)
1647
1651
1648 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1652 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1649 tracebacks when walking the stack so that the stack tracking system
1653 tracebacks when walking the stack so that the stack tracking system
1650 in emacs' python-mode can identify the frames correctly.
1654 in emacs' python-mode can identify the frames correctly.
1651
1655
1652 * IPython/ipmaker.py (make_IPython): make the internal (and
1656 * IPython/ipmaker.py (make_IPython): make the internal (and
1653 default config) autoedit_syntax value false by default. Too many
1657 default config) autoedit_syntax value false by default. Too many
1654 users have complained to me (both on and off-list) about problems
1658 users have complained to me (both on and off-list) about problems
1655 with this option being on by default, so I'm making it default to
1659 with this option being on by default, so I'm making it default to
1656 off. It can still be enabled by anyone via the usual mechanisms.
1660 off. It can still be enabled by anyone via the usual mechanisms.
1657
1661
1658 * IPython/completer.py (Completer.attr_matches): add support for
1662 * IPython/completer.py (Completer.attr_matches): add support for
1659 PyCrust-style _getAttributeNames magic method. Patch contributed
1663 PyCrust-style _getAttributeNames magic method. Patch contributed
1660 by <mscott-AT-goldenspud.com>. Closes #50.
1664 by <mscott-AT-goldenspud.com>. Closes #50.
1661
1665
1662 * IPython/iplib.py (InteractiveShell.__init__): remove the
1666 * IPython/iplib.py (InteractiveShell.__init__): remove the
1663 deletion of exit/quit from __builtin__, which can break
1667 deletion of exit/quit from __builtin__, which can break
1664 third-party tools like the Zope debugging console. The
1668 third-party tools like the Zope debugging console. The
1665 %exit/%quit magics remain. In general, it's probably a good idea
1669 %exit/%quit magics remain. In general, it's probably a good idea
1666 not to delete anything from __builtin__, since we never know what
1670 not to delete anything from __builtin__, since we never know what
1667 that will break. In any case, python now (for 2.5) will support
1671 that will break. In any case, python now (for 2.5) will support
1668 'real' exit/quit, so this issue is moot. Closes #55.
1672 'real' exit/quit, so this issue is moot. Closes #55.
1669
1673
1670 * IPython/genutils.py (with_obj): rename the 'with' function to
1674 * IPython/genutils.py (with_obj): rename the 'with' function to
1671 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1675 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1672 becomes a language keyword. Closes #53.
1676 becomes a language keyword. Closes #53.
1673
1677
1674 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1678 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1675 __file__ attribute to this so it fools more things into thinking
1679 __file__ attribute to this so it fools more things into thinking
1676 it is a real module. Closes #59.
1680 it is a real module. Closes #59.
1677
1681
1678 * IPython/Magic.py (magic_edit): add -n option to open the editor
1682 * IPython/Magic.py (magic_edit): add -n option to open the editor
1679 at a specific line number. After a patch by Stefan van der Walt.
1683 at a specific line number. After a patch by Stefan van der Walt.
1680
1684
1681 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1685 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1682
1686
1683 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1687 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1684 reason the file could not be opened. After automatic crash
1688 reason the file could not be opened. After automatic crash
1685 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1689 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1686 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1690 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1687 (_should_recompile): Don't fire editor if using %bg, since there
1691 (_should_recompile): Don't fire editor if using %bg, since there
1688 is no file in the first place. From the same report as above.
1692 is no file in the first place. From the same report as above.
1689 (raw_input): protect against faulty third-party prefilters. After
1693 (raw_input): protect against faulty third-party prefilters. After
1690 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1694 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1691 while running under SAGE.
1695 while running under SAGE.
1692
1696
1693 2006-05-23 Ville Vainio <vivainio@gmail.com>
1697 2006-05-23 Ville Vainio <vivainio@gmail.com>
1694
1698
1695 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1699 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1696 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1700 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1697 now returns None (again), unless dummy is specifically allowed by
1701 now returns None (again), unless dummy is specifically allowed by
1698 ipapi.get(allow_dummy=True).
1702 ipapi.get(allow_dummy=True).
1699
1703
1700 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1704 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1701
1705
1702 * IPython: remove all 2.2-compatibility objects and hacks from
1706 * IPython: remove all 2.2-compatibility objects and hacks from
1703 everywhere, since we only support 2.3 at this point. Docs
1707 everywhere, since we only support 2.3 at this point. Docs
1704 updated.
1708 updated.
1705
1709
1706 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1710 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1707 Anything requiring extra validation can be turned into a Python
1711 Anything requiring extra validation can be turned into a Python
1708 property in the future. I used a property for the db one b/c
1712 property in the future. I used a property for the db one b/c
1709 there was a nasty circularity problem with the initialization
1713 there was a nasty circularity problem with the initialization
1710 order, which right now I don't have time to clean up.
1714 order, which right now I don't have time to clean up.
1711
1715
1712 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1716 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1713 another locking bug reported by Jorgen. I'm not 100% sure though,
1717 another locking bug reported by Jorgen. I'm not 100% sure though,
1714 so more testing is needed...
1718 so more testing is needed...
1715
1719
1716 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1720 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1717
1721
1718 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1722 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1719 local variables from any routine in user code (typically executed
1723 local variables from any routine in user code (typically executed
1720 with %run) directly into the interactive namespace. Very useful
1724 with %run) directly into the interactive namespace. Very useful
1721 when doing complex debugging.
1725 when doing complex debugging.
1722 (IPythonNotRunning): Changed the default None object to a dummy
1726 (IPythonNotRunning): Changed the default None object to a dummy
1723 whose attributes can be queried as well as called without
1727 whose attributes can be queried as well as called without
1724 exploding, to ease writing code which works transparently both in
1728 exploding, to ease writing code which works transparently both in
1725 and out of ipython and uses some of this API.
1729 and out of ipython and uses some of this API.
1726
1730
1727 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1731 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1728
1732
1729 * IPython/hooks.py (result_display): Fix the fact that our display
1733 * IPython/hooks.py (result_display): Fix the fact that our display
1730 hook was using str() instead of repr(), as the default python
1734 hook was using str() instead of repr(), as the default python
1731 console does. This had gone unnoticed b/c it only happened if
1735 console does. This had gone unnoticed b/c it only happened if
1732 %Pprint was off, but the inconsistency was there.
1736 %Pprint was off, but the inconsistency was there.
1733
1737
1734 2006-05-15 Ville Vainio <vivainio@gmail.com>
1738 2006-05-15 Ville Vainio <vivainio@gmail.com>
1735
1739
1736 * Oinspect.py: Only show docstring for nonexisting/binary files
1740 * Oinspect.py: Only show docstring for nonexisting/binary files
1737 when doing object??, closing ticket #62
1741 when doing object??, closing ticket #62
1738
1742
1739 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1743 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1740
1744
1741 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1745 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1742 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1746 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1743 was being released in a routine which hadn't checked if it had
1747 was being released in a routine which hadn't checked if it had
1744 been the one to acquire it.
1748 been the one to acquire it.
1745
1749
1746 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1750 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1747
1751
1748 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1752 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1749
1753
1750 2006-04-11 Ville Vainio <vivainio@gmail.com>
1754 2006-04-11 Ville Vainio <vivainio@gmail.com>
1751
1755
1752 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1756 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1753 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1757 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1754 prefilters, allowing stuff like magics and aliases in the file.
1758 prefilters, allowing stuff like magics and aliases in the file.
1755
1759
1756 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1760 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1757 added. Supported now are "%clear in" and "%clear out" (clear input and
1761 added. Supported now are "%clear in" and "%clear out" (clear input and
1758 output history, respectively). Also fixed CachedOutput.flush to
1762 output history, respectively). Also fixed CachedOutput.flush to
1759 properly flush the output cache.
1763 properly flush the output cache.
1760
1764
1761 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1765 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1762 half-success (and fail explicitly).
1766 half-success (and fail explicitly).
1763
1767
1764 2006-03-28 Ville Vainio <vivainio@gmail.com>
1768 2006-03-28 Ville Vainio <vivainio@gmail.com>
1765
1769
1766 * iplib.py: Fix quoting of aliases so that only argless ones
1770 * iplib.py: Fix quoting of aliases so that only argless ones
1767 are quoted
1771 are quoted
1768
1772
1769 2006-03-28 Ville Vainio <vivainio@gmail.com>
1773 2006-03-28 Ville Vainio <vivainio@gmail.com>
1770
1774
1771 * iplib.py: Quote aliases with spaces in the name.
1775 * iplib.py: Quote aliases with spaces in the name.
1772 "c:\program files\blah\bin" is now legal alias target.
1776 "c:\program files\blah\bin" is now legal alias target.
1773
1777
1774 * ext_rehashdir.py: Space no longer allowed as arg
1778 * ext_rehashdir.py: Space no longer allowed as arg
1775 separator, since space is legal in path names.
1779 separator, since space is legal in path names.
1776
1780
1777 2006-03-16 Ville Vainio <vivainio@gmail.com>
1781 2006-03-16 Ville Vainio <vivainio@gmail.com>
1778
1782
1779 * upgrade_dir.py: Take path.py from Extensions, correcting
1783 * upgrade_dir.py: Take path.py from Extensions, correcting
1780 %upgrade magic
1784 %upgrade magic
1781
1785
1782 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1786 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1783
1787
1784 * hooks.py: Only enclose editor binary in quotes if legal and
1788 * hooks.py: Only enclose editor binary in quotes if legal and
1785 necessary (space in the name, and is an existing file). Fixes a bug
1789 necessary (space in the name, and is an existing file). Fixes a bug
1786 reported by Zachary Pincus.
1790 reported by Zachary Pincus.
1787
1791
1788 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1792 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1789
1793
1790 * Manual: thanks to a tip on proper color handling for Emacs, by
1794 * Manual: thanks to a tip on proper color handling for Emacs, by
1791 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1795 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1792
1796
1793 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1797 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1794 by applying the provided patch. Thanks to Liu Jin
1798 by applying the provided patch. Thanks to Liu Jin
1795 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1799 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1796 XEmacs/Linux, I'm trusting the submitter that it actually helps
1800 XEmacs/Linux, I'm trusting the submitter that it actually helps
1797 under win32/GNU Emacs. Will revisit if any problems are reported.
1801 under win32/GNU Emacs. Will revisit if any problems are reported.
1798
1802
1799 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1803 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1800
1804
1801 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1805 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1802 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1806 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1803
1807
1804 2006-03-12 Ville Vainio <vivainio@gmail.com>
1808 2006-03-12 Ville Vainio <vivainio@gmail.com>
1805
1809
1806 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1810 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1807 Torsten Marek.
1811 Torsten Marek.
1808
1812
1809 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1813 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1810
1814
1811 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1815 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1812 line ranges works again.
1816 line ranges works again.
1813
1817
1814 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1818 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1815
1819
1816 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1820 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1817 and friends, after a discussion with Zach Pincus on ipython-user.
1821 and friends, after a discussion with Zach Pincus on ipython-user.
1818 I'm not 100% sure, but after thinking about it quite a bit, it may
1822 I'm not 100% sure, but after thinking about it quite a bit, it may
1819 be OK. Testing with the multithreaded shells didn't reveal any
1823 be OK. Testing with the multithreaded shells didn't reveal any
1820 problems, but let's keep an eye out.
1824 problems, but let's keep an eye out.
1821
1825
1822 In the process, I fixed a few things which were calling
1826 In the process, I fixed a few things which were calling
1823 self.InteractiveTB() directly (like safe_execfile), which is a
1827 self.InteractiveTB() directly (like safe_execfile), which is a
1824 mistake: ALL exception reporting should be done by calling
1828 mistake: ALL exception reporting should be done by calling
1825 self.showtraceback(), which handles state and tab-completion and
1829 self.showtraceback(), which handles state and tab-completion and
1826 more.
1830 more.
1827
1831
1828 2006-03-01 Ville Vainio <vivainio@gmail.com>
1832 2006-03-01 Ville Vainio <vivainio@gmail.com>
1829
1833
1830 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1834 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1831 To use, do "from ipipe import *".
1835 To use, do "from ipipe import *".
1832
1836
1833 2006-02-24 Ville Vainio <vivainio@gmail.com>
1837 2006-02-24 Ville Vainio <vivainio@gmail.com>
1834
1838
1835 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1839 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1836 "cleanly" and safely than the older upgrade mechanism.
1840 "cleanly" and safely than the older upgrade mechanism.
1837
1841
1838 2006-02-21 Ville Vainio <vivainio@gmail.com>
1842 2006-02-21 Ville Vainio <vivainio@gmail.com>
1839
1843
1840 * Magic.py: %save works again.
1844 * Magic.py: %save works again.
1841
1845
1842 2006-02-15 Ville Vainio <vivainio@gmail.com>
1846 2006-02-15 Ville Vainio <vivainio@gmail.com>
1843
1847
1844 * Magic.py: %Pprint works again
1848 * Magic.py: %Pprint works again
1845
1849
1846 * Extensions/ipy_sane_defaults.py: Provide everything provided
1850 * Extensions/ipy_sane_defaults.py: Provide everything provided
1847 in default ipythonrc, to make it possible to have a completely empty
1851 in default ipythonrc, to make it possible to have a completely empty
1848 ipythonrc (and thus completely rc-file free configuration)
1852 ipythonrc (and thus completely rc-file free configuration)
1849
1853
1850 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1854 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1851
1855
1852 * IPython/hooks.py (editor): quote the call to the editor command,
1856 * IPython/hooks.py (editor): quote the call to the editor command,
1853 to allow commands with spaces in them. Problem noted by watching
1857 to allow commands with spaces in them. Problem noted by watching
1854 Ian Oswald's video about textpad under win32 at
1858 Ian Oswald's video about textpad under win32 at
1855 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1859 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1856
1860
1857 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1861 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1858 describing magics (we haven't used @ for a loong time).
1862 describing magics (we haven't used @ for a loong time).
1859
1863
1860 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1864 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1861 contributed by marienz to close
1865 contributed by marienz to close
1862 http://www.scipy.net/roundup/ipython/issue53.
1866 http://www.scipy.net/roundup/ipython/issue53.
1863
1867
1864 2006-02-10 Ville Vainio <vivainio@gmail.com>
1868 2006-02-10 Ville Vainio <vivainio@gmail.com>
1865
1869
1866 * genutils.py: getoutput now works in win32 too
1870 * genutils.py: getoutput now works in win32 too
1867
1871
1868 * completer.py: alias and magic completion only invoked
1872 * completer.py: alias and magic completion only invoked
1869 at the first "item" in the line, to avoid "cd %store"
1873 at the first "item" in the line, to avoid "cd %store"
1870 nonsense.
1874 nonsense.
1871
1875
1872 2006-02-09 Ville Vainio <vivainio@gmail.com>
1876 2006-02-09 Ville Vainio <vivainio@gmail.com>
1873
1877
1874 * test/*: Added a unit testing framework (finally).
1878 * test/*: Added a unit testing framework (finally).
1875 '%run runtests.py' to run test_*.
1879 '%run runtests.py' to run test_*.
1876
1880
1877 * ipapi.py: Exposed runlines and set_custom_exc
1881 * ipapi.py: Exposed runlines and set_custom_exc
1878
1882
1879 2006-02-07 Ville Vainio <vivainio@gmail.com>
1883 2006-02-07 Ville Vainio <vivainio@gmail.com>
1880
1884
1881 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1885 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1882 instead use "f(1 2)" as before.
1886 instead use "f(1 2)" as before.
1883
1887
1884 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1888 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1885
1889
1886 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1890 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1887 facilities, for demos processed by the IPython input filter
1891 facilities, for demos processed by the IPython input filter
1888 (IPythonDemo), and for running a script one-line-at-a-time as a
1892 (IPythonDemo), and for running a script one-line-at-a-time as a
1889 demo, both for pure Python (LineDemo) and for IPython-processed
1893 demo, both for pure Python (LineDemo) and for IPython-processed
1890 input (IPythonLineDemo). After a request by Dave Kohel, from the
1894 input (IPythonLineDemo). After a request by Dave Kohel, from the
1891 SAGE team.
1895 SAGE team.
1892 (Demo.edit): added an edit() method to the demo objects, to edit
1896 (Demo.edit): added an edit() method to the demo objects, to edit
1893 the in-memory copy of the last executed block.
1897 the in-memory copy of the last executed block.
1894
1898
1895 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1899 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1896 processing to %edit, %macro and %save. These commands can now be
1900 processing to %edit, %macro and %save. These commands can now be
1897 invoked on the unprocessed input as it was typed by the user
1901 invoked on the unprocessed input as it was typed by the user
1898 (without any prefilters applied). After requests by the SAGE team
1902 (without any prefilters applied). After requests by the SAGE team
1899 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1903 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1900
1904
1901 2006-02-01 Ville Vainio <vivainio@gmail.com>
1905 2006-02-01 Ville Vainio <vivainio@gmail.com>
1902
1906
1903 * setup.py, eggsetup.py: easy_install ipython==dev works
1907 * setup.py, eggsetup.py: easy_install ipython==dev works
1904 correctly now (on Linux)
1908 correctly now (on Linux)
1905
1909
1906 * ipy_user_conf,ipmaker: user config changes, removed spurious
1910 * ipy_user_conf,ipmaker: user config changes, removed spurious
1907 warnings
1911 warnings
1908
1912
1909 * iplib: if rc.banner is string, use it as is.
1913 * iplib: if rc.banner is string, use it as is.
1910
1914
1911 * Magic: %pycat accepts a string argument and pages it's contents.
1915 * Magic: %pycat accepts a string argument and pages it's contents.
1912
1916
1913
1917
1914 2006-01-30 Ville Vainio <vivainio@gmail.com>
1918 2006-01-30 Ville Vainio <vivainio@gmail.com>
1915
1919
1916 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1920 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1917 Now %store and bookmarks work through PickleShare, meaning that
1921 Now %store and bookmarks work through PickleShare, meaning that
1918 concurrent access is possible and all ipython sessions see the
1922 concurrent access is possible and all ipython sessions see the
1919 same database situation all the time, instead of snapshot of
1923 same database situation all the time, instead of snapshot of
1920 the situation when the session was started. Hence, %bookmark
1924 the situation when the session was started. Hence, %bookmark
1921 results are immediately accessible from othes sessions. The database
1925 results are immediately accessible from othes sessions. The database
1922 is also available for use by user extensions. See:
1926 is also available for use by user extensions. See:
1923 http://www.python.org/pypi/pickleshare
1927 http://www.python.org/pypi/pickleshare
1924
1928
1925 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1929 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1926
1930
1927 * aliases can now be %store'd
1931 * aliases can now be %store'd
1928
1932
1929 * path.py moved to Extensions so that pickleshare does not need
1933 * path.py moved to Extensions so that pickleshare does not need
1930 IPython-specific import. Extensions added to pythonpath right
1934 IPython-specific import. Extensions added to pythonpath right
1931 at __init__.
1935 at __init__.
1932
1936
1933 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1937 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1934 called with _ip.system and the pre-transformed command string.
1938 called with _ip.system and the pre-transformed command string.
1935
1939
1936 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1940 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1937
1941
1938 * IPython/iplib.py (interact): Fix that we were not catching
1942 * IPython/iplib.py (interact): Fix that we were not catching
1939 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1943 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1940 logic here had to change, but it's fixed now.
1944 logic here had to change, but it's fixed now.
1941
1945
1942 2006-01-29 Ville Vainio <vivainio@gmail.com>
1946 2006-01-29 Ville Vainio <vivainio@gmail.com>
1943
1947
1944 * iplib.py: Try to import pyreadline on Windows.
1948 * iplib.py: Try to import pyreadline on Windows.
1945
1949
1946 2006-01-27 Ville Vainio <vivainio@gmail.com>
1950 2006-01-27 Ville Vainio <vivainio@gmail.com>
1947
1951
1948 * iplib.py: Expose ipapi as _ip in builtin namespace.
1952 * iplib.py: Expose ipapi as _ip in builtin namespace.
1949 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1953 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1950 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1954 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1951 syntax now produce _ip.* variant of the commands.
1955 syntax now produce _ip.* variant of the commands.
1952
1956
1953 * "_ip.options().autoedit_syntax = 2" automatically throws
1957 * "_ip.options().autoedit_syntax = 2" automatically throws
1954 user to editor for syntax error correction without prompting.
1958 user to editor for syntax error correction without prompting.
1955
1959
1956 2006-01-27 Ville Vainio <vivainio@gmail.com>
1960 2006-01-27 Ville Vainio <vivainio@gmail.com>
1957
1961
1958 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1962 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1959 'ipython' at argv[0]) executed through command line.
1963 'ipython' at argv[0]) executed through command line.
1960 NOTE: this DEPRECATES calling ipython with multiple scripts
1964 NOTE: this DEPRECATES calling ipython with multiple scripts
1961 ("ipython a.py b.py c.py")
1965 ("ipython a.py b.py c.py")
1962
1966
1963 * iplib.py, hooks.py: Added configurable input prefilter,
1967 * iplib.py, hooks.py: Added configurable input prefilter,
1964 named 'input_prefilter'. See ext_rescapture.py for example
1968 named 'input_prefilter'. See ext_rescapture.py for example
1965 usage.
1969 usage.
1966
1970
1967 * ext_rescapture.py, Magic.py: Better system command output capture
1971 * ext_rescapture.py, Magic.py: Better system command output capture
1968 through 'var = !ls' (deprecates user-visible %sc). Same notation
1972 through 'var = !ls' (deprecates user-visible %sc). Same notation
1969 applies for magics, 'var = %alias' assigns alias list to var.
1973 applies for magics, 'var = %alias' assigns alias list to var.
1970
1974
1971 * ipapi.py: added meta() for accessing extension-usable data store.
1975 * ipapi.py: added meta() for accessing extension-usable data store.
1972
1976
1973 * iplib.py: added InteractiveShell.getapi(). New magics should be
1977 * iplib.py: added InteractiveShell.getapi(). New magics should be
1974 written doing self.getapi() instead of using the shell directly.
1978 written doing self.getapi() instead of using the shell directly.
1975
1979
1976 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1980 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1977 %store foo >> ~/myfoo.txt to store variables to files (in clean
1981 %store foo >> ~/myfoo.txt to store variables to files (in clean
1978 textual form, not a restorable pickle).
1982 textual form, not a restorable pickle).
1979
1983
1980 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1984 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1981
1985
1982 * usage.py, Magic.py: added %quickref
1986 * usage.py, Magic.py: added %quickref
1983
1987
1984 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1988 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1985
1989
1986 * GetoptErrors when invoking magics etc. with wrong args
1990 * GetoptErrors when invoking magics etc. with wrong args
1987 are now more helpful:
1991 are now more helpful:
1988 GetoptError: option -l not recognized (allowed: "qb" )
1992 GetoptError: option -l not recognized (allowed: "qb" )
1989
1993
1990 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1994 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1991
1995
1992 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1996 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1993 computationally intensive blocks don't appear to stall the demo.
1997 computationally intensive blocks don't appear to stall the demo.
1994
1998
1995 2006-01-24 Ville Vainio <vivainio@gmail.com>
1999 2006-01-24 Ville Vainio <vivainio@gmail.com>
1996
2000
1997 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2001 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1998 value to manipulate resulting history entry.
2002 value to manipulate resulting history entry.
1999
2003
2000 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2004 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2001 to instance methods of IPApi class, to make extending an embedded
2005 to instance methods of IPApi class, to make extending an embedded
2002 IPython feasible. See ext_rehashdir.py for example usage.
2006 IPython feasible. See ext_rehashdir.py for example usage.
2003
2007
2004 * Merged 1071-1076 from branches/0.7.1
2008 * Merged 1071-1076 from branches/0.7.1
2005
2009
2006
2010
2007 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2011 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2008
2012
2009 * tools/release (daystamp): Fix build tools to use the new
2013 * tools/release (daystamp): Fix build tools to use the new
2010 eggsetup.py script to build lightweight eggs.
2014 eggsetup.py script to build lightweight eggs.
2011
2015
2012 * Applied changesets 1062 and 1064 before 0.7.1 release.
2016 * Applied changesets 1062 and 1064 before 0.7.1 release.
2013
2017
2014 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2018 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2015 see the raw input history (without conversions like %ls ->
2019 see the raw input history (without conversions like %ls ->
2016 ipmagic("ls")). After a request from W. Stein, SAGE
2020 ipmagic("ls")). After a request from W. Stein, SAGE
2017 (http://modular.ucsd.edu/sage) developer. This information is
2021 (http://modular.ucsd.edu/sage) developer. This information is
2018 stored in the input_hist_raw attribute of the IPython instance, so
2022 stored in the input_hist_raw attribute of the IPython instance, so
2019 developers can access it if needed (it's an InputList instance).
2023 developers can access it if needed (it's an InputList instance).
2020
2024
2021 * Versionstring = 0.7.2.svn
2025 * Versionstring = 0.7.2.svn
2022
2026
2023 * eggsetup.py: A separate script for constructing eggs, creates
2027 * eggsetup.py: A separate script for constructing eggs, creates
2024 proper launch scripts even on Windows (an .exe file in
2028 proper launch scripts even on Windows (an .exe file in
2025 \python24\scripts).
2029 \python24\scripts).
2026
2030
2027 * ipapi.py: launch_new_instance, launch entry point needed for the
2031 * ipapi.py: launch_new_instance, launch entry point needed for the
2028 egg.
2032 egg.
2029
2033
2030 2006-01-23 Ville Vainio <vivainio@gmail.com>
2034 2006-01-23 Ville Vainio <vivainio@gmail.com>
2031
2035
2032 * Added %cpaste magic for pasting python code
2036 * Added %cpaste magic for pasting python code
2033
2037
2034 2006-01-22 Ville Vainio <vivainio@gmail.com>
2038 2006-01-22 Ville Vainio <vivainio@gmail.com>
2035
2039
2036 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2040 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2037
2041
2038 * Versionstring = 0.7.2.svn
2042 * Versionstring = 0.7.2.svn
2039
2043
2040 * eggsetup.py: A separate script for constructing eggs, creates
2044 * eggsetup.py: A separate script for constructing eggs, creates
2041 proper launch scripts even on Windows (an .exe file in
2045 proper launch scripts even on Windows (an .exe file in
2042 \python24\scripts).
2046 \python24\scripts).
2043
2047
2044 * ipapi.py: launch_new_instance, launch entry point needed for the
2048 * ipapi.py: launch_new_instance, launch entry point needed for the
2045 egg.
2049 egg.
2046
2050
2047 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2051 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2048
2052
2049 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2053 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2050 %pfile foo would print the file for foo even if it was a binary.
2054 %pfile foo would print the file for foo even if it was a binary.
2051 Now, extensions '.so' and '.dll' are skipped.
2055 Now, extensions '.so' and '.dll' are skipped.
2052
2056
2053 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2057 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2054 bug, where macros would fail in all threaded modes. I'm not 100%
2058 bug, where macros would fail in all threaded modes. I'm not 100%
2055 sure, so I'm going to put out an rc instead of making a release
2059 sure, so I'm going to put out an rc instead of making a release
2056 today, and wait for feedback for at least a few days.
2060 today, and wait for feedback for at least a few days.
2057
2061
2058 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2062 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2059 it...) the handling of pasting external code with autoindent on.
2063 it...) the handling of pasting external code with autoindent on.
2060 To get out of a multiline input, the rule will appear for most
2064 To get out of a multiline input, the rule will appear for most
2061 users unchanged: two blank lines or change the indent level
2065 users unchanged: two blank lines or change the indent level
2062 proposed by IPython. But there is a twist now: you can
2066 proposed by IPython. But there is a twist now: you can
2063 add/subtract only *one or two spaces*. If you add/subtract three
2067 add/subtract only *one or two spaces*. If you add/subtract three
2064 or more (unless you completely delete the line), IPython will
2068 or more (unless you completely delete the line), IPython will
2065 accept that line, and you'll need to enter a second one of pure
2069 accept that line, and you'll need to enter a second one of pure
2066 whitespace. I know it sounds complicated, but I can't find a
2070 whitespace. I know it sounds complicated, but I can't find a
2067 different solution that covers all the cases, with the right
2071 different solution that covers all the cases, with the right
2068 heuristics. Hopefully in actual use, nobody will really notice
2072 heuristics. Hopefully in actual use, nobody will really notice
2069 all these strange rules and things will 'just work'.
2073 all these strange rules and things will 'just work'.
2070
2074
2071 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2075 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2072
2076
2073 * IPython/iplib.py (interact): catch exceptions which can be
2077 * IPython/iplib.py (interact): catch exceptions which can be
2074 triggered asynchronously by signal handlers. Thanks to an
2078 triggered asynchronously by signal handlers. Thanks to an
2075 automatic crash report, submitted by Colin Kingsley
2079 automatic crash report, submitted by Colin Kingsley
2076 <tercel-AT-gentoo.org>.
2080 <tercel-AT-gentoo.org>.
2077
2081
2078 2006-01-20 Ville Vainio <vivainio@gmail.com>
2082 2006-01-20 Ville Vainio <vivainio@gmail.com>
2079
2083
2080 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2084 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2081 (%rehashdir, very useful, try it out) of how to extend ipython
2085 (%rehashdir, very useful, try it out) of how to extend ipython
2082 with new magics. Also added Extensions dir to pythonpath to make
2086 with new magics. Also added Extensions dir to pythonpath to make
2083 importing extensions easy.
2087 importing extensions easy.
2084
2088
2085 * %store now complains when trying to store interactively declared
2089 * %store now complains when trying to store interactively declared
2086 classes / instances of those classes.
2090 classes / instances of those classes.
2087
2091
2088 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2092 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2089 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2093 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2090 if they exist, and ipy_user_conf.py with some defaults is created for
2094 if they exist, and ipy_user_conf.py with some defaults is created for
2091 the user.
2095 the user.
2092
2096
2093 * Startup rehashing done by the config file, not InterpreterExec.
2097 * Startup rehashing done by the config file, not InterpreterExec.
2094 This means system commands are available even without selecting the
2098 This means system commands are available even without selecting the
2095 pysh profile. It's the sensible default after all.
2099 pysh profile. It's the sensible default after all.
2096
2100
2097 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2101 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2098
2102
2099 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2103 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2100 multiline code with autoindent on working. But I am really not
2104 multiline code with autoindent on working. But I am really not
2101 sure, so this needs more testing. Will commit a debug-enabled
2105 sure, so this needs more testing. Will commit a debug-enabled
2102 version for now, while I test it some more, so that Ville and
2106 version for now, while I test it some more, so that Ville and
2103 others may also catch any problems. Also made
2107 others may also catch any problems. Also made
2104 self.indent_current_str() a method, to ensure that there's no
2108 self.indent_current_str() a method, to ensure that there's no
2105 chance of the indent space count and the corresponding string
2109 chance of the indent space count and the corresponding string
2106 falling out of sync. All code needing the string should just call
2110 falling out of sync. All code needing the string should just call
2107 the method.
2111 the method.
2108
2112
2109 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2113 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2110
2114
2111 * IPython/Magic.py (magic_edit): fix check for when users don't
2115 * IPython/Magic.py (magic_edit): fix check for when users don't
2112 save their output files, the try/except was in the wrong section.
2116 save their output files, the try/except was in the wrong section.
2113
2117
2114 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2118 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2115
2119
2116 * IPython/Magic.py (magic_run): fix __file__ global missing from
2120 * IPython/Magic.py (magic_run): fix __file__ global missing from
2117 script's namespace when executed via %run. After a report by
2121 script's namespace when executed via %run. After a report by
2118 Vivian.
2122 Vivian.
2119
2123
2120 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2124 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2121 when using python 2.4. The parent constructor changed in 2.4, and
2125 when using python 2.4. The parent constructor changed in 2.4, and
2122 we need to track it directly (we can't call it, as it messes up
2126 we need to track it directly (we can't call it, as it messes up
2123 readline and tab-completion inside our pdb would stop working).
2127 readline and tab-completion inside our pdb would stop working).
2124 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2128 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2125
2129
2126 2006-01-16 Ville Vainio <vivainio@gmail.com>
2130 2006-01-16 Ville Vainio <vivainio@gmail.com>
2127
2131
2128 * Ipython/magic.py: Reverted back to old %edit functionality
2132 * Ipython/magic.py: Reverted back to old %edit functionality
2129 that returns file contents on exit.
2133 that returns file contents on exit.
2130
2134
2131 * IPython/path.py: Added Jason Orendorff's "path" module to
2135 * IPython/path.py: Added Jason Orendorff's "path" module to
2132 IPython tree, http://www.jorendorff.com/articles/python/path/.
2136 IPython tree, http://www.jorendorff.com/articles/python/path/.
2133 You can get path objects conveniently through %sc, and !!, e.g.:
2137 You can get path objects conveniently through %sc, and !!, e.g.:
2134 sc files=ls
2138 sc files=ls
2135 for p in files.paths: # or files.p
2139 for p in files.paths: # or files.p
2136 print p,p.mtime
2140 print p,p.mtime
2137
2141
2138 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2142 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2139 now work again without considering the exclusion regexp -
2143 now work again without considering the exclusion regexp -
2140 hence, things like ',foo my/path' turn to 'foo("my/path")'
2144 hence, things like ',foo my/path' turn to 'foo("my/path")'
2141 instead of syntax error.
2145 instead of syntax error.
2142
2146
2143
2147
2144 2006-01-14 Ville Vainio <vivainio@gmail.com>
2148 2006-01-14 Ville Vainio <vivainio@gmail.com>
2145
2149
2146 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2150 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2147 ipapi decorators for python 2.4 users, options() provides access to rc
2151 ipapi decorators for python 2.4 users, options() provides access to rc
2148 data.
2152 data.
2149
2153
2150 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2154 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2151 as path separators (even on Linux ;-). Space character after
2155 as path separators (even on Linux ;-). Space character after
2152 backslash (as yielded by tab completer) is still space;
2156 backslash (as yielded by tab completer) is still space;
2153 "%cd long\ name" works as expected.
2157 "%cd long\ name" works as expected.
2154
2158
2155 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2159 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2156 as "chain of command", with priority. API stays the same,
2160 as "chain of command", with priority. API stays the same,
2157 TryNext exception raised by a hook function signals that
2161 TryNext exception raised by a hook function signals that
2158 current hook failed and next hook should try handling it, as
2162 current hook failed and next hook should try handling it, as
2159 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2163 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2160 requested configurable display hook, which is now implemented.
2164 requested configurable display hook, which is now implemented.
2161
2165
2162 2006-01-13 Ville Vainio <vivainio@gmail.com>
2166 2006-01-13 Ville Vainio <vivainio@gmail.com>
2163
2167
2164 * IPython/platutils*.py: platform specific utility functions,
2168 * IPython/platutils*.py: platform specific utility functions,
2165 so far only set_term_title is implemented (change terminal
2169 so far only set_term_title is implemented (change terminal
2166 label in windowing systems). %cd now changes the title to
2170 label in windowing systems). %cd now changes the title to
2167 current dir.
2171 current dir.
2168
2172
2169 * IPython/Release.py: Added myself to "authors" list,
2173 * IPython/Release.py: Added myself to "authors" list,
2170 had to create new files.
2174 had to create new files.
2171
2175
2172 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2176 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2173 shell escape; not a known bug but had potential to be one in the
2177 shell escape; not a known bug but had potential to be one in the
2174 future.
2178 future.
2175
2179
2176 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2180 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2177 extension API for IPython! See the module for usage example. Fix
2181 extension API for IPython! See the module for usage example. Fix
2178 OInspect for docstring-less magic functions.
2182 OInspect for docstring-less magic functions.
2179
2183
2180
2184
2181 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2185 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2182
2186
2183 * IPython/iplib.py (raw_input): temporarily deactivate all
2187 * IPython/iplib.py (raw_input): temporarily deactivate all
2184 attempts at allowing pasting of code with autoindent on. It
2188 attempts at allowing pasting of code with autoindent on. It
2185 introduced bugs (reported by Prabhu) and I can't seem to find a
2189 introduced bugs (reported by Prabhu) and I can't seem to find a
2186 robust combination which works in all cases. Will have to revisit
2190 robust combination which works in all cases. Will have to revisit
2187 later.
2191 later.
2188
2192
2189 * IPython/genutils.py: remove isspace() function. We've dropped
2193 * IPython/genutils.py: remove isspace() function. We've dropped
2190 2.2 compatibility, so it's OK to use the string method.
2194 2.2 compatibility, so it's OK to use the string method.
2191
2195
2192 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2196 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2193
2197
2194 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2198 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2195 matching what NOT to autocall on, to include all python binary
2199 matching what NOT to autocall on, to include all python binary
2196 operators (including things like 'and', 'or', 'is' and 'in').
2200 operators (including things like 'and', 'or', 'is' and 'in').
2197 Prompted by a bug report on 'foo & bar', but I realized we had
2201 Prompted by a bug report on 'foo & bar', but I realized we had
2198 many more potential bug cases with other operators. The regexp is
2202 many more potential bug cases with other operators. The regexp is
2199 self.re_exclude_auto, it's fairly commented.
2203 self.re_exclude_auto, it's fairly commented.
2200
2204
2201 2006-01-12 Ville Vainio <vivainio@gmail.com>
2205 2006-01-12 Ville Vainio <vivainio@gmail.com>
2202
2206
2203 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2207 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2204 Prettified and hardened string/backslash quoting with ipsystem(),
2208 Prettified and hardened string/backslash quoting with ipsystem(),
2205 ipalias() and ipmagic(). Now even \ characters are passed to
2209 ipalias() and ipmagic(). Now even \ characters are passed to
2206 %magics, !shell escapes and aliases exactly as they are in the
2210 %magics, !shell escapes and aliases exactly as they are in the
2207 ipython command line. Should improve backslash experience,
2211 ipython command line. Should improve backslash experience,
2208 particularly in Windows (path delimiter for some commands that
2212 particularly in Windows (path delimiter for some commands that
2209 won't understand '/'), but Unix benefits as well (regexps). %cd
2213 won't understand '/'), but Unix benefits as well (regexps). %cd
2210 magic still doesn't support backslash path delimiters, though. Also
2214 magic still doesn't support backslash path delimiters, though. Also
2211 deleted all pretense of supporting multiline command strings in
2215 deleted all pretense of supporting multiline command strings in
2212 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2216 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2213
2217
2214 * doc/build_doc_instructions.txt added. Documentation on how to
2218 * doc/build_doc_instructions.txt added. Documentation on how to
2215 use doc/update_manual.py, added yesterday. Both files contributed
2219 use doc/update_manual.py, added yesterday. Both files contributed
2216 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2220 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2217 doc/*.sh for deprecation at a later date.
2221 doc/*.sh for deprecation at a later date.
2218
2222
2219 * /ipython.py Added ipython.py to root directory for
2223 * /ipython.py Added ipython.py to root directory for
2220 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2224 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2221 ipython.py) and development convenience (no need to keep doing
2225 ipython.py) and development convenience (no need to keep doing
2222 "setup.py install" between changes).
2226 "setup.py install" between changes).
2223
2227
2224 * Made ! and !! shell escapes work (again) in multiline expressions:
2228 * Made ! and !! shell escapes work (again) in multiline expressions:
2225 if 1:
2229 if 1:
2226 !ls
2230 !ls
2227 !!ls
2231 !!ls
2228
2232
2229 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2233 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2230
2234
2231 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2235 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2232 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2236 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2233 module in case-insensitive installation. Was causing crashes
2237 module in case-insensitive installation. Was causing crashes
2234 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2238 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2235
2239
2236 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2240 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2237 <marienz-AT-gentoo.org>, closes
2241 <marienz-AT-gentoo.org>, closes
2238 http://www.scipy.net/roundup/ipython/issue51.
2242 http://www.scipy.net/roundup/ipython/issue51.
2239
2243
2240 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2244 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2241
2245
2242 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2246 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2243 problem of excessive CPU usage under *nix and keyboard lag under
2247 problem of excessive CPU usage under *nix and keyboard lag under
2244 win32.
2248 win32.
2245
2249
2246 2006-01-10 *** Released version 0.7.0
2250 2006-01-10 *** Released version 0.7.0
2247
2251
2248 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2252 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2249
2253
2250 * IPython/Release.py (revision): tag version number to 0.7.0,
2254 * IPython/Release.py (revision): tag version number to 0.7.0,
2251 ready for release.
2255 ready for release.
2252
2256
2253 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2257 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2254 it informs the user of the name of the temp. file used. This can
2258 it informs the user of the name of the temp. file used. This can
2255 help if you decide later to reuse that same file, so you know
2259 help if you decide later to reuse that same file, so you know
2256 where to copy the info from.
2260 where to copy the info from.
2257
2261
2258 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2262 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2259
2263
2260 * setup_bdist_egg.py: little script to build an egg. Added
2264 * setup_bdist_egg.py: little script to build an egg. Added
2261 support in the release tools as well.
2265 support in the release tools as well.
2262
2266
2263 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2267 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2264
2268
2265 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2269 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2266 version selection (new -wxversion command line and ipythonrc
2270 version selection (new -wxversion command line and ipythonrc
2267 parameter). Patch contributed by Arnd Baecker
2271 parameter). Patch contributed by Arnd Baecker
2268 <arnd.baecker-AT-web.de>.
2272 <arnd.baecker-AT-web.de>.
2269
2273
2270 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2274 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2271 embedded instances, for variables defined at the interactive
2275 embedded instances, for variables defined at the interactive
2272 prompt of the embedded ipython. Reported by Arnd.
2276 prompt of the embedded ipython. Reported by Arnd.
2273
2277
2274 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2278 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2275 it can be used as a (stateful) toggle, or with a direct parameter.
2279 it can be used as a (stateful) toggle, or with a direct parameter.
2276
2280
2277 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2281 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2278 could be triggered in certain cases and cause the traceback
2282 could be triggered in certain cases and cause the traceback
2279 printer not to work.
2283 printer not to work.
2280
2284
2281 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2285 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2282
2286
2283 * IPython/iplib.py (_should_recompile): Small fix, closes
2287 * IPython/iplib.py (_should_recompile): Small fix, closes
2284 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2288 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2285
2289
2286 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2290 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2287
2291
2288 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2292 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2289 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2293 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2290 Moad for help with tracking it down.
2294 Moad for help with tracking it down.
2291
2295
2292 * IPython/iplib.py (handle_auto): fix autocall handling for
2296 * IPython/iplib.py (handle_auto): fix autocall handling for
2293 objects which support BOTH __getitem__ and __call__ (so that f [x]
2297 objects which support BOTH __getitem__ and __call__ (so that f [x]
2294 is left alone, instead of becoming f([x]) automatically).
2298 is left alone, instead of becoming f([x]) automatically).
2295
2299
2296 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2300 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2297 Ville's patch.
2301 Ville's patch.
2298
2302
2299 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2303 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2300
2304
2301 * IPython/iplib.py (handle_auto): changed autocall semantics to
2305 * IPython/iplib.py (handle_auto): changed autocall semantics to
2302 include 'smart' mode, where the autocall transformation is NOT
2306 include 'smart' mode, where the autocall transformation is NOT
2303 applied if there are no arguments on the line. This allows you to
2307 applied if there are no arguments on the line. This allows you to
2304 just type 'foo' if foo is a callable to see its internal form,
2308 just type 'foo' if foo is a callable to see its internal form,
2305 instead of having it called with no arguments (typically a
2309 instead of having it called with no arguments (typically a
2306 mistake). The old 'full' autocall still exists: for that, you
2310 mistake). The old 'full' autocall still exists: for that, you
2307 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2311 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2308
2312
2309 * IPython/completer.py (Completer.attr_matches): add
2313 * IPython/completer.py (Completer.attr_matches): add
2310 tab-completion support for Enthoughts' traits. After a report by
2314 tab-completion support for Enthoughts' traits. After a report by
2311 Arnd and a patch by Prabhu.
2315 Arnd and a patch by Prabhu.
2312
2316
2313 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2317 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2314
2318
2315 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2319 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2316 Schmolck's patch to fix inspect.getinnerframes().
2320 Schmolck's patch to fix inspect.getinnerframes().
2317
2321
2318 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2322 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2319 for embedded instances, regarding handling of namespaces and items
2323 for embedded instances, regarding handling of namespaces and items
2320 added to the __builtin__ one. Multiple embedded instances and
2324 added to the __builtin__ one. Multiple embedded instances and
2321 recursive embeddings should work better now (though I'm not sure
2325 recursive embeddings should work better now (though I'm not sure
2322 I've got all the corner cases fixed, that code is a bit of a brain
2326 I've got all the corner cases fixed, that code is a bit of a brain
2323 twister).
2327 twister).
2324
2328
2325 * IPython/Magic.py (magic_edit): added support to edit in-memory
2329 * IPython/Magic.py (magic_edit): added support to edit in-memory
2326 macros (automatically creates the necessary temp files). %edit
2330 macros (automatically creates the necessary temp files). %edit
2327 also doesn't return the file contents anymore, it's just noise.
2331 also doesn't return the file contents anymore, it's just noise.
2328
2332
2329 * IPython/completer.py (Completer.attr_matches): revert change to
2333 * IPython/completer.py (Completer.attr_matches): revert change to
2330 complete only on attributes listed in __all__. I realized it
2334 complete only on attributes listed in __all__. I realized it
2331 cripples the tab-completion system as a tool for exploring the
2335 cripples the tab-completion system as a tool for exploring the
2332 internals of unknown libraries (it renders any non-__all__
2336 internals of unknown libraries (it renders any non-__all__
2333 attribute off-limits). I got bit by this when trying to see
2337 attribute off-limits). I got bit by this when trying to see
2334 something inside the dis module.
2338 something inside the dis module.
2335
2339
2336 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2340 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2337
2341
2338 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2342 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2339 namespace for users and extension writers to hold data in. This
2343 namespace for users and extension writers to hold data in. This
2340 follows the discussion in
2344 follows the discussion in
2341 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2345 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2342
2346
2343 * IPython/completer.py (IPCompleter.complete): small patch to help
2347 * IPython/completer.py (IPCompleter.complete): small patch to help
2344 tab-completion under Emacs, after a suggestion by John Barnard
2348 tab-completion under Emacs, after a suggestion by John Barnard
2345 <barnarj-AT-ccf.org>.
2349 <barnarj-AT-ccf.org>.
2346
2350
2347 * IPython/Magic.py (Magic.extract_input_slices): added support for
2351 * IPython/Magic.py (Magic.extract_input_slices): added support for
2348 the slice notation in magics to use N-M to represent numbers N...M
2352 the slice notation in magics to use N-M to represent numbers N...M
2349 (closed endpoints). This is used by %macro and %save.
2353 (closed endpoints). This is used by %macro and %save.
2350
2354
2351 * IPython/completer.py (Completer.attr_matches): for modules which
2355 * IPython/completer.py (Completer.attr_matches): for modules which
2352 define __all__, complete only on those. After a patch by Jeffrey
2356 define __all__, complete only on those. After a patch by Jeffrey
2353 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2357 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2354 speed up this routine.
2358 speed up this routine.
2355
2359
2356 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2360 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2357 don't know if this is the end of it, but the behavior now is
2361 don't know if this is the end of it, but the behavior now is
2358 certainly much more correct. Note that coupled with macros,
2362 certainly much more correct. Note that coupled with macros,
2359 slightly surprising (at first) behavior may occur: a macro will in
2363 slightly surprising (at first) behavior may occur: a macro will in
2360 general expand to multiple lines of input, so upon exiting, the
2364 general expand to multiple lines of input, so upon exiting, the
2361 in/out counters will both be bumped by the corresponding amount
2365 in/out counters will both be bumped by the corresponding amount
2362 (as if the macro's contents had been typed interactively). Typing
2366 (as if the macro's contents had been typed interactively). Typing
2363 %hist will reveal the intermediate (silently processed) lines.
2367 %hist will reveal the intermediate (silently processed) lines.
2364
2368
2365 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2369 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2366 pickle to fail (%run was overwriting __main__ and not restoring
2370 pickle to fail (%run was overwriting __main__ and not restoring
2367 it, but pickle relies on __main__ to operate).
2371 it, but pickle relies on __main__ to operate).
2368
2372
2369 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2373 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2370 using properties, but forgot to make the main InteractiveShell
2374 using properties, but forgot to make the main InteractiveShell
2371 class a new-style class. Properties fail silently, and
2375 class a new-style class. Properties fail silently, and
2372 mysteriously, with old-style class (getters work, but
2376 mysteriously, with old-style class (getters work, but
2373 setters don't do anything).
2377 setters don't do anything).
2374
2378
2375 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2379 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2376
2380
2377 * IPython/Magic.py (magic_history): fix history reporting bug (I
2381 * IPython/Magic.py (magic_history): fix history reporting bug (I
2378 know some nasties are still there, I just can't seem to find a
2382 know some nasties are still there, I just can't seem to find a
2379 reproducible test case to track them down; the input history is
2383 reproducible test case to track them down; the input history is
2380 falling out of sync...)
2384 falling out of sync...)
2381
2385
2382 * IPython/iplib.py (handle_shell_escape): fix bug where both
2386 * IPython/iplib.py (handle_shell_escape): fix bug where both
2383 aliases and system accesses where broken for indented code (such
2387 aliases and system accesses where broken for indented code (such
2384 as loops).
2388 as loops).
2385
2389
2386 * IPython/genutils.py (shell): fix small but critical bug for
2390 * IPython/genutils.py (shell): fix small but critical bug for
2387 win32 system access.
2391 win32 system access.
2388
2392
2389 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2393 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2390
2394
2391 * IPython/iplib.py (showtraceback): remove use of the
2395 * IPython/iplib.py (showtraceback): remove use of the
2392 sys.last_{type/value/traceback} structures, which are non
2396 sys.last_{type/value/traceback} structures, which are non
2393 thread-safe.
2397 thread-safe.
2394 (_prefilter): change control flow to ensure that we NEVER
2398 (_prefilter): change control flow to ensure that we NEVER
2395 introspect objects when autocall is off. This will guarantee that
2399 introspect objects when autocall is off. This will guarantee that
2396 having an input line of the form 'x.y', where access to attribute
2400 having an input line of the form 'x.y', where access to attribute
2397 'y' has side effects, doesn't trigger the side effect TWICE. It
2401 'y' has side effects, doesn't trigger the side effect TWICE. It
2398 is important to note that, with autocall on, these side effects
2402 is important to note that, with autocall on, these side effects
2399 can still happen.
2403 can still happen.
2400 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2404 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2401 trio. IPython offers these three kinds of special calls which are
2405 trio. IPython offers these three kinds of special calls which are
2402 not python code, and it's a good thing to have their call method
2406 not python code, and it's a good thing to have their call method
2403 be accessible as pure python functions (not just special syntax at
2407 be accessible as pure python functions (not just special syntax at
2404 the command line). It gives us a better internal implementation
2408 the command line). It gives us a better internal implementation
2405 structure, as well as exposing these for user scripting more
2409 structure, as well as exposing these for user scripting more
2406 cleanly.
2410 cleanly.
2407
2411
2408 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2412 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2409 file. Now that they'll be more likely to be used with the
2413 file. Now that they'll be more likely to be used with the
2410 persistance system (%store), I want to make sure their module path
2414 persistance system (%store), I want to make sure their module path
2411 doesn't change in the future, so that we don't break things for
2415 doesn't change in the future, so that we don't break things for
2412 users' persisted data.
2416 users' persisted data.
2413
2417
2414 * IPython/iplib.py (autoindent_update): move indentation
2418 * IPython/iplib.py (autoindent_update): move indentation
2415 management into the _text_ processing loop, not the keyboard
2419 management into the _text_ processing loop, not the keyboard
2416 interactive one. This is necessary to correctly process non-typed
2420 interactive one. This is necessary to correctly process non-typed
2417 multiline input (such as macros).
2421 multiline input (such as macros).
2418
2422
2419 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2423 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2420 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2424 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2421 which was producing problems in the resulting manual.
2425 which was producing problems in the resulting manual.
2422 (magic_whos): improve reporting of instances (show their class,
2426 (magic_whos): improve reporting of instances (show their class,
2423 instead of simply printing 'instance' which isn't terribly
2427 instead of simply printing 'instance' which isn't terribly
2424 informative).
2428 informative).
2425
2429
2426 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2430 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2427 (minor mods) to support network shares under win32.
2431 (minor mods) to support network shares under win32.
2428
2432
2429 * IPython/winconsole.py (get_console_size): add new winconsole
2433 * IPython/winconsole.py (get_console_size): add new winconsole
2430 module and fixes to page_dumb() to improve its behavior under
2434 module and fixes to page_dumb() to improve its behavior under
2431 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2435 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2432
2436
2433 * IPython/Magic.py (Macro): simplified Macro class to just
2437 * IPython/Magic.py (Macro): simplified Macro class to just
2434 subclass list. We've had only 2.2 compatibility for a very long
2438 subclass list. We've had only 2.2 compatibility for a very long
2435 time, yet I was still avoiding subclassing the builtin types. No
2439 time, yet I was still avoiding subclassing the builtin types. No
2436 more (I'm also starting to use properties, though I won't shift to
2440 more (I'm also starting to use properties, though I won't shift to
2437 2.3-specific features quite yet).
2441 2.3-specific features quite yet).
2438 (magic_store): added Ville's patch for lightweight variable
2442 (magic_store): added Ville's patch for lightweight variable
2439 persistence, after a request on the user list by Matt Wilkie
2443 persistence, after a request on the user list by Matt Wilkie
2440 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2444 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2441 details.
2445 details.
2442
2446
2443 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2447 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2444 changed the default logfile name from 'ipython.log' to
2448 changed the default logfile name from 'ipython.log' to
2445 'ipython_log.py'. These logs are real python files, and now that
2449 'ipython_log.py'. These logs are real python files, and now that
2446 we have much better multiline support, people are more likely to
2450 we have much better multiline support, people are more likely to
2447 want to use them as such. Might as well name them correctly.
2451 want to use them as such. Might as well name them correctly.
2448
2452
2449 * IPython/Magic.py: substantial cleanup. While we can't stop
2453 * IPython/Magic.py: substantial cleanup. While we can't stop
2450 using magics as mixins, due to the existing customizations 'out
2454 using magics as mixins, due to the existing customizations 'out
2451 there' which rely on the mixin naming conventions, at least I
2455 there' which rely on the mixin naming conventions, at least I
2452 cleaned out all cross-class name usage. So once we are OK with
2456 cleaned out all cross-class name usage. So once we are OK with
2453 breaking compatibility, the two systems can be separated.
2457 breaking compatibility, the two systems can be separated.
2454
2458
2455 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2459 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2456 anymore, and the class is a fair bit less hideous as well. New
2460 anymore, and the class is a fair bit less hideous as well. New
2457 features were also introduced: timestamping of input, and logging
2461 features were also introduced: timestamping of input, and logging
2458 of output results. These are user-visible with the -t and -o
2462 of output results. These are user-visible with the -t and -o
2459 options to %logstart. Closes
2463 options to %logstart. Closes
2460 http://www.scipy.net/roundup/ipython/issue11 and a request by
2464 http://www.scipy.net/roundup/ipython/issue11 and a request by
2461 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2465 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2462
2466
2463 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2467 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2464
2468
2465 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2469 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2466 better handle backslashes in paths. See the thread 'More Windows
2470 better handle backslashes in paths. See the thread 'More Windows
2467 questions part 2 - \/ characters revisited' on the iypthon user
2471 questions part 2 - \/ characters revisited' on the iypthon user
2468 list:
2472 list:
2469 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2473 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2470
2474
2471 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2475 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2472
2476
2473 (InteractiveShell.__init__): change threaded shells to not use the
2477 (InteractiveShell.__init__): change threaded shells to not use the
2474 ipython crash handler. This was causing more problems than not,
2478 ipython crash handler. This was causing more problems than not,
2475 as exceptions in the main thread (GUI code, typically) would
2479 as exceptions in the main thread (GUI code, typically) would
2476 always show up as a 'crash', when they really weren't.
2480 always show up as a 'crash', when they really weren't.
2477
2481
2478 The colors and exception mode commands (%colors/%xmode) have been
2482 The colors and exception mode commands (%colors/%xmode) have been
2479 synchronized to also take this into account, so users can get
2483 synchronized to also take this into account, so users can get
2480 verbose exceptions for their threaded code as well. I also added
2484 verbose exceptions for their threaded code as well. I also added
2481 support for activating pdb inside this exception handler as well,
2485 support for activating pdb inside this exception handler as well,
2482 so now GUI authors can use IPython's enhanced pdb at runtime.
2486 so now GUI authors can use IPython's enhanced pdb at runtime.
2483
2487
2484 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2488 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2485 true by default, and add it to the shipped ipythonrc file. Since
2489 true by default, and add it to the shipped ipythonrc file. Since
2486 this asks the user before proceeding, I think it's OK to make it
2490 this asks the user before proceeding, I think it's OK to make it
2487 true by default.
2491 true by default.
2488
2492
2489 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2493 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2490 of the previous special-casing of input in the eval loop. I think
2494 of the previous special-casing of input in the eval loop. I think
2491 this is cleaner, as they really are commands and shouldn't have
2495 this is cleaner, as they really are commands and shouldn't have
2492 a special role in the middle of the core code.
2496 a special role in the middle of the core code.
2493
2497
2494 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2498 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2495
2499
2496 * IPython/iplib.py (edit_syntax_error): added support for
2500 * IPython/iplib.py (edit_syntax_error): added support for
2497 automatically reopening the editor if the file had a syntax error
2501 automatically reopening the editor if the file had a syntax error
2498 in it. Thanks to scottt who provided the patch at:
2502 in it. Thanks to scottt who provided the patch at:
2499 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2503 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2500 version committed).
2504 version committed).
2501
2505
2502 * IPython/iplib.py (handle_normal): add suport for multi-line
2506 * IPython/iplib.py (handle_normal): add suport for multi-line
2503 input with emtpy lines. This fixes
2507 input with emtpy lines. This fixes
2504 http://www.scipy.net/roundup/ipython/issue43 and a similar
2508 http://www.scipy.net/roundup/ipython/issue43 and a similar
2505 discussion on the user list.
2509 discussion on the user list.
2506
2510
2507 WARNING: a behavior change is necessarily introduced to support
2511 WARNING: a behavior change is necessarily introduced to support
2508 blank lines: now a single blank line with whitespace does NOT
2512 blank lines: now a single blank line with whitespace does NOT
2509 break the input loop, which means that when autoindent is on, by
2513 break the input loop, which means that when autoindent is on, by
2510 default hitting return on the next (indented) line does NOT exit.
2514 default hitting return on the next (indented) line does NOT exit.
2511
2515
2512 Instead, to exit a multiline input you can either have:
2516 Instead, to exit a multiline input you can either have:
2513
2517
2514 - TWO whitespace lines (just hit return again), or
2518 - TWO whitespace lines (just hit return again), or
2515 - a single whitespace line of a different length than provided
2519 - a single whitespace line of a different length than provided
2516 by the autoindent (add or remove a space).
2520 by the autoindent (add or remove a space).
2517
2521
2518 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2522 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2519 module to better organize all readline-related functionality.
2523 module to better organize all readline-related functionality.
2520 I've deleted FlexCompleter and put all completion clases here.
2524 I've deleted FlexCompleter and put all completion clases here.
2521
2525
2522 * IPython/iplib.py (raw_input): improve indentation management.
2526 * IPython/iplib.py (raw_input): improve indentation management.
2523 It is now possible to paste indented code with autoindent on, and
2527 It is now possible to paste indented code with autoindent on, and
2524 the code is interpreted correctly (though it still looks bad on
2528 the code is interpreted correctly (though it still looks bad on
2525 screen, due to the line-oriented nature of ipython).
2529 screen, due to the line-oriented nature of ipython).
2526 (MagicCompleter.complete): change behavior so that a TAB key on an
2530 (MagicCompleter.complete): change behavior so that a TAB key on an
2527 otherwise empty line actually inserts a tab, instead of completing
2531 otherwise empty line actually inserts a tab, instead of completing
2528 on the entire global namespace. This makes it easier to use the
2532 on the entire global namespace. This makes it easier to use the
2529 TAB key for indentation. After a request by Hans Meine
2533 TAB key for indentation. After a request by Hans Meine
2530 <hans_meine-AT-gmx.net>
2534 <hans_meine-AT-gmx.net>
2531 (_prefilter): add support so that typing plain 'exit' or 'quit'
2535 (_prefilter): add support so that typing plain 'exit' or 'quit'
2532 does a sensible thing. Originally I tried to deviate as little as
2536 does a sensible thing. Originally I tried to deviate as little as
2533 possible from the default python behavior, but even that one may
2537 possible from the default python behavior, but even that one may
2534 change in this direction (thread on python-dev to that effect).
2538 change in this direction (thread on python-dev to that effect).
2535 Regardless, ipython should do the right thing even if CPython's
2539 Regardless, ipython should do the right thing even if CPython's
2536 '>>>' prompt doesn't.
2540 '>>>' prompt doesn't.
2537 (InteractiveShell): removed subclassing code.InteractiveConsole
2541 (InteractiveShell): removed subclassing code.InteractiveConsole
2538 class. By now we'd overridden just about all of its methods: I've
2542 class. By now we'd overridden just about all of its methods: I've
2539 copied the remaining two over, and now ipython is a standalone
2543 copied the remaining two over, and now ipython is a standalone
2540 class. This will provide a clearer picture for the chainsaw
2544 class. This will provide a clearer picture for the chainsaw
2541 branch refactoring.
2545 branch refactoring.
2542
2546
2543 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2547 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2544
2548
2545 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2549 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2546 failures for objects which break when dir() is called on them.
2550 failures for objects which break when dir() is called on them.
2547
2551
2548 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2552 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2549 distinct local and global namespaces in the completer API. This
2553 distinct local and global namespaces in the completer API. This
2550 change allows us to properly handle completion with distinct
2554 change allows us to properly handle completion with distinct
2551 scopes, including in embedded instances (this had never really
2555 scopes, including in embedded instances (this had never really
2552 worked correctly).
2556 worked correctly).
2553
2557
2554 Note: this introduces a change in the constructor for
2558 Note: this introduces a change in the constructor for
2555 MagicCompleter, as a new global_namespace parameter is now the
2559 MagicCompleter, as a new global_namespace parameter is now the
2556 second argument (the others were bumped one position).
2560 second argument (the others were bumped one position).
2557
2561
2558 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2562 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2559
2563
2560 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2564 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2561 embedded instances (which can be done now thanks to Vivian's
2565 embedded instances (which can be done now thanks to Vivian's
2562 frame-handling fixes for pdb).
2566 frame-handling fixes for pdb).
2563 (InteractiveShell.__init__): Fix namespace handling problem in
2567 (InteractiveShell.__init__): Fix namespace handling problem in
2564 embedded instances. We were overwriting __main__ unconditionally,
2568 embedded instances. We were overwriting __main__ unconditionally,
2565 and this should only be done for 'full' (non-embedded) IPython;
2569 and this should only be done for 'full' (non-embedded) IPython;
2566 embedded instances must respect the caller's __main__. Thanks to
2570 embedded instances must respect the caller's __main__. Thanks to
2567 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2571 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2568
2572
2569 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2573 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2570
2574
2571 * setup.py: added download_url to setup(). This registers the
2575 * setup.py: added download_url to setup(). This registers the
2572 download address at PyPI, which is not only useful to humans
2576 download address at PyPI, which is not only useful to humans
2573 browsing the site, but is also picked up by setuptools (the Eggs
2577 browsing the site, but is also picked up by setuptools (the Eggs
2574 machinery). Thanks to Ville and R. Kern for the info/discussion
2578 machinery). Thanks to Ville and R. Kern for the info/discussion
2575 on this.
2579 on this.
2576
2580
2577 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2581 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2578
2582
2579 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2583 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2580 This brings a lot of nice functionality to the pdb mode, which now
2584 This brings a lot of nice functionality to the pdb mode, which now
2581 has tab-completion, syntax highlighting, and better stack handling
2585 has tab-completion, syntax highlighting, and better stack handling
2582 than before. Many thanks to Vivian De Smedt
2586 than before. Many thanks to Vivian De Smedt
2583 <vivian-AT-vdesmedt.com> for the original patches.
2587 <vivian-AT-vdesmedt.com> for the original patches.
2584
2588
2585 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2589 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2586
2590
2587 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2591 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2588 sequence to consistently accept the banner argument. The
2592 sequence to consistently accept the banner argument. The
2589 inconsistency was tripping SAGE, thanks to Gary Zablackis
2593 inconsistency was tripping SAGE, thanks to Gary Zablackis
2590 <gzabl-AT-yahoo.com> for the report.
2594 <gzabl-AT-yahoo.com> for the report.
2591
2595
2592 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2596 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2593
2597
2594 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2598 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2595 Fix bug where a naked 'alias' call in the ipythonrc file would
2599 Fix bug where a naked 'alias' call in the ipythonrc file would
2596 cause a crash. Bug reported by Jorgen Stenarson.
2600 cause a crash. Bug reported by Jorgen Stenarson.
2597
2601
2598 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2602 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2599
2603
2600 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2604 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2601 startup time.
2605 startup time.
2602
2606
2603 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2607 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2604 instances had introduced a bug with globals in normal code. Now
2608 instances had introduced a bug with globals in normal code. Now
2605 it's working in all cases.
2609 it's working in all cases.
2606
2610
2607 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2611 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2608 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2612 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2609 has been introduced to set the default case sensitivity of the
2613 has been introduced to set the default case sensitivity of the
2610 searches. Users can still select either mode at runtime on a
2614 searches. Users can still select either mode at runtime on a
2611 per-search basis.
2615 per-search basis.
2612
2616
2613 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2617 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2614
2618
2615 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2619 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2616 attributes in wildcard searches for subclasses. Modified version
2620 attributes in wildcard searches for subclasses. Modified version
2617 of a patch by Jorgen.
2621 of a patch by Jorgen.
2618
2622
2619 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2623 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2620
2624
2621 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2625 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2622 embedded instances. I added a user_global_ns attribute to the
2626 embedded instances. I added a user_global_ns attribute to the
2623 InteractiveShell class to handle this.
2627 InteractiveShell class to handle this.
2624
2628
2625 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2629 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2626
2630
2627 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2631 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2628 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2632 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2629 (reported under win32, but may happen also in other platforms).
2633 (reported under win32, but may happen also in other platforms).
2630 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2634 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2631
2635
2632 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2636 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2633
2637
2634 * IPython/Magic.py (magic_psearch): new support for wildcard
2638 * IPython/Magic.py (magic_psearch): new support for wildcard
2635 patterns. Now, typing ?a*b will list all names which begin with a
2639 patterns. Now, typing ?a*b will list all names which begin with a
2636 and end in b, for example. The %psearch magic has full
2640 and end in b, for example. The %psearch magic has full
2637 docstrings. Many thanks to JΓΆrgen Stenarson
2641 docstrings. Many thanks to JΓΆrgen Stenarson
2638 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2642 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2639 implementing this functionality.
2643 implementing this functionality.
2640
2644
2641 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2645 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2642
2646
2643 * Manual: fixed long-standing annoyance of double-dashes (as in
2647 * Manual: fixed long-standing annoyance of double-dashes (as in
2644 --prefix=~, for example) being stripped in the HTML version. This
2648 --prefix=~, for example) being stripped in the HTML version. This
2645 is a latex2html bug, but a workaround was provided. Many thanks
2649 is a latex2html bug, but a workaround was provided. Many thanks
2646 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2650 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2647 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2651 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2648 rolling. This seemingly small issue had tripped a number of users
2652 rolling. This seemingly small issue had tripped a number of users
2649 when first installing, so I'm glad to see it gone.
2653 when first installing, so I'm glad to see it gone.
2650
2654
2651 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2655 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2652
2656
2653 * IPython/Extensions/numeric_formats.py: fix missing import,
2657 * IPython/Extensions/numeric_formats.py: fix missing import,
2654 reported by Stephen Walton.
2658 reported by Stephen Walton.
2655
2659
2656 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2660 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2657
2661
2658 * IPython/demo.py: finish demo module, fully documented now.
2662 * IPython/demo.py: finish demo module, fully documented now.
2659
2663
2660 * IPython/genutils.py (file_read): simple little utility to read a
2664 * IPython/genutils.py (file_read): simple little utility to read a
2661 file and ensure it's closed afterwards.
2665 file and ensure it's closed afterwards.
2662
2666
2663 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2667 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2664
2668
2665 * IPython/demo.py (Demo.__init__): added support for individually
2669 * IPython/demo.py (Demo.__init__): added support for individually
2666 tagging blocks for automatic execution.
2670 tagging blocks for automatic execution.
2667
2671
2668 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2672 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2669 syntax-highlighted python sources, requested by John.
2673 syntax-highlighted python sources, requested by John.
2670
2674
2671 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2675 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2672
2676
2673 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2677 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2674 finishing.
2678 finishing.
2675
2679
2676 * IPython/genutils.py (shlex_split): moved from Magic to here,
2680 * IPython/genutils.py (shlex_split): moved from Magic to here,
2677 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2681 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2678
2682
2679 * IPython/demo.py (Demo.__init__): added support for silent
2683 * IPython/demo.py (Demo.__init__): added support for silent
2680 blocks, improved marks as regexps, docstrings written.
2684 blocks, improved marks as regexps, docstrings written.
2681 (Demo.__init__): better docstring, added support for sys.argv.
2685 (Demo.__init__): better docstring, added support for sys.argv.
2682
2686
2683 * IPython/genutils.py (marquee): little utility used by the demo
2687 * IPython/genutils.py (marquee): little utility used by the demo
2684 code, handy in general.
2688 code, handy in general.
2685
2689
2686 * IPython/demo.py (Demo.__init__): new class for interactive
2690 * IPython/demo.py (Demo.__init__): new class for interactive
2687 demos. Not documented yet, I just wrote it in a hurry for
2691 demos. Not documented yet, I just wrote it in a hurry for
2688 scipy'05. Will docstring later.
2692 scipy'05. Will docstring later.
2689
2693
2690 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2694 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2691
2695
2692 * IPython/Shell.py (sigint_handler): Drastic simplification which
2696 * IPython/Shell.py (sigint_handler): Drastic simplification which
2693 also seems to make Ctrl-C work correctly across threads! This is
2697 also seems to make Ctrl-C work correctly across threads! This is
2694 so simple, that I can't beleive I'd missed it before. Needs more
2698 so simple, that I can't beleive I'd missed it before. Needs more
2695 testing, though.
2699 testing, though.
2696 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2700 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2697 like this before...
2701 like this before...
2698
2702
2699 * IPython/genutils.py (get_home_dir): add protection against
2703 * IPython/genutils.py (get_home_dir): add protection against
2700 non-dirs in win32 registry.
2704 non-dirs in win32 registry.
2701
2705
2702 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2706 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2703 bug where dict was mutated while iterating (pysh crash).
2707 bug where dict was mutated while iterating (pysh crash).
2704
2708
2705 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2709 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2706
2710
2707 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2711 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2708 spurious newlines added by this routine. After a report by
2712 spurious newlines added by this routine. After a report by
2709 F. Mantegazza.
2713 F. Mantegazza.
2710
2714
2711 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2715 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2712
2716
2713 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2717 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2714 calls. These were a leftover from the GTK 1.x days, and can cause
2718 calls. These were a leftover from the GTK 1.x days, and can cause
2715 problems in certain cases (after a report by John Hunter).
2719 problems in certain cases (after a report by John Hunter).
2716
2720
2717 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2721 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2718 os.getcwd() fails at init time. Thanks to patch from David Remahl
2722 os.getcwd() fails at init time. Thanks to patch from David Remahl
2719 <chmod007-AT-mac.com>.
2723 <chmod007-AT-mac.com>.
2720 (InteractiveShell.__init__): prevent certain special magics from
2724 (InteractiveShell.__init__): prevent certain special magics from
2721 being shadowed by aliases. Closes
2725 being shadowed by aliases. Closes
2722 http://www.scipy.net/roundup/ipython/issue41.
2726 http://www.scipy.net/roundup/ipython/issue41.
2723
2727
2724 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2728 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2725
2729
2726 * IPython/iplib.py (InteractiveShell.complete): Added new
2730 * IPython/iplib.py (InteractiveShell.complete): Added new
2727 top-level completion method to expose the completion mechanism
2731 top-level completion method to expose the completion mechanism
2728 beyond readline-based environments.
2732 beyond readline-based environments.
2729
2733
2730 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2734 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2731
2735
2732 * tools/ipsvnc (svnversion): fix svnversion capture.
2736 * tools/ipsvnc (svnversion): fix svnversion capture.
2733
2737
2734 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2738 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2735 attribute to self, which was missing. Before, it was set by a
2739 attribute to self, which was missing. Before, it was set by a
2736 routine which in certain cases wasn't being called, so the
2740 routine which in certain cases wasn't being called, so the
2737 instance could end up missing the attribute. This caused a crash.
2741 instance could end up missing the attribute. This caused a crash.
2738 Closes http://www.scipy.net/roundup/ipython/issue40.
2742 Closes http://www.scipy.net/roundup/ipython/issue40.
2739
2743
2740 2005-08-16 Fernando Perez <fperez@colorado.edu>
2744 2005-08-16 Fernando Perez <fperez@colorado.edu>
2741
2745
2742 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2746 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2743 contains non-string attribute. Closes
2747 contains non-string attribute. Closes
2744 http://www.scipy.net/roundup/ipython/issue38.
2748 http://www.scipy.net/roundup/ipython/issue38.
2745
2749
2746 2005-08-14 Fernando Perez <fperez@colorado.edu>
2750 2005-08-14 Fernando Perez <fperez@colorado.edu>
2747
2751
2748 * tools/ipsvnc: Minor improvements, to add changeset info.
2752 * tools/ipsvnc: Minor improvements, to add changeset info.
2749
2753
2750 2005-08-12 Fernando Perez <fperez@colorado.edu>
2754 2005-08-12 Fernando Perez <fperez@colorado.edu>
2751
2755
2752 * IPython/iplib.py (runsource): remove self.code_to_run_src
2756 * IPython/iplib.py (runsource): remove self.code_to_run_src
2753 attribute. I realized this is nothing more than
2757 attribute. I realized this is nothing more than
2754 '\n'.join(self.buffer), and having the same data in two different
2758 '\n'.join(self.buffer), and having the same data in two different
2755 places is just asking for synchronization bugs. This may impact
2759 places is just asking for synchronization bugs. This may impact
2756 people who have custom exception handlers, so I need to warn
2760 people who have custom exception handlers, so I need to warn
2757 ipython-dev about it (F. Mantegazza may use them).
2761 ipython-dev about it (F. Mantegazza may use them).
2758
2762
2759 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2763 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2760
2764
2761 * IPython/genutils.py: fix 2.2 compatibility (generators)
2765 * IPython/genutils.py: fix 2.2 compatibility (generators)
2762
2766
2763 2005-07-18 Fernando Perez <fperez@colorado.edu>
2767 2005-07-18 Fernando Perez <fperez@colorado.edu>
2764
2768
2765 * IPython/genutils.py (get_home_dir): fix to help users with
2769 * IPython/genutils.py (get_home_dir): fix to help users with
2766 invalid $HOME under win32.
2770 invalid $HOME under win32.
2767
2771
2768 2005-07-17 Fernando Perez <fperez@colorado.edu>
2772 2005-07-17 Fernando Perez <fperez@colorado.edu>
2769
2773
2770 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2774 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2771 some old hacks and clean up a bit other routines; code should be
2775 some old hacks and clean up a bit other routines; code should be
2772 simpler and a bit faster.
2776 simpler and a bit faster.
2773
2777
2774 * IPython/iplib.py (interact): removed some last-resort attempts
2778 * IPython/iplib.py (interact): removed some last-resort attempts
2775 to survive broken stdout/stderr. That code was only making it
2779 to survive broken stdout/stderr. That code was only making it
2776 harder to abstract out the i/o (necessary for gui integration),
2780 harder to abstract out the i/o (necessary for gui integration),
2777 and the crashes it could prevent were extremely rare in practice
2781 and the crashes it could prevent were extremely rare in practice
2778 (besides being fully user-induced in a pretty violent manner).
2782 (besides being fully user-induced in a pretty violent manner).
2779
2783
2780 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2784 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2781 Nothing major yet, but the code is simpler to read; this should
2785 Nothing major yet, but the code is simpler to read; this should
2782 make it easier to do more serious modifications in the future.
2786 make it easier to do more serious modifications in the future.
2783
2787
2784 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2788 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2785 which broke in .15 (thanks to a report by Ville).
2789 which broke in .15 (thanks to a report by Ville).
2786
2790
2787 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2791 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2788 be quite correct, I know next to nothing about unicode). This
2792 be quite correct, I know next to nothing about unicode). This
2789 will allow unicode strings to be used in prompts, amongst other
2793 will allow unicode strings to be used in prompts, amongst other
2790 cases. It also will prevent ipython from crashing when unicode
2794 cases. It also will prevent ipython from crashing when unicode
2791 shows up unexpectedly in many places. If ascii encoding fails, we
2795 shows up unexpectedly in many places. If ascii encoding fails, we
2792 assume utf_8. Currently the encoding is not a user-visible
2796 assume utf_8. Currently the encoding is not a user-visible
2793 setting, though it could be made so if there is demand for it.
2797 setting, though it could be made so if there is demand for it.
2794
2798
2795 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2799 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2796
2800
2797 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2801 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2798
2802
2799 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2803 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2800
2804
2801 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2805 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2802 code can work transparently for 2.2/2.3.
2806 code can work transparently for 2.2/2.3.
2803
2807
2804 2005-07-16 Fernando Perez <fperez@colorado.edu>
2808 2005-07-16 Fernando Perez <fperez@colorado.edu>
2805
2809
2806 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2810 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2807 out of the color scheme table used for coloring exception
2811 out of the color scheme table used for coloring exception
2808 tracebacks. This allows user code to add new schemes at runtime.
2812 tracebacks. This allows user code to add new schemes at runtime.
2809 This is a minimally modified version of the patch at
2813 This is a minimally modified version of the patch at
2810 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2814 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2811 for the contribution.
2815 for the contribution.
2812
2816
2813 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2817 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2814 slightly modified version of the patch in
2818 slightly modified version of the patch in
2815 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2819 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2816 to remove the previous try/except solution (which was costlier).
2820 to remove the previous try/except solution (which was costlier).
2817 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2821 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2818
2822
2819 2005-06-08 Fernando Perez <fperez@colorado.edu>
2823 2005-06-08 Fernando Perez <fperez@colorado.edu>
2820
2824
2821 * IPython/iplib.py (write/write_err): Add methods to abstract all
2825 * IPython/iplib.py (write/write_err): Add methods to abstract all
2822 I/O a bit more.
2826 I/O a bit more.
2823
2827
2824 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2828 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2825 warning, reported by Aric Hagberg, fix by JD Hunter.
2829 warning, reported by Aric Hagberg, fix by JD Hunter.
2826
2830
2827 2005-06-02 *** Released version 0.6.15
2831 2005-06-02 *** Released version 0.6.15
2828
2832
2829 2005-06-01 Fernando Perez <fperez@colorado.edu>
2833 2005-06-01 Fernando Perez <fperez@colorado.edu>
2830
2834
2831 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2835 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2832 tab-completion of filenames within open-quoted strings. Note that
2836 tab-completion of filenames within open-quoted strings. Note that
2833 this requires that in ~/.ipython/ipythonrc, users change the
2837 this requires that in ~/.ipython/ipythonrc, users change the
2834 readline delimiters configuration to read:
2838 readline delimiters configuration to read:
2835
2839
2836 readline_remove_delims -/~
2840 readline_remove_delims -/~
2837
2841
2838
2842
2839 2005-05-31 *** Released version 0.6.14
2843 2005-05-31 *** Released version 0.6.14
2840
2844
2841 2005-05-29 Fernando Perez <fperez@colorado.edu>
2845 2005-05-29 Fernando Perez <fperez@colorado.edu>
2842
2846
2843 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2847 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2844 with files not on the filesystem. Reported by Eliyahu Sandler
2848 with files not on the filesystem. Reported by Eliyahu Sandler
2845 <eli@gondolin.net>
2849 <eli@gondolin.net>
2846
2850
2847 2005-05-22 Fernando Perez <fperez@colorado.edu>
2851 2005-05-22 Fernando Perez <fperez@colorado.edu>
2848
2852
2849 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2853 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2850 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2854 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2851
2855
2852 2005-05-19 Fernando Perez <fperez@colorado.edu>
2856 2005-05-19 Fernando Perez <fperez@colorado.edu>
2853
2857
2854 * IPython/iplib.py (safe_execfile): close a file which could be
2858 * IPython/iplib.py (safe_execfile): close a file which could be
2855 left open (causing problems in win32, which locks open files).
2859 left open (causing problems in win32, which locks open files).
2856 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2860 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2857
2861
2858 2005-05-18 Fernando Perez <fperez@colorado.edu>
2862 2005-05-18 Fernando Perez <fperez@colorado.edu>
2859
2863
2860 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2864 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2861 keyword arguments correctly to safe_execfile().
2865 keyword arguments correctly to safe_execfile().
2862
2866
2863 2005-05-13 Fernando Perez <fperez@colorado.edu>
2867 2005-05-13 Fernando Perez <fperez@colorado.edu>
2864
2868
2865 * ipython.1: Added info about Qt to manpage, and threads warning
2869 * ipython.1: Added info about Qt to manpage, and threads warning
2866 to usage page (invoked with --help).
2870 to usage page (invoked with --help).
2867
2871
2868 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2872 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2869 new matcher (it goes at the end of the priority list) to do
2873 new matcher (it goes at the end of the priority list) to do
2870 tab-completion on named function arguments. Submitted by George
2874 tab-completion on named function arguments. Submitted by George
2871 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2875 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2872 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2876 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2873 for more details.
2877 for more details.
2874
2878
2875 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2879 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2876 SystemExit exceptions in the script being run. Thanks to a report
2880 SystemExit exceptions in the script being run. Thanks to a report
2877 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2881 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2878 producing very annoying behavior when running unit tests.
2882 producing very annoying behavior when running unit tests.
2879
2883
2880 2005-05-12 Fernando Perez <fperez@colorado.edu>
2884 2005-05-12 Fernando Perez <fperez@colorado.edu>
2881
2885
2882 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2886 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2883 which I'd broken (again) due to a changed regexp. In the process,
2887 which I'd broken (again) due to a changed regexp. In the process,
2884 added ';' as an escape to auto-quote the whole line without
2888 added ';' as an escape to auto-quote the whole line without
2885 splitting its arguments. Thanks to a report by Jerry McRae
2889 splitting its arguments. Thanks to a report by Jerry McRae
2886 <qrs0xyc02-AT-sneakemail.com>.
2890 <qrs0xyc02-AT-sneakemail.com>.
2887
2891
2888 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2892 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2889 possible crashes caused by a TokenError. Reported by Ed Schofield
2893 possible crashes caused by a TokenError. Reported by Ed Schofield
2890 <schofield-AT-ftw.at>.
2894 <schofield-AT-ftw.at>.
2891
2895
2892 2005-05-06 Fernando Perez <fperez@colorado.edu>
2896 2005-05-06 Fernando Perez <fperez@colorado.edu>
2893
2897
2894 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2898 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2895
2899
2896 2005-04-29 Fernando Perez <fperez@colorado.edu>
2900 2005-04-29 Fernando Perez <fperez@colorado.edu>
2897
2901
2898 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2902 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2899 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2903 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2900 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2904 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2901 which provides support for Qt interactive usage (similar to the
2905 which provides support for Qt interactive usage (similar to the
2902 existing one for WX and GTK). This had been often requested.
2906 existing one for WX and GTK). This had been often requested.
2903
2907
2904 2005-04-14 *** Released version 0.6.13
2908 2005-04-14 *** Released version 0.6.13
2905
2909
2906 2005-04-08 Fernando Perez <fperez@colorado.edu>
2910 2005-04-08 Fernando Perez <fperez@colorado.edu>
2907
2911
2908 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2912 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2909 from _ofind, which gets called on almost every input line. Now,
2913 from _ofind, which gets called on almost every input line. Now,
2910 we only try to get docstrings if they are actually going to be
2914 we only try to get docstrings if they are actually going to be
2911 used (the overhead of fetching unnecessary docstrings can be
2915 used (the overhead of fetching unnecessary docstrings can be
2912 noticeable for certain objects, such as Pyro proxies).
2916 noticeable for certain objects, such as Pyro proxies).
2913
2917
2914 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2918 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2915 for completers. For some reason I had been passing them the state
2919 for completers. For some reason I had been passing them the state
2916 variable, which completers never actually need, and was in
2920 variable, which completers never actually need, and was in
2917 conflict with the rlcompleter API. Custom completers ONLY need to
2921 conflict with the rlcompleter API. Custom completers ONLY need to
2918 take the text parameter.
2922 take the text parameter.
2919
2923
2920 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2924 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2921 work correctly in pysh. I've also moved all the logic which used
2925 work correctly in pysh. I've also moved all the logic which used
2922 to be in pysh.py here, which will prevent problems with future
2926 to be in pysh.py here, which will prevent problems with future
2923 upgrades. However, this time I must warn users to update their
2927 upgrades. However, this time I must warn users to update their
2924 pysh profile to include the line
2928 pysh profile to include the line
2925
2929
2926 import_all IPython.Extensions.InterpreterExec
2930 import_all IPython.Extensions.InterpreterExec
2927
2931
2928 because otherwise things won't work for them. They MUST also
2932 because otherwise things won't work for them. They MUST also
2929 delete pysh.py and the line
2933 delete pysh.py and the line
2930
2934
2931 execfile pysh.py
2935 execfile pysh.py
2932
2936
2933 from their ipythonrc-pysh.
2937 from their ipythonrc-pysh.
2934
2938
2935 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2939 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2936 robust in the face of objects whose dir() returns non-strings
2940 robust in the face of objects whose dir() returns non-strings
2937 (which it shouldn't, but some broken libs like ITK do). Thanks to
2941 (which it shouldn't, but some broken libs like ITK do). Thanks to
2938 a patch by John Hunter (implemented differently, though). Also
2942 a patch by John Hunter (implemented differently, though). Also
2939 minor improvements by using .extend instead of + on lists.
2943 minor improvements by using .extend instead of + on lists.
2940
2944
2941 * pysh.py:
2945 * pysh.py:
2942
2946
2943 2005-04-06 Fernando Perez <fperez@colorado.edu>
2947 2005-04-06 Fernando Perez <fperez@colorado.edu>
2944
2948
2945 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2949 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2946 by default, so that all users benefit from it. Those who don't
2950 by default, so that all users benefit from it. Those who don't
2947 want it can still turn it off.
2951 want it can still turn it off.
2948
2952
2949 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2953 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2950 config file, I'd forgotten about this, so users were getting it
2954 config file, I'd forgotten about this, so users were getting it
2951 off by default.
2955 off by default.
2952
2956
2953 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2957 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2954 consistency. Now magics can be called in multiline statements,
2958 consistency. Now magics can be called in multiline statements,
2955 and python variables can be expanded in magic calls via $var.
2959 and python variables can be expanded in magic calls via $var.
2956 This makes the magic system behave just like aliases or !system
2960 This makes the magic system behave just like aliases or !system
2957 calls.
2961 calls.
2958
2962
2959 2005-03-28 Fernando Perez <fperez@colorado.edu>
2963 2005-03-28 Fernando Perez <fperez@colorado.edu>
2960
2964
2961 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2965 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2962 expensive string additions for building command. Add support for
2966 expensive string additions for building command. Add support for
2963 trailing ';' when autocall is used.
2967 trailing ';' when autocall is used.
2964
2968
2965 2005-03-26 Fernando Perez <fperez@colorado.edu>
2969 2005-03-26 Fernando Perez <fperez@colorado.edu>
2966
2970
2967 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2971 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2968 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2972 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2969 ipython.el robust against prompts with any number of spaces
2973 ipython.el robust against prompts with any number of spaces
2970 (including 0) after the ':' character.
2974 (including 0) after the ':' character.
2971
2975
2972 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2976 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2973 continuation prompt, which misled users to think the line was
2977 continuation prompt, which misled users to think the line was
2974 already indented. Closes debian Bug#300847, reported to me by
2978 already indented. Closes debian Bug#300847, reported to me by
2975 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2979 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2976
2980
2977 2005-03-23 Fernando Perez <fperez@colorado.edu>
2981 2005-03-23 Fernando Perez <fperez@colorado.edu>
2978
2982
2979 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2983 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2980 properly aligned if they have embedded newlines.
2984 properly aligned if they have embedded newlines.
2981
2985
2982 * IPython/iplib.py (runlines): Add a public method to expose
2986 * IPython/iplib.py (runlines): Add a public method to expose
2983 IPython's code execution machinery, so that users can run strings
2987 IPython's code execution machinery, so that users can run strings
2984 as if they had been typed at the prompt interactively.
2988 as if they had been typed at the prompt interactively.
2985 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2989 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2986 methods which can call the system shell, but with python variable
2990 methods which can call the system shell, but with python variable
2987 expansion. The three such methods are: __IPYTHON__.system,
2991 expansion. The three such methods are: __IPYTHON__.system,
2988 .getoutput and .getoutputerror. These need to be documented in a
2992 .getoutput and .getoutputerror. These need to be documented in a
2989 'public API' section (to be written) of the manual.
2993 'public API' section (to be written) of the manual.
2990
2994
2991 2005-03-20 Fernando Perez <fperez@colorado.edu>
2995 2005-03-20 Fernando Perez <fperez@colorado.edu>
2992
2996
2993 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2997 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2994 for custom exception handling. This is quite powerful, and it
2998 for custom exception handling. This is quite powerful, and it
2995 allows for user-installable exception handlers which can trap
2999 allows for user-installable exception handlers which can trap
2996 custom exceptions at runtime and treat them separately from
3000 custom exceptions at runtime and treat them separately from
2997 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3001 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2998 Mantegazza <mantegazza-AT-ill.fr>.
3002 Mantegazza <mantegazza-AT-ill.fr>.
2999 (InteractiveShell.set_custom_completer): public API function to
3003 (InteractiveShell.set_custom_completer): public API function to
3000 add new completers at runtime.
3004 add new completers at runtime.
3001
3005
3002 2005-03-19 Fernando Perez <fperez@colorado.edu>
3006 2005-03-19 Fernando Perez <fperez@colorado.edu>
3003
3007
3004 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3008 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3005 allow objects which provide their docstrings via non-standard
3009 allow objects which provide their docstrings via non-standard
3006 mechanisms (like Pyro proxies) to still be inspected by ipython's
3010 mechanisms (like Pyro proxies) to still be inspected by ipython's
3007 ? system.
3011 ? system.
3008
3012
3009 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3013 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3010 automatic capture system. I tried quite hard to make it work
3014 automatic capture system. I tried quite hard to make it work
3011 reliably, and simply failed. I tried many combinations with the
3015 reliably, and simply failed. I tried many combinations with the
3012 subprocess module, but eventually nothing worked in all needed
3016 subprocess module, but eventually nothing worked in all needed
3013 cases (not blocking stdin for the child, duplicating stdout
3017 cases (not blocking stdin for the child, duplicating stdout
3014 without blocking, etc). The new %sc/%sx still do capture to these
3018 without blocking, etc). The new %sc/%sx still do capture to these
3015 magical list/string objects which make shell use much more
3019 magical list/string objects which make shell use much more
3016 conveninent, so not all is lost.
3020 conveninent, so not all is lost.
3017
3021
3018 XXX - FIX MANUAL for the change above!
3022 XXX - FIX MANUAL for the change above!
3019
3023
3020 (runsource): I copied code.py's runsource() into ipython to modify
3024 (runsource): I copied code.py's runsource() into ipython to modify
3021 it a bit. Now the code object and source to be executed are
3025 it a bit. Now the code object and source to be executed are
3022 stored in ipython. This makes this info accessible to third-party
3026 stored in ipython. This makes this info accessible to third-party
3023 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3027 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3024 Mantegazza <mantegazza-AT-ill.fr>.
3028 Mantegazza <mantegazza-AT-ill.fr>.
3025
3029
3026 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3030 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3027 history-search via readline (like C-p/C-n). I'd wanted this for a
3031 history-search via readline (like C-p/C-n). I'd wanted this for a
3028 long time, but only recently found out how to do it. For users
3032 long time, but only recently found out how to do it. For users
3029 who already have their ipythonrc files made and want this, just
3033 who already have their ipythonrc files made and want this, just
3030 add:
3034 add:
3031
3035
3032 readline_parse_and_bind "\e[A": history-search-backward
3036 readline_parse_and_bind "\e[A": history-search-backward
3033 readline_parse_and_bind "\e[B": history-search-forward
3037 readline_parse_and_bind "\e[B": history-search-forward
3034
3038
3035 2005-03-18 Fernando Perez <fperez@colorado.edu>
3039 2005-03-18 Fernando Perez <fperez@colorado.edu>
3036
3040
3037 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3041 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3038 LSString and SList classes which allow transparent conversions
3042 LSString and SList classes which allow transparent conversions
3039 between list mode and whitespace-separated string.
3043 between list mode and whitespace-separated string.
3040 (magic_r): Fix recursion problem in %r.
3044 (magic_r): Fix recursion problem in %r.
3041
3045
3042 * IPython/genutils.py (LSString): New class to be used for
3046 * IPython/genutils.py (LSString): New class to be used for
3043 automatic storage of the results of all alias/system calls in _o
3047 automatic storage of the results of all alias/system calls in _o
3044 and _e (stdout/err). These provide a .l/.list attribute which
3048 and _e (stdout/err). These provide a .l/.list attribute which
3045 does automatic splitting on newlines. This means that for most
3049 does automatic splitting on newlines. This means that for most
3046 uses, you'll never need to do capturing of output with %sc/%sx
3050 uses, you'll never need to do capturing of output with %sc/%sx
3047 anymore, since ipython keeps this always done for you. Note that
3051 anymore, since ipython keeps this always done for you. Note that
3048 only the LAST results are stored, the _o/e variables are
3052 only the LAST results are stored, the _o/e variables are
3049 overwritten on each call. If you need to save their contents
3053 overwritten on each call. If you need to save their contents
3050 further, simply bind them to any other name.
3054 further, simply bind them to any other name.
3051
3055
3052 2005-03-17 Fernando Perez <fperez@colorado.edu>
3056 2005-03-17 Fernando Perez <fperez@colorado.edu>
3053
3057
3054 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3058 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3055 prompt namespace handling.
3059 prompt namespace handling.
3056
3060
3057 2005-03-16 Fernando Perez <fperez@colorado.edu>
3061 2005-03-16 Fernando Perez <fperez@colorado.edu>
3058
3062
3059 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3063 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3060 classic prompts to be '>>> ' (final space was missing, and it
3064 classic prompts to be '>>> ' (final space was missing, and it
3061 trips the emacs python mode).
3065 trips the emacs python mode).
3062 (BasePrompt.__str__): Added safe support for dynamic prompt
3066 (BasePrompt.__str__): Added safe support for dynamic prompt
3063 strings. Now you can set your prompt string to be '$x', and the
3067 strings. Now you can set your prompt string to be '$x', and the
3064 value of x will be printed from your interactive namespace. The
3068 value of x will be printed from your interactive namespace. The
3065 interpolation syntax includes the full Itpl support, so
3069 interpolation syntax includes the full Itpl support, so
3066 ${foo()+x+bar()} is a valid prompt string now, and the function
3070 ${foo()+x+bar()} is a valid prompt string now, and the function
3067 calls will be made at runtime.
3071 calls will be made at runtime.
3068
3072
3069 2005-03-15 Fernando Perez <fperez@colorado.edu>
3073 2005-03-15 Fernando Perez <fperez@colorado.edu>
3070
3074
3071 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3075 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3072 avoid name clashes in pylab. %hist still works, it just forwards
3076 avoid name clashes in pylab. %hist still works, it just forwards
3073 the call to %history.
3077 the call to %history.
3074
3078
3075 2005-03-02 *** Released version 0.6.12
3079 2005-03-02 *** Released version 0.6.12
3076
3080
3077 2005-03-02 Fernando Perez <fperez@colorado.edu>
3081 2005-03-02 Fernando Perez <fperez@colorado.edu>
3078
3082
3079 * IPython/iplib.py (handle_magic): log magic calls properly as
3083 * IPython/iplib.py (handle_magic): log magic calls properly as
3080 ipmagic() function calls.
3084 ipmagic() function calls.
3081
3085
3082 * IPython/Magic.py (magic_time): Improved %time to support
3086 * IPython/Magic.py (magic_time): Improved %time to support
3083 statements and provide wall-clock as well as CPU time.
3087 statements and provide wall-clock as well as CPU time.
3084
3088
3085 2005-02-27 Fernando Perez <fperez@colorado.edu>
3089 2005-02-27 Fernando Perez <fperez@colorado.edu>
3086
3090
3087 * IPython/hooks.py: New hooks module, to expose user-modifiable
3091 * IPython/hooks.py: New hooks module, to expose user-modifiable
3088 IPython functionality in a clean manner. For now only the editor
3092 IPython functionality in a clean manner. For now only the editor
3089 hook is actually written, and other thigns which I intend to turn
3093 hook is actually written, and other thigns which I intend to turn
3090 into proper hooks aren't yet there. The display and prefilter
3094 into proper hooks aren't yet there. The display and prefilter
3091 stuff, for example, should be hooks. But at least now the
3095 stuff, for example, should be hooks. But at least now the
3092 framework is in place, and the rest can be moved here with more
3096 framework is in place, and the rest can be moved here with more
3093 time later. IPython had had a .hooks variable for a long time for
3097 time later. IPython had had a .hooks variable for a long time for
3094 this purpose, but I'd never actually used it for anything.
3098 this purpose, but I'd never actually used it for anything.
3095
3099
3096 2005-02-26 Fernando Perez <fperez@colorado.edu>
3100 2005-02-26 Fernando Perez <fperez@colorado.edu>
3097
3101
3098 * IPython/ipmaker.py (make_IPython): make the default ipython
3102 * IPython/ipmaker.py (make_IPython): make the default ipython
3099 directory be called _ipython under win32, to follow more the
3103 directory be called _ipython under win32, to follow more the
3100 naming peculiarities of that platform (where buggy software like
3104 naming peculiarities of that platform (where buggy software like
3101 Visual Sourcesafe breaks with .named directories). Reported by
3105 Visual Sourcesafe breaks with .named directories). Reported by
3102 Ville Vainio.
3106 Ville Vainio.
3103
3107
3104 2005-02-23 Fernando Perez <fperez@colorado.edu>
3108 2005-02-23 Fernando Perez <fperez@colorado.edu>
3105
3109
3106 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3110 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3107 auto_aliases for win32 which were causing problems. Users can
3111 auto_aliases for win32 which were causing problems. Users can
3108 define the ones they personally like.
3112 define the ones they personally like.
3109
3113
3110 2005-02-21 Fernando Perez <fperez@colorado.edu>
3114 2005-02-21 Fernando Perez <fperez@colorado.edu>
3111
3115
3112 * IPython/Magic.py (magic_time): new magic to time execution of
3116 * IPython/Magic.py (magic_time): new magic to time execution of
3113 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3117 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3114
3118
3115 2005-02-19 Fernando Perez <fperez@colorado.edu>
3119 2005-02-19 Fernando Perez <fperez@colorado.edu>
3116
3120
3117 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3121 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3118 into keys (for prompts, for example).
3122 into keys (for prompts, for example).
3119
3123
3120 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3124 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3121 prompts in case users want them. This introduces a small behavior
3125 prompts in case users want them. This introduces a small behavior
3122 change: ipython does not automatically add a space to all prompts
3126 change: ipython does not automatically add a space to all prompts
3123 anymore. To get the old prompts with a space, users should add it
3127 anymore. To get the old prompts with a space, users should add it
3124 manually to their ipythonrc file, so for example prompt_in1 should
3128 manually to their ipythonrc file, so for example prompt_in1 should
3125 now read 'In [\#]: ' instead of 'In [\#]:'.
3129 now read 'In [\#]: ' instead of 'In [\#]:'.
3126 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3130 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3127 file) to control left-padding of secondary prompts.
3131 file) to control left-padding of secondary prompts.
3128
3132
3129 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3133 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3130 the profiler can't be imported. Fix for Debian, which removed
3134 the profiler can't be imported. Fix for Debian, which removed
3131 profile.py because of License issues. I applied a slightly
3135 profile.py because of License issues. I applied a slightly
3132 modified version of the original Debian patch at
3136 modified version of the original Debian patch at
3133 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3137 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3134
3138
3135 2005-02-17 Fernando Perez <fperez@colorado.edu>
3139 2005-02-17 Fernando Perez <fperez@colorado.edu>
3136
3140
3137 * IPython/genutils.py (native_line_ends): Fix bug which would
3141 * IPython/genutils.py (native_line_ends): Fix bug which would
3138 cause improper line-ends under win32 b/c I was not opening files
3142 cause improper line-ends under win32 b/c I was not opening files
3139 in binary mode. Bug report and fix thanks to Ville.
3143 in binary mode. Bug report and fix thanks to Ville.
3140
3144
3141 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3145 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3142 trying to catch spurious foo[1] autocalls. My fix actually broke
3146 trying to catch spurious foo[1] autocalls. My fix actually broke
3143 ',/' autoquote/call with explicit escape (bad regexp).
3147 ',/' autoquote/call with explicit escape (bad regexp).
3144
3148
3145 2005-02-15 *** Released version 0.6.11
3149 2005-02-15 *** Released version 0.6.11
3146
3150
3147 2005-02-14 Fernando Perez <fperez@colorado.edu>
3151 2005-02-14 Fernando Perez <fperez@colorado.edu>
3148
3152
3149 * IPython/background_jobs.py: New background job management
3153 * IPython/background_jobs.py: New background job management
3150 subsystem. This is implemented via a new set of classes, and
3154 subsystem. This is implemented via a new set of classes, and
3151 IPython now provides a builtin 'jobs' object for background job
3155 IPython now provides a builtin 'jobs' object for background job
3152 execution. A convenience %bg magic serves as a lightweight
3156 execution. A convenience %bg magic serves as a lightweight
3153 frontend for starting the more common type of calls. This was
3157 frontend for starting the more common type of calls. This was
3154 inspired by discussions with B. Granger and the BackgroundCommand
3158 inspired by discussions with B. Granger and the BackgroundCommand
3155 class described in the book Python Scripting for Computational
3159 class described in the book Python Scripting for Computational
3156 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3160 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3157 (although ultimately no code from this text was used, as IPython's
3161 (although ultimately no code from this text was used, as IPython's
3158 system is a separate implementation).
3162 system is a separate implementation).
3159
3163
3160 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3164 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3161 to control the completion of single/double underscore names
3165 to control the completion of single/double underscore names
3162 separately. As documented in the example ipytonrc file, the
3166 separately. As documented in the example ipytonrc file, the
3163 readline_omit__names variable can now be set to 2, to omit even
3167 readline_omit__names variable can now be set to 2, to omit even
3164 single underscore names. Thanks to a patch by Brian Wong
3168 single underscore names. Thanks to a patch by Brian Wong
3165 <BrianWong-AT-AirgoNetworks.Com>.
3169 <BrianWong-AT-AirgoNetworks.Com>.
3166 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3170 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3167 be autocalled as foo([1]) if foo were callable. A problem for
3171 be autocalled as foo([1]) if foo were callable. A problem for
3168 things which are both callable and implement __getitem__.
3172 things which are both callable and implement __getitem__.
3169 (init_readline): Fix autoindentation for win32. Thanks to a patch
3173 (init_readline): Fix autoindentation for win32. Thanks to a patch
3170 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3174 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3171
3175
3172 2005-02-12 Fernando Perez <fperez@colorado.edu>
3176 2005-02-12 Fernando Perez <fperez@colorado.edu>
3173
3177
3174 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3178 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3175 which I had written long ago to sort out user error messages which
3179 which I had written long ago to sort out user error messages which
3176 may occur during startup. This seemed like a good idea initially,
3180 may occur during startup. This seemed like a good idea initially,
3177 but it has proven a disaster in retrospect. I don't want to
3181 but it has proven a disaster in retrospect. I don't want to
3178 change much code for now, so my fix is to set the internal 'debug'
3182 change much code for now, so my fix is to set the internal 'debug'
3179 flag to true everywhere, whose only job was precisely to control
3183 flag to true everywhere, whose only job was precisely to control
3180 this subsystem. This closes issue 28 (as well as avoiding all
3184 this subsystem. This closes issue 28 (as well as avoiding all
3181 sorts of strange hangups which occur from time to time).
3185 sorts of strange hangups which occur from time to time).
3182
3186
3183 2005-02-07 Fernando Perez <fperez@colorado.edu>
3187 2005-02-07 Fernando Perez <fperez@colorado.edu>
3184
3188
3185 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3189 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3186 previous call produced a syntax error.
3190 previous call produced a syntax error.
3187
3191
3188 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3192 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3189 classes without constructor.
3193 classes without constructor.
3190
3194
3191 2005-02-06 Fernando Perez <fperez@colorado.edu>
3195 2005-02-06 Fernando Perez <fperez@colorado.edu>
3192
3196
3193 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3197 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3194 completions with the results of each matcher, so we return results
3198 completions with the results of each matcher, so we return results
3195 to the user from all namespaces. This breaks with ipython
3199 to the user from all namespaces. This breaks with ipython
3196 tradition, but I think it's a nicer behavior. Now you get all
3200 tradition, but I think it's a nicer behavior. Now you get all
3197 possible completions listed, from all possible namespaces (python,
3201 possible completions listed, from all possible namespaces (python,
3198 filesystem, magics...) After a request by John Hunter
3202 filesystem, magics...) After a request by John Hunter
3199 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3203 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3200
3204
3201 2005-02-05 Fernando Perez <fperez@colorado.edu>
3205 2005-02-05 Fernando Perez <fperez@colorado.edu>
3202
3206
3203 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3207 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3204 the call had quote characters in it (the quotes were stripped).
3208 the call had quote characters in it (the quotes were stripped).
3205
3209
3206 2005-01-31 Fernando Perez <fperez@colorado.edu>
3210 2005-01-31 Fernando Perez <fperez@colorado.edu>
3207
3211
3208 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3212 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3209 Itpl.itpl() to make the code more robust against psyco
3213 Itpl.itpl() to make the code more robust against psyco
3210 optimizations.
3214 optimizations.
3211
3215
3212 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3216 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3213 of causing an exception. Quicker, cleaner.
3217 of causing an exception. Quicker, cleaner.
3214
3218
3215 2005-01-28 Fernando Perez <fperez@colorado.edu>
3219 2005-01-28 Fernando Perez <fperez@colorado.edu>
3216
3220
3217 * scripts/ipython_win_post_install.py (install): hardcode
3221 * scripts/ipython_win_post_install.py (install): hardcode
3218 sys.prefix+'python.exe' as the executable path. It turns out that
3222 sys.prefix+'python.exe' as the executable path. It turns out that
3219 during the post-installation run, sys.executable resolves to the
3223 during the post-installation run, sys.executable resolves to the
3220 name of the binary installer! I should report this as a distutils
3224 name of the binary installer! I should report this as a distutils
3221 bug, I think. I updated the .10 release with this tiny fix, to
3225 bug, I think. I updated the .10 release with this tiny fix, to
3222 avoid annoying the lists further.
3226 avoid annoying the lists further.
3223
3227
3224 2005-01-27 *** Released version 0.6.10
3228 2005-01-27 *** Released version 0.6.10
3225
3229
3226 2005-01-27 Fernando Perez <fperez@colorado.edu>
3230 2005-01-27 Fernando Perez <fperez@colorado.edu>
3227
3231
3228 * IPython/numutils.py (norm): Added 'inf' as optional name for
3232 * IPython/numutils.py (norm): Added 'inf' as optional name for
3229 L-infinity norm, included references to mathworld.com for vector
3233 L-infinity norm, included references to mathworld.com for vector
3230 norm definitions.
3234 norm definitions.
3231 (amin/amax): added amin/amax for array min/max. Similar to what
3235 (amin/amax): added amin/amax for array min/max. Similar to what
3232 pylab ships with after the recent reorganization of names.
3236 pylab ships with after the recent reorganization of names.
3233 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3237 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3234
3238
3235 * ipython.el: committed Alex's recent fixes and improvements.
3239 * ipython.el: committed Alex's recent fixes and improvements.
3236 Tested with python-mode from CVS, and it looks excellent. Since
3240 Tested with python-mode from CVS, and it looks excellent. Since
3237 python-mode hasn't released anything in a while, I'm temporarily
3241 python-mode hasn't released anything in a while, I'm temporarily
3238 putting a copy of today's CVS (v 4.70) of python-mode in:
3242 putting a copy of today's CVS (v 4.70) of python-mode in:
3239 http://ipython.scipy.org/tmp/python-mode.el
3243 http://ipython.scipy.org/tmp/python-mode.el
3240
3244
3241 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3245 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3242 sys.executable for the executable name, instead of assuming it's
3246 sys.executable for the executable name, instead of assuming it's
3243 called 'python.exe' (the post-installer would have produced broken
3247 called 'python.exe' (the post-installer would have produced broken
3244 setups on systems with a differently named python binary).
3248 setups on systems with a differently named python binary).
3245
3249
3246 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3250 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3247 references to os.linesep, to make the code more
3251 references to os.linesep, to make the code more
3248 platform-independent. This is also part of the win32 coloring
3252 platform-independent. This is also part of the win32 coloring
3249 fixes.
3253 fixes.
3250
3254
3251 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3255 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3252 lines, which actually cause coloring bugs because the length of
3256 lines, which actually cause coloring bugs because the length of
3253 the line is very difficult to correctly compute with embedded
3257 the line is very difficult to correctly compute with embedded
3254 escapes. This was the source of all the coloring problems under
3258 escapes. This was the source of all the coloring problems under
3255 Win32. I think that _finally_, Win32 users have a properly
3259 Win32. I think that _finally_, Win32 users have a properly
3256 working ipython in all respects. This would never have happened
3260 working ipython in all respects. This would never have happened
3257 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3261 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3258
3262
3259 2005-01-26 *** Released version 0.6.9
3263 2005-01-26 *** Released version 0.6.9
3260
3264
3261 2005-01-25 Fernando Perez <fperez@colorado.edu>
3265 2005-01-25 Fernando Perez <fperez@colorado.edu>
3262
3266
3263 * setup.py: finally, we have a true Windows installer, thanks to
3267 * setup.py: finally, we have a true Windows installer, thanks to
3264 the excellent work of Viktor Ransmayr
3268 the excellent work of Viktor Ransmayr
3265 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3269 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3266 Windows users. The setup routine is quite a bit cleaner thanks to
3270 Windows users. The setup routine is quite a bit cleaner thanks to
3267 this, and the post-install script uses the proper functions to
3271 this, and the post-install script uses the proper functions to
3268 allow a clean de-installation using the standard Windows Control
3272 allow a clean de-installation using the standard Windows Control
3269 Panel.
3273 Panel.
3270
3274
3271 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3275 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3272 environment variable under all OSes (including win32) if
3276 environment variable under all OSes (including win32) if
3273 available. This will give consistency to win32 users who have set
3277 available. This will give consistency to win32 users who have set
3274 this variable for any reason. If os.environ['HOME'] fails, the
3278 this variable for any reason. If os.environ['HOME'] fails, the
3275 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3279 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3276
3280
3277 2005-01-24 Fernando Perez <fperez@colorado.edu>
3281 2005-01-24 Fernando Perez <fperez@colorado.edu>
3278
3282
3279 * IPython/numutils.py (empty_like): add empty_like(), similar to
3283 * IPython/numutils.py (empty_like): add empty_like(), similar to
3280 zeros_like() but taking advantage of the new empty() Numeric routine.
3284 zeros_like() but taking advantage of the new empty() Numeric routine.
3281
3285
3282 2005-01-23 *** Released version 0.6.8
3286 2005-01-23 *** Released version 0.6.8
3283
3287
3284 2005-01-22 Fernando Perez <fperez@colorado.edu>
3288 2005-01-22 Fernando Perez <fperez@colorado.edu>
3285
3289
3286 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3290 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3287 automatic show() calls. After discussing things with JDH, it
3291 automatic show() calls. After discussing things with JDH, it
3288 turns out there are too many corner cases where this can go wrong.
3292 turns out there are too many corner cases where this can go wrong.
3289 It's best not to try to be 'too smart', and simply have ipython
3293 It's best not to try to be 'too smart', and simply have ipython
3290 reproduce as much as possible the default behavior of a normal
3294 reproduce as much as possible the default behavior of a normal
3291 python shell.
3295 python shell.
3292
3296
3293 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3297 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3294 line-splitting regexp and _prefilter() to avoid calling getattr()
3298 line-splitting regexp and _prefilter() to avoid calling getattr()
3295 on assignments. This closes
3299 on assignments. This closes
3296 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3300 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3297 readline uses getattr(), so a simple <TAB> keypress is still
3301 readline uses getattr(), so a simple <TAB> keypress is still
3298 enough to trigger getattr() calls on an object.
3302 enough to trigger getattr() calls on an object.
3299
3303
3300 2005-01-21 Fernando Perez <fperez@colorado.edu>
3304 2005-01-21 Fernando Perez <fperez@colorado.edu>
3301
3305
3302 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3306 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3303 docstring under pylab so it doesn't mask the original.
3307 docstring under pylab so it doesn't mask the original.
3304
3308
3305 2005-01-21 *** Released version 0.6.7
3309 2005-01-21 *** Released version 0.6.7
3306
3310
3307 2005-01-21 Fernando Perez <fperez@colorado.edu>
3311 2005-01-21 Fernando Perez <fperez@colorado.edu>
3308
3312
3309 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3313 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3310 signal handling for win32 users in multithreaded mode.
3314 signal handling for win32 users in multithreaded mode.
3311
3315
3312 2005-01-17 Fernando Perez <fperez@colorado.edu>
3316 2005-01-17 Fernando Perez <fperez@colorado.edu>
3313
3317
3314 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3318 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3315 instances with no __init__. After a crash report by Norbert Nemec
3319 instances with no __init__. After a crash report by Norbert Nemec
3316 <Norbert-AT-nemec-online.de>.
3320 <Norbert-AT-nemec-online.de>.
3317
3321
3318 2005-01-14 Fernando Perez <fperez@colorado.edu>
3322 2005-01-14 Fernando Perez <fperez@colorado.edu>
3319
3323
3320 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3324 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3321 names for verbose exceptions, when multiple dotted names and the
3325 names for verbose exceptions, when multiple dotted names and the
3322 'parent' object were present on the same line.
3326 'parent' object were present on the same line.
3323
3327
3324 2005-01-11 Fernando Perez <fperez@colorado.edu>
3328 2005-01-11 Fernando Perez <fperez@colorado.edu>
3325
3329
3326 * IPython/genutils.py (flag_calls): new utility to trap and flag
3330 * IPython/genutils.py (flag_calls): new utility to trap and flag
3327 calls in functions. I need it to clean up matplotlib support.
3331 calls in functions. I need it to clean up matplotlib support.
3328 Also removed some deprecated code in genutils.
3332 Also removed some deprecated code in genutils.
3329
3333
3330 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3334 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3331 that matplotlib scripts called with %run, which don't call show()
3335 that matplotlib scripts called with %run, which don't call show()
3332 themselves, still have their plotting windows open.
3336 themselves, still have their plotting windows open.
3333
3337
3334 2005-01-05 Fernando Perez <fperez@colorado.edu>
3338 2005-01-05 Fernando Perez <fperez@colorado.edu>
3335
3339
3336 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3340 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3337 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3341 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3338
3342
3339 2004-12-19 Fernando Perez <fperez@colorado.edu>
3343 2004-12-19 Fernando Perez <fperez@colorado.edu>
3340
3344
3341 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3345 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3342 parent_runcode, which was an eyesore. The same result can be
3346 parent_runcode, which was an eyesore. The same result can be
3343 obtained with Python's regular superclass mechanisms.
3347 obtained with Python's regular superclass mechanisms.
3344
3348
3345 2004-12-17 Fernando Perez <fperez@colorado.edu>
3349 2004-12-17 Fernando Perez <fperez@colorado.edu>
3346
3350
3347 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3351 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3348 reported by Prabhu.
3352 reported by Prabhu.
3349 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3353 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3350 sys.stderr) instead of explicitly calling sys.stderr. This helps
3354 sys.stderr) instead of explicitly calling sys.stderr. This helps
3351 maintain our I/O abstractions clean, for future GUI embeddings.
3355 maintain our I/O abstractions clean, for future GUI embeddings.
3352
3356
3353 * IPython/genutils.py (info): added new utility for sys.stderr
3357 * IPython/genutils.py (info): added new utility for sys.stderr
3354 unified info message handling (thin wrapper around warn()).
3358 unified info message handling (thin wrapper around warn()).
3355
3359
3356 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3360 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3357 composite (dotted) names on verbose exceptions.
3361 composite (dotted) names on verbose exceptions.
3358 (VerboseTB.nullrepr): harden against another kind of errors which
3362 (VerboseTB.nullrepr): harden against another kind of errors which
3359 Python's inspect module can trigger, and which were crashing
3363 Python's inspect module can trigger, and which were crashing
3360 IPython. Thanks to a report by Marco Lombardi
3364 IPython. Thanks to a report by Marco Lombardi
3361 <mlombard-AT-ma010192.hq.eso.org>.
3365 <mlombard-AT-ma010192.hq.eso.org>.
3362
3366
3363 2004-12-13 *** Released version 0.6.6
3367 2004-12-13 *** Released version 0.6.6
3364
3368
3365 2004-12-12 Fernando Perez <fperez@colorado.edu>
3369 2004-12-12 Fernando Perez <fperez@colorado.edu>
3366
3370
3367 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3371 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3368 generated by pygtk upon initialization if it was built without
3372 generated by pygtk upon initialization if it was built without
3369 threads (for matplotlib users). After a crash reported by
3373 threads (for matplotlib users). After a crash reported by
3370 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3374 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3371
3375
3372 * IPython/ipmaker.py (make_IPython): fix small bug in the
3376 * IPython/ipmaker.py (make_IPython): fix small bug in the
3373 import_some parameter for multiple imports.
3377 import_some parameter for multiple imports.
3374
3378
3375 * IPython/iplib.py (ipmagic): simplified the interface of
3379 * IPython/iplib.py (ipmagic): simplified the interface of
3376 ipmagic() to take a single string argument, just as it would be
3380 ipmagic() to take a single string argument, just as it would be
3377 typed at the IPython cmd line.
3381 typed at the IPython cmd line.
3378 (ipalias): Added new ipalias() with an interface identical to
3382 (ipalias): Added new ipalias() with an interface identical to
3379 ipmagic(). This completes exposing a pure python interface to the
3383 ipmagic(). This completes exposing a pure python interface to the
3380 alias and magic system, which can be used in loops or more complex
3384 alias and magic system, which can be used in loops or more complex
3381 code where IPython's automatic line mangling is not active.
3385 code where IPython's automatic line mangling is not active.
3382
3386
3383 * IPython/genutils.py (timing): changed interface of timing to
3387 * IPython/genutils.py (timing): changed interface of timing to
3384 simply run code once, which is the most common case. timings()
3388 simply run code once, which is the most common case. timings()
3385 remains unchanged, for the cases where you want multiple runs.
3389 remains unchanged, for the cases where you want multiple runs.
3386
3390
3387 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3391 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3388 bug where Python2.2 crashes with exec'ing code which does not end
3392 bug where Python2.2 crashes with exec'ing code which does not end
3389 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3393 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3390 before.
3394 before.
3391
3395
3392 2004-12-10 Fernando Perez <fperez@colorado.edu>
3396 2004-12-10 Fernando Perez <fperez@colorado.edu>
3393
3397
3394 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3398 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3395 -t to -T, to accomodate the new -t flag in %run (the %run and
3399 -t to -T, to accomodate the new -t flag in %run (the %run and
3396 %prun options are kind of intermixed, and it's not easy to change
3400 %prun options are kind of intermixed, and it's not easy to change
3397 this with the limitations of python's getopt).
3401 this with the limitations of python's getopt).
3398
3402
3399 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3403 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3400 the execution of scripts. It's not as fine-tuned as timeit.py,
3404 the execution of scripts. It's not as fine-tuned as timeit.py,
3401 but it works from inside ipython (and under 2.2, which lacks
3405 but it works from inside ipython (and under 2.2, which lacks
3402 timeit.py). Optionally a number of runs > 1 can be given for
3406 timeit.py). Optionally a number of runs > 1 can be given for
3403 timing very short-running code.
3407 timing very short-running code.
3404
3408
3405 * IPython/genutils.py (uniq_stable): new routine which returns a
3409 * IPython/genutils.py (uniq_stable): new routine which returns a
3406 list of unique elements in any iterable, but in stable order of
3410 list of unique elements in any iterable, but in stable order of
3407 appearance. I needed this for the ultraTB fixes, and it's a handy
3411 appearance. I needed this for the ultraTB fixes, and it's a handy
3408 utility.
3412 utility.
3409
3413
3410 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3414 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3411 dotted names in Verbose exceptions. This had been broken since
3415 dotted names in Verbose exceptions. This had been broken since
3412 the very start, now x.y will properly be printed in a Verbose
3416 the very start, now x.y will properly be printed in a Verbose
3413 traceback, instead of x being shown and y appearing always as an
3417 traceback, instead of x being shown and y appearing always as an
3414 'undefined global'. Getting this to work was a bit tricky,
3418 'undefined global'. Getting this to work was a bit tricky,
3415 because by default python tokenizers are stateless. Saved by
3419 because by default python tokenizers are stateless. Saved by
3416 python's ability to easily add a bit of state to an arbitrary
3420 python's ability to easily add a bit of state to an arbitrary
3417 function (without needing to build a full-blown callable object).
3421 function (without needing to build a full-blown callable object).
3418
3422
3419 Also big cleanup of this code, which had horrendous runtime
3423 Also big cleanup of this code, which had horrendous runtime
3420 lookups of zillions of attributes for colorization. Moved all
3424 lookups of zillions of attributes for colorization. Moved all
3421 this code into a few templates, which make it cleaner and quicker.
3425 this code into a few templates, which make it cleaner and quicker.
3422
3426
3423 Printout quality was also improved for Verbose exceptions: one
3427 Printout quality was also improved for Verbose exceptions: one
3424 variable per line, and memory addresses are printed (this can be
3428 variable per line, and memory addresses are printed (this can be
3425 quite handy in nasty debugging situations, which is what Verbose
3429 quite handy in nasty debugging situations, which is what Verbose
3426 is for).
3430 is for).
3427
3431
3428 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3432 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3429 the command line as scripts to be loaded by embedded instances.
3433 the command line as scripts to be loaded by embedded instances.
3430 Doing so has the potential for an infinite recursion if there are
3434 Doing so has the potential for an infinite recursion if there are
3431 exceptions thrown in the process. This fixes a strange crash
3435 exceptions thrown in the process. This fixes a strange crash
3432 reported by Philippe MULLER <muller-AT-irit.fr>.
3436 reported by Philippe MULLER <muller-AT-irit.fr>.
3433
3437
3434 2004-12-09 Fernando Perez <fperez@colorado.edu>
3438 2004-12-09 Fernando Perez <fperez@colorado.edu>
3435
3439
3436 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3440 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3437 to reflect new names in matplotlib, which now expose the
3441 to reflect new names in matplotlib, which now expose the
3438 matlab-compatible interface via a pylab module instead of the
3442 matlab-compatible interface via a pylab module instead of the
3439 'matlab' name. The new code is backwards compatible, so users of
3443 'matlab' name. The new code is backwards compatible, so users of
3440 all matplotlib versions are OK. Patch by J. Hunter.
3444 all matplotlib versions are OK. Patch by J. Hunter.
3441
3445
3442 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3446 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3443 of __init__ docstrings for instances (class docstrings are already
3447 of __init__ docstrings for instances (class docstrings are already
3444 automatically printed). Instances with customized docstrings
3448 automatically printed). Instances with customized docstrings
3445 (indep. of the class) are also recognized and all 3 separate
3449 (indep. of the class) are also recognized and all 3 separate
3446 docstrings are printed (instance, class, constructor). After some
3450 docstrings are printed (instance, class, constructor). After some
3447 comments/suggestions by J. Hunter.
3451 comments/suggestions by J. Hunter.
3448
3452
3449 2004-12-05 Fernando Perez <fperez@colorado.edu>
3453 2004-12-05 Fernando Perez <fperez@colorado.edu>
3450
3454
3451 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3455 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3452 warnings when tab-completion fails and triggers an exception.
3456 warnings when tab-completion fails and triggers an exception.
3453
3457
3454 2004-12-03 Fernando Perez <fperez@colorado.edu>
3458 2004-12-03 Fernando Perez <fperez@colorado.edu>
3455
3459
3456 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3460 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3457 be triggered when using 'run -p'. An incorrect option flag was
3461 be triggered when using 'run -p'. An incorrect option flag was
3458 being set ('d' instead of 'D').
3462 being set ('d' instead of 'D').
3459 (manpage): fix missing escaped \- sign.
3463 (manpage): fix missing escaped \- sign.
3460
3464
3461 2004-11-30 *** Released version 0.6.5
3465 2004-11-30 *** Released version 0.6.5
3462
3466
3463 2004-11-30 Fernando Perez <fperez@colorado.edu>
3467 2004-11-30 Fernando Perez <fperez@colorado.edu>
3464
3468
3465 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3469 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3466 setting with -d option.
3470 setting with -d option.
3467
3471
3468 * setup.py (docfiles): Fix problem where the doc glob I was using
3472 * setup.py (docfiles): Fix problem where the doc glob I was using
3469 was COMPLETELY BROKEN. It was giving the right files by pure
3473 was COMPLETELY BROKEN. It was giving the right files by pure
3470 accident, but failed once I tried to include ipython.el. Note:
3474 accident, but failed once I tried to include ipython.el. Note:
3471 glob() does NOT allow you to do exclusion on multiple endings!
3475 glob() does NOT allow you to do exclusion on multiple endings!
3472
3476
3473 2004-11-29 Fernando Perez <fperez@colorado.edu>
3477 2004-11-29 Fernando Perez <fperez@colorado.edu>
3474
3478
3475 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3479 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3476 the manpage as the source. Better formatting & consistency.
3480 the manpage as the source. Better formatting & consistency.
3477
3481
3478 * IPython/Magic.py (magic_run): Added new -d option, to run
3482 * IPython/Magic.py (magic_run): Added new -d option, to run
3479 scripts under the control of the python pdb debugger. Note that
3483 scripts under the control of the python pdb debugger. Note that
3480 this required changing the %prun option -d to -D, to avoid a clash
3484 this required changing the %prun option -d to -D, to avoid a clash
3481 (since %run must pass options to %prun, and getopt is too dumb to
3485 (since %run must pass options to %prun, and getopt is too dumb to
3482 handle options with string values with embedded spaces). Thanks
3486 handle options with string values with embedded spaces). Thanks
3483 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3487 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3484 (magic_who_ls): added type matching to %who and %whos, so that one
3488 (magic_who_ls): added type matching to %who and %whos, so that one
3485 can filter their output to only include variables of certain
3489 can filter their output to only include variables of certain
3486 types. Another suggestion by Matthew.
3490 types. Another suggestion by Matthew.
3487 (magic_whos): Added memory summaries in kb and Mb for arrays.
3491 (magic_whos): Added memory summaries in kb and Mb for arrays.
3488 (magic_who): Improve formatting (break lines every 9 vars).
3492 (magic_who): Improve formatting (break lines every 9 vars).
3489
3493
3490 2004-11-28 Fernando Perez <fperez@colorado.edu>
3494 2004-11-28 Fernando Perez <fperez@colorado.edu>
3491
3495
3492 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3496 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3493 cache when empty lines were present.
3497 cache when empty lines were present.
3494
3498
3495 2004-11-24 Fernando Perez <fperez@colorado.edu>
3499 2004-11-24 Fernando Perez <fperez@colorado.edu>
3496
3500
3497 * IPython/usage.py (__doc__): document the re-activated threading
3501 * IPython/usage.py (__doc__): document the re-activated threading
3498 options for WX and GTK.
3502 options for WX and GTK.
3499
3503
3500 2004-11-23 Fernando Perez <fperez@colorado.edu>
3504 2004-11-23 Fernando Perez <fperez@colorado.edu>
3501
3505
3502 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3506 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3503 the -wthread and -gthread options, along with a new -tk one to try
3507 the -wthread and -gthread options, along with a new -tk one to try
3504 and coordinate Tk threading with wx/gtk. The tk support is very
3508 and coordinate Tk threading with wx/gtk. The tk support is very
3505 platform dependent, since it seems to require Tcl and Tk to be
3509 platform dependent, since it seems to require Tcl and Tk to be
3506 built with threads (Fedora1/2 appears NOT to have it, but in
3510 built with threads (Fedora1/2 appears NOT to have it, but in
3507 Prabhu's Debian boxes it works OK). But even with some Tk
3511 Prabhu's Debian boxes it works OK). But even with some Tk
3508 limitations, this is a great improvement.
3512 limitations, this is a great improvement.
3509
3513
3510 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3514 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3511 info in user prompts. Patch by Prabhu.
3515 info in user prompts. Patch by Prabhu.
3512
3516
3513 2004-11-18 Fernando Perez <fperez@colorado.edu>
3517 2004-11-18 Fernando Perez <fperez@colorado.edu>
3514
3518
3515 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3519 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3516 EOFErrors and bail, to avoid infinite loops if a non-terminating
3520 EOFErrors and bail, to avoid infinite loops if a non-terminating
3517 file is fed into ipython. Patch submitted in issue 19 by user,
3521 file is fed into ipython. Patch submitted in issue 19 by user,
3518 many thanks.
3522 many thanks.
3519
3523
3520 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3524 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3521 autoquote/parens in continuation prompts, which can cause lots of
3525 autoquote/parens in continuation prompts, which can cause lots of
3522 problems. Closes roundup issue 20.
3526 problems. Closes roundup issue 20.
3523
3527
3524 2004-11-17 Fernando Perez <fperez@colorado.edu>
3528 2004-11-17 Fernando Perez <fperez@colorado.edu>
3525
3529
3526 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3530 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3527 reported as debian bug #280505. I'm not sure my local changelog
3531 reported as debian bug #280505. I'm not sure my local changelog
3528 entry has the proper debian format (Jack?).
3532 entry has the proper debian format (Jack?).
3529
3533
3530 2004-11-08 *** Released version 0.6.4
3534 2004-11-08 *** Released version 0.6.4
3531
3535
3532 2004-11-08 Fernando Perez <fperez@colorado.edu>
3536 2004-11-08 Fernando Perez <fperez@colorado.edu>
3533
3537
3534 * IPython/iplib.py (init_readline): Fix exit message for Windows
3538 * IPython/iplib.py (init_readline): Fix exit message for Windows
3535 when readline is active. Thanks to a report by Eric Jones
3539 when readline is active. Thanks to a report by Eric Jones
3536 <eric-AT-enthought.com>.
3540 <eric-AT-enthought.com>.
3537
3541
3538 2004-11-07 Fernando Perez <fperez@colorado.edu>
3542 2004-11-07 Fernando Perez <fperez@colorado.edu>
3539
3543
3540 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3544 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3541 sometimes seen by win2k/cygwin users.
3545 sometimes seen by win2k/cygwin users.
3542
3546
3543 2004-11-06 Fernando Perez <fperez@colorado.edu>
3547 2004-11-06 Fernando Perez <fperez@colorado.edu>
3544
3548
3545 * IPython/iplib.py (interact): Change the handling of %Exit from
3549 * IPython/iplib.py (interact): Change the handling of %Exit from
3546 trying to propagate a SystemExit to an internal ipython flag.
3550 trying to propagate a SystemExit to an internal ipython flag.
3547 This is less elegant than using Python's exception mechanism, but
3551 This is less elegant than using Python's exception mechanism, but
3548 I can't get that to work reliably with threads, so under -pylab
3552 I can't get that to work reliably with threads, so under -pylab
3549 %Exit was hanging IPython. Cross-thread exception handling is
3553 %Exit was hanging IPython. Cross-thread exception handling is
3550 really a bitch. Thaks to a bug report by Stephen Walton
3554 really a bitch. Thaks to a bug report by Stephen Walton
3551 <stephen.walton-AT-csun.edu>.
3555 <stephen.walton-AT-csun.edu>.
3552
3556
3553 2004-11-04 Fernando Perez <fperez@colorado.edu>
3557 2004-11-04 Fernando Perez <fperez@colorado.edu>
3554
3558
3555 * IPython/iplib.py (raw_input_original): store a pointer to the
3559 * IPython/iplib.py (raw_input_original): store a pointer to the
3556 true raw_input to harden against code which can modify it
3560 true raw_input to harden against code which can modify it
3557 (wx.py.PyShell does this and would otherwise crash ipython).
3561 (wx.py.PyShell does this and would otherwise crash ipython).
3558 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3562 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3559
3563
3560 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3564 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3561 Ctrl-C problem, which does not mess up the input line.
3565 Ctrl-C problem, which does not mess up the input line.
3562
3566
3563 2004-11-03 Fernando Perez <fperez@colorado.edu>
3567 2004-11-03 Fernando Perez <fperez@colorado.edu>
3564
3568
3565 * IPython/Release.py: Changed licensing to BSD, in all files.
3569 * IPython/Release.py: Changed licensing to BSD, in all files.
3566 (name): lowercase name for tarball/RPM release.
3570 (name): lowercase name for tarball/RPM release.
3567
3571
3568 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3572 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3569 use throughout ipython.
3573 use throughout ipython.
3570
3574
3571 * IPython/Magic.py (Magic._ofind): Switch to using the new
3575 * IPython/Magic.py (Magic._ofind): Switch to using the new
3572 OInspect.getdoc() function.
3576 OInspect.getdoc() function.
3573
3577
3574 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3578 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3575 of the line currently being canceled via Ctrl-C. It's extremely
3579 of the line currently being canceled via Ctrl-C. It's extremely
3576 ugly, but I don't know how to do it better (the problem is one of
3580 ugly, but I don't know how to do it better (the problem is one of
3577 handling cross-thread exceptions).
3581 handling cross-thread exceptions).
3578
3582
3579 2004-10-28 Fernando Perez <fperez@colorado.edu>
3583 2004-10-28 Fernando Perez <fperez@colorado.edu>
3580
3584
3581 * IPython/Shell.py (signal_handler): add signal handlers to trap
3585 * IPython/Shell.py (signal_handler): add signal handlers to trap
3582 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3586 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3583 report by Francesc Alted.
3587 report by Francesc Alted.
3584
3588
3585 2004-10-21 Fernando Perez <fperez@colorado.edu>
3589 2004-10-21 Fernando Perez <fperez@colorado.edu>
3586
3590
3587 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3591 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3588 to % for pysh syntax extensions.
3592 to % for pysh syntax extensions.
3589
3593
3590 2004-10-09 Fernando Perez <fperez@colorado.edu>
3594 2004-10-09 Fernando Perez <fperez@colorado.edu>
3591
3595
3592 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3596 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3593 arrays to print a more useful summary, without calling str(arr).
3597 arrays to print a more useful summary, without calling str(arr).
3594 This avoids the problem of extremely lengthy computations which
3598 This avoids the problem of extremely lengthy computations which
3595 occur if arr is large, and appear to the user as a system lockup
3599 occur if arr is large, and appear to the user as a system lockup
3596 with 100% cpu activity. After a suggestion by Kristian Sandberg
3600 with 100% cpu activity. After a suggestion by Kristian Sandberg
3597 <Kristian.Sandberg@colorado.edu>.
3601 <Kristian.Sandberg@colorado.edu>.
3598 (Magic.__init__): fix bug in global magic escapes not being
3602 (Magic.__init__): fix bug in global magic escapes not being
3599 correctly set.
3603 correctly set.
3600
3604
3601 2004-10-08 Fernando Perez <fperez@colorado.edu>
3605 2004-10-08 Fernando Perez <fperez@colorado.edu>
3602
3606
3603 * IPython/Magic.py (__license__): change to absolute imports of
3607 * IPython/Magic.py (__license__): change to absolute imports of
3604 ipython's own internal packages, to start adapting to the absolute
3608 ipython's own internal packages, to start adapting to the absolute
3605 import requirement of PEP-328.
3609 import requirement of PEP-328.
3606
3610
3607 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3611 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3608 files, and standardize author/license marks through the Release
3612 files, and standardize author/license marks through the Release
3609 module instead of having per/file stuff (except for files with
3613 module instead of having per/file stuff (except for files with
3610 particular licenses, like the MIT/PSF-licensed codes).
3614 particular licenses, like the MIT/PSF-licensed codes).
3611
3615
3612 * IPython/Debugger.py: remove dead code for python 2.1
3616 * IPython/Debugger.py: remove dead code for python 2.1
3613
3617
3614 2004-10-04 Fernando Perez <fperez@colorado.edu>
3618 2004-10-04 Fernando Perez <fperez@colorado.edu>
3615
3619
3616 * IPython/iplib.py (ipmagic): New function for accessing magics
3620 * IPython/iplib.py (ipmagic): New function for accessing magics
3617 via a normal python function call.
3621 via a normal python function call.
3618
3622
3619 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3623 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3620 from '@' to '%', to accomodate the new @decorator syntax of python
3624 from '@' to '%', to accomodate the new @decorator syntax of python
3621 2.4.
3625 2.4.
3622
3626
3623 2004-09-29 Fernando Perez <fperez@colorado.edu>
3627 2004-09-29 Fernando Perez <fperez@colorado.edu>
3624
3628
3625 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3629 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3626 matplotlib.use to prevent running scripts which try to switch
3630 matplotlib.use to prevent running scripts which try to switch
3627 interactive backends from within ipython. This will just crash
3631 interactive backends from within ipython. This will just crash
3628 the python interpreter, so we can't allow it (but a detailed error
3632 the python interpreter, so we can't allow it (but a detailed error
3629 is given to the user).
3633 is given to the user).
3630
3634
3631 2004-09-28 Fernando Perez <fperez@colorado.edu>
3635 2004-09-28 Fernando Perez <fperez@colorado.edu>
3632
3636
3633 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3637 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3634 matplotlib-related fixes so that using @run with non-matplotlib
3638 matplotlib-related fixes so that using @run with non-matplotlib
3635 scripts doesn't pop up spurious plot windows. This requires
3639 scripts doesn't pop up spurious plot windows. This requires
3636 matplotlib >= 0.63, where I had to make some changes as well.
3640 matplotlib >= 0.63, where I had to make some changes as well.
3637
3641
3638 * IPython/ipmaker.py (make_IPython): update version requirement to
3642 * IPython/ipmaker.py (make_IPython): update version requirement to
3639 python 2.2.
3643 python 2.2.
3640
3644
3641 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3645 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3642 banner arg for embedded customization.
3646 banner arg for embedded customization.
3643
3647
3644 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3648 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3645 explicit uses of __IP as the IPython's instance name. Now things
3649 explicit uses of __IP as the IPython's instance name. Now things
3646 are properly handled via the shell.name value. The actual code
3650 are properly handled via the shell.name value. The actual code
3647 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3651 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3648 is much better than before. I'll clean things completely when the
3652 is much better than before. I'll clean things completely when the
3649 magic stuff gets a real overhaul.
3653 magic stuff gets a real overhaul.
3650
3654
3651 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3655 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3652 minor changes to debian dir.
3656 minor changes to debian dir.
3653
3657
3654 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3658 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3655 pointer to the shell itself in the interactive namespace even when
3659 pointer to the shell itself in the interactive namespace even when
3656 a user-supplied dict is provided. This is needed for embedding
3660 a user-supplied dict is provided. This is needed for embedding
3657 purposes (found by tests with Michel Sanner).
3661 purposes (found by tests with Michel Sanner).
3658
3662
3659 2004-09-27 Fernando Perez <fperez@colorado.edu>
3663 2004-09-27 Fernando Perez <fperez@colorado.edu>
3660
3664
3661 * IPython/UserConfig/ipythonrc: remove []{} from
3665 * IPython/UserConfig/ipythonrc: remove []{} from
3662 readline_remove_delims, so that things like [modname.<TAB> do
3666 readline_remove_delims, so that things like [modname.<TAB> do
3663 proper completion. This disables [].TAB, but that's a less common
3667 proper completion. This disables [].TAB, but that's a less common
3664 case than module names in list comprehensions, for example.
3668 case than module names in list comprehensions, for example.
3665 Thanks to a report by Andrea Riciputi.
3669 Thanks to a report by Andrea Riciputi.
3666
3670
3667 2004-09-09 Fernando Perez <fperez@colorado.edu>
3671 2004-09-09 Fernando Perez <fperez@colorado.edu>
3668
3672
3669 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3673 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3670 blocking problems in win32 and osx. Fix by John.
3674 blocking problems in win32 and osx. Fix by John.
3671
3675
3672 2004-09-08 Fernando Perez <fperez@colorado.edu>
3676 2004-09-08 Fernando Perez <fperez@colorado.edu>
3673
3677
3674 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3678 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3675 for Win32 and OSX. Fix by John Hunter.
3679 for Win32 and OSX. Fix by John Hunter.
3676
3680
3677 2004-08-30 *** Released version 0.6.3
3681 2004-08-30 *** Released version 0.6.3
3678
3682
3679 2004-08-30 Fernando Perez <fperez@colorado.edu>
3683 2004-08-30 Fernando Perez <fperez@colorado.edu>
3680
3684
3681 * setup.py (isfile): Add manpages to list of dependent files to be
3685 * setup.py (isfile): Add manpages to list of dependent files to be
3682 updated.
3686 updated.
3683
3687
3684 2004-08-27 Fernando Perez <fperez@colorado.edu>
3688 2004-08-27 Fernando Perez <fperez@colorado.edu>
3685
3689
3686 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3690 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3687 for now. They don't really work with standalone WX/GTK code
3691 for now. They don't really work with standalone WX/GTK code
3688 (though matplotlib IS working fine with both of those backends).
3692 (though matplotlib IS working fine with both of those backends).
3689 This will neeed much more testing. I disabled most things with
3693 This will neeed much more testing. I disabled most things with
3690 comments, so turning it back on later should be pretty easy.
3694 comments, so turning it back on later should be pretty easy.
3691
3695
3692 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3696 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3693 autocalling of expressions like r'foo', by modifying the line
3697 autocalling of expressions like r'foo', by modifying the line
3694 split regexp. Closes
3698 split regexp. Closes
3695 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3699 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3696 Riley <ipythonbugs-AT-sabi.net>.
3700 Riley <ipythonbugs-AT-sabi.net>.
3697 (InteractiveShell.mainloop): honor --nobanner with banner
3701 (InteractiveShell.mainloop): honor --nobanner with banner
3698 extensions.
3702 extensions.
3699
3703
3700 * IPython/Shell.py: Significant refactoring of all classes, so
3704 * IPython/Shell.py: Significant refactoring of all classes, so
3701 that we can really support ALL matplotlib backends and threading
3705 that we can really support ALL matplotlib backends and threading
3702 models (John spotted a bug with Tk which required this). Now we
3706 models (John spotted a bug with Tk which required this). Now we
3703 should support single-threaded, WX-threads and GTK-threads, both
3707 should support single-threaded, WX-threads and GTK-threads, both
3704 for generic code and for matplotlib.
3708 for generic code and for matplotlib.
3705
3709
3706 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3710 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3707 -pylab, to simplify things for users. Will also remove the pylab
3711 -pylab, to simplify things for users. Will also remove the pylab
3708 profile, since now all of matplotlib configuration is directly
3712 profile, since now all of matplotlib configuration is directly
3709 handled here. This also reduces startup time.
3713 handled here. This also reduces startup time.
3710
3714
3711 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3715 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3712 shell wasn't being correctly called. Also in IPShellWX.
3716 shell wasn't being correctly called. Also in IPShellWX.
3713
3717
3714 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3718 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3715 fine-tune banner.
3719 fine-tune banner.
3716
3720
3717 * IPython/numutils.py (spike): Deprecate these spike functions,
3721 * IPython/numutils.py (spike): Deprecate these spike functions,
3718 delete (long deprecated) gnuplot_exec handler.
3722 delete (long deprecated) gnuplot_exec handler.
3719
3723
3720 2004-08-26 Fernando Perez <fperez@colorado.edu>
3724 2004-08-26 Fernando Perez <fperez@colorado.edu>
3721
3725
3722 * ipython.1: Update for threading options, plus some others which
3726 * ipython.1: Update for threading options, plus some others which
3723 were missing.
3727 were missing.
3724
3728
3725 * IPython/ipmaker.py (__call__): Added -wthread option for
3729 * IPython/ipmaker.py (__call__): Added -wthread option for
3726 wxpython thread handling. Make sure threading options are only
3730 wxpython thread handling. Make sure threading options are only
3727 valid at the command line.
3731 valid at the command line.
3728
3732
3729 * scripts/ipython: moved shell selection into a factory function
3733 * scripts/ipython: moved shell selection into a factory function
3730 in Shell.py, to keep the starter script to a minimum.
3734 in Shell.py, to keep the starter script to a minimum.
3731
3735
3732 2004-08-25 Fernando Perez <fperez@colorado.edu>
3736 2004-08-25 Fernando Perez <fperez@colorado.edu>
3733
3737
3734 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3738 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3735 John. Along with some recent changes he made to matplotlib, the
3739 John. Along with some recent changes he made to matplotlib, the
3736 next versions of both systems should work very well together.
3740 next versions of both systems should work very well together.
3737
3741
3738 2004-08-24 Fernando Perez <fperez@colorado.edu>
3742 2004-08-24 Fernando Perez <fperez@colorado.edu>
3739
3743
3740 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3744 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3741 tried to switch the profiling to using hotshot, but I'm getting
3745 tried to switch the profiling to using hotshot, but I'm getting
3742 strange errors from prof.runctx() there. I may be misreading the
3746 strange errors from prof.runctx() there. I may be misreading the
3743 docs, but it looks weird. For now the profiling code will
3747 docs, but it looks weird. For now the profiling code will
3744 continue to use the standard profiler.
3748 continue to use the standard profiler.
3745
3749
3746 2004-08-23 Fernando Perez <fperez@colorado.edu>
3750 2004-08-23 Fernando Perez <fperez@colorado.edu>
3747
3751
3748 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3752 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3749 threaded shell, by John Hunter. It's not quite ready yet, but
3753 threaded shell, by John Hunter. It's not quite ready yet, but
3750 close.
3754 close.
3751
3755
3752 2004-08-22 Fernando Perez <fperez@colorado.edu>
3756 2004-08-22 Fernando Perez <fperez@colorado.edu>
3753
3757
3754 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3758 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3755 in Magic and ultraTB.
3759 in Magic and ultraTB.
3756
3760
3757 * ipython.1: document threading options in manpage.
3761 * ipython.1: document threading options in manpage.
3758
3762
3759 * scripts/ipython: Changed name of -thread option to -gthread,
3763 * scripts/ipython: Changed name of -thread option to -gthread,
3760 since this is GTK specific. I want to leave the door open for a
3764 since this is GTK specific. I want to leave the door open for a
3761 -wthread option for WX, which will most likely be necessary. This
3765 -wthread option for WX, which will most likely be necessary. This
3762 change affects usage and ipmaker as well.
3766 change affects usage and ipmaker as well.
3763
3767
3764 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3768 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3765 handle the matplotlib shell issues. Code by John Hunter
3769 handle the matplotlib shell issues. Code by John Hunter
3766 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3770 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3767 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3771 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3768 broken (and disabled for end users) for now, but it puts the
3772 broken (and disabled for end users) for now, but it puts the
3769 infrastructure in place.
3773 infrastructure in place.
3770
3774
3771 2004-08-21 Fernando Perez <fperez@colorado.edu>
3775 2004-08-21 Fernando Perez <fperez@colorado.edu>
3772
3776
3773 * ipythonrc-pylab: Add matplotlib support.
3777 * ipythonrc-pylab: Add matplotlib support.
3774
3778
3775 * matplotlib_config.py: new files for matplotlib support, part of
3779 * matplotlib_config.py: new files for matplotlib support, part of
3776 the pylab profile.
3780 the pylab profile.
3777
3781
3778 * IPython/usage.py (__doc__): documented the threading options.
3782 * IPython/usage.py (__doc__): documented the threading options.
3779
3783
3780 2004-08-20 Fernando Perez <fperez@colorado.edu>
3784 2004-08-20 Fernando Perez <fperez@colorado.edu>
3781
3785
3782 * ipython: Modified the main calling routine to handle the -thread
3786 * ipython: Modified the main calling routine to handle the -thread
3783 and -mpthread options. This needs to be done as a top-level hack,
3787 and -mpthread options. This needs to be done as a top-level hack,
3784 because it determines which class to instantiate for IPython
3788 because it determines which class to instantiate for IPython
3785 itself.
3789 itself.
3786
3790
3787 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3791 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3788 classes to support multithreaded GTK operation without blocking,
3792 classes to support multithreaded GTK operation without blocking,
3789 and matplotlib with all backends. This is a lot of still very
3793 and matplotlib with all backends. This is a lot of still very
3790 experimental code, and threads are tricky. So it may still have a
3794 experimental code, and threads are tricky. So it may still have a
3791 few rough edges... This code owes a lot to
3795 few rough edges... This code owes a lot to
3792 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3796 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3793 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3797 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3794 to John Hunter for all the matplotlib work.
3798 to John Hunter for all the matplotlib work.
3795
3799
3796 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3800 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3797 options for gtk thread and matplotlib support.
3801 options for gtk thread and matplotlib support.
3798
3802
3799 2004-08-16 Fernando Perez <fperez@colorado.edu>
3803 2004-08-16 Fernando Perez <fperez@colorado.edu>
3800
3804
3801 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3805 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3802 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3806 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3803 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3807 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3804
3808
3805 2004-08-11 Fernando Perez <fperez@colorado.edu>
3809 2004-08-11 Fernando Perez <fperez@colorado.edu>
3806
3810
3807 * setup.py (isfile): Fix build so documentation gets updated for
3811 * setup.py (isfile): Fix build so documentation gets updated for
3808 rpms (it was only done for .tgz builds).
3812 rpms (it was only done for .tgz builds).
3809
3813
3810 2004-08-10 Fernando Perez <fperez@colorado.edu>
3814 2004-08-10 Fernando Perez <fperez@colorado.edu>
3811
3815
3812 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3816 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3813
3817
3814 * iplib.py : Silence syntax error exceptions in tab-completion.
3818 * iplib.py : Silence syntax error exceptions in tab-completion.
3815
3819
3816 2004-08-05 Fernando Perez <fperez@colorado.edu>
3820 2004-08-05 Fernando Perez <fperez@colorado.edu>
3817
3821
3818 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3822 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3819 'color off' mark for continuation prompts. This was causing long
3823 'color off' mark for continuation prompts. This was causing long
3820 continuation lines to mis-wrap.
3824 continuation lines to mis-wrap.
3821
3825
3822 2004-08-01 Fernando Perez <fperez@colorado.edu>
3826 2004-08-01 Fernando Perez <fperez@colorado.edu>
3823
3827
3824 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3828 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3825 for building ipython to be a parameter. All this is necessary
3829 for building ipython to be a parameter. All this is necessary
3826 right now to have a multithreaded version, but this insane
3830 right now to have a multithreaded version, but this insane
3827 non-design will be cleaned up soon. For now, it's a hack that
3831 non-design will be cleaned up soon. For now, it's a hack that
3828 works.
3832 works.
3829
3833
3830 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3834 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3831 args in various places. No bugs so far, but it's a dangerous
3835 args in various places. No bugs so far, but it's a dangerous
3832 practice.
3836 practice.
3833
3837
3834 2004-07-31 Fernando Perez <fperez@colorado.edu>
3838 2004-07-31 Fernando Perez <fperez@colorado.edu>
3835
3839
3836 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3840 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3837 fix completion of files with dots in their names under most
3841 fix completion of files with dots in their names under most
3838 profiles (pysh was OK because the completion order is different).
3842 profiles (pysh was OK because the completion order is different).
3839
3843
3840 2004-07-27 Fernando Perez <fperez@colorado.edu>
3844 2004-07-27 Fernando Perez <fperez@colorado.edu>
3841
3845
3842 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3846 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3843 keywords manually, b/c the one in keyword.py was removed in python
3847 keywords manually, b/c the one in keyword.py was removed in python
3844 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3848 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3845 This is NOT a bug under python 2.3 and earlier.
3849 This is NOT a bug under python 2.3 and earlier.
3846
3850
3847 2004-07-26 Fernando Perez <fperez@colorado.edu>
3851 2004-07-26 Fernando Perez <fperez@colorado.edu>
3848
3852
3849 * IPython/ultraTB.py (VerboseTB.text): Add another
3853 * IPython/ultraTB.py (VerboseTB.text): Add another
3850 linecache.checkcache() call to try to prevent inspect.py from
3854 linecache.checkcache() call to try to prevent inspect.py from
3851 crashing under python 2.3. I think this fixes
3855 crashing under python 2.3. I think this fixes
3852 http://www.scipy.net/roundup/ipython/issue17.
3856 http://www.scipy.net/roundup/ipython/issue17.
3853
3857
3854 2004-07-26 *** Released version 0.6.2
3858 2004-07-26 *** Released version 0.6.2
3855
3859
3856 2004-07-26 Fernando Perez <fperez@colorado.edu>
3860 2004-07-26 Fernando Perez <fperez@colorado.edu>
3857
3861
3858 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3862 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3859 fail for any number.
3863 fail for any number.
3860 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3864 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3861 empty bookmarks.
3865 empty bookmarks.
3862
3866
3863 2004-07-26 *** Released version 0.6.1
3867 2004-07-26 *** Released version 0.6.1
3864
3868
3865 2004-07-26 Fernando Perez <fperez@colorado.edu>
3869 2004-07-26 Fernando Perez <fperez@colorado.edu>
3866
3870
3867 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3871 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3868
3872
3869 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3873 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3870 escaping '()[]{}' in filenames.
3874 escaping '()[]{}' in filenames.
3871
3875
3872 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3876 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3873 Python 2.2 users who lack a proper shlex.split.
3877 Python 2.2 users who lack a proper shlex.split.
3874
3878
3875 2004-07-19 Fernando Perez <fperez@colorado.edu>
3879 2004-07-19 Fernando Perez <fperez@colorado.edu>
3876
3880
3877 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3881 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3878 for reading readline's init file. I follow the normal chain:
3882 for reading readline's init file. I follow the normal chain:
3879 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3883 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3880 report by Mike Heeter. This closes
3884 report by Mike Heeter. This closes
3881 http://www.scipy.net/roundup/ipython/issue16.
3885 http://www.scipy.net/roundup/ipython/issue16.
3882
3886
3883 2004-07-18 Fernando Perez <fperez@colorado.edu>
3887 2004-07-18 Fernando Perez <fperez@colorado.edu>
3884
3888
3885 * IPython/iplib.py (__init__): Add better handling of '\' under
3889 * IPython/iplib.py (__init__): Add better handling of '\' under
3886 Win32 for filenames. After a patch by Ville.
3890 Win32 for filenames. After a patch by Ville.
3887
3891
3888 2004-07-17 Fernando Perez <fperez@colorado.edu>
3892 2004-07-17 Fernando Perez <fperez@colorado.edu>
3889
3893
3890 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3894 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3891 autocalling would be triggered for 'foo is bar' if foo is
3895 autocalling would be triggered for 'foo is bar' if foo is
3892 callable. I also cleaned up the autocall detection code to use a
3896 callable. I also cleaned up the autocall detection code to use a
3893 regexp, which is faster. Bug reported by Alexander Schmolck.
3897 regexp, which is faster. Bug reported by Alexander Schmolck.
3894
3898
3895 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3899 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3896 '?' in them would confuse the help system. Reported by Alex
3900 '?' in them would confuse the help system. Reported by Alex
3897 Schmolck.
3901 Schmolck.
3898
3902
3899 2004-07-16 Fernando Perez <fperez@colorado.edu>
3903 2004-07-16 Fernando Perez <fperez@colorado.edu>
3900
3904
3901 * IPython/GnuplotInteractive.py (__all__): added plot2.
3905 * IPython/GnuplotInteractive.py (__all__): added plot2.
3902
3906
3903 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3907 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3904 plotting dictionaries, lists or tuples of 1d arrays.
3908 plotting dictionaries, lists or tuples of 1d arrays.
3905
3909
3906 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3910 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3907 optimizations.
3911 optimizations.
3908
3912
3909 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3913 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3910 the information which was there from Janko's original IPP code:
3914 the information which was there from Janko's original IPP code:
3911
3915
3912 03.05.99 20:53 porto.ifm.uni-kiel.de
3916 03.05.99 20:53 porto.ifm.uni-kiel.de
3913 --Started changelog.
3917 --Started changelog.
3914 --make clear do what it say it does
3918 --make clear do what it say it does
3915 --added pretty output of lines from inputcache
3919 --added pretty output of lines from inputcache
3916 --Made Logger a mixin class, simplifies handling of switches
3920 --Made Logger a mixin class, simplifies handling of switches
3917 --Added own completer class. .string<TAB> expands to last history
3921 --Added own completer class. .string<TAB> expands to last history
3918 line which starts with string. The new expansion is also present
3922 line which starts with string. The new expansion is also present
3919 with Ctrl-r from the readline library. But this shows, who this
3923 with Ctrl-r from the readline library. But this shows, who this
3920 can be done for other cases.
3924 can be done for other cases.
3921 --Added convention that all shell functions should accept a
3925 --Added convention that all shell functions should accept a
3922 parameter_string This opens the door for different behaviour for
3926 parameter_string This opens the door for different behaviour for
3923 each function. @cd is a good example of this.
3927 each function. @cd is a good example of this.
3924
3928
3925 04.05.99 12:12 porto.ifm.uni-kiel.de
3929 04.05.99 12:12 porto.ifm.uni-kiel.de
3926 --added logfile rotation
3930 --added logfile rotation
3927 --added new mainloop method which freezes first the namespace
3931 --added new mainloop method which freezes first the namespace
3928
3932
3929 07.05.99 21:24 porto.ifm.uni-kiel.de
3933 07.05.99 21:24 porto.ifm.uni-kiel.de
3930 --added the docreader classes. Now there is a help system.
3934 --added the docreader classes. Now there is a help system.
3931 -This is only a first try. Currently it's not easy to put new
3935 -This is only a first try. Currently it's not easy to put new
3932 stuff in the indices. But this is the way to go. Info would be
3936 stuff in the indices. But this is the way to go. Info would be
3933 better, but HTML is every where and not everybody has an info
3937 better, but HTML is every where and not everybody has an info
3934 system installed and it's not so easy to change html-docs to info.
3938 system installed and it's not so easy to change html-docs to info.
3935 --added global logfile option
3939 --added global logfile option
3936 --there is now a hook for object inspection method pinfo needs to
3940 --there is now a hook for object inspection method pinfo needs to
3937 be provided for this. Can be reached by two '??'.
3941 be provided for this. Can be reached by two '??'.
3938
3942
3939 08.05.99 20:51 porto.ifm.uni-kiel.de
3943 08.05.99 20:51 porto.ifm.uni-kiel.de
3940 --added a README
3944 --added a README
3941 --bug in rc file. Something has changed so functions in the rc
3945 --bug in rc file. Something has changed so functions in the rc
3942 file need to reference the shell and not self. Not clear if it's a
3946 file need to reference the shell and not self. Not clear if it's a
3943 bug or feature.
3947 bug or feature.
3944 --changed rc file for new behavior
3948 --changed rc file for new behavior
3945
3949
3946 2004-07-15 Fernando Perez <fperez@colorado.edu>
3950 2004-07-15 Fernando Perez <fperez@colorado.edu>
3947
3951
3948 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3952 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3949 cache was falling out of sync in bizarre manners when multi-line
3953 cache was falling out of sync in bizarre manners when multi-line
3950 input was present. Minor optimizations and cleanup.
3954 input was present. Minor optimizations and cleanup.
3951
3955
3952 (Logger): Remove old Changelog info for cleanup. This is the
3956 (Logger): Remove old Changelog info for cleanup. This is the
3953 information which was there from Janko's original code:
3957 information which was there from Janko's original code:
3954
3958
3955 Changes to Logger: - made the default log filename a parameter
3959 Changes to Logger: - made the default log filename a parameter
3956
3960
3957 - put a check for lines beginning with !@? in log(). Needed
3961 - put a check for lines beginning with !@? in log(). Needed
3958 (even if the handlers properly log their lines) for mid-session
3962 (even if the handlers properly log their lines) for mid-session
3959 logging activation to work properly. Without this, lines logged
3963 logging activation to work properly. Without this, lines logged
3960 in mid session, which get read from the cache, would end up
3964 in mid session, which get read from the cache, would end up
3961 'bare' (with !@? in the open) in the log. Now they are caught
3965 'bare' (with !@? in the open) in the log. Now they are caught
3962 and prepended with a #.
3966 and prepended with a #.
3963
3967
3964 * IPython/iplib.py (InteractiveShell.init_readline): added check
3968 * IPython/iplib.py (InteractiveShell.init_readline): added check
3965 in case MagicCompleter fails to be defined, so we don't crash.
3969 in case MagicCompleter fails to be defined, so we don't crash.
3966
3970
3967 2004-07-13 Fernando Perez <fperez@colorado.edu>
3971 2004-07-13 Fernando Perez <fperez@colorado.edu>
3968
3972
3969 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3973 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3970 of EPS if the requested filename ends in '.eps'.
3974 of EPS if the requested filename ends in '.eps'.
3971
3975
3972 2004-07-04 Fernando Perez <fperez@colorado.edu>
3976 2004-07-04 Fernando Perez <fperez@colorado.edu>
3973
3977
3974 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3978 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3975 escaping of quotes when calling the shell.
3979 escaping of quotes when calling the shell.
3976
3980
3977 2004-07-02 Fernando Perez <fperez@colorado.edu>
3981 2004-07-02 Fernando Perez <fperez@colorado.edu>
3978
3982
3979 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3983 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3980 gettext not working because we were clobbering '_'. Fixes
3984 gettext not working because we were clobbering '_'. Fixes
3981 http://www.scipy.net/roundup/ipython/issue6.
3985 http://www.scipy.net/roundup/ipython/issue6.
3982
3986
3983 2004-07-01 Fernando Perez <fperez@colorado.edu>
3987 2004-07-01 Fernando Perez <fperez@colorado.edu>
3984
3988
3985 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3989 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3986 into @cd. Patch by Ville.
3990 into @cd. Patch by Ville.
3987
3991
3988 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3992 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3989 new function to store things after ipmaker runs. Patch by Ville.
3993 new function to store things after ipmaker runs. Patch by Ville.
3990 Eventually this will go away once ipmaker is removed and the class
3994 Eventually this will go away once ipmaker is removed and the class
3991 gets cleaned up, but for now it's ok. Key functionality here is
3995 gets cleaned up, but for now it's ok. Key functionality here is
3992 the addition of the persistent storage mechanism, a dict for
3996 the addition of the persistent storage mechanism, a dict for
3993 keeping data across sessions (for now just bookmarks, but more can
3997 keeping data across sessions (for now just bookmarks, but more can
3994 be implemented later).
3998 be implemented later).
3995
3999
3996 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4000 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3997 persistent across sections. Patch by Ville, I modified it
4001 persistent across sections. Patch by Ville, I modified it
3998 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4002 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3999 added a '-l' option to list all bookmarks.
4003 added a '-l' option to list all bookmarks.
4000
4004
4001 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4005 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4002 center for cleanup. Registered with atexit.register(). I moved
4006 center for cleanup. Registered with atexit.register(). I moved
4003 here the old exit_cleanup(). After a patch by Ville.
4007 here the old exit_cleanup(). After a patch by Ville.
4004
4008
4005 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4009 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4006 characters in the hacked shlex_split for python 2.2.
4010 characters in the hacked shlex_split for python 2.2.
4007
4011
4008 * IPython/iplib.py (file_matches): more fixes to filenames with
4012 * IPython/iplib.py (file_matches): more fixes to filenames with
4009 whitespace in them. It's not perfect, but limitations in python's
4013 whitespace in them. It's not perfect, but limitations in python's
4010 readline make it impossible to go further.
4014 readline make it impossible to go further.
4011
4015
4012 2004-06-29 Fernando Perez <fperez@colorado.edu>
4016 2004-06-29 Fernando Perez <fperez@colorado.edu>
4013
4017
4014 * IPython/iplib.py (file_matches): escape whitespace correctly in
4018 * IPython/iplib.py (file_matches): escape whitespace correctly in
4015 filename completions. Bug reported by Ville.
4019 filename completions. Bug reported by Ville.
4016
4020
4017 2004-06-28 Fernando Perez <fperez@colorado.edu>
4021 2004-06-28 Fernando Perez <fperez@colorado.edu>
4018
4022
4019 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4023 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4020 the history file will be called 'history-PROFNAME' (or just
4024 the history file will be called 'history-PROFNAME' (or just
4021 'history' if no profile is loaded). I was getting annoyed at
4025 'history' if no profile is loaded). I was getting annoyed at
4022 getting my Numerical work history clobbered by pysh sessions.
4026 getting my Numerical work history clobbered by pysh sessions.
4023
4027
4024 * IPython/iplib.py (InteractiveShell.__init__): Internal
4028 * IPython/iplib.py (InteractiveShell.__init__): Internal
4025 getoutputerror() function so that we can honor the system_verbose
4029 getoutputerror() function so that we can honor the system_verbose
4026 flag for _all_ system calls. I also added escaping of #
4030 flag for _all_ system calls. I also added escaping of #
4027 characters here to avoid confusing Itpl.
4031 characters here to avoid confusing Itpl.
4028
4032
4029 * IPython/Magic.py (shlex_split): removed call to shell in
4033 * IPython/Magic.py (shlex_split): removed call to shell in
4030 parse_options and replaced it with shlex.split(). The annoying
4034 parse_options and replaced it with shlex.split(). The annoying
4031 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4035 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4032 to backport it from 2.3, with several frail hacks (the shlex
4036 to backport it from 2.3, with several frail hacks (the shlex
4033 module is rather limited in 2.2). Thanks to a suggestion by Ville
4037 module is rather limited in 2.2). Thanks to a suggestion by Ville
4034 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4038 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4035 problem.
4039 problem.
4036
4040
4037 (Magic.magic_system_verbose): new toggle to print the actual
4041 (Magic.magic_system_verbose): new toggle to print the actual
4038 system calls made by ipython. Mainly for debugging purposes.
4042 system calls made by ipython. Mainly for debugging purposes.
4039
4043
4040 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4044 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4041 doesn't support persistence. Reported (and fix suggested) by
4045 doesn't support persistence. Reported (and fix suggested) by
4042 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4046 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4043
4047
4044 2004-06-26 Fernando Perez <fperez@colorado.edu>
4048 2004-06-26 Fernando Perez <fperez@colorado.edu>
4045
4049
4046 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4050 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4047 continue prompts.
4051 continue prompts.
4048
4052
4049 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4053 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4050 function (basically a big docstring) and a few more things here to
4054 function (basically a big docstring) and a few more things here to
4051 speedup startup. pysh.py is now very lightweight. We want because
4055 speedup startup. pysh.py is now very lightweight. We want because
4052 it gets execfile'd, while InterpreterExec gets imported, so
4056 it gets execfile'd, while InterpreterExec gets imported, so
4053 byte-compilation saves time.
4057 byte-compilation saves time.
4054
4058
4055 2004-06-25 Fernando Perez <fperez@colorado.edu>
4059 2004-06-25 Fernando Perez <fperez@colorado.edu>
4056
4060
4057 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4061 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4058 -NUM', which was recently broken.
4062 -NUM', which was recently broken.
4059
4063
4060 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4064 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4061 in multi-line input (but not !!, which doesn't make sense there).
4065 in multi-line input (but not !!, which doesn't make sense there).
4062
4066
4063 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4067 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4064 It's just too useful, and people can turn it off in the less
4068 It's just too useful, and people can turn it off in the less
4065 common cases where it's a problem.
4069 common cases where it's a problem.
4066
4070
4067 2004-06-24 Fernando Perez <fperez@colorado.edu>
4071 2004-06-24 Fernando Perez <fperez@colorado.edu>
4068
4072
4069 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4073 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4070 special syntaxes (like alias calling) is now allied in multi-line
4074 special syntaxes (like alias calling) is now allied in multi-line
4071 input. This is still _very_ experimental, but it's necessary for
4075 input. This is still _very_ experimental, but it's necessary for
4072 efficient shell usage combining python looping syntax with system
4076 efficient shell usage combining python looping syntax with system
4073 calls. For now it's restricted to aliases, I don't think it
4077 calls. For now it's restricted to aliases, I don't think it
4074 really even makes sense to have this for magics.
4078 really even makes sense to have this for magics.
4075
4079
4076 2004-06-23 Fernando Perez <fperez@colorado.edu>
4080 2004-06-23 Fernando Perez <fperez@colorado.edu>
4077
4081
4078 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4082 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4079 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4083 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4080
4084
4081 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4085 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4082 extensions under Windows (after code sent by Gary Bishop). The
4086 extensions under Windows (after code sent by Gary Bishop). The
4083 extensions considered 'executable' are stored in IPython's rc
4087 extensions considered 'executable' are stored in IPython's rc
4084 structure as win_exec_ext.
4088 structure as win_exec_ext.
4085
4089
4086 * IPython/genutils.py (shell): new function, like system() but
4090 * IPython/genutils.py (shell): new function, like system() but
4087 without return value. Very useful for interactive shell work.
4091 without return value. Very useful for interactive shell work.
4088
4092
4089 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4093 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4090 delete aliases.
4094 delete aliases.
4091
4095
4092 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4096 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4093 sure that the alias table doesn't contain python keywords.
4097 sure that the alias table doesn't contain python keywords.
4094
4098
4095 2004-06-21 Fernando Perez <fperez@colorado.edu>
4099 2004-06-21 Fernando Perez <fperez@colorado.edu>
4096
4100
4097 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4101 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4098 non-existent items are found in $PATH. Reported by Thorsten.
4102 non-existent items are found in $PATH. Reported by Thorsten.
4099
4103
4100 2004-06-20 Fernando Perez <fperez@colorado.edu>
4104 2004-06-20 Fernando Perez <fperez@colorado.edu>
4101
4105
4102 * IPython/iplib.py (complete): modified the completer so that the
4106 * IPython/iplib.py (complete): modified the completer so that the
4103 order of priorities can be easily changed at runtime.
4107 order of priorities can be easily changed at runtime.
4104
4108
4105 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4109 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4106 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4110 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4107
4111
4108 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4112 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4109 expand Python variables prepended with $ in all system calls. The
4113 expand Python variables prepended with $ in all system calls. The
4110 same was done to InteractiveShell.handle_shell_escape. Now all
4114 same was done to InteractiveShell.handle_shell_escape. Now all
4111 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4115 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4112 expansion of python variables and expressions according to the
4116 expansion of python variables and expressions according to the
4113 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4117 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4114
4118
4115 Though PEP-215 has been rejected, a similar (but simpler) one
4119 Though PEP-215 has been rejected, a similar (but simpler) one
4116 seems like it will go into Python 2.4, PEP-292 -
4120 seems like it will go into Python 2.4, PEP-292 -
4117 http://www.python.org/peps/pep-0292.html.
4121 http://www.python.org/peps/pep-0292.html.
4118
4122
4119 I'll keep the full syntax of PEP-215, since IPython has since the
4123 I'll keep the full syntax of PEP-215, since IPython has since the
4120 start used Ka-Ping Yee's reference implementation discussed there
4124 start used Ka-Ping Yee's reference implementation discussed there
4121 (Itpl), and I actually like the powerful semantics it offers.
4125 (Itpl), and I actually like the powerful semantics it offers.
4122
4126
4123 In order to access normal shell variables, the $ has to be escaped
4127 In order to access normal shell variables, the $ has to be escaped
4124 via an extra $. For example:
4128 via an extra $. For example:
4125
4129
4126 In [7]: PATH='a python variable'
4130 In [7]: PATH='a python variable'
4127
4131
4128 In [8]: !echo $PATH
4132 In [8]: !echo $PATH
4129 a python variable
4133 a python variable
4130
4134
4131 In [9]: !echo $$PATH
4135 In [9]: !echo $$PATH
4132 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4136 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4133
4137
4134 (Magic.parse_options): escape $ so the shell doesn't evaluate
4138 (Magic.parse_options): escape $ so the shell doesn't evaluate
4135 things prematurely.
4139 things prematurely.
4136
4140
4137 * IPython/iplib.py (InteractiveShell.call_alias): added the
4141 * IPython/iplib.py (InteractiveShell.call_alias): added the
4138 ability for aliases to expand python variables via $.
4142 ability for aliases to expand python variables via $.
4139
4143
4140 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4144 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4141 system, now there's a @rehash/@rehashx pair of magics. These work
4145 system, now there's a @rehash/@rehashx pair of magics. These work
4142 like the csh rehash command, and can be invoked at any time. They
4146 like the csh rehash command, and can be invoked at any time. They
4143 build a table of aliases to everything in the user's $PATH
4147 build a table of aliases to everything in the user's $PATH
4144 (@rehash uses everything, @rehashx is slower but only adds
4148 (@rehash uses everything, @rehashx is slower but only adds
4145 executable files). With this, the pysh.py-based shell profile can
4149 executable files). With this, the pysh.py-based shell profile can
4146 now simply call rehash upon startup, and full access to all
4150 now simply call rehash upon startup, and full access to all
4147 programs in the user's path is obtained.
4151 programs in the user's path is obtained.
4148
4152
4149 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4153 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4150 functionality is now fully in place. I removed the old dynamic
4154 functionality is now fully in place. I removed the old dynamic
4151 code generation based approach, in favor of a much lighter one
4155 code generation based approach, in favor of a much lighter one
4152 based on a simple dict. The advantage is that this allows me to
4156 based on a simple dict. The advantage is that this allows me to
4153 now have thousands of aliases with negligible cost (unthinkable
4157 now have thousands of aliases with negligible cost (unthinkable
4154 with the old system).
4158 with the old system).
4155
4159
4156 2004-06-19 Fernando Perez <fperez@colorado.edu>
4160 2004-06-19 Fernando Perez <fperez@colorado.edu>
4157
4161
4158 * IPython/iplib.py (__init__): extended MagicCompleter class to
4162 * IPython/iplib.py (__init__): extended MagicCompleter class to
4159 also complete (last in priority) on user aliases.
4163 also complete (last in priority) on user aliases.
4160
4164
4161 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4165 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4162 call to eval.
4166 call to eval.
4163 (ItplNS.__init__): Added a new class which functions like Itpl,
4167 (ItplNS.__init__): Added a new class which functions like Itpl,
4164 but allows configuring the namespace for the evaluation to occur
4168 but allows configuring the namespace for the evaluation to occur
4165 in.
4169 in.
4166
4170
4167 2004-06-18 Fernando Perez <fperez@colorado.edu>
4171 2004-06-18 Fernando Perez <fperez@colorado.edu>
4168
4172
4169 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4173 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4170 better message when 'exit' or 'quit' are typed (a common newbie
4174 better message when 'exit' or 'quit' are typed (a common newbie
4171 confusion).
4175 confusion).
4172
4176
4173 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4177 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4174 check for Windows users.
4178 check for Windows users.
4175
4179
4176 * IPython/iplib.py (InteractiveShell.user_setup): removed
4180 * IPython/iplib.py (InteractiveShell.user_setup): removed
4177 disabling of colors for Windows. I'll test at runtime and issue a
4181 disabling of colors for Windows. I'll test at runtime and issue a
4178 warning if Gary's readline isn't found, as to nudge users to
4182 warning if Gary's readline isn't found, as to nudge users to
4179 download it.
4183 download it.
4180
4184
4181 2004-06-16 Fernando Perez <fperez@colorado.edu>
4185 2004-06-16 Fernando Perez <fperez@colorado.edu>
4182
4186
4183 * IPython/genutils.py (Stream.__init__): changed to print errors
4187 * IPython/genutils.py (Stream.__init__): changed to print errors
4184 to sys.stderr. I had a circular dependency here. Now it's
4188 to sys.stderr. I had a circular dependency here. Now it's
4185 possible to run ipython as IDLE's shell (consider this pre-alpha,
4189 possible to run ipython as IDLE's shell (consider this pre-alpha,
4186 since true stdout things end up in the starting terminal instead
4190 since true stdout things end up in the starting terminal instead
4187 of IDLE's out).
4191 of IDLE's out).
4188
4192
4189 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4193 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4190 users who haven't # updated their prompt_in2 definitions. Remove
4194 users who haven't # updated their prompt_in2 definitions. Remove
4191 eventually.
4195 eventually.
4192 (multiple_replace): added credit to original ASPN recipe.
4196 (multiple_replace): added credit to original ASPN recipe.
4193
4197
4194 2004-06-15 Fernando Perez <fperez@colorado.edu>
4198 2004-06-15 Fernando Perez <fperez@colorado.edu>
4195
4199
4196 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4200 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4197 list of auto-defined aliases.
4201 list of auto-defined aliases.
4198
4202
4199 2004-06-13 Fernando Perez <fperez@colorado.edu>
4203 2004-06-13 Fernando Perez <fperez@colorado.edu>
4200
4204
4201 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4205 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4202 install was really requested (so setup.py can be used for other
4206 install was really requested (so setup.py can be used for other
4203 things under Windows).
4207 things under Windows).
4204
4208
4205 2004-06-10 Fernando Perez <fperez@colorado.edu>
4209 2004-06-10 Fernando Perez <fperez@colorado.edu>
4206
4210
4207 * IPython/Logger.py (Logger.create_log): Manually remove any old
4211 * IPython/Logger.py (Logger.create_log): Manually remove any old
4208 backup, since os.remove may fail under Windows. Fixes bug
4212 backup, since os.remove may fail under Windows. Fixes bug
4209 reported by Thorsten.
4213 reported by Thorsten.
4210
4214
4211 2004-06-09 Fernando Perez <fperez@colorado.edu>
4215 2004-06-09 Fernando Perez <fperez@colorado.edu>
4212
4216
4213 * examples/example-embed.py: fixed all references to %n (replaced
4217 * examples/example-embed.py: fixed all references to %n (replaced
4214 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4218 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4215 for all examples and the manual as well.
4219 for all examples and the manual as well.
4216
4220
4217 2004-06-08 Fernando Perez <fperez@colorado.edu>
4221 2004-06-08 Fernando Perez <fperez@colorado.edu>
4218
4222
4219 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4223 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4220 alignment and color management. All 3 prompt subsystems now
4224 alignment and color management. All 3 prompt subsystems now
4221 inherit from BasePrompt.
4225 inherit from BasePrompt.
4222
4226
4223 * tools/release: updates for windows installer build and tag rpms
4227 * tools/release: updates for windows installer build and tag rpms
4224 with python version (since paths are fixed).
4228 with python version (since paths are fixed).
4225
4229
4226 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4230 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4227 which will become eventually obsolete. Also fixed the default
4231 which will become eventually obsolete. Also fixed the default
4228 prompt_in2 to use \D, so at least new users start with the correct
4232 prompt_in2 to use \D, so at least new users start with the correct
4229 defaults.
4233 defaults.
4230 WARNING: Users with existing ipythonrc files will need to apply
4234 WARNING: Users with existing ipythonrc files will need to apply
4231 this fix manually!
4235 this fix manually!
4232
4236
4233 * setup.py: make windows installer (.exe). This is finally the
4237 * setup.py: make windows installer (.exe). This is finally the
4234 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4238 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4235 which I hadn't included because it required Python 2.3 (or recent
4239 which I hadn't included because it required Python 2.3 (or recent
4236 distutils).
4240 distutils).
4237
4241
4238 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4242 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4239 usage of new '\D' escape.
4243 usage of new '\D' escape.
4240
4244
4241 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4245 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4242 lacks os.getuid())
4246 lacks os.getuid())
4243 (CachedOutput.set_colors): Added the ability to turn coloring
4247 (CachedOutput.set_colors): Added the ability to turn coloring
4244 on/off with @colors even for manually defined prompt colors. It
4248 on/off with @colors even for manually defined prompt colors. It
4245 uses a nasty global, but it works safely and via the generic color
4249 uses a nasty global, but it works safely and via the generic color
4246 handling mechanism.
4250 handling mechanism.
4247 (Prompt2.__init__): Introduced new escape '\D' for continuation
4251 (Prompt2.__init__): Introduced new escape '\D' for continuation
4248 prompts. It represents the counter ('\#') as dots.
4252 prompts. It represents the counter ('\#') as dots.
4249 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4253 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4250 need to update their ipythonrc files and replace '%n' with '\D' in
4254 need to update their ipythonrc files and replace '%n' with '\D' in
4251 their prompt_in2 settings everywhere. Sorry, but there's
4255 their prompt_in2 settings everywhere. Sorry, but there's
4252 otherwise no clean way to get all prompts to properly align. The
4256 otherwise no clean way to get all prompts to properly align. The
4253 ipythonrc shipped with IPython has been updated.
4257 ipythonrc shipped with IPython has been updated.
4254
4258
4255 2004-06-07 Fernando Perez <fperez@colorado.edu>
4259 2004-06-07 Fernando Perez <fperez@colorado.edu>
4256
4260
4257 * setup.py (isfile): Pass local_icons option to latex2html, so the
4261 * setup.py (isfile): Pass local_icons option to latex2html, so the
4258 resulting HTML file is self-contained. Thanks to
4262 resulting HTML file is self-contained. Thanks to
4259 dryice-AT-liu.com.cn for the tip.
4263 dryice-AT-liu.com.cn for the tip.
4260
4264
4261 * pysh.py: I created a new profile 'shell', which implements a
4265 * pysh.py: I created a new profile 'shell', which implements a
4262 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4266 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4263 system shell, nor will it become one anytime soon. It's mainly
4267 system shell, nor will it become one anytime soon. It's mainly
4264 meant to illustrate the use of the new flexible bash-like prompts.
4268 meant to illustrate the use of the new flexible bash-like prompts.
4265 I guess it could be used by hardy souls for true shell management,
4269 I guess it could be used by hardy souls for true shell management,
4266 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4270 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4267 profile. This uses the InterpreterExec extension provided by
4271 profile. This uses the InterpreterExec extension provided by
4268 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4272 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4269
4273
4270 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4274 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4271 auto-align itself with the length of the previous input prompt
4275 auto-align itself with the length of the previous input prompt
4272 (taking into account the invisible color escapes).
4276 (taking into account the invisible color escapes).
4273 (CachedOutput.__init__): Large restructuring of this class. Now
4277 (CachedOutput.__init__): Large restructuring of this class. Now
4274 all three prompts (primary1, primary2, output) are proper objects,
4278 all three prompts (primary1, primary2, output) are proper objects,
4275 managed by the 'parent' CachedOutput class. The code is still a
4279 managed by the 'parent' CachedOutput class. The code is still a
4276 bit hackish (all prompts share state via a pointer to the cache),
4280 bit hackish (all prompts share state via a pointer to the cache),
4277 but it's overall far cleaner than before.
4281 but it's overall far cleaner than before.
4278
4282
4279 * IPython/genutils.py (getoutputerror): modified to add verbose,
4283 * IPython/genutils.py (getoutputerror): modified to add verbose,
4280 debug and header options. This makes the interface of all getout*
4284 debug and header options. This makes the interface of all getout*
4281 functions uniform.
4285 functions uniform.
4282 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4286 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4283
4287
4284 * IPython/Magic.py (Magic.default_option): added a function to
4288 * IPython/Magic.py (Magic.default_option): added a function to
4285 allow registering default options for any magic command. This
4289 allow registering default options for any magic command. This
4286 makes it easy to have profiles which customize the magics globally
4290 makes it easy to have profiles which customize the magics globally
4287 for a certain use. The values set through this function are
4291 for a certain use. The values set through this function are
4288 picked up by the parse_options() method, which all magics should
4292 picked up by the parse_options() method, which all magics should
4289 use to parse their options.
4293 use to parse their options.
4290
4294
4291 * IPython/genutils.py (warn): modified the warnings framework to
4295 * IPython/genutils.py (warn): modified the warnings framework to
4292 use the Term I/O class. I'm trying to slowly unify all of
4296 use the Term I/O class. I'm trying to slowly unify all of
4293 IPython's I/O operations to pass through Term.
4297 IPython's I/O operations to pass through Term.
4294
4298
4295 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4299 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4296 the secondary prompt to correctly match the length of the primary
4300 the secondary prompt to correctly match the length of the primary
4297 one for any prompt. Now multi-line code will properly line up
4301 one for any prompt. Now multi-line code will properly line up
4298 even for path dependent prompts, such as the new ones available
4302 even for path dependent prompts, such as the new ones available
4299 via the prompt_specials.
4303 via the prompt_specials.
4300
4304
4301 2004-06-06 Fernando Perez <fperez@colorado.edu>
4305 2004-06-06 Fernando Perez <fperez@colorado.edu>
4302
4306
4303 * IPython/Prompts.py (prompt_specials): Added the ability to have
4307 * IPython/Prompts.py (prompt_specials): Added the ability to have
4304 bash-like special sequences in the prompts, which get
4308 bash-like special sequences in the prompts, which get
4305 automatically expanded. Things like hostname, current working
4309 automatically expanded. Things like hostname, current working
4306 directory and username are implemented already, but it's easy to
4310 directory and username are implemented already, but it's easy to
4307 add more in the future. Thanks to a patch by W.J. van der Laan
4311 add more in the future. Thanks to a patch by W.J. van der Laan
4308 <gnufnork-AT-hetdigitalegat.nl>
4312 <gnufnork-AT-hetdigitalegat.nl>
4309 (prompt_specials): Added color support for prompt strings, so
4313 (prompt_specials): Added color support for prompt strings, so
4310 users can define arbitrary color setups for their prompts.
4314 users can define arbitrary color setups for their prompts.
4311
4315
4312 2004-06-05 Fernando Perez <fperez@colorado.edu>
4316 2004-06-05 Fernando Perez <fperez@colorado.edu>
4313
4317
4314 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4318 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4315 code to load Gary Bishop's readline and configure it
4319 code to load Gary Bishop's readline and configure it
4316 automatically. Thanks to Gary for help on this.
4320 automatically. Thanks to Gary for help on this.
4317
4321
4318 2004-06-01 Fernando Perez <fperez@colorado.edu>
4322 2004-06-01 Fernando Perez <fperez@colorado.edu>
4319
4323
4320 * IPython/Logger.py (Logger.create_log): fix bug for logging
4324 * IPython/Logger.py (Logger.create_log): fix bug for logging
4321 with no filename (previous fix was incomplete).
4325 with no filename (previous fix was incomplete).
4322
4326
4323 2004-05-25 Fernando Perez <fperez@colorado.edu>
4327 2004-05-25 Fernando Perez <fperez@colorado.edu>
4324
4328
4325 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4329 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4326 parens would get passed to the shell.
4330 parens would get passed to the shell.
4327
4331
4328 2004-05-20 Fernando Perez <fperez@colorado.edu>
4332 2004-05-20 Fernando Perez <fperez@colorado.edu>
4329
4333
4330 * IPython/Magic.py (Magic.magic_prun): changed default profile
4334 * IPython/Magic.py (Magic.magic_prun): changed default profile
4331 sort order to 'time' (the more common profiling need).
4335 sort order to 'time' (the more common profiling need).
4332
4336
4333 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4337 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4334 so that source code shown is guaranteed in sync with the file on
4338 so that source code shown is guaranteed in sync with the file on
4335 disk (also changed in psource). Similar fix to the one for
4339 disk (also changed in psource). Similar fix to the one for
4336 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4340 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4337 <yann.ledu-AT-noos.fr>.
4341 <yann.ledu-AT-noos.fr>.
4338
4342
4339 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4343 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4340 with a single option would not be correctly parsed. Closes
4344 with a single option would not be correctly parsed. Closes
4341 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4345 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4342 introduced in 0.6.0 (on 2004-05-06).
4346 introduced in 0.6.0 (on 2004-05-06).
4343
4347
4344 2004-05-13 *** Released version 0.6.0
4348 2004-05-13 *** Released version 0.6.0
4345
4349
4346 2004-05-13 Fernando Perez <fperez@colorado.edu>
4350 2004-05-13 Fernando Perez <fperez@colorado.edu>
4347
4351
4348 * debian/: Added debian/ directory to CVS, so that debian support
4352 * debian/: Added debian/ directory to CVS, so that debian support
4349 is publicly accessible. The debian package is maintained by Jack
4353 is publicly accessible. The debian package is maintained by Jack
4350 Moffit <jack-AT-xiph.org>.
4354 Moffit <jack-AT-xiph.org>.
4351
4355
4352 * Documentation: included the notes about an ipython-based system
4356 * Documentation: included the notes about an ipython-based system
4353 shell (the hypothetical 'pysh') into the new_design.pdf document,
4357 shell (the hypothetical 'pysh') into the new_design.pdf document,
4354 so that these ideas get distributed to users along with the
4358 so that these ideas get distributed to users along with the
4355 official documentation.
4359 official documentation.
4356
4360
4357 2004-05-10 Fernando Perez <fperez@colorado.edu>
4361 2004-05-10 Fernando Perez <fperez@colorado.edu>
4358
4362
4359 * IPython/Logger.py (Logger.create_log): fix recently introduced
4363 * IPython/Logger.py (Logger.create_log): fix recently introduced
4360 bug (misindented line) where logstart would fail when not given an
4364 bug (misindented line) where logstart would fail when not given an
4361 explicit filename.
4365 explicit filename.
4362
4366
4363 2004-05-09 Fernando Perez <fperez@colorado.edu>
4367 2004-05-09 Fernando Perez <fperez@colorado.edu>
4364
4368
4365 * IPython/Magic.py (Magic.parse_options): skip system call when
4369 * IPython/Magic.py (Magic.parse_options): skip system call when
4366 there are no options to look for. Faster, cleaner for the common
4370 there are no options to look for. Faster, cleaner for the common
4367 case.
4371 case.
4368
4372
4369 * Documentation: many updates to the manual: describing Windows
4373 * Documentation: many updates to the manual: describing Windows
4370 support better, Gnuplot updates, credits, misc small stuff. Also
4374 support better, Gnuplot updates, credits, misc small stuff. Also
4371 updated the new_design doc a bit.
4375 updated the new_design doc a bit.
4372
4376
4373 2004-05-06 *** Released version 0.6.0.rc1
4377 2004-05-06 *** Released version 0.6.0.rc1
4374
4378
4375 2004-05-06 Fernando Perez <fperez@colorado.edu>
4379 2004-05-06 Fernando Perez <fperez@colorado.edu>
4376
4380
4377 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4381 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4378 operations to use the vastly more efficient list/''.join() method.
4382 operations to use the vastly more efficient list/''.join() method.
4379 (FormattedTB.text): Fix
4383 (FormattedTB.text): Fix
4380 http://www.scipy.net/roundup/ipython/issue12 - exception source
4384 http://www.scipy.net/roundup/ipython/issue12 - exception source
4381 extract not updated after reload. Thanks to Mike Salib
4385 extract not updated after reload. Thanks to Mike Salib
4382 <msalib-AT-mit.edu> for pinning the source of the problem.
4386 <msalib-AT-mit.edu> for pinning the source of the problem.
4383 Fortunately, the solution works inside ipython and doesn't require
4387 Fortunately, the solution works inside ipython and doesn't require
4384 any changes to python proper.
4388 any changes to python proper.
4385
4389
4386 * IPython/Magic.py (Magic.parse_options): Improved to process the
4390 * IPython/Magic.py (Magic.parse_options): Improved to process the
4387 argument list as a true shell would (by actually using the
4391 argument list as a true shell would (by actually using the
4388 underlying system shell). This way, all @magics automatically get
4392 underlying system shell). This way, all @magics automatically get
4389 shell expansion for variables. Thanks to a comment by Alex
4393 shell expansion for variables. Thanks to a comment by Alex
4390 Schmolck.
4394 Schmolck.
4391
4395
4392 2004-04-04 Fernando Perez <fperez@colorado.edu>
4396 2004-04-04 Fernando Perez <fperez@colorado.edu>
4393
4397
4394 * IPython/iplib.py (InteractiveShell.interact): Added a special
4398 * IPython/iplib.py (InteractiveShell.interact): Added a special
4395 trap for a debugger quit exception, which is basically impossible
4399 trap for a debugger quit exception, which is basically impossible
4396 to handle by normal mechanisms, given what pdb does to the stack.
4400 to handle by normal mechanisms, given what pdb does to the stack.
4397 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4401 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4398
4402
4399 2004-04-03 Fernando Perez <fperez@colorado.edu>
4403 2004-04-03 Fernando Perez <fperez@colorado.edu>
4400
4404
4401 * IPython/genutils.py (Term): Standardized the names of the Term
4405 * IPython/genutils.py (Term): Standardized the names of the Term
4402 class streams to cin/cout/cerr, following C++ naming conventions
4406 class streams to cin/cout/cerr, following C++ naming conventions
4403 (I can't use in/out/err because 'in' is not a valid attribute
4407 (I can't use in/out/err because 'in' is not a valid attribute
4404 name).
4408 name).
4405
4409
4406 * IPython/iplib.py (InteractiveShell.interact): don't increment
4410 * IPython/iplib.py (InteractiveShell.interact): don't increment
4407 the prompt if there's no user input. By Daniel 'Dang' Griffith
4411 the prompt if there's no user input. By Daniel 'Dang' Griffith
4408 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4412 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4409 Francois Pinard.
4413 Francois Pinard.
4410
4414
4411 2004-04-02 Fernando Perez <fperez@colorado.edu>
4415 2004-04-02 Fernando Perez <fperez@colorado.edu>
4412
4416
4413 * IPython/genutils.py (Stream.__init__): Modified to survive at
4417 * IPython/genutils.py (Stream.__init__): Modified to survive at
4414 least importing in contexts where stdin/out/err aren't true file
4418 least importing in contexts where stdin/out/err aren't true file
4415 objects, such as PyCrust (they lack fileno() and mode). However,
4419 objects, such as PyCrust (they lack fileno() and mode). However,
4416 the recovery facilities which rely on these things existing will
4420 the recovery facilities which rely on these things existing will
4417 not work.
4421 not work.
4418
4422
4419 2004-04-01 Fernando Perez <fperez@colorado.edu>
4423 2004-04-01 Fernando Perez <fperez@colorado.edu>
4420
4424
4421 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4425 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4422 use the new getoutputerror() function, so it properly
4426 use the new getoutputerror() function, so it properly
4423 distinguishes stdout/err.
4427 distinguishes stdout/err.
4424
4428
4425 * IPython/genutils.py (getoutputerror): added a function to
4429 * IPython/genutils.py (getoutputerror): added a function to
4426 capture separately the standard output and error of a command.
4430 capture separately the standard output and error of a command.
4427 After a comment from dang on the mailing lists. This code is
4431 After a comment from dang on the mailing lists. This code is
4428 basically a modified version of commands.getstatusoutput(), from
4432 basically a modified version of commands.getstatusoutput(), from
4429 the standard library.
4433 the standard library.
4430
4434
4431 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4435 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4432 '!!' as a special syntax (shorthand) to access @sx.
4436 '!!' as a special syntax (shorthand) to access @sx.
4433
4437
4434 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4438 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4435 command and return its output as a list split on '\n'.
4439 command and return its output as a list split on '\n'.
4436
4440
4437 2004-03-31 Fernando Perez <fperez@colorado.edu>
4441 2004-03-31 Fernando Perez <fperez@colorado.edu>
4438
4442
4439 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4443 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4440 method to dictionaries used as FakeModule instances if they lack
4444 method to dictionaries used as FakeModule instances if they lack
4441 it. At least pydoc in python2.3 breaks for runtime-defined
4445 it. At least pydoc in python2.3 breaks for runtime-defined
4442 functions without this hack. At some point I need to _really_
4446 functions without this hack. At some point I need to _really_
4443 understand what FakeModule is doing, because it's a gross hack.
4447 understand what FakeModule is doing, because it's a gross hack.
4444 But it solves Arnd's problem for now...
4448 But it solves Arnd's problem for now...
4445
4449
4446 2004-02-27 Fernando Perez <fperez@colorado.edu>
4450 2004-02-27 Fernando Perez <fperez@colorado.edu>
4447
4451
4448 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4452 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4449 mode would behave erratically. Also increased the number of
4453 mode would behave erratically. Also increased the number of
4450 possible logs in rotate mod to 999. Thanks to Rod Holland
4454 possible logs in rotate mod to 999. Thanks to Rod Holland
4451 <rhh@StructureLABS.com> for the report and fixes.
4455 <rhh@StructureLABS.com> for the report and fixes.
4452
4456
4453 2004-02-26 Fernando Perez <fperez@colorado.edu>
4457 2004-02-26 Fernando Perez <fperez@colorado.edu>
4454
4458
4455 * IPython/genutils.py (page): Check that the curses module really
4459 * IPython/genutils.py (page): Check that the curses module really
4456 has the initscr attribute before trying to use it. For some
4460 has the initscr attribute before trying to use it. For some
4457 reason, the Solaris curses module is missing this. I think this
4461 reason, the Solaris curses module is missing this. I think this
4458 should be considered a Solaris python bug, but I'm not sure.
4462 should be considered a Solaris python bug, but I'm not sure.
4459
4463
4460 2004-01-17 Fernando Perez <fperez@colorado.edu>
4464 2004-01-17 Fernando Perez <fperez@colorado.edu>
4461
4465
4462 * IPython/genutils.py (Stream.__init__): Changes to try to make
4466 * IPython/genutils.py (Stream.__init__): Changes to try to make
4463 ipython robust against stdin/out/err being closed by the user.
4467 ipython robust against stdin/out/err being closed by the user.
4464 This is 'user error' (and blocks a normal python session, at least
4468 This is 'user error' (and blocks a normal python session, at least
4465 the stdout case). However, Ipython should be able to survive such
4469 the stdout case). However, Ipython should be able to survive such
4466 instances of abuse as gracefully as possible. To simplify the
4470 instances of abuse as gracefully as possible. To simplify the
4467 coding and maintain compatibility with Gary Bishop's Term
4471 coding and maintain compatibility with Gary Bishop's Term
4468 contributions, I've made use of classmethods for this. I think
4472 contributions, I've made use of classmethods for this. I think
4469 this introduces a dependency on python 2.2.
4473 this introduces a dependency on python 2.2.
4470
4474
4471 2004-01-13 Fernando Perez <fperez@colorado.edu>
4475 2004-01-13 Fernando Perez <fperez@colorado.edu>
4472
4476
4473 * IPython/numutils.py (exp_safe): simplified the code a bit and
4477 * IPython/numutils.py (exp_safe): simplified the code a bit and
4474 removed the need for importing the kinds module altogether.
4478 removed the need for importing the kinds module altogether.
4475
4479
4476 2004-01-06 Fernando Perez <fperez@colorado.edu>
4480 2004-01-06 Fernando Perez <fperez@colorado.edu>
4477
4481
4478 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4482 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4479 a magic function instead, after some community feedback. No
4483 a magic function instead, after some community feedback. No
4480 special syntax will exist for it, but its name is deliberately
4484 special syntax will exist for it, but its name is deliberately
4481 very short.
4485 very short.
4482
4486
4483 2003-12-20 Fernando Perez <fperez@colorado.edu>
4487 2003-12-20 Fernando Perez <fperez@colorado.edu>
4484
4488
4485 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4489 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4486 new functionality, to automagically assign the result of a shell
4490 new functionality, to automagically assign the result of a shell
4487 command to a variable. I'll solicit some community feedback on
4491 command to a variable. I'll solicit some community feedback on
4488 this before making it permanent.
4492 this before making it permanent.
4489
4493
4490 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4494 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4491 requested about callables for which inspect couldn't obtain a
4495 requested about callables for which inspect couldn't obtain a
4492 proper argspec. Thanks to a crash report sent by Etienne
4496 proper argspec. Thanks to a crash report sent by Etienne
4493 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4497 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4494
4498
4495 2003-12-09 Fernando Perez <fperez@colorado.edu>
4499 2003-12-09 Fernando Perez <fperez@colorado.edu>
4496
4500
4497 * IPython/genutils.py (page): patch for the pager to work across
4501 * IPython/genutils.py (page): patch for the pager to work across
4498 various versions of Windows. By Gary Bishop.
4502 various versions of Windows. By Gary Bishop.
4499
4503
4500 2003-12-04 Fernando Perez <fperez@colorado.edu>
4504 2003-12-04 Fernando Perez <fperez@colorado.edu>
4501
4505
4502 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4506 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4503 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4507 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4504 While I tested this and it looks ok, there may still be corner
4508 While I tested this and it looks ok, there may still be corner
4505 cases I've missed.
4509 cases I've missed.
4506
4510
4507 2003-12-01 Fernando Perez <fperez@colorado.edu>
4511 2003-12-01 Fernando Perez <fperez@colorado.edu>
4508
4512
4509 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4513 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4510 where a line like 'p,q=1,2' would fail because the automagic
4514 where a line like 'p,q=1,2' would fail because the automagic
4511 system would be triggered for @p.
4515 system would be triggered for @p.
4512
4516
4513 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4517 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4514 cleanups, code unmodified.
4518 cleanups, code unmodified.
4515
4519
4516 * IPython/genutils.py (Term): added a class for IPython to handle
4520 * IPython/genutils.py (Term): added a class for IPython to handle
4517 output. In most cases it will just be a proxy for stdout/err, but
4521 output. In most cases it will just be a proxy for stdout/err, but
4518 having this allows modifications to be made for some platforms,
4522 having this allows modifications to be made for some platforms,
4519 such as handling color escapes under Windows. All of this code
4523 such as handling color escapes under Windows. All of this code
4520 was contributed by Gary Bishop, with minor modifications by me.
4524 was contributed by Gary Bishop, with minor modifications by me.
4521 The actual changes affect many files.
4525 The actual changes affect many files.
4522
4526
4523 2003-11-30 Fernando Perez <fperez@colorado.edu>
4527 2003-11-30 Fernando Perez <fperez@colorado.edu>
4524
4528
4525 * IPython/iplib.py (file_matches): new completion code, courtesy
4529 * IPython/iplib.py (file_matches): new completion code, courtesy
4526 of Jeff Collins. This enables filename completion again under
4530 of Jeff Collins. This enables filename completion again under
4527 python 2.3, which disabled it at the C level.
4531 python 2.3, which disabled it at the C level.
4528
4532
4529 2003-11-11 Fernando Perez <fperez@colorado.edu>
4533 2003-11-11 Fernando Perez <fperez@colorado.edu>
4530
4534
4531 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4535 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4532 for Numeric.array(map(...)), but often convenient.
4536 for Numeric.array(map(...)), but often convenient.
4533
4537
4534 2003-11-05 Fernando Perez <fperez@colorado.edu>
4538 2003-11-05 Fernando Perez <fperez@colorado.edu>
4535
4539
4536 * IPython/numutils.py (frange): Changed a call from int() to
4540 * IPython/numutils.py (frange): Changed a call from int() to
4537 int(round()) to prevent a problem reported with arange() in the
4541 int(round()) to prevent a problem reported with arange() in the
4538 numpy list.
4542 numpy list.
4539
4543
4540 2003-10-06 Fernando Perez <fperez@colorado.edu>
4544 2003-10-06 Fernando Perez <fperez@colorado.edu>
4541
4545
4542 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4546 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4543 prevent crashes if sys lacks an argv attribute (it happens with
4547 prevent crashes if sys lacks an argv attribute (it happens with
4544 embedded interpreters which build a bare-bones sys module).
4548 embedded interpreters which build a bare-bones sys module).
4545 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4549 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4546
4550
4547 2003-09-24 Fernando Perez <fperez@colorado.edu>
4551 2003-09-24 Fernando Perez <fperez@colorado.edu>
4548
4552
4549 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4553 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4550 to protect against poorly written user objects where __getattr__
4554 to protect against poorly written user objects where __getattr__
4551 raises exceptions other than AttributeError. Thanks to a bug
4555 raises exceptions other than AttributeError. Thanks to a bug
4552 report by Oliver Sander <osander-AT-gmx.de>.
4556 report by Oliver Sander <osander-AT-gmx.de>.
4553
4557
4554 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4558 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4555 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4559 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4556
4560
4557 2003-09-09 Fernando Perez <fperez@colorado.edu>
4561 2003-09-09 Fernando Perez <fperez@colorado.edu>
4558
4562
4559 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4563 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4560 unpacking a list whith a callable as first element would
4564 unpacking a list whith a callable as first element would
4561 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4565 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4562 Collins.
4566 Collins.
4563
4567
4564 2003-08-25 *** Released version 0.5.0
4568 2003-08-25 *** Released version 0.5.0
4565
4569
4566 2003-08-22 Fernando Perez <fperez@colorado.edu>
4570 2003-08-22 Fernando Perez <fperez@colorado.edu>
4567
4571
4568 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4572 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4569 improperly defined user exceptions. Thanks to feedback from Mark
4573 improperly defined user exceptions. Thanks to feedback from Mark
4570 Russell <mrussell-AT-verio.net>.
4574 Russell <mrussell-AT-verio.net>.
4571
4575
4572 2003-08-20 Fernando Perez <fperez@colorado.edu>
4576 2003-08-20 Fernando Perez <fperez@colorado.edu>
4573
4577
4574 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4578 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4575 printing so that it would print multi-line string forms starting
4579 printing so that it would print multi-line string forms starting
4576 with a new line. This way the formatting is better respected for
4580 with a new line. This way the formatting is better respected for
4577 objects which work hard to make nice string forms.
4581 objects which work hard to make nice string forms.
4578
4582
4579 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4583 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4580 autocall would overtake data access for objects with both
4584 autocall would overtake data access for objects with both
4581 __getitem__ and __call__.
4585 __getitem__ and __call__.
4582
4586
4583 2003-08-19 *** Released version 0.5.0-rc1
4587 2003-08-19 *** Released version 0.5.0-rc1
4584
4588
4585 2003-08-19 Fernando Perez <fperez@colorado.edu>
4589 2003-08-19 Fernando Perez <fperez@colorado.edu>
4586
4590
4587 * IPython/deep_reload.py (load_tail): single tiny change here
4591 * IPython/deep_reload.py (load_tail): single tiny change here
4588 seems to fix the long-standing bug of dreload() failing to work
4592 seems to fix the long-standing bug of dreload() failing to work
4589 for dotted names. But this module is pretty tricky, so I may have
4593 for dotted names. But this module is pretty tricky, so I may have
4590 missed some subtlety. Needs more testing!.
4594 missed some subtlety. Needs more testing!.
4591
4595
4592 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4596 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4593 exceptions which have badly implemented __str__ methods.
4597 exceptions which have badly implemented __str__ methods.
4594 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4598 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4595 which I've been getting reports about from Python 2.3 users. I
4599 which I've been getting reports about from Python 2.3 users. I
4596 wish I had a simple test case to reproduce the problem, so I could
4600 wish I had a simple test case to reproduce the problem, so I could
4597 either write a cleaner workaround or file a bug report if
4601 either write a cleaner workaround or file a bug report if
4598 necessary.
4602 necessary.
4599
4603
4600 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4604 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4601 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4605 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4602 a bug report by Tjabo Kloppenburg.
4606 a bug report by Tjabo Kloppenburg.
4603
4607
4604 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4608 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4605 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4609 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4606 seems rather unstable. Thanks to a bug report by Tjabo
4610 seems rather unstable. Thanks to a bug report by Tjabo
4607 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4611 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4608
4612
4609 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4613 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4610 this out soon because of the critical fixes in the inner loop for
4614 this out soon because of the critical fixes in the inner loop for
4611 generators.
4615 generators.
4612
4616
4613 * IPython/Magic.py (Magic.getargspec): removed. This (and
4617 * IPython/Magic.py (Magic.getargspec): removed. This (and
4614 _get_def) have been obsoleted by OInspect for a long time, I
4618 _get_def) have been obsoleted by OInspect for a long time, I
4615 hadn't noticed that they were dead code.
4619 hadn't noticed that they were dead code.
4616 (Magic._ofind): restored _ofind functionality for a few literals
4620 (Magic._ofind): restored _ofind functionality for a few literals
4617 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4621 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4618 for things like "hello".capitalize?, since that would require a
4622 for things like "hello".capitalize?, since that would require a
4619 potentially dangerous eval() again.
4623 potentially dangerous eval() again.
4620
4624
4621 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4625 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4622 logic a bit more to clean up the escapes handling and minimize the
4626 logic a bit more to clean up the escapes handling and minimize the
4623 use of _ofind to only necessary cases. The interactive 'feel' of
4627 use of _ofind to only necessary cases. The interactive 'feel' of
4624 IPython should have improved quite a bit with the changes in
4628 IPython should have improved quite a bit with the changes in
4625 _prefilter and _ofind (besides being far safer than before).
4629 _prefilter and _ofind (besides being far safer than before).
4626
4630
4627 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4631 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4628 obscure, never reported). Edit would fail to find the object to
4632 obscure, never reported). Edit would fail to find the object to
4629 edit under some circumstances.
4633 edit under some circumstances.
4630 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4634 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4631 which were causing double-calling of generators. Those eval calls
4635 which were causing double-calling of generators. Those eval calls
4632 were _very_ dangerous, since code with side effects could be
4636 were _very_ dangerous, since code with side effects could be
4633 triggered. As they say, 'eval is evil'... These were the
4637 triggered. As they say, 'eval is evil'... These were the
4634 nastiest evals in IPython. Besides, _ofind is now far simpler,
4638 nastiest evals in IPython. Besides, _ofind is now far simpler,
4635 and it should also be quite a bit faster. Its use of inspect is
4639 and it should also be quite a bit faster. Its use of inspect is
4636 also safer, so perhaps some of the inspect-related crashes I've
4640 also safer, so perhaps some of the inspect-related crashes I've
4637 seen lately with Python 2.3 might be taken care of. That will
4641 seen lately with Python 2.3 might be taken care of. That will
4638 need more testing.
4642 need more testing.
4639
4643
4640 2003-08-17 Fernando Perez <fperez@colorado.edu>
4644 2003-08-17 Fernando Perez <fperez@colorado.edu>
4641
4645
4642 * IPython/iplib.py (InteractiveShell._prefilter): significant
4646 * IPython/iplib.py (InteractiveShell._prefilter): significant
4643 simplifications to the logic for handling user escapes. Faster
4647 simplifications to the logic for handling user escapes. Faster
4644 and simpler code.
4648 and simpler code.
4645
4649
4646 2003-08-14 Fernando Perez <fperez@colorado.edu>
4650 2003-08-14 Fernando Perez <fperez@colorado.edu>
4647
4651
4648 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4652 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4649 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4653 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4650 but it should be quite a bit faster. And the recursive version
4654 but it should be quite a bit faster. And the recursive version
4651 generated O(log N) intermediate storage for all rank>1 arrays,
4655 generated O(log N) intermediate storage for all rank>1 arrays,
4652 even if they were contiguous.
4656 even if they were contiguous.
4653 (l1norm): Added this function.
4657 (l1norm): Added this function.
4654 (norm): Added this function for arbitrary norms (including
4658 (norm): Added this function for arbitrary norms (including
4655 l-infinity). l1 and l2 are still special cases for convenience
4659 l-infinity). l1 and l2 are still special cases for convenience
4656 and speed.
4660 and speed.
4657
4661
4658 2003-08-03 Fernando Perez <fperez@colorado.edu>
4662 2003-08-03 Fernando Perez <fperez@colorado.edu>
4659
4663
4660 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4664 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4661 exceptions, which now raise PendingDeprecationWarnings in Python
4665 exceptions, which now raise PendingDeprecationWarnings in Python
4662 2.3. There were some in Magic and some in Gnuplot2.
4666 2.3. There were some in Magic and some in Gnuplot2.
4663
4667
4664 2003-06-30 Fernando Perez <fperez@colorado.edu>
4668 2003-06-30 Fernando Perez <fperez@colorado.edu>
4665
4669
4666 * IPython/genutils.py (page): modified to call curses only for
4670 * IPython/genutils.py (page): modified to call curses only for
4667 terminals where TERM=='xterm'. After problems under many other
4671 terminals where TERM=='xterm'. After problems under many other
4668 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4672 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4669
4673
4670 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4674 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4671 would be triggered when readline was absent. This was just an old
4675 would be triggered when readline was absent. This was just an old
4672 debugging statement I'd forgotten to take out.
4676 debugging statement I'd forgotten to take out.
4673
4677
4674 2003-06-20 Fernando Perez <fperez@colorado.edu>
4678 2003-06-20 Fernando Perez <fperez@colorado.edu>
4675
4679
4676 * IPython/genutils.py (clock): modified to return only user time
4680 * IPython/genutils.py (clock): modified to return only user time
4677 (not counting system time), after a discussion on scipy. While
4681 (not counting system time), after a discussion on scipy. While
4678 system time may be a useful quantity occasionally, it may much
4682 system time may be a useful quantity occasionally, it may much
4679 more easily be skewed by occasional swapping or other similar
4683 more easily be skewed by occasional swapping or other similar
4680 activity.
4684 activity.
4681
4685
4682 2003-06-05 Fernando Perez <fperez@colorado.edu>
4686 2003-06-05 Fernando Perez <fperez@colorado.edu>
4683
4687
4684 * IPython/numutils.py (identity): new function, for building
4688 * IPython/numutils.py (identity): new function, for building
4685 arbitrary rank Kronecker deltas (mostly backwards compatible with
4689 arbitrary rank Kronecker deltas (mostly backwards compatible with
4686 Numeric.identity)
4690 Numeric.identity)
4687
4691
4688 2003-06-03 Fernando Perez <fperez@colorado.edu>
4692 2003-06-03 Fernando Perez <fperez@colorado.edu>
4689
4693
4690 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4694 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4691 arguments passed to magics with spaces, to allow trailing '\' to
4695 arguments passed to magics with spaces, to allow trailing '\' to
4692 work normally (mainly for Windows users).
4696 work normally (mainly for Windows users).
4693
4697
4694 2003-05-29 Fernando Perez <fperez@colorado.edu>
4698 2003-05-29 Fernando Perez <fperez@colorado.edu>
4695
4699
4696 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4700 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4697 instead of pydoc.help. This fixes a bizarre behavior where
4701 instead of pydoc.help. This fixes a bizarre behavior where
4698 printing '%s' % locals() would trigger the help system. Now
4702 printing '%s' % locals() would trigger the help system. Now
4699 ipython behaves like normal python does.
4703 ipython behaves like normal python does.
4700
4704
4701 Note that if one does 'from pydoc import help', the bizarre
4705 Note that if one does 'from pydoc import help', the bizarre
4702 behavior returns, but this will also happen in normal python, so
4706 behavior returns, but this will also happen in normal python, so
4703 it's not an ipython bug anymore (it has to do with how pydoc.help
4707 it's not an ipython bug anymore (it has to do with how pydoc.help
4704 is implemented).
4708 is implemented).
4705
4709
4706 2003-05-22 Fernando Perez <fperez@colorado.edu>
4710 2003-05-22 Fernando Perez <fperez@colorado.edu>
4707
4711
4708 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4712 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4709 return [] instead of None when nothing matches, also match to end
4713 return [] instead of None when nothing matches, also match to end
4710 of line. Patch by Gary Bishop.
4714 of line. Patch by Gary Bishop.
4711
4715
4712 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4716 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4713 protection as before, for files passed on the command line. This
4717 protection as before, for files passed on the command line. This
4714 prevents the CrashHandler from kicking in if user files call into
4718 prevents the CrashHandler from kicking in if user files call into
4715 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4719 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4716 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4720 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4717
4721
4718 2003-05-20 *** Released version 0.4.0
4722 2003-05-20 *** Released version 0.4.0
4719
4723
4720 2003-05-20 Fernando Perez <fperez@colorado.edu>
4724 2003-05-20 Fernando Perez <fperez@colorado.edu>
4721
4725
4722 * setup.py: added support for manpages. It's a bit hackish b/c of
4726 * setup.py: added support for manpages. It's a bit hackish b/c of
4723 a bug in the way the bdist_rpm distutils target handles gzipped
4727 a bug in the way the bdist_rpm distutils target handles gzipped
4724 manpages, but it works. After a patch by Jack.
4728 manpages, but it works. After a patch by Jack.
4725
4729
4726 2003-05-19 Fernando Perez <fperez@colorado.edu>
4730 2003-05-19 Fernando Perez <fperez@colorado.edu>
4727
4731
4728 * IPython/numutils.py: added a mockup of the kinds module, since
4732 * IPython/numutils.py: added a mockup of the kinds module, since
4729 it was recently removed from Numeric. This way, numutils will
4733 it was recently removed from Numeric. This way, numutils will
4730 work for all users even if they are missing kinds.
4734 work for all users even if they are missing kinds.
4731
4735
4732 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4736 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4733 failure, which can occur with SWIG-wrapped extensions. After a
4737 failure, which can occur with SWIG-wrapped extensions. After a
4734 crash report from Prabhu.
4738 crash report from Prabhu.
4735
4739
4736 2003-05-16 Fernando Perez <fperez@colorado.edu>
4740 2003-05-16 Fernando Perez <fperez@colorado.edu>
4737
4741
4738 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4742 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4739 protect ipython from user code which may call directly
4743 protect ipython from user code which may call directly
4740 sys.excepthook (this looks like an ipython crash to the user, even
4744 sys.excepthook (this looks like an ipython crash to the user, even
4741 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4745 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4742 This is especially important to help users of WxWindows, but may
4746 This is especially important to help users of WxWindows, but may
4743 also be useful in other cases.
4747 also be useful in other cases.
4744
4748
4745 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4749 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4746 an optional tb_offset to be specified, and to preserve exception
4750 an optional tb_offset to be specified, and to preserve exception
4747 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4751 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4748
4752
4749 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4753 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4750
4754
4751 2003-05-15 Fernando Perez <fperez@colorado.edu>
4755 2003-05-15 Fernando Perez <fperez@colorado.edu>
4752
4756
4753 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4757 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4754 installing for a new user under Windows.
4758 installing for a new user under Windows.
4755
4759
4756 2003-05-12 Fernando Perez <fperez@colorado.edu>
4760 2003-05-12 Fernando Perez <fperez@colorado.edu>
4757
4761
4758 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4762 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4759 handler for Emacs comint-based lines. Currently it doesn't do
4763 handler for Emacs comint-based lines. Currently it doesn't do
4760 much (but importantly, it doesn't update the history cache). In
4764 much (but importantly, it doesn't update the history cache). In
4761 the future it may be expanded if Alex needs more functionality
4765 the future it may be expanded if Alex needs more functionality
4762 there.
4766 there.
4763
4767
4764 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4768 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4765 info to crash reports.
4769 info to crash reports.
4766
4770
4767 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4771 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4768 just like Python's -c. Also fixed crash with invalid -color
4772 just like Python's -c. Also fixed crash with invalid -color
4769 option value at startup. Thanks to Will French
4773 option value at startup. Thanks to Will French
4770 <wfrench-AT-bestweb.net> for the bug report.
4774 <wfrench-AT-bestweb.net> for the bug report.
4771
4775
4772 2003-05-09 Fernando Perez <fperez@colorado.edu>
4776 2003-05-09 Fernando Perez <fperez@colorado.edu>
4773
4777
4774 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4778 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4775 to EvalDict (it's a mapping, after all) and simplified its code
4779 to EvalDict (it's a mapping, after all) and simplified its code
4776 quite a bit, after a nice discussion on c.l.py where Gustavo
4780 quite a bit, after a nice discussion on c.l.py where Gustavo
4777 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4781 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4778
4782
4779 2003-04-30 Fernando Perez <fperez@colorado.edu>
4783 2003-04-30 Fernando Perez <fperez@colorado.edu>
4780
4784
4781 * IPython/genutils.py (timings_out): modified it to reduce its
4785 * IPython/genutils.py (timings_out): modified it to reduce its
4782 overhead in the common reps==1 case.
4786 overhead in the common reps==1 case.
4783
4787
4784 2003-04-29 Fernando Perez <fperez@colorado.edu>
4788 2003-04-29 Fernando Perez <fperez@colorado.edu>
4785
4789
4786 * IPython/genutils.py (timings_out): Modified to use the resource
4790 * IPython/genutils.py (timings_out): Modified to use the resource
4787 module, which avoids the wraparound problems of time.clock().
4791 module, which avoids the wraparound problems of time.clock().
4788
4792
4789 2003-04-17 *** Released version 0.2.15pre4
4793 2003-04-17 *** Released version 0.2.15pre4
4790
4794
4791 2003-04-17 Fernando Perez <fperez@colorado.edu>
4795 2003-04-17 Fernando Perez <fperez@colorado.edu>
4792
4796
4793 * setup.py (scriptfiles): Split windows-specific stuff over to a
4797 * setup.py (scriptfiles): Split windows-specific stuff over to a
4794 separate file, in an attempt to have a Windows GUI installer.
4798 separate file, in an attempt to have a Windows GUI installer.
4795 That didn't work, but part of the groundwork is done.
4799 That didn't work, but part of the groundwork is done.
4796
4800
4797 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4801 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4798 indent/unindent with 4 spaces. Particularly useful in combination
4802 indent/unindent with 4 spaces. Particularly useful in combination
4799 with the new auto-indent option.
4803 with the new auto-indent option.
4800
4804
4801 2003-04-16 Fernando Perez <fperez@colorado.edu>
4805 2003-04-16 Fernando Perez <fperez@colorado.edu>
4802
4806
4803 * IPython/Magic.py: various replacements of self.rc for
4807 * IPython/Magic.py: various replacements of self.rc for
4804 self.shell.rc. A lot more remains to be done to fully disentangle
4808 self.shell.rc. A lot more remains to be done to fully disentangle
4805 this class from the main Shell class.
4809 this class from the main Shell class.
4806
4810
4807 * IPython/GnuplotRuntime.py: added checks for mouse support so
4811 * IPython/GnuplotRuntime.py: added checks for mouse support so
4808 that we don't try to enable it if the current gnuplot doesn't
4812 that we don't try to enable it if the current gnuplot doesn't
4809 really support it. Also added checks so that we don't try to
4813 really support it. Also added checks so that we don't try to
4810 enable persist under Windows (where Gnuplot doesn't recognize the
4814 enable persist under Windows (where Gnuplot doesn't recognize the
4811 option).
4815 option).
4812
4816
4813 * IPython/iplib.py (InteractiveShell.interact): Added optional
4817 * IPython/iplib.py (InteractiveShell.interact): Added optional
4814 auto-indenting code, after a patch by King C. Shu
4818 auto-indenting code, after a patch by King C. Shu
4815 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4819 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4816 get along well with pasting indented code. If I ever figure out
4820 get along well with pasting indented code. If I ever figure out
4817 how to make that part go well, it will become on by default.
4821 how to make that part go well, it will become on by default.
4818
4822
4819 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4823 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4820 crash ipython if there was an unmatched '%' in the user's prompt
4824 crash ipython if there was an unmatched '%' in the user's prompt
4821 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4825 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4822
4826
4823 * IPython/iplib.py (InteractiveShell.interact): removed the
4827 * IPython/iplib.py (InteractiveShell.interact): removed the
4824 ability to ask the user whether he wants to crash or not at the
4828 ability to ask the user whether he wants to crash or not at the
4825 'last line' exception handler. Calling functions at that point
4829 'last line' exception handler. Calling functions at that point
4826 changes the stack, and the error reports would have incorrect
4830 changes the stack, and the error reports would have incorrect
4827 tracebacks.
4831 tracebacks.
4828
4832
4829 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4833 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4830 pass through a peger a pretty-printed form of any object. After a
4834 pass through a peger a pretty-printed form of any object. After a
4831 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4835 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4832
4836
4833 2003-04-14 Fernando Perez <fperez@colorado.edu>
4837 2003-04-14 Fernando Perez <fperez@colorado.edu>
4834
4838
4835 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4839 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4836 all files in ~ would be modified at first install (instead of
4840 all files in ~ would be modified at first install (instead of
4837 ~/.ipython). This could be potentially disastrous, as the
4841 ~/.ipython). This could be potentially disastrous, as the
4838 modification (make line-endings native) could damage binary files.
4842 modification (make line-endings native) could damage binary files.
4839
4843
4840 2003-04-10 Fernando Perez <fperez@colorado.edu>
4844 2003-04-10 Fernando Perez <fperez@colorado.edu>
4841
4845
4842 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4846 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4843 handle only lines which are invalid python. This now means that
4847 handle only lines which are invalid python. This now means that
4844 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4848 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4845 for the bug report.
4849 for the bug report.
4846
4850
4847 2003-04-01 Fernando Perez <fperez@colorado.edu>
4851 2003-04-01 Fernando Perez <fperez@colorado.edu>
4848
4852
4849 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4853 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4850 where failing to set sys.last_traceback would crash pdb.pm().
4854 where failing to set sys.last_traceback would crash pdb.pm().
4851 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4855 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4852 report.
4856 report.
4853
4857
4854 2003-03-25 Fernando Perez <fperez@colorado.edu>
4858 2003-03-25 Fernando Perez <fperez@colorado.edu>
4855
4859
4856 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4860 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4857 before printing it (it had a lot of spurious blank lines at the
4861 before printing it (it had a lot of spurious blank lines at the
4858 end).
4862 end).
4859
4863
4860 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4864 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4861 output would be sent 21 times! Obviously people don't use this
4865 output would be sent 21 times! Obviously people don't use this
4862 too often, or I would have heard about it.
4866 too often, or I would have heard about it.
4863
4867
4864 2003-03-24 Fernando Perez <fperez@colorado.edu>
4868 2003-03-24 Fernando Perez <fperez@colorado.edu>
4865
4869
4866 * setup.py (scriptfiles): renamed the data_files parameter from
4870 * setup.py (scriptfiles): renamed the data_files parameter from
4867 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4871 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4868 for the patch.
4872 for the patch.
4869
4873
4870 2003-03-20 Fernando Perez <fperez@colorado.edu>
4874 2003-03-20 Fernando Perez <fperez@colorado.edu>
4871
4875
4872 * IPython/genutils.py (error): added error() and fatal()
4876 * IPython/genutils.py (error): added error() and fatal()
4873 functions.
4877 functions.
4874
4878
4875 2003-03-18 *** Released version 0.2.15pre3
4879 2003-03-18 *** Released version 0.2.15pre3
4876
4880
4877 2003-03-18 Fernando Perez <fperez@colorado.edu>
4881 2003-03-18 Fernando Perez <fperez@colorado.edu>
4878
4882
4879 * setupext/install_data_ext.py
4883 * setupext/install_data_ext.py
4880 (install_data_ext.initialize_options): Class contributed by Jack
4884 (install_data_ext.initialize_options): Class contributed by Jack
4881 Moffit for fixing the old distutils hack. He is sending this to
4885 Moffit for fixing the old distutils hack. He is sending this to
4882 the distutils folks so in the future we may not need it as a
4886 the distutils folks so in the future we may not need it as a
4883 private fix.
4887 private fix.
4884
4888
4885 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4889 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4886 changes for Debian packaging. See his patch for full details.
4890 changes for Debian packaging. See his patch for full details.
4887 The old distutils hack of making the ipythonrc* files carry a
4891 The old distutils hack of making the ipythonrc* files carry a
4888 bogus .py extension is gone, at last. Examples were moved to a
4892 bogus .py extension is gone, at last. Examples were moved to a
4889 separate subdir under doc/, and the separate executable scripts
4893 separate subdir under doc/, and the separate executable scripts
4890 now live in their own directory. Overall a great cleanup. The
4894 now live in their own directory. Overall a great cleanup. The
4891 manual was updated to use the new files, and setup.py has been
4895 manual was updated to use the new files, and setup.py has been
4892 fixed for this setup.
4896 fixed for this setup.
4893
4897
4894 * IPython/PyColorize.py (Parser.usage): made non-executable and
4898 * IPython/PyColorize.py (Parser.usage): made non-executable and
4895 created a pycolor wrapper around it to be included as a script.
4899 created a pycolor wrapper around it to be included as a script.
4896
4900
4897 2003-03-12 *** Released version 0.2.15pre2
4901 2003-03-12 *** Released version 0.2.15pre2
4898
4902
4899 2003-03-12 Fernando Perez <fperez@colorado.edu>
4903 2003-03-12 Fernando Perez <fperez@colorado.edu>
4900
4904
4901 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4905 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4902 long-standing problem with garbage characters in some terminals.
4906 long-standing problem with garbage characters in some terminals.
4903 The issue was really that the \001 and \002 escapes must _only_ be
4907 The issue was really that the \001 and \002 escapes must _only_ be
4904 passed to input prompts (which call readline), but _never_ to
4908 passed to input prompts (which call readline), but _never_ to
4905 normal text to be printed on screen. I changed ColorANSI to have
4909 normal text to be printed on screen. I changed ColorANSI to have
4906 two classes: TermColors and InputTermColors, each with the
4910 two classes: TermColors and InputTermColors, each with the
4907 appropriate escapes for input prompts or normal text. The code in
4911 appropriate escapes for input prompts or normal text. The code in
4908 Prompts.py got slightly more complicated, but this very old and
4912 Prompts.py got slightly more complicated, but this very old and
4909 annoying bug is finally fixed.
4913 annoying bug is finally fixed.
4910
4914
4911 All the credit for nailing down the real origin of this problem
4915 All the credit for nailing down the real origin of this problem
4912 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4916 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4913 *Many* thanks to him for spending quite a bit of effort on this.
4917 *Many* thanks to him for spending quite a bit of effort on this.
4914
4918
4915 2003-03-05 *** Released version 0.2.15pre1
4919 2003-03-05 *** Released version 0.2.15pre1
4916
4920
4917 2003-03-03 Fernando Perez <fperez@colorado.edu>
4921 2003-03-03 Fernando Perez <fperez@colorado.edu>
4918
4922
4919 * IPython/FakeModule.py: Moved the former _FakeModule to a
4923 * IPython/FakeModule.py: Moved the former _FakeModule to a
4920 separate file, because it's also needed by Magic (to fix a similar
4924 separate file, because it's also needed by Magic (to fix a similar
4921 pickle-related issue in @run).
4925 pickle-related issue in @run).
4922
4926
4923 2003-03-02 Fernando Perez <fperez@colorado.edu>
4927 2003-03-02 Fernando Perez <fperez@colorado.edu>
4924
4928
4925 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4929 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4926 the autocall option at runtime.
4930 the autocall option at runtime.
4927 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4931 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4928 across Magic.py to start separating Magic from InteractiveShell.
4932 across Magic.py to start separating Magic from InteractiveShell.
4929 (Magic._ofind): Fixed to return proper namespace for dotted
4933 (Magic._ofind): Fixed to return proper namespace for dotted
4930 names. Before, a dotted name would always return 'not currently
4934 names. Before, a dotted name would always return 'not currently
4931 defined', because it would find the 'parent'. s.x would be found,
4935 defined', because it would find the 'parent'. s.x would be found,
4932 but since 'x' isn't defined by itself, it would get confused.
4936 but since 'x' isn't defined by itself, it would get confused.
4933 (Magic.magic_run): Fixed pickling problems reported by Ralf
4937 (Magic.magic_run): Fixed pickling problems reported by Ralf
4934 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4938 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4935 that I'd used when Mike Heeter reported similar issues at the
4939 that I'd used when Mike Heeter reported similar issues at the
4936 top-level, but now for @run. It boils down to injecting the
4940 top-level, but now for @run. It boils down to injecting the
4937 namespace where code is being executed with something that looks
4941 namespace where code is being executed with something that looks
4938 enough like a module to fool pickle.dump(). Since a pickle stores
4942 enough like a module to fool pickle.dump(). Since a pickle stores
4939 a named reference to the importing module, we need this for
4943 a named reference to the importing module, we need this for
4940 pickles to save something sensible.
4944 pickles to save something sensible.
4941
4945
4942 * IPython/ipmaker.py (make_IPython): added an autocall option.
4946 * IPython/ipmaker.py (make_IPython): added an autocall option.
4943
4947
4944 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4948 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4945 the auto-eval code. Now autocalling is an option, and the code is
4949 the auto-eval code. Now autocalling is an option, and the code is
4946 also vastly safer. There is no more eval() involved at all.
4950 also vastly safer. There is no more eval() involved at all.
4947
4951
4948 2003-03-01 Fernando Perez <fperez@colorado.edu>
4952 2003-03-01 Fernando Perez <fperez@colorado.edu>
4949
4953
4950 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4954 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4951 dict with named keys instead of a tuple.
4955 dict with named keys instead of a tuple.
4952
4956
4953 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4957 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4954
4958
4955 * setup.py (make_shortcut): Fixed message about directories
4959 * setup.py (make_shortcut): Fixed message about directories
4956 created during Windows installation (the directories were ok, just
4960 created during Windows installation (the directories were ok, just
4957 the printed message was misleading). Thanks to Chris Liechti
4961 the printed message was misleading). Thanks to Chris Liechti
4958 <cliechti-AT-gmx.net> for the heads up.
4962 <cliechti-AT-gmx.net> for the heads up.
4959
4963
4960 2003-02-21 Fernando Perez <fperez@colorado.edu>
4964 2003-02-21 Fernando Perez <fperez@colorado.edu>
4961
4965
4962 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4966 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4963 of ValueError exception when checking for auto-execution. This
4967 of ValueError exception when checking for auto-execution. This
4964 one is raised by things like Numeric arrays arr.flat when the
4968 one is raised by things like Numeric arrays arr.flat when the
4965 array is non-contiguous.
4969 array is non-contiguous.
4966
4970
4967 2003-01-31 Fernando Perez <fperez@colorado.edu>
4971 2003-01-31 Fernando Perez <fperez@colorado.edu>
4968
4972
4969 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4973 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4970 not return any value at all (even though the command would get
4974 not return any value at all (even though the command would get
4971 executed).
4975 executed).
4972 (xsys): Flush stdout right after printing the command to ensure
4976 (xsys): Flush stdout right after printing the command to ensure
4973 proper ordering of commands and command output in the total
4977 proper ordering of commands and command output in the total
4974 output.
4978 output.
4975 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4979 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4976 system/getoutput as defaults. The old ones are kept for
4980 system/getoutput as defaults. The old ones are kept for
4977 compatibility reasons, so no code which uses this library needs
4981 compatibility reasons, so no code which uses this library needs
4978 changing.
4982 changing.
4979
4983
4980 2003-01-27 *** Released version 0.2.14
4984 2003-01-27 *** Released version 0.2.14
4981
4985
4982 2003-01-25 Fernando Perez <fperez@colorado.edu>
4986 2003-01-25 Fernando Perez <fperez@colorado.edu>
4983
4987
4984 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4988 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4985 functions defined in previous edit sessions could not be re-edited
4989 functions defined in previous edit sessions could not be re-edited
4986 (because the temp files were immediately removed). Now temp files
4990 (because the temp files were immediately removed). Now temp files
4987 are removed only at IPython's exit.
4991 are removed only at IPython's exit.
4988 (Magic.magic_run): Improved @run to perform shell-like expansions
4992 (Magic.magic_run): Improved @run to perform shell-like expansions
4989 on its arguments (~users and $VARS). With this, @run becomes more
4993 on its arguments (~users and $VARS). With this, @run becomes more
4990 like a normal command-line.
4994 like a normal command-line.
4991
4995
4992 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4996 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4993 bugs related to embedding and cleaned up that code. A fairly
4997 bugs related to embedding and cleaned up that code. A fairly
4994 important one was the impossibility to access the global namespace
4998 important one was the impossibility to access the global namespace
4995 through the embedded IPython (only local variables were visible).
4999 through the embedded IPython (only local variables were visible).
4996
5000
4997 2003-01-14 Fernando Perez <fperez@colorado.edu>
5001 2003-01-14 Fernando Perez <fperez@colorado.edu>
4998
5002
4999 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5003 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5000 auto-calling to be a bit more conservative. Now it doesn't get
5004 auto-calling to be a bit more conservative. Now it doesn't get
5001 triggered if any of '!=()<>' are in the rest of the input line, to
5005 triggered if any of '!=()<>' are in the rest of the input line, to
5002 allow comparing callables. Thanks to Alex for the heads up.
5006 allow comparing callables. Thanks to Alex for the heads up.
5003
5007
5004 2003-01-07 Fernando Perez <fperez@colorado.edu>
5008 2003-01-07 Fernando Perez <fperez@colorado.edu>
5005
5009
5006 * IPython/genutils.py (page): fixed estimation of the number of
5010 * IPython/genutils.py (page): fixed estimation of the number of
5007 lines in a string to be paged to simply count newlines. This
5011 lines in a string to be paged to simply count newlines. This
5008 prevents over-guessing due to embedded escape sequences. A better
5012 prevents over-guessing due to embedded escape sequences. A better
5009 long-term solution would involve stripping out the control chars
5013 long-term solution would involve stripping out the control chars
5010 for the count, but it's potentially so expensive I just don't
5014 for the count, but it's potentially so expensive I just don't
5011 think it's worth doing.
5015 think it's worth doing.
5012
5016
5013 2002-12-19 *** Released version 0.2.14pre50
5017 2002-12-19 *** Released version 0.2.14pre50
5014
5018
5015 2002-12-19 Fernando Perez <fperez@colorado.edu>
5019 2002-12-19 Fernando Perez <fperez@colorado.edu>
5016
5020
5017 * tools/release (version): Changed release scripts to inform
5021 * tools/release (version): Changed release scripts to inform
5018 Andrea and build a NEWS file with a list of recent changes.
5022 Andrea and build a NEWS file with a list of recent changes.
5019
5023
5020 * IPython/ColorANSI.py (__all__): changed terminal detection
5024 * IPython/ColorANSI.py (__all__): changed terminal detection
5021 code. Seems to work better for xterms without breaking
5025 code. Seems to work better for xterms without breaking
5022 konsole. Will need more testing to determine if WinXP and Mac OSX
5026 konsole. Will need more testing to determine if WinXP and Mac OSX
5023 also work ok.
5027 also work ok.
5024
5028
5025 2002-12-18 *** Released version 0.2.14pre49
5029 2002-12-18 *** Released version 0.2.14pre49
5026
5030
5027 2002-12-18 Fernando Perez <fperez@colorado.edu>
5031 2002-12-18 Fernando Perez <fperez@colorado.edu>
5028
5032
5029 * Docs: added new info about Mac OSX, from Andrea.
5033 * Docs: added new info about Mac OSX, from Andrea.
5030
5034
5031 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5035 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5032 allow direct plotting of python strings whose format is the same
5036 allow direct plotting of python strings whose format is the same
5033 of gnuplot data files.
5037 of gnuplot data files.
5034
5038
5035 2002-12-16 Fernando Perez <fperez@colorado.edu>
5039 2002-12-16 Fernando Perez <fperez@colorado.edu>
5036
5040
5037 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5041 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5038 value of exit question to be acknowledged.
5042 value of exit question to be acknowledged.
5039
5043
5040 2002-12-03 Fernando Perez <fperez@colorado.edu>
5044 2002-12-03 Fernando Perez <fperez@colorado.edu>
5041
5045
5042 * IPython/ipmaker.py: removed generators, which had been added
5046 * IPython/ipmaker.py: removed generators, which had been added
5043 by mistake in an earlier debugging run. This was causing trouble
5047 by mistake in an earlier debugging run. This was causing trouble
5044 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5048 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5045 for pointing this out.
5049 for pointing this out.
5046
5050
5047 2002-11-17 Fernando Perez <fperez@colorado.edu>
5051 2002-11-17 Fernando Perez <fperez@colorado.edu>
5048
5052
5049 * Manual: updated the Gnuplot section.
5053 * Manual: updated the Gnuplot section.
5050
5054
5051 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5055 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5052 a much better split of what goes in Runtime and what goes in
5056 a much better split of what goes in Runtime and what goes in
5053 Interactive.
5057 Interactive.
5054
5058
5055 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5059 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5056 being imported from iplib.
5060 being imported from iplib.
5057
5061
5058 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5062 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5059 for command-passing. Now the global Gnuplot instance is called
5063 for command-passing. Now the global Gnuplot instance is called
5060 'gp' instead of 'g', which was really a far too fragile and
5064 'gp' instead of 'g', which was really a far too fragile and
5061 common name.
5065 common name.
5062
5066
5063 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5067 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5064 bounding boxes generated by Gnuplot for square plots.
5068 bounding boxes generated by Gnuplot for square plots.
5065
5069
5066 * IPython/genutils.py (popkey): new function added. I should
5070 * IPython/genutils.py (popkey): new function added. I should
5067 suggest this on c.l.py as a dict method, it seems useful.
5071 suggest this on c.l.py as a dict method, it seems useful.
5068
5072
5069 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5073 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5070 to transparently handle PostScript generation. MUCH better than
5074 to transparently handle PostScript generation. MUCH better than
5071 the previous plot_eps/replot_eps (which I removed now). The code
5075 the previous plot_eps/replot_eps (which I removed now). The code
5072 is also fairly clean and well documented now (including
5076 is also fairly clean and well documented now (including
5073 docstrings).
5077 docstrings).
5074
5078
5075 2002-11-13 Fernando Perez <fperez@colorado.edu>
5079 2002-11-13 Fernando Perez <fperez@colorado.edu>
5076
5080
5077 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5081 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5078 (inconsistent with options).
5082 (inconsistent with options).
5079
5083
5080 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5084 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5081 manually disabled, I don't know why. Fixed it.
5085 manually disabled, I don't know why. Fixed it.
5082 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5086 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5083 eps output.
5087 eps output.
5084
5088
5085 2002-11-12 Fernando Perez <fperez@colorado.edu>
5089 2002-11-12 Fernando Perez <fperez@colorado.edu>
5086
5090
5087 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5091 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5088 don't propagate up to caller. Fixes crash reported by François
5092 don't propagate up to caller. Fixes crash reported by François
5089 Pinard.
5093 Pinard.
5090
5094
5091 2002-11-09 Fernando Perez <fperez@colorado.edu>
5095 2002-11-09 Fernando Perez <fperez@colorado.edu>
5092
5096
5093 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5097 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5094 history file for new users.
5098 history file for new users.
5095 (make_IPython): fixed bug where initial install would leave the
5099 (make_IPython): fixed bug where initial install would leave the
5096 user running in the .ipython dir.
5100 user running in the .ipython dir.
5097 (make_IPython): fixed bug where config dir .ipython would be
5101 (make_IPython): fixed bug where config dir .ipython would be
5098 created regardless of the given -ipythondir option. Thanks to Cory
5102 created regardless of the given -ipythondir option. Thanks to Cory
5099 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5103 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5100
5104
5101 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5105 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5102 type confirmations. Will need to use it in all of IPython's code
5106 type confirmations. Will need to use it in all of IPython's code
5103 consistently.
5107 consistently.
5104
5108
5105 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5109 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5106 context to print 31 lines instead of the default 5. This will make
5110 context to print 31 lines instead of the default 5. This will make
5107 the crash reports extremely detailed in case the problem is in
5111 the crash reports extremely detailed in case the problem is in
5108 libraries I don't have access to.
5112 libraries I don't have access to.
5109
5113
5110 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5114 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5111 line of defense' code to still crash, but giving users fair
5115 line of defense' code to still crash, but giving users fair
5112 warning. I don't want internal errors to go unreported: if there's
5116 warning. I don't want internal errors to go unreported: if there's
5113 an internal problem, IPython should crash and generate a full
5117 an internal problem, IPython should crash and generate a full
5114 report.
5118 report.
5115
5119
5116 2002-11-08 Fernando Perez <fperez@colorado.edu>
5120 2002-11-08 Fernando Perez <fperez@colorado.edu>
5117
5121
5118 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5122 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5119 otherwise uncaught exceptions which can appear if people set
5123 otherwise uncaught exceptions which can appear if people set
5120 sys.stdout to something badly broken. Thanks to a crash report
5124 sys.stdout to something badly broken. Thanks to a crash report
5121 from henni-AT-mail.brainbot.com.
5125 from henni-AT-mail.brainbot.com.
5122
5126
5123 2002-11-04 Fernando Perez <fperez@colorado.edu>
5127 2002-11-04 Fernando Perez <fperez@colorado.edu>
5124
5128
5125 * IPython/iplib.py (InteractiveShell.interact): added
5129 * IPython/iplib.py (InteractiveShell.interact): added
5126 __IPYTHON__active to the builtins. It's a flag which goes on when
5130 __IPYTHON__active to the builtins. It's a flag which goes on when
5127 the interaction starts and goes off again when it stops. This
5131 the interaction starts and goes off again when it stops. This
5128 allows embedding code to detect being inside IPython. Before this
5132 allows embedding code to detect being inside IPython. Before this
5129 was done via __IPYTHON__, but that only shows that an IPython
5133 was done via __IPYTHON__, but that only shows that an IPython
5130 instance has been created.
5134 instance has been created.
5131
5135
5132 * IPython/Magic.py (Magic.magic_env): I realized that in a
5136 * IPython/Magic.py (Magic.magic_env): I realized that in a
5133 UserDict, instance.data holds the data as a normal dict. So I
5137 UserDict, instance.data holds the data as a normal dict. So I
5134 modified @env to return os.environ.data instead of rebuilding a
5138 modified @env to return os.environ.data instead of rebuilding a
5135 dict by hand.
5139 dict by hand.
5136
5140
5137 2002-11-02 Fernando Perez <fperez@colorado.edu>
5141 2002-11-02 Fernando Perez <fperez@colorado.edu>
5138
5142
5139 * IPython/genutils.py (warn): changed so that level 1 prints no
5143 * IPython/genutils.py (warn): changed so that level 1 prints no
5140 header. Level 2 is now the default (with 'WARNING' header, as
5144 header. Level 2 is now the default (with 'WARNING' header, as
5141 before). I think I tracked all places where changes were needed in
5145 before). I think I tracked all places where changes were needed in
5142 IPython, but outside code using the old level numbering may have
5146 IPython, but outside code using the old level numbering may have
5143 broken.
5147 broken.
5144
5148
5145 * IPython/iplib.py (InteractiveShell.runcode): added this to
5149 * IPython/iplib.py (InteractiveShell.runcode): added this to
5146 handle the tracebacks in SystemExit traps correctly. The previous
5150 handle the tracebacks in SystemExit traps correctly. The previous
5147 code (through interact) was printing more of the stack than
5151 code (through interact) was printing more of the stack than
5148 necessary, showing IPython internal code to the user.
5152 necessary, showing IPython internal code to the user.
5149
5153
5150 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5154 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5151 default. Now that the default at the confirmation prompt is yes,
5155 default. Now that the default at the confirmation prompt is yes,
5152 it's not so intrusive. François' argument that ipython sessions
5156 it's not so intrusive. François' argument that ipython sessions
5153 tend to be complex enough not to lose them from an accidental C-d,
5157 tend to be complex enough not to lose them from an accidental C-d,
5154 is a valid one.
5158 is a valid one.
5155
5159
5156 * IPython/iplib.py (InteractiveShell.interact): added a
5160 * IPython/iplib.py (InteractiveShell.interact): added a
5157 showtraceback() call to the SystemExit trap, and modified the exit
5161 showtraceback() call to the SystemExit trap, and modified the exit
5158 confirmation to have yes as the default.
5162 confirmation to have yes as the default.
5159
5163
5160 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5164 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5161 this file. It's been gone from the code for a long time, this was
5165 this file. It's been gone from the code for a long time, this was
5162 simply leftover junk.
5166 simply leftover junk.
5163
5167
5164 2002-11-01 Fernando Perez <fperez@colorado.edu>
5168 2002-11-01 Fernando Perez <fperez@colorado.edu>
5165
5169
5166 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5170 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5167 added. If set, IPython now traps EOF and asks for
5171 added. If set, IPython now traps EOF and asks for
5168 confirmation. After a request by François Pinard.
5172 confirmation. After a request by François Pinard.
5169
5173
5170 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5174 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5171 of @abort, and with a new (better) mechanism for handling the
5175 of @abort, and with a new (better) mechanism for handling the
5172 exceptions.
5176 exceptions.
5173
5177
5174 2002-10-27 Fernando Perez <fperez@colorado.edu>
5178 2002-10-27 Fernando Perez <fperez@colorado.edu>
5175
5179
5176 * IPython/usage.py (__doc__): updated the --help information and
5180 * IPython/usage.py (__doc__): updated the --help information and
5177 the ipythonrc file to indicate that -log generates
5181 the ipythonrc file to indicate that -log generates
5178 ./ipython.log. Also fixed the corresponding info in @logstart.
5182 ./ipython.log. Also fixed the corresponding info in @logstart.
5179 This and several other fixes in the manuals thanks to reports by
5183 This and several other fixes in the manuals thanks to reports by
5180 François Pinard <pinard-AT-iro.umontreal.ca>.
5184 François Pinard <pinard-AT-iro.umontreal.ca>.
5181
5185
5182 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5186 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5183 refer to @logstart (instead of @log, which doesn't exist).
5187 refer to @logstart (instead of @log, which doesn't exist).
5184
5188
5185 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5189 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5186 AttributeError crash. Thanks to Christopher Armstrong
5190 AttributeError crash. Thanks to Christopher Armstrong
5187 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5191 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5188 introduced recently (in 0.2.14pre37) with the fix to the eval
5192 introduced recently (in 0.2.14pre37) with the fix to the eval
5189 problem mentioned below.
5193 problem mentioned below.
5190
5194
5191 2002-10-17 Fernando Perez <fperez@colorado.edu>
5195 2002-10-17 Fernando Perez <fperez@colorado.edu>
5192
5196
5193 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5197 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5194 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5198 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5195
5199
5196 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5200 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5197 this function to fix a problem reported by Alex Schmolck. He saw
5201 this function to fix a problem reported by Alex Schmolck. He saw
5198 it with list comprehensions and generators, which were getting
5202 it with list comprehensions and generators, which were getting
5199 called twice. The real problem was an 'eval' call in testing for
5203 called twice. The real problem was an 'eval' call in testing for
5200 automagic which was evaluating the input line silently.
5204 automagic which was evaluating the input line silently.
5201
5205
5202 This is a potentially very nasty bug, if the input has side
5206 This is a potentially very nasty bug, if the input has side
5203 effects which must not be repeated. The code is much cleaner now,
5207 effects which must not be repeated. The code is much cleaner now,
5204 without any blanket 'except' left and with a regexp test for
5208 without any blanket 'except' left and with a regexp test for
5205 actual function names.
5209 actual function names.
5206
5210
5207 But an eval remains, which I'm not fully comfortable with. I just
5211 But an eval remains, which I'm not fully comfortable with. I just
5208 don't know how to find out if an expression could be a callable in
5212 don't know how to find out if an expression could be a callable in
5209 the user's namespace without doing an eval on the string. However
5213 the user's namespace without doing an eval on the string. However
5210 that string is now much more strictly checked so that no code
5214 that string is now much more strictly checked so that no code
5211 slips by, so the eval should only happen for things that can
5215 slips by, so the eval should only happen for things that can
5212 really be only function/method names.
5216 really be only function/method names.
5213
5217
5214 2002-10-15 Fernando Perez <fperez@colorado.edu>
5218 2002-10-15 Fernando Perez <fperez@colorado.edu>
5215
5219
5216 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5220 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5217 OSX information to main manual, removed README_Mac_OSX file from
5221 OSX information to main manual, removed README_Mac_OSX file from
5218 distribution. Also updated credits for recent additions.
5222 distribution. Also updated credits for recent additions.
5219
5223
5220 2002-10-10 Fernando Perez <fperez@colorado.edu>
5224 2002-10-10 Fernando Perez <fperez@colorado.edu>
5221
5225
5222 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5226 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5223 terminal-related issues. Many thanks to Andrea Riciputi
5227 terminal-related issues. Many thanks to Andrea Riciputi
5224 <andrea.riciputi-AT-libero.it> for writing it.
5228 <andrea.riciputi-AT-libero.it> for writing it.
5225
5229
5226 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5230 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5227 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5231 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5228
5232
5229 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5233 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5230 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5234 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5231 <syver-en-AT-online.no> who both submitted patches for this problem.
5235 <syver-en-AT-online.no> who both submitted patches for this problem.
5232
5236
5233 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5237 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5234 global embedding to make sure that things don't overwrite user
5238 global embedding to make sure that things don't overwrite user
5235 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5239 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5236
5240
5237 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5241 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5238 compatibility. Thanks to Hayden Callow
5242 compatibility. Thanks to Hayden Callow
5239 <h.callow-AT-elec.canterbury.ac.nz>
5243 <h.callow-AT-elec.canterbury.ac.nz>
5240
5244
5241 2002-10-04 Fernando Perez <fperez@colorado.edu>
5245 2002-10-04 Fernando Perez <fperez@colorado.edu>
5242
5246
5243 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5247 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5244 Gnuplot.File objects.
5248 Gnuplot.File objects.
5245
5249
5246 2002-07-23 Fernando Perez <fperez@colorado.edu>
5250 2002-07-23 Fernando Perez <fperez@colorado.edu>
5247
5251
5248 * IPython/genutils.py (timing): Added timings() and timing() for
5252 * IPython/genutils.py (timing): Added timings() and timing() for
5249 quick access to the most commonly needed data, the execution
5253 quick access to the most commonly needed data, the execution
5250 times. Old timing() renamed to timings_out().
5254 times. Old timing() renamed to timings_out().
5251
5255
5252 2002-07-18 Fernando Perez <fperez@colorado.edu>
5256 2002-07-18 Fernando Perez <fperez@colorado.edu>
5253
5257
5254 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5258 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5255 bug with nested instances disrupting the parent's tab completion.
5259 bug with nested instances disrupting the parent's tab completion.
5256
5260
5257 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5261 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5258 all_completions code to begin the emacs integration.
5262 all_completions code to begin the emacs integration.
5259
5263
5260 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5264 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5261 argument to allow titling individual arrays when plotting.
5265 argument to allow titling individual arrays when plotting.
5262
5266
5263 2002-07-15 Fernando Perez <fperez@colorado.edu>
5267 2002-07-15 Fernando Perez <fperez@colorado.edu>
5264
5268
5265 * setup.py (make_shortcut): changed to retrieve the value of
5269 * setup.py (make_shortcut): changed to retrieve the value of
5266 'Program Files' directory from the registry (this value changes in
5270 'Program Files' directory from the registry (this value changes in
5267 non-english versions of Windows). Thanks to Thomas Fanslau
5271 non-english versions of Windows). Thanks to Thomas Fanslau
5268 <tfanslau-AT-gmx.de> for the report.
5272 <tfanslau-AT-gmx.de> for the report.
5269
5273
5270 2002-07-10 Fernando Perez <fperez@colorado.edu>
5274 2002-07-10 Fernando Perez <fperez@colorado.edu>
5271
5275
5272 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5276 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5273 a bug in pdb, which crashes if a line with only whitespace is
5277 a bug in pdb, which crashes if a line with only whitespace is
5274 entered. Bug report submitted to sourceforge.
5278 entered. Bug report submitted to sourceforge.
5275
5279
5276 2002-07-09 Fernando Perez <fperez@colorado.edu>
5280 2002-07-09 Fernando Perez <fperez@colorado.edu>
5277
5281
5278 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5282 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5279 reporting exceptions (it's a bug in inspect.py, I just set a
5283 reporting exceptions (it's a bug in inspect.py, I just set a
5280 workaround).
5284 workaround).
5281
5285
5282 2002-07-08 Fernando Perez <fperez@colorado.edu>
5286 2002-07-08 Fernando Perez <fperez@colorado.edu>
5283
5287
5284 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5288 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5285 __IPYTHON__ in __builtins__ to show up in user_ns.
5289 __IPYTHON__ in __builtins__ to show up in user_ns.
5286
5290
5287 2002-07-03 Fernando Perez <fperez@colorado.edu>
5291 2002-07-03 Fernando Perez <fperez@colorado.edu>
5288
5292
5289 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5293 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5290 name from @gp_set_instance to @gp_set_default.
5294 name from @gp_set_instance to @gp_set_default.
5291
5295
5292 * IPython/ipmaker.py (make_IPython): default editor value set to
5296 * IPython/ipmaker.py (make_IPython): default editor value set to
5293 '0' (a string), to match the rc file. Otherwise will crash when
5297 '0' (a string), to match the rc file. Otherwise will crash when
5294 .strip() is called on it.
5298 .strip() is called on it.
5295
5299
5296
5300
5297 2002-06-28 Fernando Perez <fperez@colorado.edu>
5301 2002-06-28 Fernando Perez <fperez@colorado.edu>
5298
5302
5299 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5303 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5300 of files in current directory when a file is executed via
5304 of files in current directory when a file is executed via
5301 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5305 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5302
5306
5303 * setup.py (manfiles): fix for rpm builds, submitted by RA
5307 * setup.py (manfiles): fix for rpm builds, submitted by RA
5304 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5308 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5305
5309
5306 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5310 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5307 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5311 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5308 string!). A. Schmolck caught this one.
5312 string!). A. Schmolck caught this one.
5309
5313
5310 2002-06-27 Fernando Perez <fperez@colorado.edu>
5314 2002-06-27 Fernando Perez <fperez@colorado.edu>
5311
5315
5312 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5316 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5313 defined files at the cmd line. __name__ wasn't being set to
5317 defined files at the cmd line. __name__ wasn't being set to
5314 __main__.
5318 __main__.
5315
5319
5316 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5320 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5317 regular lists and tuples besides Numeric arrays.
5321 regular lists and tuples besides Numeric arrays.
5318
5322
5319 * IPython/Prompts.py (CachedOutput.__call__): Added output
5323 * IPython/Prompts.py (CachedOutput.__call__): Added output
5320 supression for input ending with ';'. Similar to Mathematica and
5324 supression for input ending with ';'. Similar to Mathematica and
5321 Matlab. The _* vars and Out[] list are still updated, just like
5325 Matlab. The _* vars and Out[] list are still updated, just like
5322 Mathematica behaves.
5326 Mathematica behaves.
5323
5327
5324 2002-06-25 Fernando Perez <fperez@colorado.edu>
5328 2002-06-25 Fernando Perez <fperez@colorado.edu>
5325
5329
5326 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5330 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5327 .ini extensions for profiels under Windows.
5331 .ini extensions for profiels under Windows.
5328
5332
5329 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5333 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5330 string form. Fix contributed by Alexander Schmolck
5334 string form. Fix contributed by Alexander Schmolck
5331 <a.schmolck-AT-gmx.net>
5335 <a.schmolck-AT-gmx.net>
5332
5336
5333 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5337 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5334 pre-configured Gnuplot instance.
5338 pre-configured Gnuplot instance.
5335
5339
5336 2002-06-21 Fernando Perez <fperez@colorado.edu>
5340 2002-06-21 Fernando Perez <fperez@colorado.edu>
5337
5341
5338 * IPython/numutils.py (exp_safe): new function, works around the
5342 * IPython/numutils.py (exp_safe): new function, works around the
5339 underflow problems in Numeric.
5343 underflow problems in Numeric.
5340 (log2): New fn. Safe log in base 2: returns exact integer answer
5344 (log2): New fn. Safe log in base 2: returns exact integer answer
5341 for exact integer powers of 2.
5345 for exact integer powers of 2.
5342
5346
5343 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5347 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5344 properly.
5348 properly.
5345
5349
5346 2002-06-20 Fernando Perez <fperez@colorado.edu>
5350 2002-06-20 Fernando Perez <fperez@colorado.edu>
5347
5351
5348 * IPython/genutils.py (timing): new function like
5352 * IPython/genutils.py (timing): new function like
5349 Mathematica's. Similar to time_test, but returns more info.
5353 Mathematica's. Similar to time_test, but returns more info.
5350
5354
5351 2002-06-18 Fernando Perez <fperez@colorado.edu>
5355 2002-06-18 Fernando Perez <fperez@colorado.edu>
5352
5356
5353 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5357 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5354 according to Mike Heeter's suggestions.
5358 according to Mike Heeter's suggestions.
5355
5359
5356 2002-06-16 Fernando Perez <fperez@colorado.edu>
5360 2002-06-16 Fernando Perez <fperez@colorado.edu>
5357
5361
5358 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5362 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5359 system. GnuplotMagic is gone as a user-directory option. New files
5363 system. GnuplotMagic is gone as a user-directory option. New files
5360 make it easier to use all the gnuplot stuff both from external
5364 make it easier to use all the gnuplot stuff both from external
5361 programs as well as from IPython. Had to rewrite part of
5365 programs as well as from IPython. Had to rewrite part of
5362 hardcopy() b/c of a strange bug: often the ps files simply don't
5366 hardcopy() b/c of a strange bug: often the ps files simply don't
5363 get created, and require a repeat of the command (often several
5367 get created, and require a repeat of the command (often several
5364 times).
5368 times).
5365
5369
5366 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5370 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5367 resolve output channel at call time, so that if sys.stderr has
5371 resolve output channel at call time, so that if sys.stderr has
5368 been redirected by user this gets honored.
5372 been redirected by user this gets honored.
5369
5373
5370 2002-06-13 Fernando Perez <fperez@colorado.edu>
5374 2002-06-13 Fernando Perez <fperez@colorado.edu>
5371
5375
5372 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5376 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5373 IPShell. Kept a copy with the old names to avoid breaking people's
5377 IPShell. Kept a copy with the old names to avoid breaking people's
5374 embedded code.
5378 embedded code.
5375
5379
5376 * IPython/ipython: simplified it to the bare minimum after
5380 * IPython/ipython: simplified it to the bare minimum after
5377 Holger's suggestions. Added info about how to use it in
5381 Holger's suggestions. Added info about how to use it in
5378 PYTHONSTARTUP.
5382 PYTHONSTARTUP.
5379
5383
5380 * IPython/Shell.py (IPythonShell): changed the options passing
5384 * IPython/Shell.py (IPythonShell): changed the options passing
5381 from a string with funky %s replacements to a straight list. Maybe
5385 from a string with funky %s replacements to a straight list. Maybe
5382 a bit more typing, but it follows sys.argv conventions, so there's
5386 a bit more typing, but it follows sys.argv conventions, so there's
5383 less special-casing to remember.
5387 less special-casing to remember.
5384
5388
5385 2002-06-12 Fernando Perez <fperez@colorado.edu>
5389 2002-06-12 Fernando Perez <fperez@colorado.edu>
5386
5390
5387 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5391 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5388 command. Thanks to a suggestion by Mike Heeter.
5392 command. Thanks to a suggestion by Mike Heeter.
5389 (Magic.magic_pfile): added behavior to look at filenames if given
5393 (Magic.magic_pfile): added behavior to look at filenames if given
5390 arg is not a defined object.
5394 arg is not a defined object.
5391 (Magic.magic_save): New @save function to save code snippets. Also
5395 (Magic.magic_save): New @save function to save code snippets. Also
5392 a Mike Heeter idea.
5396 a Mike Heeter idea.
5393
5397
5394 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5398 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5395 plot() and replot(). Much more convenient now, especially for
5399 plot() and replot(). Much more convenient now, especially for
5396 interactive use.
5400 interactive use.
5397
5401
5398 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5402 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5399 filenames.
5403 filenames.
5400
5404
5401 2002-06-02 Fernando Perez <fperez@colorado.edu>
5405 2002-06-02 Fernando Perez <fperez@colorado.edu>
5402
5406
5403 * IPython/Struct.py (Struct.__init__): modified to admit
5407 * IPython/Struct.py (Struct.__init__): modified to admit
5404 initialization via another struct.
5408 initialization via another struct.
5405
5409
5406 * IPython/genutils.py (SystemExec.__init__): New stateful
5410 * IPython/genutils.py (SystemExec.__init__): New stateful
5407 interface to xsys and bq. Useful for writing system scripts.
5411 interface to xsys and bq. Useful for writing system scripts.
5408
5412
5409 2002-05-30 Fernando Perez <fperez@colorado.edu>
5413 2002-05-30 Fernando Perez <fperez@colorado.edu>
5410
5414
5411 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5415 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5412 documents. This will make the user download smaller (it's getting
5416 documents. This will make the user download smaller (it's getting
5413 too big).
5417 too big).
5414
5418
5415 2002-05-29 Fernando Perez <fperez@colorado.edu>
5419 2002-05-29 Fernando Perez <fperez@colorado.edu>
5416
5420
5417 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5421 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5418 fix problems with shelve and pickle. Seems to work, but I don't
5422 fix problems with shelve and pickle. Seems to work, but I don't
5419 know if corner cases break it. Thanks to Mike Heeter
5423 know if corner cases break it. Thanks to Mike Heeter
5420 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5424 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5421
5425
5422 2002-05-24 Fernando Perez <fperez@colorado.edu>
5426 2002-05-24 Fernando Perez <fperez@colorado.edu>
5423
5427
5424 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5428 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5425 macros having broken.
5429 macros having broken.
5426
5430
5427 2002-05-21 Fernando Perez <fperez@colorado.edu>
5431 2002-05-21 Fernando Perez <fperez@colorado.edu>
5428
5432
5429 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5433 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5430 introduced logging bug: all history before logging started was
5434 introduced logging bug: all history before logging started was
5431 being written one character per line! This came from the redesign
5435 being written one character per line! This came from the redesign
5432 of the input history as a special list which slices to strings,
5436 of the input history as a special list which slices to strings,
5433 not to lists.
5437 not to lists.
5434
5438
5435 2002-05-20 Fernando Perez <fperez@colorado.edu>
5439 2002-05-20 Fernando Perez <fperez@colorado.edu>
5436
5440
5437 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5441 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5438 be an attribute of all classes in this module. The design of these
5442 be an attribute of all classes in this module. The design of these
5439 classes needs some serious overhauling.
5443 classes needs some serious overhauling.
5440
5444
5441 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5445 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5442 which was ignoring '_' in option names.
5446 which was ignoring '_' in option names.
5443
5447
5444 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5448 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5445 'Verbose_novars' to 'Context' and made it the new default. It's a
5449 'Verbose_novars' to 'Context' and made it the new default. It's a
5446 bit more readable and also safer than verbose.
5450 bit more readable and also safer than verbose.
5447
5451
5448 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5452 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5449 triple-quoted strings.
5453 triple-quoted strings.
5450
5454
5451 * IPython/OInspect.py (__all__): new module exposing the object
5455 * IPython/OInspect.py (__all__): new module exposing the object
5452 introspection facilities. Now the corresponding magics are dummy
5456 introspection facilities. Now the corresponding magics are dummy
5453 wrappers around this. Having this module will make it much easier
5457 wrappers around this. Having this module will make it much easier
5454 to put these functions into our modified pdb.
5458 to put these functions into our modified pdb.
5455 This new object inspector system uses the new colorizing module,
5459 This new object inspector system uses the new colorizing module,
5456 so source code and other things are nicely syntax highlighted.
5460 so source code and other things are nicely syntax highlighted.
5457
5461
5458 2002-05-18 Fernando Perez <fperez@colorado.edu>
5462 2002-05-18 Fernando Perez <fperez@colorado.edu>
5459
5463
5460 * IPython/ColorANSI.py: Split the coloring tools into a separate
5464 * IPython/ColorANSI.py: Split the coloring tools into a separate
5461 module so I can use them in other code easier (they were part of
5465 module so I can use them in other code easier (they were part of
5462 ultraTB).
5466 ultraTB).
5463
5467
5464 2002-05-17 Fernando Perez <fperez@colorado.edu>
5468 2002-05-17 Fernando Perez <fperez@colorado.edu>
5465
5469
5466 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5470 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5467 fixed it to set the global 'g' also to the called instance, as
5471 fixed it to set the global 'g' also to the called instance, as
5468 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5472 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5469 user's 'g' variables).
5473 user's 'g' variables).
5470
5474
5471 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5475 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5472 global variables (aliases to _ih,_oh) so that users which expect
5476 global variables (aliases to _ih,_oh) so that users which expect
5473 In[5] or Out[7] to work aren't unpleasantly surprised.
5477 In[5] or Out[7] to work aren't unpleasantly surprised.
5474 (InputList.__getslice__): new class to allow executing slices of
5478 (InputList.__getslice__): new class to allow executing slices of
5475 input history directly. Very simple class, complements the use of
5479 input history directly. Very simple class, complements the use of
5476 macros.
5480 macros.
5477
5481
5478 2002-05-16 Fernando Perez <fperez@colorado.edu>
5482 2002-05-16 Fernando Perez <fperez@colorado.edu>
5479
5483
5480 * setup.py (docdirbase): make doc directory be just doc/IPython
5484 * setup.py (docdirbase): make doc directory be just doc/IPython
5481 without version numbers, it will reduce clutter for users.
5485 without version numbers, it will reduce clutter for users.
5482
5486
5483 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5487 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5484 execfile call to prevent possible memory leak. See for details:
5488 execfile call to prevent possible memory leak. See for details:
5485 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5489 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5486
5490
5487 2002-05-15 Fernando Perez <fperez@colorado.edu>
5491 2002-05-15 Fernando Perez <fperez@colorado.edu>
5488
5492
5489 * IPython/Magic.py (Magic.magic_psource): made the object
5493 * IPython/Magic.py (Magic.magic_psource): made the object
5490 introspection names be more standard: pdoc, pdef, pfile and
5494 introspection names be more standard: pdoc, pdef, pfile and
5491 psource. They all print/page their output, and it makes
5495 psource. They all print/page their output, and it makes
5492 remembering them easier. Kept old names for compatibility as
5496 remembering them easier. Kept old names for compatibility as
5493 aliases.
5497 aliases.
5494
5498
5495 2002-05-14 Fernando Perez <fperez@colorado.edu>
5499 2002-05-14 Fernando Perez <fperez@colorado.edu>
5496
5500
5497 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5501 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5498 what the mouse problem was. The trick is to use gnuplot with temp
5502 what the mouse problem was. The trick is to use gnuplot with temp
5499 files and NOT with pipes (for data communication), because having
5503 files and NOT with pipes (for data communication), because having
5500 both pipes and the mouse on is bad news.
5504 both pipes and the mouse on is bad news.
5501
5505
5502 2002-05-13 Fernando Perez <fperez@colorado.edu>
5506 2002-05-13 Fernando Perez <fperez@colorado.edu>
5503
5507
5504 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5508 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5505 bug. Information would be reported about builtins even when
5509 bug. Information would be reported about builtins even when
5506 user-defined functions overrode them.
5510 user-defined functions overrode them.
5507
5511
5508 2002-05-11 Fernando Perez <fperez@colorado.edu>
5512 2002-05-11 Fernando Perez <fperez@colorado.edu>
5509
5513
5510 * IPython/__init__.py (__all__): removed FlexCompleter from
5514 * IPython/__init__.py (__all__): removed FlexCompleter from
5511 __all__ so that things don't fail in platforms without readline.
5515 __all__ so that things don't fail in platforms without readline.
5512
5516
5513 2002-05-10 Fernando Perez <fperez@colorado.edu>
5517 2002-05-10 Fernando Perez <fperez@colorado.edu>
5514
5518
5515 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5519 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5516 it requires Numeric, effectively making Numeric a dependency for
5520 it requires Numeric, effectively making Numeric a dependency for
5517 IPython.
5521 IPython.
5518
5522
5519 * Released 0.2.13
5523 * Released 0.2.13
5520
5524
5521 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5525 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5522 profiler interface. Now all the major options from the profiler
5526 profiler interface. Now all the major options from the profiler
5523 module are directly supported in IPython, both for single
5527 module are directly supported in IPython, both for single
5524 expressions (@prun) and for full programs (@run -p).
5528 expressions (@prun) and for full programs (@run -p).
5525
5529
5526 2002-05-09 Fernando Perez <fperez@colorado.edu>
5530 2002-05-09 Fernando Perez <fperez@colorado.edu>
5527
5531
5528 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5532 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5529 magic properly formatted for screen.
5533 magic properly formatted for screen.
5530
5534
5531 * setup.py (make_shortcut): Changed things to put pdf version in
5535 * setup.py (make_shortcut): Changed things to put pdf version in
5532 doc/ instead of doc/manual (had to change lyxport a bit).
5536 doc/ instead of doc/manual (had to change lyxport a bit).
5533
5537
5534 * IPython/Magic.py (Profile.string_stats): made profile runs go
5538 * IPython/Magic.py (Profile.string_stats): made profile runs go
5535 through pager (they are long and a pager allows searching, saving,
5539 through pager (they are long and a pager allows searching, saving,
5536 etc.)
5540 etc.)
5537
5541
5538 2002-05-08 Fernando Perez <fperez@colorado.edu>
5542 2002-05-08 Fernando Perez <fperez@colorado.edu>
5539
5543
5540 * Released 0.2.12
5544 * Released 0.2.12
5541
5545
5542 2002-05-06 Fernando Perez <fperez@colorado.edu>
5546 2002-05-06 Fernando Perez <fperez@colorado.edu>
5543
5547
5544 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5548 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5545 introduced); 'hist n1 n2' was broken.
5549 introduced); 'hist n1 n2' was broken.
5546 (Magic.magic_pdb): added optional on/off arguments to @pdb
5550 (Magic.magic_pdb): added optional on/off arguments to @pdb
5547 (Magic.magic_run): added option -i to @run, which executes code in
5551 (Magic.magic_run): added option -i to @run, which executes code in
5548 the IPython namespace instead of a clean one. Also added @irun as
5552 the IPython namespace instead of a clean one. Also added @irun as
5549 an alias to @run -i.
5553 an alias to @run -i.
5550
5554
5551 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5555 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5552 fixed (it didn't really do anything, the namespaces were wrong).
5556 fixed (it didn't really do anything, the namespaces were wrong).
5553
5557
5554 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5558 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5555
5559
5556 * IPython/__init__.py (__all__): Fixed package namespace, now
5560 * IPython/__init__.py (__all__): Fixed package namespace, now
5557 'import IPython' does give access to IPython.<all> as
5561 'import IPython' does give access to IPython.<all> as
5558 expected. Also renamed __release__ to Release.
5562 expected. Also renamed __release__ to Release.
5559
5563
5560 * IPython/Debugger.py (__license__): created new Pdb class which
5564 * IPython/Debugger.py (__license__): created new Pdb class which
5561 functions like a drop-in for the normal pdb.Pdb but does NOT
5565 functions like a drop-in for the normal pdb.Pdb but does NOT
5562 import readline by default. This way it doesn't muck up IPython's
5566 import readline by default. This way it doesn't muck up IPython's
5563 readline handling, and now tab-completion finally works in the
5567 readline handling, and now tab-completion finally works in the
5564 debugger -- sort of. It completes things globally visible, but the
5568 debugger -- sort of. It completes things globally visible, but the
5565 completer doesn't track the stack as pdb walks it. That's a bit
5569 completer doesn't track the stack as pdb walks it. That's a bit
5566 tricky, and I'll have to implement it later.
5570 tricky, and I'll have to implement it later.
5567
5571
5568 2002-05-05 Fernando Perez <fperez@colorado.edu>
5572 2002-05-05 Fernando Perez <fperez@colorado.edu>
5569
5573
5570 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5574 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5571 magic docstrings when printed via ? (explicit \'s were being
5575 magic docstrings when printed via ? (explicit \'s were being
5572 printed).
5576 printed).
5573
5577
5574 * IPython/ipmaker.py (make_IPython): fixed namespace
5578 * IPython/ipmaker.py (make_IPython): fixed namespace
5575 identification bug. Now variables loaded via logs or command-line
5579 identification bug. Now variables loaded via logs or command-line
5576 files are recognized in the interactive namespace by @who.
5580 files are recognized in the interactive namespace by @who.
5577
5581
5578 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5582 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5579 log replay system stemming from the string form of Structs.
5583 log replay system stemming from the string form of Structs.
5580
5584
5581 * IPython/Magic.py (Macro.__init__): improved macros to properly
5585 * IPython/Magic.py (Macro.__init__): improved macros to properly
5582 handle magic commands in them.
5586 handle magic commands in them.
5583 (Magic.magic_logstart): usernames are now expanded so 'logstart
5587 (Magic.magic_logstart): usernames are now expanded so 'logstart
5584 ~/mylog' now works.
5588 ~/mylog' now works.
5585
5589
5586 * IPython/iplib.py (complete): fixed bug where paths starting with
5590 * IPython/iplib.py (complete): fixed bug where paths starting with
5587 '/' would be completed as magic names.
5591 '/' would be completed as magic names.
5588
5592
5589 2002-05-04 Fernando Perez <fperez@colorado.edu>
5593 2002-05-04 Fernando Perez <fperez@colorado.edu>
5590
5594
5591 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5595 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5592 allow running full programs under the profiler's control.
5596 allow running full programs under the profiler's control.
5593
5597
5594 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5598 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5595 mode to report exceptions verbosely but without formatting
5599 mode to report exceptions verbosely but without formatting
5596 variables. This addresses the issue of ipython 'freezing' (it's
5600 variables. This addresses the issue of ipython 'freezing' (it's
5597 not frozen, but caught in an expensive formatting loop) when huge
5601 not frozen, but caught in an expensive formatting loop) when huge
5598 variables are in the context of an exception.
5602 variables are in the context of an exception.
5599 (VerboseTB.text): Added '--->' markers at line where exception was
5603 (VerboseTB.text): Added '--->' markers at line where exception was
5600 triggered. Much clearer to read, especially in NoColor modes.
5604 triggered. Much clearer to read, especially in NoColor modes.
5601
5605
5602 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5606 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5603 implemented in reverse when changing to the new parse_options().
5607 implemented in reverse when changing to the new parse_options().
5604
5608
5605 2002-05-03 Fernando Perez <fperez@colorado.edu>
5609 2002-05-03 Fernando Perez <fperez@colorado.edu>
5606
5610
5607 * IPython/Magic.py (Magic.parse_options): new function so that
5611 * IPython/Magic.py (Magic.parse_options): new function so that
5608 magics can parse options easier.
5612 magics can parse options easier.
5609 (Magic.magic_prun): new function similar to profile.run(),
5613 (Magic.magic_prun): new function similar to profile.run(),
5610 suggested by Chris Hart.
5614 suggested by Chris Hart.
5611 (Magic.magic_cd): fixed behavior so that it only changes if
5615 (Magic.magic_cd): fixed behavior so that it only changes if
5612 directory actually is in history.
5616 directory actually is in history.
5613
5617
5614 * IPython/usage.py (__doc__): added information about potential
5618 * IPython/usage.py (__doc__): added information about potential
5615 slowness of Verbose exception mode when there are huge data
5619 slowness of Verbose exception mode when there are huge data
5616 structures to be formatted (thanks to Archie Paulson).
5620 structures to be formatted (thanks to Archie Paulson).
5617
5621
5618 * IPython/ipmaker.py (make_IPython): Changed default logging
5622 * IPython/ipmaker.py (make_IPython): Changed default logging
5619 (when simply called with -log) to use curr_dir/ipython.log in
5623 (when simply called with -log) to use curr_dir/ipython.log in
5620 rotate mode. Fixed crash which was occuring with -log before
5624 rotate mode. Fixed crash which was occuring with -log before
5621 (thanks to Jim Boyle).
5625 (thanks to Jim Boyle).
5622
5626
5623 2002-05-01 Fernando Perez <fperez@colorado.edu>
5627 2002-05-01 Fernando Perez <fperez@colorado.edu>
5624
5628
5625 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5629 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5626 was nasty -- though somewhat of a corner case).
5630 was nasty -- though somewhat of a corner case).
5627
5631
5628 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5632 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5629 text (was a bug).
5633 text (was a bug).
5630
5634
5631 2002-04-30 Fernando Perez <fperez@colorado.edu>
5635 2002-04-30 Fernando Perez <fperez@colorado.edu>
5632
5636
5633 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5637 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5634 a print after ^D or ^C from the user so that the In[] prompt
5638 a print after ^D or ^C from the user so that the In[] prompt
5635 doesn't over-run the gnuplot one.
5639 doesn't over-run the gnuplot one.
5636
5640
5637 2002-04-29 Fernando Perez <fperez@colorado.edu>
5641 2002-04-29 Fernando Perez <fperez@colorado.edu>
5638
5642
5639 * Released 0.2.10
5643 * Released 0.2.10
5640
5644
5641 * IPython/__release__.py (version): get date dynamically.
5645 * IPython/__release__.py (version): get date dynamically.
5642
5646
5643 * Misc. documentation updates thanks to Arnd's comments. Also ran
5647 * Misc. documentation updates thanks to Arnd's comments. Also ran
5644 a full spellcheck on the manual (hadn't been done in a while).
5648 a full spellcheck on the manual (hadn't been done in a while).
5645
5649
5646 2002-04-27 Fernando Perez <fperez@colorado.edu>
5650 2002-04-27 Fernando Perez <fperez@colorado.edu>
5647
5651
5648 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5652 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5649 starting a log in mid-session would reset the input history list.
5653 starting a log in mid-session would reset the input history list.
5650
5654
5651 2002-04-26 Fernando Perez <fperez@colorado.edu>
5655 2002-04-26 Fernando Perez <fperez@colorado.edu>
5652
5656
5653 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5657 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5654 all files were being included in an update. Now anything in
5658 all files were being included in an update. Now anything in
5655 UserConfig that matches [A-Za-z]*.py will go (this excludes
5659 UserConfig that matches [A-Za-z]*.py will go (this excludes
5656 __init__.py)
5660 __init__.py)
5657
5661
5658 2002-04-25 Fernando Perez <fperez@colorado.edu>
5662 2002-04-25 Fernando Perez <fperez@colorado.edu>
5659
5663
5660 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5664 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5661 to __builtins__ so that any form of embedded or imported code can
5665 to __builtins__ so that any form of embedded or imported code can
5662 test for being inside IPython.
5666 test for being inside IPython.
5663
5667
5664 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5668 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5665 changed to GnuplotMagic because it's now an importable module,
5669 changed to GnuplotMagic because it's now an importable module,
5666 this makes the name follow that of the standard Gnuplot module.
5670 this makes the name follow that of the standard Gnuplot module.
5667 GnuplotMagic can now be loaded at any time in mid-session.
5671 GnuplotMagic can now be loaded at any time in mid-session.
5668
5672
5669 2002-04-24 Fernando Perez <fperez@colorado.edu>
5673 2002-04-24 Fernando Perez <fperez@colorado.edu>
5670
5674
5671 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5675 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5672 the globals (IPython has its own namespace) and the
5676 the globals (IPython has its own namespace) and the
5673 PhysicalQuantity stuff is much better anyway.
5677 PhysicalQuantity stuff is much better anyway.
5674
5678
5675 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5679 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5676 embedding example to standard user directory for
5680 embedding example to standard user directory for
5677 distribution. Also put it in the manual.
5681 distribution. Also put it in the manual.
5678
5682
5679 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5683 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5680 instance as first argument (so it doesn't rely on some obscure
5684 instance as first argument (so it doesn't rely on some obscure
5681 hidden global).
5685 hidden global).
5682
5686
5683 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5687 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5684 delimiters. While it prevents ().TAB from working, it allows
5688 delimiters. While it prevents ().TAB from working, it allows
5685 completions in open (... expressions. This is by far a more common
5689 completions in open (... expressions. This is by far a more common
5686 case.
5690 case.
5687
5691
5688 2002-04-23 Fernando Perez <fperez@colorado.edu>
5692 2002-04-23 Fernando Perez <fperez@colorado.edu>
5689
5693
5690 * IPython/Extensions/InterpreterPasteInput.py: new
5694 * IPython/Extensions/InterpreterPasteInput.py: new
5691 syntax-processing module for pasting lines with >>> or ... at the
5695 syntax-processing module for pasting lines with >>> or ... at the
5692 start.
5696 start.
5693
5697
5694 * IPython/Extensions/PhysicalQ_Interactive.py
5698 * IPython/Extensions/PhysicalQ_Interactive.py
5695 (PhysicalQuantityInteractive.__int__): fixed to work with either
5699 (PhysicalQuantityInteractive.__int__): fixed to work with either
5696 Numeric or math.
5700 Numeric or math.
5697
5701
5698 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5702 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5699 provided profiles. Now we have:
5703 provided profiles. Now we have:
5700 -math -> math module as * and cmath with its own namespace.
5704 -math -> math module as * and cmath with its own namespace.
5701 -numeric -> Numeric as *, plus gnuplot & grace
5705 -numeric -> Numeric as *, plus gnuplot & grace
5702 -physics -> same as before
5706 -physics -> same as before
5703
5707
5704 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5708 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5705 user-defined magics wouldn't be found by @magic if they were
5709 user-defined magics wouldn't be found by @magic if they were
5706 defined as class methods. Also cleaned up the namespace search
5710 defined as class methods. Also cleaned up the namespace search
5707 logic and the string building (to use %s instead of many repeated
5711 logic and the string building (to use %s instead of many repeated
5708 string adds).
5712 string adds).
5709
5713
5710 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5714 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5711 of user-defined magics to operate with class methods (cleaner, in
5715 of user-defined magics to operate with class methods (cleaner, in
5712 line with the gnuplot code).
5716 line with the gnuplot code).
5713
5717
5714 2002-04-22 Fernando Perez <fperez@colorado.edu>
5718 2002-04-22 Fernando Perez <fperez@colorado.edu>
5715
5719
5716 * setup.py: updated dependency list so that manual is updated when
5720 * setup.py: updated dependency list so that manual is updated when
5717 all included files change.
5721 all included files change.
5718
5722
5719 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5723 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5720 the delimiter removal option (the fix is ugly right now).
5724 the delimiter removal option (the fix is ugly right now).
5721
5725
5722 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5726 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5723 all of the math profile (quicker loading, no conflict between
5727 all of the math profile (quicker loading, no conflict between
5724 g-9.8 and g-gnuplot).
5728 g-9.8 and g-gnuplot).
5725
5729
5726 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5730 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5727 name of post-mortem files to IPython_crash_report.txt.
5731 name of post-mortem files to IPython_crash_report.txt.
5728
5732
5729 * Cleanup/update of the docs. Added all the new readline info and
5733 * Cleanup/update of the docs. Added all the new readline info and
5730 formatted all lists as 'real lists'.
5734 formatted all lists as 'real lists'.
5731
5735
5732 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5736 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5733 tab-completion options, since the full readline parse_and_bind is
5737 tab-completion options, since the full readline parse_and_bind is
5734 now accessible.
5738 now accessible.
5735
5739
5736 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5740 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5737 handling of readline options. Now users can specify any string to
5741 handling of readline options. Now users can specify any string to
5738 be passed to parse_and_bind(), as well as the delimiters to be
5742 be passed to parse_and_bind(), as well as the delimiters to be
5739 removed.
5743 removed.
5740 (InteractiveShell.__init__): Added __name__ to the global
5744 (InteractiveShell.__init__): Added __name__ to the global
5741 namespace so that things like Itpl which rely on its existence
5745 namespace so that things like Itpl which rely on its existence
5742 don't crash.
5746 don't crash.
5743 (InteractiveShell._prefilter): Defined the default with a _ so
5747 (InteractiveShell._prefilter): Defined the default with a _ so
5744 that prefilter() is easier to override, while the default one
5748 that prefilter() is easier to override, while the default one
5745 remains available.
5749 remains available.
5746
5750
5747 2002-04-18 Fernando Perez <fperez@colorado.edu>
5751 2002-04-18 Fernando Perez <fperez@colorado.edu>
5748
5752
5749 * Added information about pdb in the docs.
5753 * Added information about pdb in the docs.
5750
5754
5751 2002-04-17 Fernando Perez <fperez@colorado.edu>
5755 2002-04-17 Fernando Perez <fperez@colorado.edu>
5752
5756
5753 * IPython/ipmaker.py (make_IPython): added rc_override option to
5757 * IPython/ipmaker.py (make_IPython): added rc_override option to
5754 allow passing config options at creation time which may override
5758 allow passing config options at creation time which may override
5755 anything set in the config files or command line. This is
5759 anything set in the config files or command line. This is
5756 particularly useful for configuring embedded instances.
5760 particularly useful for configuring embedded instances.
5757
5761
5758 2002-04-15 Fernando Perez <fperez@colorado.edu>
5762 2002-04-15 Fernando Perez <fperez@colorado.edu>
5759
5763
5760 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5764 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5761 crash embedded instances because of the input cache falling out of
5765 crash embedded instances because of the input cache falling out of
5762 sync with the output counter.
5766 sync with the output counter.
5763
5767
5764 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5768 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5765 mode which calls pdb after an uncaught exception in IPython itself.
5769 mode which calls pdb after an uncaught exception in IPython itself.
5766
5770
5767 2002-04-14 Fernando Perez <fperez@colorado.edu>
5771 2002-04-14 Fernando Perez <fperez@colorado.edu>
5768
5772
5769 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5773 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5770 readline, fix it back after each call.
5774 readline, fix it back after each call.
5771
5775
5772 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5776 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5773 method to force all access via __call__(), which guarantees that
5777 method to force all access via __call__(), which guarantees that
5774 traceback references are properly deleted.
5778 traceback references are properly deleted.
5775
5779
5776 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5780 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5777 improve printing when pprint is in use.
5781 improve printing when pprint is in use.
5778
5782
5779 2002-04-13 Fernando Perez <fperez@colorado.edu>
5783 2002-04-13 Fernando Perez <fperez@colorado.edu>
5780
5784
5781 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5785 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5782 exceptions aren't caught anymore. If the user triggers one, he
5786 exceptions aren't caught anymore. If the user triggers one, he
5783 should know why he's doing it and it should go all the way up,
5787 should know why he's doing it and it should go all the way up,
5784 just like any other exception. So now @abort will fully kill the
5788 just like any other exception. So now @abort will fully kill the
5785 embedded interpreter and the embedding code (unless that happens
5789 embedded interpreter and the embedding code (unless that happens
5786 to catch SystemExit).
5790 to catch SystemExit).
5787
5791
5788 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5792 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5789 and a debugger() method to invoke the interactive pdb debugger
5793 and a debugger() method to invoke the interactive pdb debugger
5790 after printing exception information. Also added the corresponding
5794 after printing exception information. Also added the corresponding
5791 -pdb option and @pdb magic to control this feature, and updated
5795 -pdb option and @pdb magic to control this feature, and updated
5792 the docs. After a suggestion from Christopher Hart
5796 the docs. After a suggestion from Christopher Hart
5793 (hart-AT-caltech.edu).
5797 (hart-AT-caltech.edu).
5794
5798
5795 2002-04-12 Fernando Perez <fperez@colorado.edu>
5799 2002-04-12 Fernando Perez <fperez@colorado.edu>
5796
5800
5797 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5801 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5798 the exception handlers defined by the user (not the CrashHandler)
5802 the exception handlers defined by the user (not the CrashHandler)
5799 so that user exceptions don't trigger an ipython bug report.
5803 so that user exceptions don't trigger an ipython bug report.
5800
5804
5801 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5805 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5802 configurable (it should have always been so).
5806 configurable (it should have always been so).
5803
5807
5804 2002-03-26 Fernando Perez <fperez@colorado.edu>
5808 2002-03-26 Fernando Perez <fperez@colorado.edu>
5805
5809
5806 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5810 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5807 and there to fix embedding namespace issues. This should all be
5811 and there to fix embedding namespace issues. This should all be
5808 done in a more elegant way.
5812 done in a more elegant way.
5809
5813
5810 2002-03-25 Fernando Perez <fperez@colorado.edu>
5814 2002-03-25 Fernando Perez <fperez@colorado.edu>
5811
5815
5812 * IPython/genutils.py (get_home_dir): Try to make it work under
5816 * IPython/genutils.py (get_home_dir): Try to make it work under
5813 win9x also.
5817 win9x also.
5814
5818
5815 2002-03-20 Fernando Perez <fperez@colorado.edu>
5819 2002-03-20 Fernando Perez <fperez@colorado.edu>
5816
5820
5817 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5821 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5818 sys.displayhook untouched upon __init__.
5822 sys.displayhook untouched upon __init__.
5819
5823
5820 2002-03-19 Fernando Perez <fperez@colorado.edu>
5824 2002-03-19 Fernando Perez <fperez@colorado.edu>
5821
5825
5822 * Released 0.2.9 (for embedding bug, basically).
5826 * Released 0.2.9 (for embedding bug, basically).
5823
5827
5824 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5828 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5825 exceptions so that enclosing shell's state can be restored.
5829 exceptions so that enclosing shell's state can be restored.
5826
5830
5827 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5831 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5828 naming conventions in the .ipython/ dir.
5832 naming conventions in the .ipython/ dir.
5829
5833
5830 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5834 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5831 from delimiters list so filenames with - in them get expanded.
5835 from delimiters list so filenames with - in them get expanded.
5832
5836
5833 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5837 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5834 sys.displayhook not being properly restored after an embedded call.
5838 sys.displayhook not being properly restored after an embedded call.
5835
5839
5836 2002-03-18 Fernando Perez <fperez@colorado.edu>
5840 2002-03-18 Fernando Perez <fperez@colorado.edu>
5837
5841
5838 * Released 0.2.8
5842 * Released 0.2.8
5839
5843
5840 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5844 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5841 some files weren't being included in a -upgrade.
5845 some files weren't being included in a -upgrade.
5842 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5846 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5843 on' so that the first tab completes.
5847 on' so that the first tab completes.
5844 (InteractiveShell.handle_magic): fixed bug with spaces around
5848 (InteractiveShell.handle_magic): fixed bug with spaces around
5845 quotes breaking many magic commands.
5849 quotes breaking many magic commands.
5846
5850
5847 * setup.py: added note about ignoring the syntax error messages at
5851 * setup.py: added note about ignoring the syntax error messages at
5848 installation.
5852 installation.
5849
5853
5850 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5854 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5851 streamlining the gnuplot interface, now there's only one magic @gp.
5855 streamlining the gnuplot interface, now there's only one magic @gp.
5852
5856
5853 2002-03-17 Fernando Perez <fperez@colorado.edu>
5857 2002-03-17 Fernando Perez <fperez@colorado.edu>
5854
5858
5855 * IPython/UserConfig/magic_gnuplot.py: new name for the
5859 * IPython/UserConfig/magic_gnuplot.py: new name for the
5856 example-magic_pm.py file. Much enhanced system, now with a shell
5860 example-magic_pm.py file. Much enhanced system, now with a shell
5857 for communicating directly with gnuplot, one command at a time.
5861 for communicating directly with gnuplot, one command at a time.
5858
5862
5859 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5863 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5860 setting __name__=='__main__'.
5864 setting __name__=='__main__'.
5861
5865
5862 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5866 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5863 mini-shell for accessing gnuplot from inside ipython. Should
5867 mini-shell for accessing gnuplot from inside ipython. Should
5864 extend it later for grace access too. Inspired by Arnd's
5868 extend it later for grace access too. Inspired by Arnd's
5865 suggestion.
5869 suggestion.
5866
5870
5867 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5871 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5868 calling magic functions with () in their arguments. Thanks to Arnd
5872 calling magic functions with () in their arguments. Thanks to Arnd
5869 Baecker for pointing this to me.
5873 Baecker for pointing this to me.
5870
5874
5871 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5875 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5872 infinitely for integer or complex arrays (only worked with floats).
5876 infinitely for integer or complex arrays (only worked with floats).
5873
5877
5874 2002-03-16 Fernando Perez <fperez@colorado.edu>
5878 2002-03-16 Fernando Perez <fperez@colorado.edu>
5875
5879
5876 * setup.py: Merged setup and setup_windows into a single script
5880 * setup.py: Merged setup and setup_windows into a single script
5877 which properly handles things for windows users.
5881 which properly handles things for windows users.
5878
5882
5879 2002-03-15 Fernando Perez <fperez@colorado.edu>
5883 2002-03-15 Fernando Perez <fperez@colorado.edu>
5880
5884
5881 * Big change to the manual: now the magics are all automatically
5885 * Big change to the manual: now the magics are all automatically
5882 documented. This information is generated from their docstrings
5886 documented. This information is generated from their docstrings
5883 and put in a latex file included by the manual lyx file. This way
5887 and put in a latex file included by the manual lyx file. This way
5884 we get always up to date information for the magics. The manual
5888 we get always up to date information for the magics. The manual
5885 now also has proper version information, also auto-synced.
5889 now also has proper version information, also auto-synced.
5886
5890
5887 For this to work, an undocumented --magic_docstrings option was added.
5891 For this to work, an undocumented --magic_docstrings option was added.
5888
5892
5889 2002-03-13 Fernando Perez <fperez@colorado.edu>
5893 2002-03-13 Fernando Perez <fperez@colorado.edu>
5890
5894
5891 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5895 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5892 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5896 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5893
5897
5894 2002-03-12 Fernando Perez <fperez@colorado.edu>
5898 2002-03-12 Fernando Perez <fperez@colorado.edu>
5895
5899
5896 * IPython/ultraTB.py (TermColors): changed color escapes again to
5900 * IPython/ultraTB.py (TermColors): changed color escapes again to
5897 fix the (old, reintroduced) line-wrapping bug. Basically, if
5901 fix the (old, reintroduced) line-wrapping bug. Basically, if
5898 \001..\002 aren't given in the color escapes, lines get wrapped
5902 \001..\002 aren't given in the color escapes, lines get wrapped
5899 weirdly. But giving those screws up old xterms and emacs terms. So
5903 weirdly. But giving those screws up old xterms and emacs terms. So
5900 I added some logic for emacs terms to be ok, but I can't identify old
5904 I added some logic for emacs terms to be ok, but I can't identify old
5901 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5905 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5902
5906
5903 2002-03-10 Fernando Perez <fperez@colorado.edu>
5907 2002-03-10 Fernando Perez <fperez@colorado.edu>
5904
5908
5905 * IPython/usage.py (__doc__): Various documentation cleanups and
5909 * IPython/usage.py (__doc__): Various documentation cleanups and
5906 updates, both in usage docstrings and in the manual.
5910 updates, both in usage docstrings and in the manual.
5907
5911
5908 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5912 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5909 handling of caching. Set minimum acceptabe value for having a
5913 handling of caching. Set minimum acceptabe value for having a
5910 cache at 20 values.
5914 cache at 20 values.
5911
5915
5912 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5916 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5913 install_first_time function to a method, renamed it and added an
5917 install_first_time function to a method, renamed it and added an
5914 'upgrade' mode. Now people can update their config directory with
5918 'upgrade' mode. Now people can update their config directory with
5915 a simple command line switch (-upgrade, also new).
5919 a simple command line switch (-upgrade, also new).
5916
5920
5917 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5921 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5918 @file (convenient for automagic users under Python >= 2.2).
5922 @file (convenient for automagic users under Python >= 2.2).
5919 Removed @files (it seemed more like a plural than an abbrev. of
5923 Removed @files (it seemed more like a plural than an abbrev. of
5920 'file show').
5924 'file show').
5921
5925
5922 * IPython/iplib.py (install_first_time): Fixed crash if there were
5926 * IPython/iplib.py (install_first_time): Fixed crash if there were
5923 backup files ('~') in .ipython/ install directory.
5927 backup files ('~') in .ipython/ install directory.
5924
5928
5925 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5929 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5926 system. Things look fine, but these changes are fairly
5930 system. Things look fine, but these changes are fairly
5927 intrusive. Test them for a few days.
5931 intrusive. Test them for a few days.
5928
5932
5929 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5933 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5930 the prompts system. Now all in/out prompt strings are user
5934 the prompts system. Now all in/out prompt strings are user
5931 controllable. This is particularly useful for embedding, as one
5935 controllable. This is particularly useful for embedding, as one
5932 can tag embedded instances with particular prompts.
5936 can tag embedded instances with particular prompts.
5933
5937
5934 Also removed global use of sys.ps1/2, which now allows nested
5938 Also removed global use of sys.ps1/2, which now allows nested
5935 embeddings without any problems. Added command-line options for
5939 embeddings without any problems. Added command-line options for
5936 the prompt strings.
5940 the prompt strings.
5937
5941
5938 2002-03-08 Fernando Perez <fperez@colorado.edu>
5942 2002-03-08 Fernando Perez <fperez@colorado.edu>
5939
5943
5940 * IPython/UserConfig/example-embed-short.py (ipshell): added
5944 * IPython/UserConfig/example-embed-short.py (ipshell): added
5941 example file with the bare minimum code for embedding.
5945 example file with the bare minimum code for embedding.
5942
5946
5943 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5947 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5944 functionality for the embeddable shell to be activated/deactivated
5948 functionality for the embeddable shell to be activated/deactivated
5945 either globally or at each call.
5949 either globally or at each call.
5946
5950
5947 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5951 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5948 rewriting the prompt with '--->' for auto-inputs with proper
5952 rewriting the prompt with '--->' for auto-inputs with proper
5949 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5953 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5950 this is handled by the prompts class itself, as it should.
5954 this is handled by the prompts class itself, as it should.
5951
5955
5952 2002-03-05 Fernando Perez <fperez@colorado.edu>
5956 2002-03-05 Fernando Perez <fperez@colorado.edu>
5953
5957
5954 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5958 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5955 @logstart to avoid name clashes with the math log function.
5959 @logstart to avoid name clashes with the math log function.
5956
5960
5957 * Big updates to X/Emacs section of the manual.
5961 * Big updates to X/Emacs section of the manual.
5958
5962
5959 * Removed ipython_emacs. Milan explained to me how to pass
5963 * Removed ipython_emacs. Milan explained to me how to pass
5960 arguments to ipython through Emacs. Some day I'm going to end up
5964 arguments to ipython through Emacs. Some day I'm going to end up
5961 learning some lisp...
5965 learning some lisp...
5962
5966
5963 2002-03-04 Fernando Perez <fperez@colorado.edu>
5967 2002-03-04 Fernando Perez <fperez@colorado.edu>
5964
5968
5965 * IPython/ipython_emacs: Created script to be used as the
5969 * IPython/ipython_emacs: Created script to be used as the
5966 py-python-command Emacs variable so we can pass IPython
5970 py-python-command Emacs variable so we can pass IPython
5967 parameters. I can't figure out how to tell Emacs directly to pass
5971 parameters. I can't figure out how to tell Emacs directly to pass
5968 parameters to IPython, so a dummy shell script will do it.
5972 parameters to IPython, so a dummy shell script will do it.
5969
5973
5970 Other enhancements made for things to work better under Emacs'
5974 Other enhancements made for things to work better under Emacs'
5971 various types of terminals. Many thanks to Milan Zamazal
5975 various types of terminals. Many thanks to Milan Zamazal
5972 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5976 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5973
5977
5974 2002-03-01 Fernando Perez <fperez@colorado.edu>
5978 2002-03-01 Fernando Perez <fperez@colorado.edu>
5975
5979
5976 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5980 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5977 that loading of readline is now optional. This gives better
5981 that loading of readline is now optional. This gives better
5978 control to emacs users.
5982 control to emacs users.
5979
5983
5980 * IPython/ultraTB.py (__date__): Modified color escape sequences
5984 * IPython/ultraTB.py (__date__): Modified color escape sequences
5981 and now things work fine under xterm and in Emacs' term buffers
5985 and now things work fine under xterm and in Emacs' term buffers
5982 (though not shell ones). Well, in emacs you get colors, but all
5986 (though not shell ones). Well, in emacs you get colors, but all
5983 seem to be 'light' colors (no difference between dark and light
5987 seem to be 'light' colors (no difference between dark and light
5984 ones). But the garbage chars are gone, and also in xterms. It
5988 ones). But the garbage chars are gone, and also in xterms. It
5985 seems that now I'm using 'cleaner' ansi sequences.
5989 seems that now I'm using 'cleaner' ansi sequences.
5986
5990
5987 2002-02-21 Fernando Perez <fperez@colorado.edu>
5991 2002-02-21 Fernando Perez <fperez@colorado.edu>
5988
5992
5989 * Released 0.2.7 (mainly to publish the scoping fix).
5993 * Released 0.2.7 (mainly to publish the scoping fix).
5990
5994
5991 * IPython/Logger.py (Logger.logstate): added. A corresponding
5995 * IPython/Logger.py (Logger.logstate): added. A corresponding
5992 @logstate magic was created.
5996 @logstate magic was created.
5993
5997
5994 * IPython/Magic.py: fixed nested scoping problem under Python
5998 * IPython/Magic.py: fixed nested scoping problem under Python
5995 2.1.x (automagic wasn't working).
5999 2.1.x (automagic wasn't working).
5996
6000
5997 2002-02-20 Fernando Perez <fperez@colorado.edu>
6001 2002-02-20 Fernando Perez <fperez@colorado.edu>
5998
6002
5999 * Released 0.2.6.
6003 * Released 0.2.6.
6000
6004
6001 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6005 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6002 option so that logs can come out without any headers at all.
6006 option so that logs can come out without any headers at all.
6003
6007
6004 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6008 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6005 SciPy.
6009 SciPy.
6006
6010
6007 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6011 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6008 that embedded IPython calls don't require vars() to be explicitly
6012 that embedded IPython calls don't require vars() to be explicitly
6009 passed. Now they are extracted from the caller's frame (code
6013 passed. Now they are extracted from the caller's frame (code
6010 snatched from Eric Jones' weave). Added better documentation to
6014 snatched from Eric Jones' weave). Added better documentation to
6011 the section on embedding and the example file.
6015 the section on embedding and the example file.
6012
6016
6013 * IPython/genutils.py (page): Changed so that under emacs, it just
6017 * IPython/genutils.py (page): Changed so that under emacs, it just
6014 prints the string. You can then page up and down in the emacs
6018 prints the string. You can then page up and down in the emacs
6015 buffer itself. This is how the builtin help() works.
6019 buffer itself. This is how the builtin help() works.
6016
6020
6017 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6021 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6018 macro scoping: macros need to be executed in the user's namespace
6022 macro scoping: macros need to be executed in the user's namespace
6019 to work as if they had been typed by the user.
6023 to work as if they had been typed by the user.
6020
6024
6021 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6025 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6022 execute automatically (no need to type 'exec...'). They then
6026 execute automatically (no need to type 'exec...'). They then
6023 behave like 'true macros'. The printing system was also modified
6027 behave like 'true macros'. The printing system was also modified
6024 for this to work.
6028 for this to work.
6025
6029
6026 2002-02-19 Fernando Perez <fperez@colorado.edu>
6030 2002-02-19 Fernando Perez <fperez@colorado.edu>
6027
6031
6028 * IPython/genutils.py (page_file): new function for paging files
6032 * IPython/genutils.py (page_file): new function for paging files
6029 in an OS-independent way. Also necessary for file viewing to work
6033 in an OS-independent way. Also necessary for file viewing to work
6030 well inside Emacs buffers.
6034 well inside Emacs buffers.
6031 (page): Added checks for being in an emacs buffer.
6035 (page): Added checks for being in an emacs buffer.
6032 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6036 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6033 same bug in iplib.
6037 same bug in iplib.
6034
6038
6035 2002-02-18 Fernando Perez <fperez@colorado.edu>
6039 2002-02-18 Fernando Perez <fperez@colorado.edu>
6036
6040
6037 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6041 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6038 of readline so that IPython can work inside an Emacs buffer.
6042 of readline so that IPython can work inside an Emacs buffer.
6039
6043
6040 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6044 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6041 method signatures (they weren't really bugs, but it looks cleaner
6045 method signatures (they weren't really bugs, but it looks cleaner
6042 and keeps PyChecker happy).
6046 and keeps PyChecker happy).
6043
6047
6044 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6048 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6045 for implementing various user-defined hooks. Currently only
6049 for implementing various user-defined hooks. Currently only
6046 display is done.
6050 display is done.
6047
6051
6048 * IPython/Prompts.py (CachedOutput._display): changed display
6052 * IPython/Prompts.py (CachedOutput._display): changed display
6049 functions so that they can be dynamically changed by users easily.
6053 functions so that they can be dynamically changed by users easily.
6050
6054
6051 * IPython/Extensions/numeric_formats.py (num_display): added an
6055 * IPython/Extensions/numeric_formats.py (num_display): added an
6052 extension for printing NumPy arrays in flexible manners. It
6056 extension for printing NumPy arrays in flexible manners. It
6053 doesn't do anything yet, but all the structure is in
6057 doesn't do anything yet, but all the structure is in
6054 place. Ultimately the plan is to implement output format control
6058 place. Ultimately the plan is to implement output format control
6055 like in Octave.
6059 like in Octave.
6056
6060
6057 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6061 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6058 methods are found at run-time by all the automatic machinery.
6062 methods are found at run-time by all the automatic machinery.
6059
6063
6060 2002-02-17 Fernando Perez <fperez@colorado.edu>
6064 2002-02-17 Fernando Perez <fperez@colorado.edu>
6061
6065
6062 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6066 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6063 whole file a little.
6067 whole file a little.
6064
6068
6065 * ToDo: closed this document. Now there's a new_design.lyx
6069 * ToDo: closed this document. Now there's a new_design.lyx
6066 document for all new ideas. Added making a pdf of it for the
6070 document for all new ideas. Added making a pdf of it for the
6067 end-user distro.
6071 end-user distro.
6068
6072
6069 * IPython/Logger.py (Logger.switch_log): Created this to replace
6073 * IPython/Logger.py (Logger.switch_log): Created this to replace
6070 logon() and logoff(). It also fixes a nasty crash reported by
6074 logon() and logoff(). It also fixes a nasty crash reported by
6071 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6075 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6072
6076
6073 * IPython/iplib.py (complete): got auto-completion to work with
6077 * IPython/iplib.py (complete): got auto-completion to work with
6074 automagic (I had wanted this for a long time).
6078 automagic (I had wanted this for a long time).
6075
6079
6076 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6080 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6077 to @file, since file() is now a builtin and clashes with automagic
6081 to @file, since file() is now a builtin and clashes with automagic
6078 for @file.
6082 for @file.
6079
6083
6080 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6084 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6081 of this was previously in iplib, which had grown to more than 2000
6085 of this was previously in iplib, which had grown to more than 2000
6082 lines, way too long. No new functionality, but it makes managing
6086 lines, way too long. No new functionality, but it makes managing
6083 the code a bit easier.
6087 the code a bit easier.
6084
6088
6085 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6089 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6086 information to crash reports.
6090 information to crash reports.
6087
6091
6088 2002-02-12 Fernando Perez <fperez@colorado.edu>
6092 2002-02-12 Fernando Perez <fperez@colorado.edu>
6089
6093
6090 * Released 0.2.5.
6094 * Released 0.2.5.
6091
6095
6092 2002-02-11 Fernando Perez <fperez@colorado.edu>
6096 2002-02-11 Fernando Perez <fperez@colorado.edu>
6093
6097
6094 * Wrote a relatively complete Windows installer. It puts
6098 * Wrote a relatively complete Windows installer. It puts
6095 everything in place, creates Start Menu entries and fixes the
6099 everything in place, creates Start Menu entries and fixes the
6096 color issues. Nothing fancy, but it works.
6100 color issues. Nothing fancy, but it works.
6097
6101
6098 2002-02-10 Fernando Perez <fperez@colorado.edu>
6102 2002-02-10 Fernando Perez <fperez@colorado.edu>
6099
6103
6100 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6104 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6101 os.path.expanduser() call so that we can type @run ~/myfile.py and
6105 os.path.expanduser() call so that we can type @run ~/myfile.py and
6102 have thigs work as expected.
6106 have thigs work as expected.
6103
6107
6104 * IPython/genutils.py (page): fixed exception handling so things
6108 * IPython/genutils.py (page): fixed exception handling so things
6105 work both in Unix and Windows correctly. Quitting a pager triggers
6109 work both in Unix and Windows correctly. Quitting a pager triggers
6106 an IOError/broken pipe in Unix, and in windows not finding a pager
6110 an IOError/broken pipe in Unix, and in windows not finding a pager
6107 is also an IOError, so I had to actually look at the return value
6111 is also an IOError, so I had to actually look at the return value
6108 of the exception, not just the exception itself. Should be ok now.
6112 of the exception, not just the exception itself. Should be ok now.
6109
6113
6110 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6114 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6111 modified to allow case-insensitive color scheme changes.
6115 modified to allow case-insensitive color scheme changes.
6112
6116
6113 2002-02-09 Fernando Perez <fperez@colorado.edu>
6117 2002-02-09 Fernando Perez <fperez@colorado.edu>
6114
6118
6115 * IPython/genutils.py (native_line_ends): new function to leave
6119 * IPython/genutils.py (native_line_ends): new function to leave
6116 user config files with os-native line-endings.
6120 user config files with os-native line-endings.
6117
6121
6118 * README and manual updates.
6122 * README and manual updates.
6119
6123
6120 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6124 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6121 instead of StringType to catch Unicode strings.
6125 instead of StringType to catch Unicode strings.
6122
6126
6123 * IPython/genutils.py (filefind): fixed bug for paths with
6127 * IPython/genutils.py (filefind): fixed bug for paths with
6124 embedded spaces (very common in Windows).
6128 embedded spaces (very common in Windows).
6125
6129
6126 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6130 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6127 files under Windows, so that they get automatically associated
6131 files under Windows, so that they get automatically associated
6128 with a text editor. Windows makes it a pain to handle
6132 with a text editor. Windows makes it a pain to handle
6129 extension-less files.
6133 extension-less files.
6130
6134
6131 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6135 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6132 warning about readline only occur for Posix. In Windows there's no
6136 warning about readline only occur for Posix. In Windows there's no
6133 way to get readline, so why bother with the warning.
6137 way to get readline, so why bother with the warning.
6134
6138
6135 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6139 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6136 for __str__ instead of dir(self), since dir() changed in 2.2.
6140 for __str__ instead of dir(self), since dir() changed in 2.2.
6137
6141
6138 * Ported to Windows! Tested on XP, I suspect it should work fine
6142 * Ported to Windows! Tested on XP, I suspect it should work fine
6139 on NT/2000, but I don't think it will work on 98 et al. That
6143 on NT/2000, but I don't think it will work on 98 et al. That
6140 series of Windows is such a piece of junk anyway that I won't try
6144 series of Windows is such a piece of junk anyway that I won't try
6141 porting it there. The XP port was straightforward, showed a few
6145 porting it there. The XP port was straightforward, showed a few
6142 bugs here and there (fixed all), in particular some string
6146 bugs here and there (fixed all), in particular some string
6143 handling stuff which required considering Unicode strings (which
6147 handling stuff which required considering Unicode strings (which
6144 Windows uses). This is good, but hasn't been too tested :) No
6148 Windows uses). This is good, but hasn't been too tested :) No
6145 fancy installer yet, I'll put a note in the manual so people at
6149 fancy installer yet, I'll put a note in the manual so people at
6146 least make manually a shortcut.
6150 least make manually a shortcut.
6147
6151
6148 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6152 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6149 into a single one, "colors". This now controls both prompt and
6153 into a single one, "colors". This now controls both prompt and
6150 exception color schemes, and can be changed both at startup
6154 exception color schemes, and can be changed both at startup
6151 (either via command-line switches or via ipythonrc files) and at
6155 (either via command-line switches or via ipythonrc files) and at
6152 runtime, with @colors.
6156 runtime, with @colors.
6153 (Magic.magic_run): renamed @prun to @run and removed the old
6157 (Magic.magic_run): renamed @prun to @run and removed the old
6154 @run. The two were too similar to warrant keeping both.
6158 @run. The two were too similar to warrant keeping both.
6155
6159
6156 2002-02-03 Fernando Perez <fperez@colorado.edu>
6160 2002-02-03 Fernando Perez <fperez@colorado.edu>
6157
6161
6158 * IPython/iplib.py (install_first_time): Added comment on how to
6162 * IPython/iplib.py (install_first_time): Added comment on how to
6159 configure the color options for first-time users. Put a <return>
6163 configure the color options for first-time users. Put a <return>
6160 request at the end so that small-terminal users get a chance to
6164 request at the end so that small-terminal users get a chance to
6161 read the startup info.
6165 read the startup info.
6162
6166
6163 2002-01-23 Fernando Perez <fperez@colorado.edu>
6167 2002-01-23 Fernando Perez <fperez@colorado.edu>
6164
6168
6165 * IPython/iplib.py (CachedOutput.update): Changed output memory
6169 * IPython/iplib.py (CachedOutput.update): Changed output memory
6166 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6170 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6167 input history we still use _i. Did this b/c these variable are
6171 input history we still use _i. Did this b/c these variable are
6168 very commonly used in interactive work, so the less we need to
6172 very commonly used in interactive work, so the less we need to
6169 type the better off we are.
6173 type the better off we are.
6170 (Magic.magic_prun): updated @prun to better handle the namespaces
6174 (Magic.magic_prun): updated @prun to better handle the namespaces
6171 the file will run in, including a fix for __name__ not being set
6175 the file will run in, including a fix for __name__ not being set
6172 before.
6176 before.
6173
6177
6174 2002-01-20 Fernando Perez <fperez@colorado.edu>
6178 2002-01-20 Fernando Perez <fperez@colorado.edu>
6175
6179
6176 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6180 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6177 extra garbage for Python 2.2. Need to look more carefully into
6181 extra garbage for Python 2.2. Need to look more carefully into
6178 this later.
6182 this later.
6179
6183
6180 2002-01-19 Fernando Perez <fperez@colorado.edu>
6184 2002-01-19 Fernando Perez <fperez@colorado.edu>
6181
6185
6182 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6186 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6183 display SyntaxError exceptions properly formatted when they occur
6187 display SyntaxError exceptions properly formatted when they occur
6184 (they can be triggered by imported code).
6188 (they can be triggered by imported code).
6185
6189
6186 2002-01-18 Fernando Perez <fperez@colorado.edu>
6190 2002-01-18 Fernando Perez <fperez@colorado.edu>
6187
6191
6188 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6192 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6189 SyntaxError exceptions are reported nicely formatted, instead of
6193 SyntaxError exceptions are reported nicely formatted, instead of
6190 spitting out only offset information as before.
6194 spitting out only offset information as before.
6191 (Magic.magic_prun): Added the @prun function for executing
6195 (Magic.magic_prun): Added the @prun function for executing
6192 programs with command line args inside IPython.
6196 programs with command line args inside IPython.
6193
6197
6194 2002-01-16 Fernando Perez <fperez@colorado.edu>
6198 2002-01-16 Fernando Perez <fperez@colorado.edu>
6195
6199
6196 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6200 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6197 to *not* include the last item given in a range. This brings their
6201 to *not* include the last item given in a range. This brings their
6198 behavior in line with Python's slicing:
6202 behavior in line with Python's slicing:
6199 a[n1:n2] -> a[n1]...a[n2-1]
6203 a[n1:n2] -> a[n1]...a[n2-1]
6200 It may be a bit less convenient, but I prefer to stick to Python's
6204 It may be a bit less convenient, but I prefer to stick to Python's
6201 conventions *everywhere*, so users never have to wonder.
6205 conventions *everywhere*, so users never have to wonder.
6202 (Magic.magic_macro): Added @macro function to ease the creation of
6206 (Magic.magic_macro): Added @macro function to ease the creation of
6203 macros.
6207 macros.
6204
6208
6205 2002-01-05 Fernando Perez <fperez@colorado.edu>
6209 2002-01-05 Fernando Perez <fperez@colorado.edu>
6206
6210
6207 * Released 0.2.4.
6211 * Released 0.2.4.
6208
6212
6209 * IPython/iplib.py (Magic.magic_pdef):
6213 * IPython/iplib.py (Magic.magic_pdef):
6210 (InteractiveShell.safe_execfile): report magic lines and error
6214 (InteractiveShell.safe_execfile): report magic lines and error
6211 lines without line numbers so one can easily copy/paste them for
6215 lines without line numbers so one can easily copy/paste them for
6212 re-execution.
6216 re-execution.
6213
6217
6214 * Updated manual with recent changes.
6218 * Updated manual with recent changes.
6215
6219
6216 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6220 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6217 docstring printing when class? is called. Very handy for knowing
6221 docstring printing when class? is called. Very handy for knowing
6218 how to create class instances (as long as __init__ is well
6222 how to create class instances (as long as __init__ is well
6219 documented, of course :)
6223 documented, of course :)
6220 (Magic.magic_doc): print both class and constructor docstrings.
6224 (Magic.magic_doc): print both class and constructor docstrings.
6221 (Magic.magic_pdef): give constructor info if passed a class and
6225 (Magic.magic_pdef): give constructor info if passed a class and
6222 __call__ info for callable object instances.
6226 __call__ info for callable object instances.
6223
6227
6224 2002-01-04 Fernando Perez <fperez@colorado.edu>
6228 2002-01-04 Fernando Perez <fperez@colorado.edu>
6225
6229
6226 * Made deep_reload() off by default. It doesn't always work
6230 * Made deep_reload() off by default. It doesn't always work
6227 exactly as intended, so it's probably safer to have it off. It's
6231 exactly as intended, so it's probably safer to have it off. It's
6228 still available as dreload() anyway, so nothing is lost.
6232 still available as dreload() anyway, so nothing is lost.
6229
6233
6230 2002-01-02 Fernando Perez <fperez@colorado.edu>
6234 2002-01-02 Fernando Perez <fperez@colorado.edu>
6231
6235
6232 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6236 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6233 so I wanted an updated release).
6237 so I wanted an updated release).
6234
6238
6235 2001-12-27 Fernando Perez <fperez@colorado.edu>
6239 2001-12-27 Fernando Perez <fperez@colorado.edu>
6236
6240
6237 * IPython/iplib.py (InteractiveShell.interact): Added the original
6241 * IPython/iplib.py (InteractiveShell.interact): Added the original
6238 code from 'code.py' for this module in order to change the
6242 code from 'code.py' for this module in order to change the
6239 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6243 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6240 the history cache would break when the user hit Ctrl-C, and
6244 the history cache would break when the user hit Ctrl-C, and
6241 interact() offers no way to add any hooks to it.
6245 interact() offers no way to add any hooks to it.
6242
6246
6243 2001-12-23 Fernando Perez <fperez@colorado.edu>
6247 2001-12-23 Fernando Perez <fperez@colorado.edu>
6244
6248
6245 * setup.py: added check for 'MANIFEST' before trying to remove
6249 * setup.py: added check for 'MANIFEST' before trying to remove
6246 it. Thanks to Sean Reifschneider.
6250 it. Thanks to Sean Reifschneider.
6247
6251
6248 2001-12-22 Fernando Perez <fperez@colorado.edu>
6252 2001-12-22 Fernando Perez <fperez@colorado.edu>
6249
6253
6250 * Released 0.2.2.
6254 * Released 0.2.2.
6251
6255
6252 * Finished (reasonably) writing the manual. Later will add the
6256 * Finished (reasonably) writing the manual. Later will add the
6253 python-standard navigation stylesheets, but for the time being
6257 python-standard navigation stylesheets, but for the time being
6254 it's fairly complete. Distribution will include html and pdf
6258 it's fairly complete. Distribution will include html and pdf
6255 versions.
6259 versions.
6256
6260
6257 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6261 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6258 (MayaVi author).
6262 (MayaVi author).
6259
6263
6260 2001-12-21 Fernando Perez <fperez@colorado.edu>
6264 2001-12-21 Fernando Perez <fperez@colorado.edu>
6261
6265
6262 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6266 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6263 good public release, I think (with the manual and the distutils
6267 good public release, I think (with the manual and the distutils
6264 installer). The manual can use some work, but that can go
6268 installer). The manual can use some work, but that can go
6265 slowly. Otherwise I think it's quite nice for end users. Next
6269 slowly. Otherwise I think it's quite nice for end users. Next
6266 summer, rewrite the guts of it...
6270 summer, rewrite the guts of it...
6267
6271
6268 * Changed format of ipythonrc files to use whitespace as the
6272 * Changed format of ipythonrc files to use whitespace as the
6269 separator instead of an explicit '='. Cleaner.
6273 separator instead of an explicit '='. Cleaner.
6270
6274
6271 2001-12-20 Fernando Perez <fperez@colorado.edu>
6275 2001-12-20 Fernando Perez <fperez@colorado.edu>
6272
6276
6273 * Started a manual in LyX. For now it's just a quick merge of the
6277 * Started a manual in LyX. For now it's just a quick merge of the
6274 various internal docstrings and READMEs. Later it may grow into a
6278 various internal docstrings and READMEs. Later it may grow into a
6275 nice, full-blown manual.
6279 nice, full-blown manual.
6276
6280
6277 * Set up a distutils based installer. Installation should now be
6281 * Set up a distutils based installer. Installation should now be
6278 trivially simple for end-users.
6282 trivially simple for end-users.
6279
6283
6280 2001-12-11 Fernando Perez <fperez@colorado.edu>
6284 2001-12-11 Fernando Perez <fperez@colorado.edu>
6281
6285
6282 * Released 0.2.0. First public release, announced it at
6286 * Released 0.2.0. First public release, announced it at
6283 comp.lang.python. From now on, just bugfixes...
6287 comp.lang.python. From now on, just bugfixes...
6284
6288
6285 * Went through all the files, set copyright/license notices and
6289 * Went through all the files, set copyright/license notices and
6286 cleaned up things. Ready for release.
6290 cleaned up things. Ready for release.
6287
6291
6288 2001-12-10 Fernando Perez <fperez@colorado.edu>
6292 2001-12-10 Fernando Perez <fperez@colorado.edu>
6289
6293
6290 * Changed the first-time installer not to use tarfiles. It's more
6294 * Changed the first-time installer not to use tarfiles. It's more
6291 robust now and less unix-dependent. Also makes it easier for
6295 robust now and less unix-dependent. Also makes it easier for
6292 people to later upgrade versions.
6296 people to later upgrade versions.
6293
6297
6294 * Changed @exit to @abort to reflect the fact that it's pretty
6298 * Changed @exit to @abort to reflect the fact that it's pretty
6295 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6299 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6296 becomes significant only when IPyhton is embedded: in that case,
6300 becomes significant only when IPyhton is embedded: in that case,
6297 C-D closes IPython only, but @abort kills the enclosing program
6301 C-D closes IPython only, but @abort kills the enclosing program
6298 too (unless it had called IPython inside a try catching
6302 too (unless it had called IPython inside a try catching
6299 SystemExit).
6303 SystemExit).
6300
6304
6301 * Created Shell module which exposes the actuall IPython Shell
6305 * Created Shell module which exposes the actuall IPython Shell
6302 classes, currently the normal and the embeddable one. This at
6306 classes, currently the normal and the embeddable one. This at
6303 least offers a stable interface we won't need to change when
6307 least offers a stable interface we won't need to change when
6304 (later) the internals are rewritten. That rewrite will be confined
6308 (later) the internals are rewritten. That rewrite will be confined
6305 to iplib and ipmaker, but the Shell interface should remain as is.
6309 to iplib and ipmaker, but the Shell interface should remain as is.
6306
6310
6307 * Added embed module which offers an embeddable IPShell object,
6311 * Added embed module which offers an embeddable IPShell object,
6308 useful to fire up IPython *inside* a running program. Great for
6312 useful to fire up IPython *inside* a running program. Great for
6309 debugging or dynamical data analysis.
6313 debugging or dynamical data analysis.
6310
6314
6311 2001-12-08 Fernando Perez <fperez@colorado.edu>
6315 2001-12-08 Fernando Perez <fperez@colorado.edu>
6312
6316
6313 * Fixed small bug preventing seeing info from methods of defined
6317 * Fixed small bug preventing seeing info from methods of defined
6314 objects (incorrect namespace in _ofind()).
6318 objects (incorrect namespace in _ofind()).
6315
6319
6316 * Documentation cleanup. Moved the main usage docstrings to a
6320 * Documentation cleanup. Moved the main usage docstrings to a
6317 separate file, usage.py (cleaner to maintain, and hopefully in the
6321 separate file, usage.py (cleaner to maintain, and hopefully in the
6318 future some perlpod-like way of producing interactive, man and
6322 future some perlpod-like way of producing interactive, man and
6319 html docs out of it will be found).
6323 html docs out of it will be found).
6320
6324
6321 * Added @profile to see your profile at any time.
6325 * Added @profile to see your profile at any time.
6322
6326
6323 * Added @p as an alias for 'print'. It's especially convenient if
6327 * Added @p as an alias for 'print'. It's especially convenient if
6324 using automagic ('p x' prints x).
6328 using automagic ('p x' prints x).
6325
6329
6326 * Small cleanups and fixes after a pychecker run.
6330 * Small cleanups and fixes after a pychecker run.
6327
6331
6328 * Changed the @cd command to handle @cd - and @cd -<n> for
6332 * Changed the @cd command to handle @cd - and @cd -<n> for
6329 visiting any directory in _dh.
6333 visiting any directory in _dh.
6330
6334
6331 * Introduced _dh, a history of visited directories. @dhist prints
6335 * Introduced _dh, a history of visited directories. @dhist prints
6332 it out with numbers.
6336 it out with numbers.
6333
6337
6334 2001-12-07 Fernando Perez <fperez@colorado.edu>
6338 2001-12-07 Fernando Perez <fperez@colorado.edu>
6335
6339
6336 * Released 0.1.22
6340 * Released 0.1.22
6337
6341
6338 * Made initialization a bit more robust against invalid color
6342 * Made initialization a bit more robust against invalid color
6339 options in user input (exit, not traceback-crash).
6343 options in user input (exit, not traceback-crash).
6340
6344
6341 * Changed the bug crash reporter to write the report only in the
6345 * Changed the bug crash reporter to write the report only in the
6342 user's .ipython directory. That way IPython won't litter people's
6346 user's .ipython directory. That way IPython won't litter people's
6343 hard disks with crash files all over the place. Also print on
6347 hard disks with crash files all over the place. Also print on
6344 screen the necessary mail command.
6348 screen the necessary mail command.
6345
6349
6346 * With the new ultraTB, implemented LightBG color scheme for light
6350 * With the new ultraTB, implemented LightBG color scheme for light
6347 background terminals. A lot of people like white backgrounds, so I
6351 background terminals. A lot of people like white backgrounds, so I
6348 guess we should at least give them something readable.
6352 guess we should at least give them something readable.
6349
6353
6350 2001-12-06 Fernando Perez <fperez@colorado.edu>
6354 2001-12-06 Fernando Perez <fperez@colorado.edu>
6351
6355
6352 * Modified the structure of ultraTB. Now there's a proper class
6356 * Modified the structure of ultraTB. Now there's a proper class
6353 for tables of color schemes which allow adding schemes easily and
6357 for tables of color schemes which allow adding schemes easily and
6354 switching the active scheme without creating a new instance every
6358 switching the active scheme without creating a new instance every
6355 time (which was ridiculous). The syntax for creating new schemes
6359 time (which was ridiculous). The syntax for creating new schemes
6356 is also cleaner. I think ultraTB is finally done, with a clean
6360 is also cleaner. I think ultraTB is finally done, with a clean
6357 class structure. Names are also much cleaner (now there's proper
6361 class structure. Names are also much cleaner (now there's proper
6358 color tables, no need for every variable to also have 'color' in
6362 color tables, no need for every variable to also have 'color' in
6359 its name).
6363 its name).
6360
6364
6361 * Broke down genutils into separate files. Now genutils only
6365 * Broke down genutils into separate files. Now genutils only
6362 contains utility functions, and classes have been moved to their
6366 contains utility functions, and classes have been moved to their
6363 own files (they had enough independent functionality to warrant
6367 own files (they had enough independent functionality to warrant
6364 it): ConfigLoader, OutputTrap, Struct.
6368 it): ConfigLoader, OutputTrap, Struct.
6365
6369
6366 2001-12-05 Fernando Perez <fperez@colorado.edu>
6370 2001-12-05 Fernando Perez <fperez@colorado.edu>
6367
6371
6368 * IPython turns 21! Released version 0.1.21, as a candidate for
6372 * IPython turns 21! Released version 0.1.21, as a candidate for
6369 public consumption. If all goes well, release in a few days.
6373 public consumption. If all goes well, release in a few days.
6370
6374
6371 * Fixed path bug (files in Extensions/ directory wouldn't be found
6375 * Fixed path bug (files in Extensions/ directory wouldn't be found
6372 unless IPython/ was explicitly in sys.path).
6376 unless IPython/ was explicitly in sys.path).
6373
6377
6374 * Extended the FlexCompleter class as MagicCompleter to allow
6378 * Extended the FlexCompleter class as MagicCompleter to allow
6375 completion of @-starting lines.
6379 completion of @-starting lines.
6376
6380
6377 * Created __release__.py file as a central repository for release
6381 * Created __release__.py file as a central repository for release
6378 info that other files can read from.
6382 info that other files can read from.
6379
6383
6380 * Fixed small bug in logging: when logging was turned on in
6384 * Fixed small bug in logging: when logging was turned on in
6381 mid-session, old lines with special meanings (!@?) were being
6385 mid-session, old lines with special meanings (!@?) were being
6382 logged without the prepended comment, which is necessary since
6386 logged without the prepended comment, which is necessary since
6383 they are not truly valid python syntax. This should make session
6387 they are not truly valid python syntax. This should make session
6384 restores produce less errors.
6388 restores produce less errors.
6385
6389
6386 * The namespace cleanup forced me to make a FlexCompleter class
6390 * The namespace cleanup forced me to make a FlexCompleter class
6387 which is nothing but a ripoff of rlcompleter, but with selectable
6391 which is nothing but a ripoff of rlcompleter, but with selectable
6388 namespace (rlcompleter only works in __main__.__dict__). I'll try
6392 namespace (rlcompleter only works in __main__.__dict__). I'll try
6389 to submit a note to the authors to see if this change can be
6393 to submit a note to the authors to see if this change can be
6390 incorporated in future rlcompleter releases (Dec.6: done)
6394 incorporated in future rlcompleter releases (Dec.6: done)
6391
6395
6392 * More fixes to namespace handling. It was a mess! Now all
6396 * More fixes to namespace handling. It was a mess! Now all
6393 explicit references to __main__.__dict__ are gone (except when
6397 explicit references to __main__.__dict__ are gone (except when
6394 really needed) and everything is handled through the namespace
6398 really needed) and everything is handled through the namespace
6395 dicts in the IPython instance. We seem to be getting somewhere
6399 dicts in the IPython instance. We seem to be getting somewhere
6396 with this, finally...
6400 with this, finally...
6397
6401
6398 * Small documentation updates.
6402 * Small documentation updates.
6399
6403
6400 * Created the Extensions directory under IPython (with an
6404 * Created the Extensions directory under IPython (with an
6401 __init__.py). Put the PhysicalQ stuff there. This directory should
6405 __init__.py). Put the PhysicalQ stuff there. This directory should
6402 be used for all special-purpose extensions.
6406 be used for all special-purpose extensions.
6403
6407
6404 * File renaming:
6408 * File renaming:
6405 ipythonlib --> ipmaker
6409 ipythonlib --> ipmaker
6406 ipplib --> iplib
6410 ipplib --> iplib
6407 This makes a bit more sense in terms of what these files actually do.
6411 This makes a bit more sense in terms of what these files actually do.
6408
6412
6409 * Moved all the classes and functions in ipythonlib to ipplib, so
6413 * Moved all the classes and functions in ipythonlib to ipplib, so
6410 now ipythonlib only has make_IPython(). This will ease up its
6414 now ipythonlib only has make_IPython(). This will ease up its
6411 splitting in smaller functional chunks later.
6415 splitting in smaller functional chunks later.
6412
6416
6413 * Cleaned up (done, I think) output of @whos. Better column
6417 * Cleaned up (done, I think) output of @whos. Better column
6414 formatting, and now shows str(var) for as much as it can, which is
6418 formatting, and now shows str(var) for as much as it can, which is
6415 typically what one gets with a 'print var'.
6419 typically what one gets with a 'print var'.
6416
6420
6417 2001-12-04 Fernando Perez <fperez@colorado.edu>
6421 2001-12-04 Fernando Perez <fperez@colorado.edu>
6418
6422
6419 * Fixed namespace problems. Now builtin/IPyhton/user names get
6423 * Fixed namespace problems. Now builtin/IPyhton/user names get
6420 properly reported in their namespace. Internal namespace handling
6424 properly reported in their namespace. Internal namespace handling
6421 is finally getting decent (not perfect yet, but much better than
6425 is finally getting decent (not perfect yet, but much better than
6422 the ad-hoc mess we had).
6426 the ad-hoc mess we had).
6423
6427
6424 * Removed -exit option. If people just want to run a python
6428 * Removed -exit option. If people just want to run a python
6425 script, that's what the normal interpreter is for. Less
6429 script, that's what the normal interpreter is for. Less
6426 unnecessary options, less chances for bugs.
6430 unnecessary options, less chances for bugs.
6427
6431
6428 * Added a crash handler which generates a complete post-mortem if
6432 * Added a crash handler which generates a complete post-mortem if
6429 IPython crashes. This will help a lot in tracking bugs down the
6433 IPython crashes. This will help a lot in tracking bugs down the
6430 road.
6434 road.
6431
6435
6432 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6436 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6433 which were boud to functions being reassigned would bypass the
6437 which were boud to functions being reassigned would bypass the
6434 logger, breaking the sync of _il with the prompt counter. This
6438 logger, breaking the sync of _il with the prompt counter. This
6435 would then crash IPython later when a new line was logged.
6439 would then crash IPython later when a new line was logged.
6436
6440
6437 2001-12-02 Fernando Perez <fperez@colorado.edu>
6441 2001-12-02 Fernando Perez <fperez@colorado.edu>
6438
6442
6439 * Made IPython a package. This means people don't have to clutter
6443 * Made IPython a package. This means people don't have to clutter
6440 their sys.path with yet another directory. Changed the INSTALL
6444 their sys.path with yet another directory. Changed the INSTALL
6441 file accordingly.
6445 file accordingly.
6442
6446
6443 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6447 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6444 sorts its output (so @who shows it sorted) and @whos formats the
6448 sorts its output (so @who shows it sorted) and @whos formats the
6445 table according to the width of the first column. Nicer, easier to
6449 table according to the width of the first column. Nicer, easier to
6446 read. Todo: write a generic table_format() which takes a list of
6450 read. Todo: write a generic table_format() which takes a list of
6447 lists and prints it nicely formatted, with optional row/column
6451 lists and prints it nicely formatted, with optional row/column
6448 separators and proper padding and justification.
6452 separators and proper padding and justification.
6449
6453
6450 * Released 0.1.20
6454 * Released 0.1.20
6451
6455
6452 * Fixed bug in @log which would reverse the inputcache list (a
6456 * Fixed bug in @log which would reverse the inputcache list (a
6453 copy operation was missing).
6457 copy operation was missing).
6454
6458
6455 * Code cleanup. @config was changed to use page(). Better, since
6459 * Code cleanup. @config was changed to use page(). Better, since
6456 its output is always quite long.
6460 its output is always quite long.
6457
6461
6458 * Itpl is back as a dependency. I was having too many problems
6462 * Itpl is back as a dependency. I was having too many problems
6459 getting the parametric aliases to work reliably, and it's just
6463 getting the parametric aliases to work reliably, and it's just
6460 easier to code weird string operations with it than playing %()s
6464 easier to code weird string operations with it than playing %()s
6461 games. It's only ~6k, so I don't think it's too big a deal.
6465 games. It's only ~6k, so I don't think it's too big a deal.
6462
6466
6463 * Found (and fixed) a very nasty bug with history. !lines weren't
6467 * Found (and fixed) a very nasty bug with history. !lines weren't
6464 getting cached, and the out of sync caches would crash
6468 getting cached, and the out of sync caches would crash
6465 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6469 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6466 division of labor a bit better. Bug fixed, cleaner structure.
6470 division of labor a bit better. Bug fixed, cleaner structure.
6467
6471
6468 2001-12-01 Fernando Perez <fperez@colorado.edu>
6472 2001-12-01 Fernando Perez <fperez@colorado.edu>
6469
6473
6470 * Released 0.1.19
6474 * Released 0.1.19
6471
6475
6472 * Added option -n to @hist to prevent line number printing. Much
6476 * Added option -n to @hist to prevent line number printing. Much
6473 easier to copy/paste code this way.
6477 easier to copy/paste code this way.
6474
6478
6475 * Created global _il to hold the input list. Allows easy
6479 * Created global _il to hold the input list. Allows easy
6476 re-execution of blocks of code by slicing it (inspired by Janko's
6480 re-execution of blocks of code by slicing it (inspired by Janko's
6477 comment on 'macros').
6481 comment on 'macros').
6478
6482
6479 * Small fixes and doc updates.
6483 * Small fixes and doc updates.
6480
6484
6481 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6485 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6482 much too fragile with automagic. Handles properly multi-line
6486 much too fragile with automagic. Handles properly multi-line
6483 statements and takes parameters.
6487 statements and takes parameters.
6484
6488
6485 2001-11-30 Fernando Perez <fperez@colorado.edu>
6489 2001-11-30 Fernando Perez <fperez@colorado.edu>
6486
6490
6487 * Version 0.1.18 released.
6491 * Version 0.1.18 released.
6488
6492
6489 * Fixed nasty namespace bug in initial module imports.
6493 * Fixed nasty namespace bug in initial module imports.
6490
6494
6491 * Added copyright/license notes to all code files (except
6495 * Added copyright/license notes to all code files (except
6492 DPyGetOpt). For the time being, LGPL. That could change.
6496 DPyGetOpt). For the time being, LGPL. That could change.
6493
6497
6494 * Rewrote a much nicer README, updated INSTALL, cleaned up
6498 * Rewrote a much nicer README, updated INSTALL, cleaned up
6495 ipythonrc-* samples.
6499 ipythonrc-* samples.
6496
6500
6497 * Overall code/documentation cleanup. Basically ready for
6501 * Overall code/documentation cleanup. Basically ready for
6498 release. Only remaining thing: licence decision (LGPL?).
6502 release. Only remaining thing: licence decision (LGPL?).
6499
6503
6500 * Converted load_config to a class, ConfigLoader. Now recursion
6504 * Converted load_config to a class, ConfigLoader. Now recursion
6501 control is better organized. Doesn't include the same file twice.
6505 control is better organized. Doesn't include the same file twice.
6502
6506
6503 2001-11-29 Fernando Perez <fperez@colorado.edu>
6507 2001-11-29 Fernando Perez <fperez@colorado.edu>
6504
6508
6505 * Got input history working. Changed output history variables from
6509 * Got input history working. Changed output history variables from
6506 _p to _o so that _i is for input and _o for output. Just cleaner
6510 _p to _o so that _i is for input and _o for output. Just cleaner
6507 convention.
6511 convention.
6508
6512
6509 * Implemented parametric aliases. This pretty much allows the
6513 * Implemented parametric aliases. This pretty much allows the
6510 alias system to offer full-blown shell convenience, I think.
6514 alias system to offer full-blown shell convenience, I think.
6511
6515
6512 * Version 0.1.17 released, 0.1.18 opened.
6516 * Version 0.1.17 released, 0.1.18 opened.
6513
6517
6514 * dot_ipython/ipythonrc (alias): added documentation.
6518 * dot_ipython/ipythonrc (alias): added documentation.
6515 (xcolor): Fixed small bug (xcolors -> xcolor)
6519 (xcolor): Fixed small bug (xcolors -> xcolor)
6516
6520
6517 * Changed the alias system. Now alias is a magic command to define
6521 * Changed the alias system. Now alias is a magic command to define
6518 aliases just like the shell. Rationale: the builtin magics should
6522 aliases just like the shell. Rationale: the builtin magics should
6519 be there for things deeply connected to IPython's
6523 be there for things deeply connected to IPython's
6520 architecture. And this is a much lighter system for what I think
6524 architecture. And this is a much lighter system for what I think
6521 is the really important feature: allowing users to define quickly
6525 is the really important feature: allowing users to define quickly
6522 magics that will do shell things for them, so they can customize
6526 magics that will do shell things for them, so they can customize
6523 IPython easily to match their work habits. If someone is really
6527 IPython easily to match their work habits. If someone is really
6524 desperate to have another name for a builtin alias, they can
6528 desperate to have another name for a builtin alias, they can
6525 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6529 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6526 works.
6530 works.
6527
6531
6528 2001-11-28 Fernando Perez <fperez@colorado.edu>
6532 2001-11-28 Fernando Perez <fperez@colorado.edu>
6529
6533
6530 * Changed @file so that it opens the source file at the proper
6534 * Changed @file so that it opens the source file at the proper
6531 line. Since it uses less, if your EDITOR environment is
6535 line. Since it uses less, if your EDITOR environment is
6532 configured, typing v will immediately open your editor of choice
6536 configured, typing v will immediately open your editor of choice
6533 right at the line where the object is defined. Not as quick as
6537 right at the line where the object is defined. Not as quick as
6534 having a direct @edit command, but for all intents and purposes it
6538 having a direct @edit command, but for all intents and purposes it
6535 works. And I don't have to worry about writing @edit to deal with
6539 works. And I don't have to worry about writing @edit to deal with
6536 all the editors, less does that.
6540 all the editors, less does that.
6537
6541
6538 * Version 0.1.16 released, 0.1.17 opened.
6542 * Version 0.1.16 released, 0.1.17 opened.
6539
6543
6540 * Fixed some nasty bugs in the page/page_dumb combo that could
6544 * Fixed some nasty bugs in the page/page_dumb combo that could
6541 crash IPython.
6545 crash IPython.
6542
6546
6543 2001-11-27 Fernando Perez <fperez@colorado.edu>
6547 2001-11-27 Fernando Perez <fperez@colorado.edu>
6544
6548
6545 * Version 0.1.15 released, 0.1.16 opened.
6549 * Version 0.1.15 released, 0.1.16 opened.
6546
6550
6547 * Finally got ? and ?? to work for undefined things: now it's
6551 * Finally got ? and ?? to work for undefined things: now it's
6548 possible to type {}.get? and get information about the get method
6552 possible to type {}.get? and get information about the get method
6549 of dicts, or os.path? even if only os is defined (so technically
6553 of dicts, or os.path? even if only os is defined (so technically
6550 os.path isn't). Works at any level. For example, after import os,
6554 os.path isn't). Works at any level. For example, after import os,
6551 os?, os.path?, os.path.abspath? all work. This is great, took some
6555 os?, os.path?, os.path.abspath? all work. This is great, took some
6552 work in _ofind.
6556 work in _ofind.
6553
6557
6554 * Fixed more bugs with logging. The sanest way to do it was to add
6558 * Fixed more bugs with logging. The sanest way to do it was to add
6555 to @log a 'mode' parameter. Killed two in one shot (this mode
6559 to @log a 'mode' parameter. Killed two in one shot (this mode
6556 option was a request of Janko's). I think it's finally clean
6560 option was a request of Janko's). I think it's finally clean
6557 (famous last words).
6561 (famous last words).
6558
6562
6559 * Added a page_dumb() pager which does a decent job of paging on
6563 * Added a page_dumb() pager which does a decent job of paging on
6560 screen, if better things (like less) aren't available. One less
6564 screen, if better things (like less) aren't available. One less
6561 unix dependency (someday maybe somebody will port this to
6565 unix dependency (someday maybe somebody will port this to
6562 windows).
6566 windows).
6563
6567
6564 * Fixed problem in magic_log: would lock of logging out if log
6568 * Fixed problem in magic_log: would lock of logging out if log
6565 creation failed (because it would still think it had succeeded).
6569 creation failed (because it would still think it had succeeded).
6566
6570
6567 * Improved the page() function using curses to auto-detect screen
6571 * Improved the page() function using curses to auto-detect screen
6568 size. Now it can make a much better decision on whether to print
6572 size. Now it can make a much better decision on whether to print
6569 or page a string. Option screen_length was modified: a value 0
6573 or page a string. Option screen_length was modified: a value 0
6570 means auto-detect, and that's the default now.
6574 means auto-detect, and that's the default now.
6571
6575
6572 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6576 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6573 go out. I'll test it for a few days, then talk to Janko about
6577 go out. I'll test it for a few days, then talk to Janko about
6574 licences and announce it.
6578 licences and announce it.
6575
6579
6576 * Fixed the length of the auto-generated ---> prompt which appears
6580 * Fixed the length of the auto-generated ---> prompt which appears
6577 for auto-parens and auto-quotes. Getting this right isn't trivial,
6581 for auto-parens and auto-quotes. Getting this right isn't trivial,
6578 with all the color escapes, different prompt types and optional
6582 with all the color escapes, different prompt types and optional
6579 separators. But it seems to be working in all the combinations.
6583 separators. But it seems to be working in all the combinations.
6580
6584
6581 2001-11-26 Fernando Perez <fperez@colorado.edu>
6585 2001-11-26 Fernando Perez <fperez@colorado.edu>
6582
6586
6583 * Wrote a regexp filter to get option types from the option names
6587 * Wrote a regexp filter to get option types from the option names
6584 string. This eliminates the need to manually keep two duplicate
6588 string. This eliminates the need to manually keep two duplicate
6585 lists.
6589 lists.
6586
6590
6587 * Removed the unneeded check_option_names. Now options are handled
6591 * Removed the unneeded check_option_names. Now options are handled
6588 in a much saner manner and it's easy to visually check that things
6592 in a much saner manner and it's easy to visually check that things
6589 are ok.
6593 are ok.
6590
6594
6591 * Updated version numbers on all files I modified to carry a
6595 * Updated version numbers on all files I modified to carry a
6592 notice so Janko and Nathan have clear version markers.
6596 notice so Janko and Nathan have clear version markers.
6593
6597
6594 * Updated docstring for ultraTB with my changes. I should send
6598 * Updated docstring for ultraTB with my changes. I should send
6595 this to Nathan.
6599 this to Nathan.
6596
6600
6597 * Lots of small fixes. Ran everything through pychecker again.
6601 * Lots of small fixes. Ran everything through pychecker again.
6598
6602
6599 * Made loading of deep_reload an cmd line option. If it's not too
6603 * Made loading of deep_reload an cmd line option. If it's not too
6600 kosher, now people can just disable it. With -nodeep_reload it's
6604 kosher, now people can just disable it. With -nodeep_reload it's
6601 still available as dreload(), it just won't overwrite reload().
6605 still available as dreload(), it just won't overwrite reload().
6602
6606
6603 * Moved many options to the no| form (-opt and -noopt
6607 * Moved many options to the no| form (-opt and -noopt
6604 accepted). Cleaner.
6608 accepted). Cleaner.
6605
6609
6606 * Changed magic_log so that if called with no parameters, it uses
6610 * Changed magic_log so that if called with no parameters, it uses
6607 'rotate' mode. That way auto-generated logs aren't automatically
6611 'rotate' mode. That way auto-generated logs aren't automatically
6608 over-written. For normal logs, now a backup is made if it exists
6612 over-written. For normal logs, now a backup is made if it exists
6609 (only 1 level of backups). A new 'backup' mode was added to the
6613 (only 1 level of backups). A new 'backup' mode was added to the
6610 Logger class to support this. This was a request by Janko.
6614 Logger class to support this. This was a request by Janko.
6611
6615
6612 * Added @logoff/@logon to stop/restart an active log.
6616 * Added @logoff/@logon to stop/restart an active log.
6613
6617
6614 * Fixed a lot of bugs in log saving/replay. It was pretty
6618 * Fixed a lot of bugs in log saving/replay. It was pretty
6615 broken. Now special lines (!@,/) appear properly in the command
6619 broken. Now special lines (!@,/) appear properly in the command
6616 history after a log replay.
6620 history after a log replay.
6617
6621
6618 * Tried and failed to implement full session saving via pickle. My
6622 * Tried and failed to implement full session saving via pickle. My
6619 idea was to pickle __main__.__dict__, but modules can't be
6623 idea was to pickle __main__.__dict__, but modules can't be
6620 pickled. This would be a better alternative to replaying logs, but
6624 pickled. This would be a better alternative to replaying logs, but
6621 seems quite tricky to get to work. Changed -session to be called
6625 seems quite tricky to get to work. Changed -session to be called
6622 -logplay, which more accurately reflects what it does. And if we
6626 -logplay, which more accurately reflects what it does. And if we
6623 ever get real session saving working, -session is now available.
6627 ever get real session saving working, -session is now available.
6624
6628
6625 * Implemented color schemes for prompts also. As for tracebacks,
6629 * Implemented color schemes for prompts also. As for tracebacks,
6626 currently only NoColor and Linux are supported. But now the
6630 currently only NoColor and Linux are supported. But now the
6627 infrastructure is in place, based on a generic ColorScheme
6631 infrastructure is in place, based on a generic ColorScheme
6628 class. So writing and activating new schemes both for the prompts
6632 class. So writing and activating new schemes both for the prompts
6629 and the tracebacks should be straightforward.
6633 and the tracebacks should be straightforward.
6630
6634
6631 * Version 0.1.13 released, 0.1.14 opened.
6635 * Version 0.1.13 released, 0.1.14 opened.
6632
6636
6633 * Changed handling of options for output cache. Now counter is
6637 * Changed handling of options for output cache. Now counter is
6634 hardwired starting at 1 and one specifies the maximum number of
6638 hardwired starting at 1 and one specifies the maximum number of
6635 entries *in the outcache* (not the max prompt counter). This is
6639 entries *in the outcache* (not the max prompt counter). This is
6636 much better, since many statements won't increase the cache
6640 much better, since many statements won't increase the cache
6637 count. It also eliminated some confusing options, now there's only
6641 count. It also eliminated some confusing options, now there's only
6638 one: cache_size.
6642 one: cache_size.
6639
6643
6640 * Added 'alias' magic function and magic_alias option in the
6644 * Added 'alias' magic function and magic_alias option in the
6641 ipythonrc file. Now the user can easily define whatever names he
6645 ipythonrc file. Now the user can easily define whatever names he
6642 wants for the magic functions without having to play weird
6646 wants for the magic functions without having to play weird
6643 namespace games. This gives IPython a real shell-like feel.
6647 namespace games. This gives IPython a real shell-like feel.
6644
6648
6645 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6649 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6646 @ or not).
6650 @ or not).
6647
6651
6648 This was one of the last remaining 'visible' bugs (that I know
6652 This was one of the last remaining 'visible' bugs (that I know
6649 of). I think if I can clean up the session loading so it works
6653 of). I think if I can clean up the session loading so it works
6650 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6654 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6651 about licensing).
6655 about licensing).
6652
6656
6653 2001-11-25 Fernando Perez <fperez@colorado.edu>
6657 2001-11-25 Fernando Perez <fperez@colorado.edu>
6654
6658
6655 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6659 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6656 there's a cleaner distinction between what ? and ?? show.
6660 there's a cleaner distinction between what ? and ?? show.
6657
6661
6658 * Added screen_length option. Now the user can define his own
6662 * Added screen_length option. Now the user can define his own
6659 screen size for page() operations.
6663 screen size for page() operations.
6660
6664
6661 * Implemented magic shell-like functions with automatic code
6665 * Implemented magic shell-like functions with automatic code
6662 generation. Now adding another function is just a matter of adding
6666 generation. Now adding another function is just a matter of adding
6663 an entry to a dict, and the function is dynamically generated at
6667 an entry to a dict, and the function is dynamically generated at
6664 run-time. Python has some really cool features!
6668 run-time. Python has some really cool features!
6665
6669
6666 * Renamed many options to cleanup conventions a little. Now all
6670 * Renamed many options to cleanup conventions a little. Now all
6667 are lowercase, and only underscores where needed. Also in the code
6671 are lowercase, and only underscores where needed. Also in the code
6668 option name tables are clearer.
6672 option name tables are clearer.
6669
6673
6670 * Changed prompts a little. Now input is 'In [n]:' instead of
6674 * Changed prompts a little. Now input is 'In [n]:' instead of
6671 'In[n]:='. This allows it the numbers to be aligned with the
6675 'In[n]:='. This allows it the numbers to be aligned with the
6672 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6676 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6673 Python (it was a Mathematica thing). The '...' continuation prompt
6677 Python (it was a Mathematica thing). The '...' continuation prompt
6674 was also changed a little to align better.
6678 was also changed a little to align better.
6675
6679
6676 * Fixed bug when flushing output cache. Not all _p<n> variables
6680 * Fixed bug when flushing output cache. Not all _p<n> variables
6677 exist, so their deletion needs to be wrapped in a try:
6681 exist, so their deletion needs to be wrapped in a try:
6678
6682
6679 * Figured out how to properly use inspect.formatargspec() (it
6683 * Figured out how to properly use inspect.formatargspec() (it
6680 requires the args preceded by *). So I removed all the code from
6684 requires the args preceded by *). So I removed all the code from
6681 _get_pdef in Magic, which was just replicating that.
6685 _get_pdef in Magic, which was just replicating that.
6682
6686
6683 * Added test to prefilter to allow redefining magic function names
6687 * Added test to prefilter to allow redefining magic function names
6684 as variables. This is ok, since the @ form is always available,
6688 as variables. This is ok, since the @ form is always available,
6685 but whe should allow the user to define a variable called 'ls' if
6689 but whe should allow the user to define a variable called 'ls' if
6686 he needs it.
6690 he needs it.
6687
6691
6688 * Moved the ToDo information from README into a separate ToDo.
6692 * Moved the ToDo information from README into a separate ToDo.
6689
6693
6690 * General code cleanup and small bugfixes. I think it's close to a
6694 * General code cleanup and small bugfixes. I think it's close to a
6691 state where it can be released, obviously with a big 'beta'
6695 state where it can be released, obviously with a big 'beta'
6692 warning on it.
6696 warning on it.
6693
6697
6694 * Got the magic function split to work. Now all magics are defined
6698 * Got the magic function split to work. Now all magics are defined
6695 in a separate class. It just organizes things a bit, and now
6699 in a separate class. It just organizes things a bit, and now
6696 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6700 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6697 was too long).
6701 was too long).
6698
6702
6699 * Changed @clear to @reset to avoid potential confusions with
6703 * Changed @clear to @reset to avoid potential confusions with
6700 the shell command clear. Also renamed @cl to @clear, which does
6704 the shell command clear. Also renamed @cl to @clear, which does
6701 exactly what people expect it to from their shell experience.
6705 exactly what people expect it to from their shell experience.
6702
6706
6703 Added a check to the @reset command (since it's so
6707 Added a check to the @reset command (since it's so
6704 destructive, it's probably a good idea to ask for confirmation).
6708 destructive, it's probably a good idea to ask for confirmation).
6705 But now reset only works for full namespace resetting. Since the
6709 But now reset only works for full namespace resetting. Since the
6706 del keyword is already there for deleting a few specific
6710 del keyword is already there for deleting a few specific
6707 variables, I don't see the point of having a redundant magic
6711 variables, I don't see the point of having a redundant magic
6708 function for the same task.
6712 function for the same task.
6709
6713
6710 2001-11-24 Fernando Perez <fperez@colorado.edu>
6714 2001-11-24 Fernando Perez <fperez@colorado.edu>
6711
6715
6712 * Updated the builtin docs (esp. the ? ones).
6716 * Updated the builtin docs (esp. the ? ones).
6713
6717
6714 * Ran all the code through pychecker. Not terribly impressed with
6718 * Ran all the code through pychecker. Not terribly impressed with
6715 it: lots of spurious warnings and didn't really find anything of
6719 it: lots of spurious warnings and didn't really find anything of
6716 substance (just a few modules being imported and not used).
6720 substance (just a few modules being imported and not used).
6717
6721
6718 * Implemented the new ultraTB functionality into IPython. New
6722 * Implemented the new ultraTB functionality into IPython. New
6719 option: xcolors. This chooses color scheme. xmode now only selects
6723 option: xcolors. This chooses color scheme. xmode now only selects
6720 between Plain and Verbose. Better orthogonality.
6724 between Plain and Verbose. Better orthogonality.
6721
6725
6722 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6726 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6723 mode and color scheme for the exception handlers. Now it's
6727 mode and color scheme for the exception handlers. Now it's
6724 possible to have the verbose traceback with no coloring.
6728 possible to have the verbose traceback with no coloring.
6725
6729
6726 2001-11-23 Fernando Perez <fperez@colorado.edu>
6730 2001-11-23 Fernando Perez <fperez@colorado.edu>
6727
6731
6728 * Version 0.1.12 released, 0.1.13 opened.
6732 * Version 0.1.12 released, 0.1.13 opened.
6729
6733
6730 * Removed option to set auto-quote and auto-paren escapes by
6734 * Removed option to set auto-quote and auto-paren escapes by
6731 user. The chances of breaking valid syntax are just too high. If
6735 user. The chances of breaking valid syntax are just too high. If
6732 someone *really* wants, they can always dig into the code.
6736 someone *really* wants, they can always dig into the code.
6733
6737
6734 * Made prompt separators configurable.
6738 * Made prompt separators configurable.
6735
6739
6736 2001-11-22 Fernando Perez <fperez@colorado.edu>
6740 2001-11-22 Fernando Perez <fperez@colorado.edu>
6737
6741
6738 * Small bugfixes in many places.
6742 * Small bugfixes in many places.
6739
6743
6740 * Removed the MyCompleter class from ipplib. It seemed redundant
6744 * Removed the MyCompleter class from ipplib. It seemed redundant
6741 with the C-p,C-n history search functionality. Less code to
6745 with the C-p,C-n history search functionality. Less code to
6742 maintain.
6746 maintain.
6743
6747
6744 * Moved all the original ipython.py code into ipythonlib.py. Right
6748 * Moved all the original ipython.py code into ipythonlib.py. Right
6745 now it's just one big dump into a function called make_IPython, so
6749 now it's just one big dump into a function called make_IPython, so
6746 no real modularity has been gained. But at least it makes the
6750 no real modularity has been gained. But at least it makes the
6747 wrapper script tiny, and since ipythonlib is a module, it gets
6751 wrapper script tiny, and since ipythonlib is a module, it gets
6748 compiled and startup is much faster.
6752 compiled and startup is much faster.
6749
6753
6750 This is a reasobably 'deep' change, so we should test it for a
6754 This is a reasobably 'deep' change, so we should test it for a
6751 while without messing too much more with the code.
6755 while without messing too much more with the code.
6752
6756
6753 2001-11-21 Fernando Perez <fperez@colorado.edu>
6757 2001-11-21 Fernando Perez <fperez@colorado.edu>
6754
6758
6755 * Version 0.1.11 released, 0.1.12 opened for further work.
6759 * Version 0.1.11 released, 0.1.12 opened for further work.
6756
6760
6757 * Removed dependency on Itpl. It was only needed in one place. It
6761 * Removed dependency on Itpl. It was only needed in one place. It
6758 would be nice if this became part of python, though. It makes life
6762 would be nice if this became part of python, though. It makes life
6759 *a lot* easier in some cases.
6763 *a lot* easier in some cases.
6760
6764
6761 * Simplified the prefilter code a bit. Now all handlers are
6765 * Simplified the prefilter code a bit. Now all handlers are
6762 expected to explicitly return a value (at least a blank string).
6766 expected to explicitly return a value (at least a blank string).
6763
6767
6764 * Heavy edits in ipplib. Removed the help system altogether. Now
6768 * Heavy edits in ipplib. Removed the help system altogether. Now
6765 obj?/?? is used for inspecting objects, a magic @doc prints
6769 obj?/?? is used for inspecting objects, a magic @doc prints
6766 docstrings, and full-blown Python help is accessed via the 'help'
6770 docstrings, and full-blown Python help is accessed via the 'help'
6767 keyword. This cleans up a lot of code (less to maintain) and does
6771 keyword. This cleans up a lot of code (less to maintain) and does
6768 the job. Since 'help' is now a standard Python component, might as
6772 the job. Since 'help' is now a standard Python component, might as
6769 well use it and remove duplicate functionality.
6773 well use it and remove duplicate functionality.
6770
6774
6771 Also removed the option to use ipplib as a standalone program. By
6775 Also removed the option to use ipplib as a standalone program. By
6772 now it's too dependent on other parts of IPython to function alone.
6776 now it's too dependent on other parts of IPython to function alone.
6773
6777
6774 * Fixed bug in genutils.pager. It would crash if the pager was
6778 * Fixed bug in genutils.pager. It would crash if the pager was
6775 exited immediately after opening (broken pipe).
6779 exited immediately after opening (broken pipe).
6776
6780
6777 * Trimmed down the VerboseTB reporting a little. The header is
6781 * Trimmed down the VerboseTB reporting a little. The header is
6778 much shorter now and the repeated exception arguments at the end
6782 much shorter now and the repeated exception arguments at the end
6779 have been removed. For interactive use the old header seemed a bit
6783 have been removed. For interactive use the old header seemed a bit
6780 excessive.
6784 excessive.
6781
6785
6782 * Fixed small bug in output of @whos for variables with multi-word
6786 * Fixed small bug in output of @whos for variables with multi-word
6783 types (only first word was displayed).
6787 types (only first word was displayed).
6784
6788
6785 2001-11-17 Fernando Perez <fperez@colorado.edu>
6789 2001-11-17 Fernando Perez <fperez@colorado.edu>
6786
6790
6787 * Version 0.1.10 released, 0.1.11 opened for further work.
6791 * Version 0.1.10 released, 0.1.11 opened for further work.
6788
6792
6789 * Modified dirs and friends. dirs now *returns* the stack (not
6793 * Modified dirs and friends. dirs now *returns* the stack (not
6790 prints), so one can manipulate it as a variable. Convenient to
6794 prints), so one can manipulate it as a variable. Convenient to
6791 travel along many directories.
6795 travel along many directories.
6792
6796
6793 * Fixed bug in magic_pdef: would only work with functions with
6797 * Fixed bug in magic_pdef: would only work with functions with
6794 arguments with default values.
6798 arguments with default values.
6795
6799
6796 2001-11-14 Fernando Perez <fperez@colorado.edu>
6800 2001-11-14 Fernando Perez <fperez@colorado.edu>
6797
6801
6798 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6802 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6799 example with IPython. Various other minor fixes and cleanups.
6803 example with IPython. Various other minor fixes and cleanups.
6800
6804
6801 * Version 0.1.9 released, 0.1.10 opened for further work.
6805 * Version 0.1.9 released, 0.1.10 opened for further work.
6802
6806
6803 * Added sys.path to the list of directories searched in the
6807 * Added sys.path to the list of directories searched in the
6804 execfile= option. It used to be the current directory and the
6808 execfile= option. It used to be the current directory and the
6805 user's IPYTHONDIR only.
6809 user's IPYTHONDIR only.
6806
6810
6807 2001-11-13 Fernando Perez <fperez@colorado.edu>
6811 2001-11-13 Fernando Perez <fperez@colorado.edu>
6808
6812
6809 * Reinstated the raw_input/prefilter separation that Janko had
6813 * Reinstated the raw_input/prefilter separation that Janko had
6810 initially. This gives a more convenient setup for extending the
6814 initially. This gives a more convenient setup for extending the
6811 pre-processor from the outside: raw_input always gets a string,
6815 pre-processor from the outside: raw_input always gets a string,
6812 and prefilter has to process it. We can then redefine prefilter
6816 and prefilter has to process it. We can then redefine prefilter
6813 from the outside and implement extensions for special
6817 from the outside and implement extensions for special
6814 purposes.
6818 purposes.
6815
6819
6816 Today I got one for inputting PhysicalQuantity objects
6820 Today I got one for inputting PhysicalQuantity objects
6817 (from Scientific) without needing any function calls at
6821 (from Scientific) without needing any function calls at
6818 all. Extremely convenient, and it's all done as a user-level
6822 all. Extremely convenient, and it's all done as a user-level
6819 extension (no IPython code was touched). Now instead of:
6823 extension (no IPython code was touched). Now instead of:
6820 a = PhysicalQuantity(4.2,'m/s**2')
6824 a = PhysicalQuantity(4.2,'m/s**2')
6821 one can simply say
6825 one can simply say
6822 a = 4.2 m/s**2
6826 a = 4.2 m/s**2
6823 or even
6827 or even
6824 a = 4.2 m/s^2
6828 a = 4.2 m/s^2
6825
6829
6826 I use this, but it's also a proof of concept: IPython really is
6830 I use this, but it's also a proof of concept: IPython really is
6827 fully user-extensible, even at the level of the parsing of the
6831 fully user-extensible, even at the level of the parsing of the
6828 command line. It's not trivial, but it's perfectly doable.
6832 command line. It's not trivial, but it's perfectly doable.
6829
6833
6830 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6834 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6831 the problem of modules being loaded in the inverse order in which
6835 the problem of modules being loaded in the inverse order in which
6832 they were defined in
6836 they were defined in
6833
6837
6834 * Version 0.1.8 released, 0.1.9 opened for further work.
6838 * Version 0.1.8 released, 0.1.9 opened for further work.
6835
6839
6836 * Added magics pdef, source and file. They respectively show the
6840 * Added magics pdef, source and file. They respectively show the
6837 definition line ('prototype' in C), source code and full python
6841 definition line ('prototype' in C), source code and full python
6838 file for any callable object. The object inspector oinfo uses
6842 file for any callable object. The object inspector oinfo uses
6839 these to show the same information.
6843 these to show the same information.
6840
6844
6841 * Version 0.1.7 released, 0.1.8 opened for further work.
6845 * Version 0.1.7 released, 0.1.8 opened for further work.
6842
6846
6843 * Separated all the magic functions into a class called Magic. The
6847 * Separated all the magic functions into a class called Magic. The
6844 InteractiveShell class was becoming too big for Xemacs to handle
6848 InteractiveShell class was becoming too big for Xemacs to handle
6845 (de-indenting a line would lock it up for 10 seconds while it
6849 (de-indenting a line would lock it up for 10 seconds while it
6846 backtracked on the whole class!)
6850 backtracked on the whole class!)
6847
6851
6848 FIXME: didn't work. It can be done, but right now namespaces are
6852 FIXME: didn't work. It can be done, but right now namespaces are
6849 all messed up. Do it later (reverted it for now, so at least
6853 all messed up. Do it later (reverted it for now, so at least
6850 everything works as before).
6854 everything works as before).
6851
6855
6852 * Got the object introspection system (magic_oinfo) working! I
6856 * Got the object introspection system (magic_oinfo) working! I
6853 think this is pretty much ready for release to Janko, so he can
6857 think this is pretty much ready for release to Janko, so he can
6854 test it for a while and then announce it. Pretty much 100% of what
6858 test it for a while and then announce it. Pretty much 100% of what
6855 I wanted for the 'phase 1' release is ready. Happy, tired.
6859 I wanted for the 'phase 1' release is ready. Happy, tired.
6856
6860
6857 2001-11-12 Fernando Perez <fperez@colorado.edu>
6861 2001-11-12 Fernando Perez <fperez@colorado.edu>
6858
6862
6859 * Version 0.1.6 released, 0.1.7 opened for further work.
6863 * Version 0.1.6 released, 0.1.7 opened for further work.
6860
6864
6861 * Fixed bug in printing: it used to test for truth before
6865 * Fixed bug in printing: it used to test for truth before
6862 printing, so 0 wouldn't print. Now checks for None.
6866 printing, so 0 wouldn't print. Now checks for None.
6863
6867
6864 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6868 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6865 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6869 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6866 reaches by hand into the outputcache. Think of a better way to do
6870 reaches by hand into the outputcache. Think of a better way to do
6867 this later.
6871 this later.
6868
6872
6869 * Various small fixes thanks to Nathan's comments.
6873 * Various small fixes thanks to Nathan's comments.
6870
6874
6871 * Changed magic_pprint to magic_Pprint. This way it doesn't
6875 * Changed magic_pprint to magic_Pprint. This way it doesn't
6872 collide with pprint() and the name is consistent with the command
6876 collide with pprint() and the name is consistent with the command
6873 line option.
6877 line option.
6874
6878
6875 * Changed prompt counter behavior to be fully like
6879 * Changed prompt counter behavior to be fully like
6876 Mathematica's. That is, even input that doesn't return a result
6880 Mathematica's. That is, even input that doesn't return a result
6877 raises the prompt counter. The old behavior was kind of confusing
6881 raises the prompt counter. The old behavior was kind of confusing
6878 (getting the same prompt number several times if the operation
6882 (getting the same prompt number several times if the operation
6879 didn't return a result).
6883 didn't return a result).
6880
6884
6881 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6885 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6882
6886
6883 * Fixed -Classic mode (wasn't working anymore).
6887 * Fixed -Classic mode (wasn't working anymore).
6884
6888
6885 * Added colored prompts using Nathan's new code. Colors are
6889 * Added colored prompts using Nathan's new code. Colors are
6886 currently hardwired, they can be user-configurable. For
6890 currently hardwired, they can be user-configurable. For
6887 developers, they can be chosen in file ipythonlib.py, at the
6891 developers, they can be chosen in file ipythonlib.py, at the
6888 beginning of the CachedOutput class def.
6892 beginning of the CachedOutput class def.
6889
6893
6890 2001-11-11 Fernando Perez <fperez@colorado.edu>
6894 2001-11-11 Fernando Perez <fperez@colorado.edu>
6891
6895
6892 * Version 0.1.5 released, 0.1.6 opened for further work.
6896 * Version 0.1.5 released, 0.1.6 opened for further work.
6893
6897
6894 * Changed magic_env to *return* the environment as a dict (not to
6898 * Changed magic_env to *return* the environment as a dict (not to
6895 print it). This way it prints, but it can also be processed.
6899 print it). This way it prints, but it can also be processed.
6896
6900
6897 * Added Verbose exception reporting to interactive
6901 * Added Verbose exception reporting to interactive
6898 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6902 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6899 traceback. Had to make some changes to the ultraTB file. This is
6903 traceback. Had to make some changes to the ultraTB file. This is
6900 probably the last 'big' thing in my mental todo list. This ties
6904 probably the last 'big' thing in my mental todo list. This ties
6901 in with the next entry:
6905 in with the next entry:
6902
6906
6903 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6907 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6904 has to specify is Plain, Color or Verbose for all exception
6908 has to specify is Plain, Color or Verbose for all exception
6905 handling.
6909 handling.
6906
6910
6907 * Removed ShellServices option. All this can really be done via
6911 * Removed ShellServices option. All this can really be done via
6908 the magic system. It's easier to extend, cleaner and has automatic
6912 the magic system. It's easier to extend, cleaner and has automatic
6909 namespace protection and documentation.
6913 namespace protection and documentation.
6910
6914
6911 2001-11-09 Fernando Perez <fperez@colorado.edu>
6915 2001-11-09 Fernando Perez <fperez@colorado.edu>
6912
6916
6913 * Fixed bug in output cache flushing (missing parameter to
6917 * Fixed bug in output cache flushing (missing parameter to
6914 __init__). Other small bugs fixed (found using pychecker).
6918 __init__). Other small bugs fixed (found using pychecker).
6915
6919
6916 * Version 0.1.4 opened for bugfixing.
6920 * Version 0.1.4 opened for bugfixing.
6917
6921
6918 2001-11-07 Fernando Perez <fperez@colorado.edu>
6922 2001-11-07 Fernando Perez <fperez@colorado.edu>
6919
6923
6920 * Version 0.1.3 released, mainly because of the raw_input bug.
6924 * Version 0.1.3 released, mainly because of the raw_input bug.
6921
6925
6922 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6926 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6923 and when testing for whether things were callable, a call could
6927 and when testing for whether things were callable, a call could
6924 actually be made to certain functions. They would get called again
6928 actually be made to certain functions. They would get called again
6925 once 'really' executed, with a resulting double call. A disaster
6929 once 'really' executed, with a resulting double call. A disaster
6926 in many cases (list.reverse() would never work!).
6930 in many cases (list.reverse() would never work!).
6927
6931
6928 * Removed prefilter() function, moved its code to raw_input (which
6932 * Removed prefilter() function, moved its code to raw_input (which
6929 after all was just a near-empty caller for prefilter). This saves
6933 after all was just a near-empty caller for prefilter). This saves
6930 a function call on every prompt, and simplifies the class a tiny bit.
6934 a function call on every prompt, and simplifies the class a tiny bit.
6931
6935
6932 * Fix _ip to __ip name in magic example file.
6936 * Fix _ip to __ip name in magic example file.
6933
6937
6934 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6938 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6935 work with non-gnu versions of tar.
6939 work with non-gnu versions of tar.
6936
6940
6937 2001-11-06 Fernando Perez <fperez@colorado.edu>
6941 2001-11-06 Fernando Perez <fperez@colorado.edu>
6938
6942
6939 * Version 0.1.2. Just to keep track of the recent changes.
6943 * Version 0.1.2. Just to keep track of the recent changes.
6940
6944
6941 * Fixed nasty bug in output prompt routine. It used to check 'if
6945 * Fixed nasty bug in output prompt routine. It used to check 'if
6942 arg != None...'. Problem is, this fails if arg implements a
6946 arg != None...'. Problem is, this fails if arg implements a
6943 special comparison (__cmp__) which disallows comparing to
6947 special comparison (__cmp__) which disallows comparing to
6944 None. Found it when trying to use the PhysicalQuantity module from
6948 None. Found it when trying to use the PhysicalQuantity module from
6945 ScientificPython.
6949 ScientificPython.
6946
6950
6947 2001-11-05 Fernando Perez <fperez@colorado.edu>
6951 2001-11-05 Fernando Perez <fperez@colorado.edu>
6948
6952
6949 * Also added dirs. Now the pushd/popd/dirs family functions
6953 * Also added dirs. Now the pushd/popd/dirs family functions
6950 basically like the shell, with the added convenience of going home
6954 basically like the shell, with the added convenience of going home
6951 when called with no args.
6955 when called with no args.
6952
6956
6953 * pushd/popd slightly modified to mimic shell behavior more
6957 * pushd/popd slightly modified to mimic shell behavior more
6954 closely.
6958 closely.
6955
6959
6956 * Added env,pushd,popd from ShellServices as magic functions. I
6960 * Added env,pushd,popd from ShellServices as magic functions. I
6957 think the cleanest will be to port all desired functions from
6961 think the cleanest will be to port all desired functions from
6958 ShellServices as magics and remove ShellServices altogether. This
6962 ShellServices as magics and remove ShellServices altogether. This
6959 will provide a single, clean way of adding functionality
6963 will provide a single, clean way of adding functionality
6960 (shell-type or otherwise) to IP.
6964 (shell-type or otherwise) to IP.
6961
6965
6962 2001-11-04 Fernando Perez <fperez@colorado.edu>
6966 2001-11-04 Fernando Perez <fperez@colorado.edu>
6963
6967
6964 * Added .ipython/ directory to sys.path. This way users can keep
6968 * Added .ipython/ directory to sys.path. This way users can keep
6965 customizations there and access them via import.
6969 customizations there and access them via import.
6966
6970
6967 2001-11-03 Fernando Perez <fperez@colorado.edu>
6971 2001-11-03 Fernando Perez <fperez@colorado.edu>
6968
6972
6969 * Opened version 0.1.1 for new changes.
6973 * Opened version 0.1.1 for new changes.
6970
6974
6971 * Changed version number to 0.1.0: first 'public' release, sent to
6975 * Changed version number to 0.1.0: first 'public' release, sent to
6972 Nathan and Janko.
6976 Nathan and Janko.
6973
6977
6974 * Lots of small fixes and tweaks.
6978 * Lots of small fixes and tweaks.
6975
6979
6976 * Minor changes to whos format. Now strings are shown, snipped if
6980 * Minor changes to whos format. Now strings are shown, snipped if
6977 too long.
6981 too long.
6978
6982
6979 * Changed ShellServices to work on __main__ so they show up in @who
6983 * Changed ShellServices to work on __main__ so they show up in @who
6980
6984
6981 * Help also works with ? at the end of a line:
6985 * Help also works with ? at the end of a line:
6982 ?sin and sin?
6986 ?sin and sin?
6983 both produce the same effect. This is nice, as often I use the
6987 both produce the same effect. This is nice, as often I use the
6984 tab-complete to find the name of a method, but I used to then have
6988 tab-complete to find the name of a method, but I used to then have
6985 to go to the beginning of the line to put a ? if I wanted more
6989 to go to the beginning of the line to put a ? if I wanted more
6986 info. Now I can just add the ? and hit return. Convenient.
6990 info. Now I can just add the ? and hit return. Convenient.
6987
6991
6988 2001-11-02 Fernando Perez <fperez@colorado.edu>
6992 2001-11-02 Fernando Perez <fperez@colorado.edu>
6989
6993
6990 * Python version check (>=2.1) added.
6994 * Python version check (>=2.1) added.
6991
6995
6992 * Added LazyPython documentation. At this point the docs are quite
6996 * Added LazyPython documentation. At this point the docs are quite
6993 a mess. A cleanup is in order.
6997 a mess. A cleanup is in order.
6994
6998
6995 * Auto-installer created. For some bizarre reason, the zipfiles
6999 * Auto-installer created. For some bizarre reason, the zipfiles
6996 module isn't working on my system. So I made a tar version
7000 module isn't working on my system. So I made a tar version
6997 (hopefully the command line options in various systems won't kill
7001 (hopefully the command line options in various systems won't kill
6998 me).
7002 me).
6999
7003
7000 * Fixes to Struct in genutils. Now all dictionary-like methods are
7004 * Fixes to Struct in genutils. Now all dictionary-like methods are
7001 protected (reasonably).
7005 protected (reasonably).
7002
7006
7003 * Added pager function to genutils and changed ? to print usage
7007 * Added pager function to genutils and changed ? to print usage
7004 note through it (it was too long).
7008 note through it (it was too long).
7005
7009
7006 * Added the LazyPython functionality. Works great! I changed the
7010 * Added the LazyPython functionality. Works great! I changed the
7007 auto-quote escape to ';', it's on home row and next to '. But
7011 auto-quote escape to ';', it's on home row and next to '. But
7008 both auto-quote and auto-paren (still /) escapes are command-line
7012 both auto-quote and auto-paren (still /) escapes are command-line
7009 parameters.
7013 parameters.
7010
7014
7011
7015
7012 2001-11-01 Fernando Perez <fperez@colorado.edu>
7016 2001-11-01 Fernando Perez <fperez@colorado.edu>
7013
7017
7014 * Version changed to 0.0.7. Fairly large change: configuration now
7018 * Version changed to 0.0.7. Fairly large change: configuration now
7015 is all stored in a directory, by default .ipython. There, all
7019 is all stored in a directory, by default .ipython. There, all
7016 config files have normal looking names (not .names)
7020 config files have normal looking names (not .names)
7017
7021
7018 * Version 0.0.6 Released first to Lucas and Archie as a test
7022 * Version 0.0.6 Released first to Lucas and Archie as a test
7019 run. Since it's the first 'semi-public' release, change version to
7023 run. Since it's the first 'semi-public' release, change version to
7020 > 0.0.6 for any changes now.
7024 > 0.0.6 for any changes now.
7021
7025
7022 * Stuff I had put in the ipplib.py changelog:
7026 * Stuff I had put in the ipplib.py changelog:
7023
7027
7024 Changes to InteractiveShell:
7028 Changes to InteractiveShell:
7025
7029
7026 - Made the usage message a parameter.
7030 - Made the usage message a parameter.
7027
7031
7028 - Require the name of the shell variable to be given. It's a bit
7032 - Require the name of the shell variable to be given. It's a bit
7029 of a hack, but allows the name 'shell' not to be hardwired in the
7033 of a hack, but allows the name 'shell' not to be hardwired in the
7030 magic (@) handler, which is problematic b/c it requires
7034 magic (@) handler, which is problematic b/c it requires
7031 polluting the global namespace with 'shell'. This in turn is
7035 polluting the global namespace with 'shell'. This in turn is
7032 fragile: if a user redefines a variable called shell, things
7036 fragile: if a user redefines a variable called shell, things
7033 break.
7037 break.
7034
7038
7035 - magic @: all functions available through @ need to be defined
7039 - magic @: all functions available through @ need to be defined
7036 as magic_<name>, even though they can be called simply as
7040 as magic_<name>, even though they can be called simply as
7037 @<name>. This allows the special command @magic to gather
7041 @<name>. This allows the special command @magic to gather
7038 information automatically about all existing magic functions,
7042 information automatically about all existing magic functions,
7039 even if they are run-time user extensions, by parsing the shell
7043 even if they are run-time user extensions, by parsing the shell
7040 instance __dict__ looking for special magic_ names.
7044 instance __dict__ looking for special magic_ names.
7041
7045
7042 - mainloop: added *two* local namespace parameters. This allows
7046 - mainloop: added *two* local namespace parameters. This allows
7043 the class to differentiate between parameters which were there
7047 the class to differentiate between parameters which were there
7044 before and after command line initialization was processed. This
7048 before and after command line initialization was processed. This
7045 way, later @who can show things loaded at startup by the
7049 way, later @who can show things loaded at startup by the
7046 user. This trick was necessary to make session saving/reloading
7050 user. This trick was necessary to make session saving/reloading
7047 really work: ideally after saving/exiting/reloading a session,
7051 really work: ideally after saving/exiting/reloading a session,
7048 *everything* should look the same, including the output of @who. I
7052 *everything* should look the same, including the output of @who. I
7049 was only able to make this work with this double namespace
7053 was only able to make this work with this double namespace
7050 trick.
7054 trick.
7051
7055
7052 - added a header to the logfile which allows (almost) full
7056 - added a header to the logfile which allows (almost) full
7053 session restoring.
7057 session restoring.
7054
7058
7055 - prepend lines beginning with @ or !, with a and log
7059 - prepend lines beginning with @ or !, with a and log
7056 them. Why? !lines: may be useful to know what you did @lines:
7060 them. Why? !lines: may be useful to know what you did @lines:
7057 they may affect session state. So when restoring a session, at
7061 they may affect session state. So when restoring a session, at
7058 least inform the user of their presence. I couldn't quite get
7062 least inform the user of their presence. I couldn't quite get
7059 them to properly re-execute, but at least the user is warned.
7063 them to properly re-execute, but at least the user is warned.
7060
7064
7061 * Started ChangeLog.
7065 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now